diff options
author | Alan Viverette <alanv@google.com> | 2015-01-21 21:13:33 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2015-01-21 21:13:33 +0000 |
commit | 8ac90a0609caba703b22dc4462da4f45fbb1985e (patch) | |
tree | 6453cdc96b616c00771ea9e2fcb24a65ed30b2fb /graphics | |
parent | 767cddd3ddbe9ac2f82e3213338fcbd61d3d85c5 (diff) | |
parent | 2aacb861f4c7b80c5d2bb22956c9a5d4ace4df67 (diff) | |
download | frameworks_base-8ac90a0609caba703b22dc4462da4f45fbb1985e.zip frameworks_base-8ac90a0609caba703b22dc4462da4f45fbb1985e.tar.gz frameworks_base-8ac90a0609caba703b22dc4462da4f45fbb1985e.tar.bz2 |
Avoid ripple buffer creation for empty bounds automerge: b74155c automerge: e6e216c
automerge: 2aacb86
* commit '2aacb861f4c7b80c5d2bb22956c9a5d4ace4df67':
Avoid ripple buffer creation for empty bounds
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 c7b506e..ca9f714 100644 --- a/graphics/java/android/graphics/drawable/RippleDrawable.java +++ b/graphics/java/android/graphics/drawable/RippleDrawable.java @@ -673,7 +673,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; @@ -686,7 +687,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()) { |