diff options
author | Alan Viverette <alanv@google.com> | 2015-01-21 12:30:49 -0800 |
---|---|---|
committer | Alan Viverette <alanv@google.com> | 2015-01-21 12:30:49 -0800 |
commit | b74155cf01f959fc9b7909de5a22806ad519f7c9 (patch) | |
tree | 131fd758305d54be67bba4cde63a6ab3fe616500 /graphics | |
parent | 213269599bdec3d83d3d811f5e8f62b9fd8d245c (diff) | |
download | frameworks_base-b74155cf01f959fc9b7909de5a22806ad519f7c9.zip frameworks_base-b74155cf01f959fc9b7909de5a22806ad519f7c9.tar.gz frameworks_base-b74155cf01f959fc9b7909de5a22806ad519f7c9.tar.bz2 |
Avoid ripple buffer creation for empty bounds
Bug: 19068439
Change-Id: I031d4303bbf101a25612dce6f02d81ce4cf58e2b
Diffstat (limited to 'graphics')
-rw-r--r-- | graphics/java/android/graphics/drawable/RippleDrawable.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/graphics/java/android/graphics/drawable/RippleDrawable.java b/graphics/java/android/graphics/drawable/RippleDrawable.java index 9809606..1263447 100644 --- a/graphics/java/android/graphics/drawable/RippleDrawable.java +++ b/graphics/java/android/graphics/drawable/RippleDrawable.java @@ -661,7 +661,8 @@ public class RippleDrawable extends LayerDrawable { mHasValidMask = true; - if (maskType == MASK_NONE) { + final Rect bounds = getBounds(); + if (maskType == MASK_NONE || bounds.isEmpty()) { if (mMaskBuffer != null) { mMaskBuffer.recycle(); mMaskBuffer = null; @@ -674,7 +675,6 @@ public class RippleDrawable extends LayerDrawable { } // Ensure we have a correctly-sized buffer. - final Rect bounds = getBounds(); if (mMaskBuffer == null || mMaskBuffer.getWidth() != bounds.width() || mMaskBuffer.getHeight() != bounds.height()) { |