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

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

Merge "Avoid trying to draw invisible ShapeDrawables" into jb-mr2-dev

parents 7f61d014 f0e06784
Loading
Loading
Loading
Loading
+12 −9
Original line number Diff line number Diff line
@@ -217,6 +217,8 @@ public class ShapeDrawable extends Drawable {
        int prevAlpha = paint.getAlpha();
        paint.setAlpha(modulateAlpha(prevAlpha, mShapeState.mAlpha));

        // only draw shape if it may affect output
        if (paint.getAlpha() != 0 || paint.getXfermode() != null || paint.hasShadow) {
            if (mShapeState.mShape != null) {
                // need the save both for the translate, and for the (unknown) Shape
                int count = canvas.save();
@@ -226,6 +228,7 @@ public class ShapeDrawable extends Drawable {
            } else {
                canvas.drawRect(r, paint);
            }
        }

        // restore
        paint.setAlpha(prevAlpha);