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

Commit 32e18d9f authored by Chris Craik's avatar Chris Craik Committed by Android Git Automerger
Browse files

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

* commit 'cccd6c67':
  Avoid trying to draw invisible ShapeDrawables
parents 6d248625 cccd6c67
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);