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

Commit 751afe20 authored by Chris Craik's avatar Chris Craik Committed by Android (Google) Code Review
Browse files

Merge "Dont ignore layer paint alpha in software path" into mnc-dev

parents bcdf0dc1 f396f011
Loading
Loading
Loading
Loading
+9 −9
Original line number Diff line number Diff line
@@ -16070,23 +16070,23 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
            }
        } else if (cache != null) {
            mPrivateFlags &= ~PFLAG_DIRTY_MASK;
            Paint cachePaint;
            int restoreAlpha = 0;
            if (layerType == LAYER_TYPE_NONE) {
                cachePaint = parent.mCachePaint;
                // no layer paint, use temporary paint to draw bitmap
                Paint cachePaint = parent.mCachePaint;
                if (cachePaint == null) {
                    cachePaint = new Paint();
                    cachePaint.setDither(false);
                    parent.mCachePaint = cachePaint;
                }
            } else {
                cachePaint = mLayerPaint;
                restoreAlpha = mLayerPaint.getAlpha();
            }
                cachePaint.setAlpha((int) (alpha * 255));
                canvas.drawBitmap(cache, 0.0f, 0.0f, cachePaint);
            cachePaint.setAlpha(restoreAlpha);
            } else {
                // use layer paint to draw the bitmap, merging the two alphas, but also restore
                int layerPaintAlpha = mLayerPaint.getAlpha();
                mLayerPaint.setAlpha((int) (alpha * layerPaintAlpha));
                canvas.drawBitmap(cache, 0.0f, 0.0f, mLayerPaint);
                mLayerPaint.setAlpha(layerPaintAlpha);
            }
        }
        if (restoreTo >= 0) {