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

Commit 41683230 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Revert "Add trace point into onMeasure/onDraw of TextView"" into main

parents f3993d13 c171ec3b
Loading
Loading
Loading
Loading
+283 −298
Original line number Diff line number Diff line
@@ -106,7 +106,6 @@ import android.os.Parcelable;
import android.os.ParcelableParcel;
import android.os.Process;
import android.os.SystemClock;
import android.os.Trace;
import android.os.UserHandle;
import android.provider.Settings;
import android.text.BoringLayout;
@@ -9230,8 +9229,6 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
    @Override
    protected void onDraw(Canvas canvas) {
        Trace.traceBegin(Trace.TRACE_TAG_VIEW, "TextView.onDraw");
        try {
        restartMarqueeIfNeeded();
        // Draw the background for this view
@@ -9400,9 +9397,6 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
        }
        canvas.restore();
        } finally {
            Trace.traceEnd(Trace.TRACE_TAG_VIEW);
        }
    }
    @Override
@@ -11260,8 +11254,6 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
    @Override
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        Trace.traceBegin(Trace.TRACE_TAG_VIEW, "TextView.onMeasure");
        try {
        int widthMode = MeasureSpec.getMode(widthMeasureSpec);
        int heightMode = MeasureSpec.getMode(heightMeasureSpec);
        int widthSize = MeasureSpec.getSize(widthMeasureSpec);
@@ -11335,8 +11327,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
                if (hintDes < 0) {
                    hintBoring = BoringLayout.isBoring(mHint, mTextPaint, mTextDir,
                                isFallbackLineSpacingForBoringLayout(),
                                getResolvedMinimumFontMetrics(),
                            isFallbackLineSpacingForBoringLayout(), getResolvedMinimumFontMetrics(),
                            mHintBoring);
                    if (hintBoring != null) {
                        mHintBoring = hintBoring;
@@ -11393,8 +11384,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
            makeNewLayout(want, hintWant, boring, hintBoring,
                          width - getCompoundPaddingLeft() - getCompoundPaddingRight(), false);
        } else {
                final boolean layoutChanged =
                        (mLayout.getWidth() != want) || (hintWidth != hintWant)
            final boolean layoutChanged = (mLayout.getWidth() != want) || (hintWidth != hintWant)
                    || (mLayout.getEllipsizedWidth()
                            != width - getCompoundPaddingLeft() - getCompoundPaddingRight());
@@ -11403,16 +11393,14 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
                    && (mLayout instanceof BoringLayout
                            || (fromexisting && des >= 0 && des <= want));
                final boolean maximumChanged =
                        (mMaxMode != mOldMaxMode) || (mMaximum != mOldMaximum);
            final boolean maximumChanged = (mMaxMode != mOldMaxMode) || (mMaximum != mOldMaximum);
            if (layoutChanged || maximumChanged) {
                if (!maximumChanged && widthChanged) {
                    mLayout.increaseWidthTo(want);
                } else {
                    makeNewLayout(want, hintWant, boring, hintBoring,
                                width - getCompoundPaddingLeft() - getCompoundPaddingRight(),
                                false);
                            width - getCompoundPaddingLeft() - getCompoundPaddingRight(), false);
                }
            } else {
                // Nothing has changed
@@ -11452,9 +11440,6 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
        }
        setMeasuredDimension(width, height);
        } finally {
            Trace.traceEnd(Trace.TRACE_TAG_VIEW);
        }
    }
    /**