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

Commit f396f011 authored by Chris Craik's avatar Chris Craik
Browse files

Dont ignore layer paint alpha in software path

bug:19412691

Change-Id: Ie56b2cbc667a078eb4a7c5bfe7b8e8dd6b0fc24b
parent 72285e56
Loading
Loading
Loading
Loading
+9 −9
Original line number Diff line number Diff line
@@ -16064,23 +16064,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) {