From 684385ddde2ac0c26de0862390ad713aff3fb149 Mon Sep 17 00:00:00 2001 From: Romain Guy Date: Tue, 18 Sep 2012 16:56:11 -0700 Subject: [PATCH] mutate() didn't work as advertised Bug #7162705 Change-Id: I15b2663fa7f1c71a2a3479134b8b7f37bfcbc607 --- .../java/android/graphics/drawable/BitmapDrawable.java | 9 --------- .../java/android/graphics/drawable/ColorDrawable.java | 2 -- .../java/android/graphics/drawable/GradientDrawable.java | 2 +- .../android/graphics/drawable/NinePatchDrawable.java | 5 ----- 4 files changed, 1 insertion(+), 17 deletions(-) diff --git a/graphics/java/android/graphics/drawable/BitmapDrawable.java b/graphics/java/android/graphics/drawable/BitmapDrawable.java index 7a4a1ca92ad17..e82ccd4988b1b 100644 --- a/graphics/java/android/graphics/drawable/BitmapDrawable.java +++ b/graphics/java/android/graphics/drawable/BitmapDrawable.java @@ -80,7 +80,6 @@ public class BitmapDrawable extends Drawable { @Deprecated public BitmapDrawable() { mBitmapState = new BitmapState((Bitmap) null); - mMutated = true; } /** @@ -91,7 +90,6 @@ public class BitmapDrawable extends Drawable { public BitmapDrawable(Resources res) { mBitmapState = new BitmapState((Bitmap) null); mBitmapState.mTargetDensity = mTargetDensity; - mMutated = true; } /** @@ -102,7 +100,6 @@ public class BitmapDrawable extends Drawable { @Deprecated public BitmapDrawable(Bitmap bitmap) { this(new BitmapState(bitmap), null); - mMutated = true; } /** @@ -112,7 +109,6 @@ public class BitmapDrawable extends Drawable { public BitmapDrawable(Resources res, Bitmap bitmap) { this(new BitmapState(bitmap), res); mBitmapState.mTargetDensity = mTargetDensity; - mMutated = true; } /** @@ -126,7 +122,6 @@ public class BitmapDrawable extends Drawable { if (mBitmap == null) { android.util.Log.w("BitmapDrawable", "BitmapDrawable cannot decode " + filepath); } - mMutated = true; } /** @@ -139,7 +134,6 @@ public class BitmapDrawable extends Drawable { if (mBitmap == null) { android.util.Log.w("BitmapDrawable", "BitmapDrawable cannot decode " + filepath); } - mMutated = true; } /** @@ -153,7 +147,6 @@ public class BitmapDrawable extends Drawable { if (mBitmap == null) { android.util.Log.w("BitmapDrawable", "BitmapDrawable cannot decode " + is); } - mMutated = true; } /** @@ -166,7 +159,6 @@ public class BitmapDrawable extends Drawable { if (mBitmap == null) { android.util.Log.w("BitmapDrawable", "BitmapDrawable cannot decode " + is); } - mMutated = true; } /** @@ -560,7 +552,6 @@ public class BitmapDrawable extends Drawable { } else { mTargetDensity = state.mTargetDensity; } - mMutated = false; setBitmap(state != null ? state.mBitmap : null); } } diff --git a/graphics/java/android/graphics/drawable/ColorDrawable.java b/graphics/java/android/graphics/drawable/ColorDrawable.java index f8e3944ca6cb1..4561397d0e1fb 100644 --- a/graphics/java/android/graphics/drawable/ColorDrawable.java +++ b/graphics/java/android/graphics/drawable/ColorDrawable.java @@ -43,7 +43,6 @@ public class ColorDrawable extends Drawable { */ public ColorDrawable() { this(null); - mMutated = true; } /** @@ -54,7 +53,6 @@ public class ColorDrawable extends Drawable { public ColorDrawable(int color) { this(null); setColor(color); - mMutated = true; } private ColorDrawable(ColorState state) { diff --git a/graphics/java/android/graphics/drawable/GradientDrawable.java b/graphics/java/android/graphics/drawable/GradientDrawable.java index 42be657c1af79..2ca54d4dca0f4 100644 --- a/graphics/java/android/graphics/drawable/GradientDrawable.java +++ b/graphics/java/android/graphics/drawable/GradientDrawable.java @@ -124,7 +124,7 @@ public class GradientDrawable extends Drawable { private Paint mLayerPaint; // internal, used if we use saveLayer() private boolean mRectIsDirty; // internal state - private boolean mMutated = true; + private boolean mMutated; private Path mRingPath; private boolean mPathIsDirty = true; diff --git a/graphics/java/android/graphics/drawable/NinePatchDrawable.java b/graphics/java/android/graphics/drawable/NinePatchDrawable.java index 7a434968b2531..2ee623316b9ec 100644 --- a/graphics/java/android/graphics/drawable/NinePatchDrawable.java +++ b/graphics/java/android/graphics/drawable/NinePatchDrawable.java @@ -77,7 +77,6 @@ public class NinePatchDrawable extends Drawable { @Deprecated public NinePatchDrawable(Bitmap bitmap, byte[] chunk, Rect padding, String srcName) { this(new NinePatchState(new NinePatch(bitmap, chunk, srcName), padding), null); - mMutated = true; } /** @@ -88,7 +87,6 @@ public class NinePatchDrawable extends Drawable { Rect padding, String srcName) { this(new NinePatchState(new NinePatch(bitmap, chunk, srcName), padding), res); mNinePatchState.mTargetDensity = mTargetDensity; - mMutated = true; } /** @@ -101,7 +99,6 @@ public class NinePatchDrawable extends Drawable { Rect padding, Rect layoutInsets, String srcName) { this(new NinePatchState(new NinePatch(bitmap, chunk, srcName), padding, layoutInsets), res); mNinePatchState.mTargetDensity = mTargetDensity; - mMutated = true; } /** @@ -112,7 +109,6 @@ public class NinePatchDrawable extends Drawable { @Deprecated public NinePatchDrawable(NinePatch patch) { this(new NinePatchState(patch, new Rect()), null); - mMutated = true; } /** @@ -122,7 +118,6 @@ public class NinePatchDrawable extends Drawable { public NinePatchDrawable(Resources res, NinePatch patch) { this(new NinePatchState(patch, new Rect()), res); mNinePatchState.mTargetDensity = mTargetDensity; - mMutated = true; } private void setNinePatchState(NinePatchState state, Resources res) {