summaryrefslogtreecommitdiffstats
path: root/graphics
diff options
context:
space:
mode:
authorAlan Viverette <alanv@google.com>2014-10-13 16:47:57 -0700
committerAlan Viverette <alanv@google.com>2014-10-13 16:47:57 -0700
commita7b64e8eefec1a200701443622debf1032291bdd (patch)
treeae1bbfc9b2a7c852365043d8265360564263bb69 /graphics
parent2f82e48abb71c92e41caa8057e3068dbfe96ed62 (diff)
downloadframeworks_base-a7b64e8eefec1a200701443622debf1032291bdd.zip
frameworks_base-a7b64e8eefec1a200701443622debf1032291bdd.tar.gz
frameworks_base-a7b64e8eefec1a200701443622debf1032291bdd.tar.bz2
Avoid saveLayer in RippleDrawable if the background won't draw
BUG: 17952941 Change-Id: Ic2640f847e2ed43fc5117d43230513ee7696d9e7
Diffstat (limited to 'graphics')
-rw-r--r--graphics/java/android/graphics/drawable/RippleDrawable.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/graphics/java/android/graphics/drawable/RippleDrawable.java b/graphics/java/android/graphics/drawable/RippleDrawable.java
index f14ccd4..aee75a0 100644
--- a/graphics/java/android/graphics/drawable/RippleDrawable.java
+++ b/graphics/java/android/graphics/drawable/RippleDrawable.java
@@ -719,10 +719,12 @@ public class RippleDrawable extends LayerDrawable {
final ChildDrawable[] array = mLayerState.mChildren;
final int count = mLayerState.mNum;
- // We don't need a layer if we don't expect to draw any ripples, we have
- // an explicit mask, or if the non-mask content is all opaque.
+ // We don't need a layer if we don't expect to draw any ripples or
+ // a background, we have an explicit mask, or if the non-mask content
+ // is all opaque.
boolean needsLayer = false;
- if ((mExitingRipplesCount > 0 || mBackground != null) && mMask == null) {
+ if ((mExitingRipplesCount > 0 || (mBackground != null && mBackground.shouldDraw()))
+ && mMask == null) {
for (int i = 0; i < count; i++) {
if (array[i].mId != R.id.mask
&& array[i].mDrawable.getOpacity() != PixelFormat.OPAQUE) {