Merge "mutate() didn't work as advertised Bug #7162705" into jb-mr1-dev

This commit is contained in:
Romain Guy
2012-09-18 17:03:04 -07:00
committed by Android (Google) Code Review
4 changed files with 1 additions and 17 deletions

View File

@@ -80,7 +80,6 @@ public class BitmapDrawable extends Drawable {
@Deprecated @Deprecated
public BitmapDrawable() { public BitmapDrawable() {
mBitmapState = new BitmapState((Bitmap) null); mBitmapState = new BitmapState((Bitmap) null);
mMutated = true;
} }
/** /**
@@ -91,7 +90,6 @@ public class BitmapDrawable extends Drawable {
public BitmapDrawable(Resources res) { public BitmapDrawable(Resources res) {
mBitmapState = new BitmapState((Bitmap) null); mBitmapState = new BitmapState((Bitmap) null);
mBitmapState.mTargetDensity = mTargetDensity; mBitmapState.mTargetDensity = mTargetDensity;
mMutated = true;
} }
/** /**
@@ -102,7 +100,6 @@ public class BitmapDrawable extends Drawable {
@Deprecated @Deprecated
public BitmapDrawable(Bitmap bitmap) { public BitmapDrawable(Bitmap bitmap) {
this(new BitmapState(bitmap), null); this(new BitmapState(bitmap), null);
mMutated = true;
} }
/** /**
@@ -112,7 +109,6 @@ public class BitmapDrawable extends Drawable {
public BitmapDrawable(Resources res, Bitmap bitmap) { public BitmapDrawable(Resources res, Bitmap bitmap) {
this(new BitmapState(bitmap), res); this(new BitmapState(bitmap), res);
mBitmapState.mTargetDensity = mTargetDensity; mBitmapState.mTargetDensity = mTargetDensity;
mMutated = true;
} }
/** /**
@@ -126,7 +122,6 @@ public class BitmapDrawable extends Drawable {
if (mBitmap == null) { if (mBitmap == null) {
android.util.Log.w("BitmapDrawable", "BitmapDrawable cannot decode " + filepath); android.util.Log.w("BitmapDrawable", "BitmapDrawable cannot decode " + filepath);
} }
mMutated = true;
} }
/** /**
@@ -139,7 +134,6 @@ public class BitmapDrawable extends Drawable {
if (mBitmap == null) { if (mBitmap == null) {
android.util.Log.w("BitmapDrawable", "BitmapDrawable cannot decode " + filepath); android.util.Log.w("BitmapDrawable", "BitmapDrawable cannot decode " + filepath);
} }
mMutated = true;
} }
/** /**
@@ -153,7 +147,6 @@ public class BitmapDrawable extends Drawable {
if (mBitmap == null) { if (mBitmap == null) {
android.util.Log.w("BitmapDrawable", "BitmapDrawable cannot decode " + is); android.util.Log.w("BitmapDrawable", "BitmapDrawable cannot decode " + is);
} }
mMutated = true;
} }
/** /**
@@ -166,7 +159,6 @@ public class BitmapDrawable extends Drawable {
if (mBitmap == null) { if (mBitmap == null) {
android.util.Log.w("BitmapDrawable", "BitmapDrawable cannot decode " + is); android.util.Log.w("BitmapDrawable", "BitmapDrawable cannot decode " + is);
} }
mMutated = true;
} }
/** /**
@@ -560,7 +552,6 @@ public class BitmapDrawable extends Drawable {
} else { } else {
mTargetDensity = state.mTargetDensity; mTargetDensity = state.mTargetDensity;
} }
mMutated = false;
setBitmap(state != null ? state.mBitmap : null); setBitmap(state != null ? state.mBitmap : null);
} }
} }

View File

@@ -43,7 +43,6 @@ public class ColorDrawable extends Drawable {
*/ */
public ColorDrawable() { public ColorDrawable() {
this(null); this(null);
mMutated = true;
} }
/** /**
@@ -54,7 +53,6 @@ public class ColorDrawable extends Drawable {
public ColorDrawable(int color) { public ColorDrawable(int color) {
this(null); this(null);
setColor(color); setColor(color);
mMutated = true;
} }
private ColorDrawable(ColorState state) { private ColorDrawable(ColorState state) {

View File

@@ -124,7 +124,7 @@ public class GradientDrawable extends Drawable {
private Paint mLayerPaint; // internal, used if we use saveLayer() private Paint mLayerPaint; // internal, used if we use saveLayer()
private boolean mRectIsDirty; // internal state private boolean mRectIsDirty; // internal state
private boolean mMutated = true; private boolean mMutated;
private Path mRingPath; private Path mRingPath;
private boolean mPathIsDirty = true; private boolean mPathIsDirty = true;

View File

@@ -77,7 +77,6 @@ public class NinePatchDrawable extends Drawable {
@Deprecated @Deprecated
public NinePatchDrawable(Bitmap bitmap, byte[] chunk, Rect padding, String srcName) { public NinePatchDrawable(Bitmap bitmap, byte[] chunk, Rect padding, String srcName) {
this(new NinePatchState(new NinePatch(bitmap, chunk, srcName), padding), null); 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) { Rect padding, String srcName) {
this(new NinePatchState(new NinePatch(bitmap, chunk, srcName), padding), res); this(new NinePatchState(new NinePatch(bitmap, chunk, srcName), padding), res);
mNinePatchState.mTargetDensity = mTargetDensity; mNinePatchState.mTargetDensity = mTargetDensity;
mMutated = true;
} }
/** /**
@@ -101,7 +99,6 @@ public class NinePatchDrawable extends Drawable {
Rect padding, Rect layoutInsets, String srcName) { Rect padding, Rect layoutInsets, String srcName) {
this(new NinePatchState(new NinePatch(bitmap, chunk, srcName), padding, layoutInsets), res); this(new NinePatchState(new NinePatch(bitmap, chunk, srcName), padding, layoutInsets), res);
mNinePatchState.mTargetDensity = mTargetDensity; mNinePatchState.mTargetDensity = mTargetDensity;
mMutated = true;
} }
/** /**
@@ -112,7 +109,6 @@ public class NinePatchDrawable extends Drawable {
@Deprecated @Deprecated
public NinePatchDrawable(NinePatch patch) { public NinePatchDrawable(NinePatch patch) {
this(new NinePatchState(patch, new Rect()), null); this(new NinePatchState(patch, new Rect()), null);
mMutated = true;
} }
/** /**
@@ -122,7 +118,6 @@ public class NinePatchDrawable extends Drawable {
public NinePatchDrawable(Resources res, NinePatch patch) { public NinePatchDrawable(Resources res, NinePatch patch) {
this(new NinePatchState(patch, new Rect()), res); this(new NinePatchState(patch, new Rect()), res);
mNinePatchState.mTargetDensity = mTargetDensity; mNinePatchState.mTargetDensity = mTargetDensity;
mMutated = true;
} }
private void setNinePatchState(NinePatchState state, Resources res) { private void setNinePatchState(NinePatchState state, Resources res) {