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

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

Merge "Make LD stateful / opacity management look more like DC"

parents 6fc01e04 eb727759
Loading
Loading
Loading
Loading
+7 −8
Original line number Diff line number Diff line
@@ -1128,8 +1128,6 @@ public class DrawableContainer extends Drawable implements Drawable.Callback {

            createAllFutures();

            mCheckedOpacity = true;

            final int N = mNumChildren;
            final Drawable[] drawables = mDrawables;
            int op = (N > 0) ? drawables[0].getOpacity() : PixelFormat.TRANSPARENT;
@@ -1138,6 +1136,7 @@ public class DrawableContainer extends Drawable implements Drawable.Callback {
            }

            mOpacity = op;
            mCheckedOpacity = true;
            return op;
        }

@@ -1148,19 +1147,19 @@ public class DrawableContainer extends Drawable implements Drawable.Callback {

            createAllFutures();

            mCheckedStateful = true;

            final int N = mNumChildren;
            final Drawable[] drawables = mDrawables;
            boolean isStateful = false;
            for (int i = 0; i < N; i++) {
                if (drawables[i].isStateful()) {
                    mStateful = true;
                    return true;
                    isStateful = true;
                    break;
                }
            }

            mStateful = false;
            return false;
            mStateful = isStateful;
            mCheckedStateful = true;
            return isStateful;
        }

        public void growArray(int oldSize, int newSize) {
+56 −56

File changed.

Preview size limit exceeded, changes collapsed.

+4 −4
Original line number Diff line number Diff line
@@ -667,7 +667,7 @@ public class RippleDrawable extends LayerDrawable {
    public void getOutline(@NonNull Outline outline) {
        final LayerState state = mLayerState;
        final ChildDrawable[] children = state.mChildren;
        final int N = state.mNum;
        final int N = state.mNumChildren;
        for (int i = 0; i < N; i++) {
            if (children[i].mId != R.id.mask) {
                children[i].mDrawable.getOutline(outline);
@@ -815,7 +815,7 @@ public class RippleDrawable extends LayerDrawable {

        // Check for non-opaque, non-mask content.
        final ChildDrawable[] array = mLayerState.mChildren;
        final int count = mLayerState.mNum;
        final int count = mLayerState.mNumChildren;
        for (int i = 0; i < count; i++) {
            if (array[i].mDrawable.getOpacity() != PixelFormat.OPAQUE) {
                return MASK_CONTENT;
@@ -829,7 +829,7 @@ public class RippleDrawable extends LayerDrawable {
    private void drawContent(Canvas canvas) {
        // Draw everything except the mask.
        final ChildDrawable[] array = mLayerState.mChildren;
        final int count = mLayerState.mNum;
        final int count = mLayerState.mNumChildren;
        for (int i = 0; i < count; i++) {
            if (array[i].mId != R.id.mask) {
                array[i].mDrawable.draw(canvas);
@@ -1045,7 +1045,7 @@ public class RippleDrawable extends LayerDrawable {
        mLayerState = mState;
        mDensity = Drawable.resolveDensity(res, mState.mDensity);

        if (mState.mNum > 0) {
        if (mState.mNumChildren > 0) {
            ensurePadding();
            refreshPadding();
        }