Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4f1766c3 authored by Allen Su's avatar Allen Su
Browse files

Add Trace for phrase breaking

Bug: 259340823
Test: by manual
Change-Id: I64784f1879e152dcc56ffd9f6fcc569f6ecd6a88
parent c5943960
Loading
Loading
Loading
Loading
+21 −13
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@ import android.annotation.IntRange;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.Px;
import android.os.Trace;

import dalvik.annotation.optimization.CriticalNative;
import dalvik.annotation.optimization.FastNative;
@@ -475,7 +476,10 @@ public class LineBreaker {
            @NonNull MeasuredText measuredPara,
            @NonNull ParagraphConstraints constraints,
            @IntRange(from = 0) int lineNumber) {
        return new Result(nComputeLineBreaks(
        Trace.traceBegin(Trace.TRACE_TAG_VIEW, "compute line break");
        long result = 0;
        try {
            result = nComputeLineBreaks(
                    mNativePtr,

                    // Inputs
@@ -487,7 +491,11 @@ public class LineBreaker {
                    constraints.mWidth,
                    constraints.mVariableTabStops,
                    constraints.mDefaultTabStop,
                lineNumber));
                    lineNumber);
        } finally {
            Trace.traceEnd(Trace.TRACE_TAG_VIEW);
        }
        return new Result(result);
    }

    @FastNative