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

Commit 5e78d9be authored by Gilles Debunne's avatar Gilles Debunne
Browse files

Invalidate display list on alpha change

Bug 5945886

Change-Id: Ibab3ad2c9e526c038672699b571de154dfc8d17c
parent 9ae76313
Loading
Loading
Loading
Loading
+15 −9
Original line number Diff line number Diff line
@@ -4637,6 +4637,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
        // Alpha is supported if and only if the drawing can be done in one pass.
        // TODO text with spans with a background color currently do not respect this alpha.
        if (getBackground() == null) {
            if (mCurrentAlpha != alpha) {
                mCurrentAlpha = alpha;
                final Drawables dr = mDrawables;
                if (dr != null) {
@@ -4647,9 +4648,14 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
                    if (dr.mDrawableStart != null) dr.mDrawableStart.mutate().setAlpha(alpha);
                    if (dr.mDrawableEnd != null) dr.mDrawableEnd.mutate().setAlpha(alpha);
                }
                mTextDisplayListIsValid = false;
            }
            return true;
        }

        if (mCurrentAlpha != 255) {
            mTextDisplayListIsValid = false;
        }
        mCurrentAlpha = 255;
        return false;
    }