Skip to content

Commit 684385d

Browse files
author
Romain Guy
committed
mutate() didn't work as advertised
Bug #7162705 Change-Id: I15b2663fa7f1c71a2a3479134b8b7f37bfcbc607
1 parent 35643dd commit 684385d

File tree

4 files changed

+1
-17
lines changed

4 files changed

+1
-17
lines changed

graphics/java/android/graphics/drawable/BitmapDrawable.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ public class BitmapDrawable extends Drawable {
8080
@Deprecated
8181
public BitmapDrawable() {
8282
mBitmapState = new BitmapState((Bitmap) null);
83-
mMutated = true;
8483
}
8584

8685
/**
@@ -91,7 +90,6 @@ public BitmapDrawable() {
9190
public BitmapDrawable(Resources res) {
9291
mBitmapState = new BitmapState((Bitmap) null);
9392
mBitmapState.mTargetDensity = mTargetDensity;
94-
mMutated = true;
9593
}
9694

9795
/**
@@ -102,7 +100,6 @@ public BitmapDrawable(Resources res) {
102100
@Deprecated
103101
public BitmapDrawable(Bitmap bitmap) {
104102
this(new BitmapState(bitmap), null);
105-
mMutated = true;
106103
}
107104

108105
/**
@@ -112,7 +109,6 @@ public BitmapDrawable(Bitmap bitmap) {
112109
public BitmapDrawable(Resources res, Bitmap bitmap) {
113110
this(new BitmapState(bitmap), res);
114111
mBitmapState.mTargetDensity = mTargetDensity;
115-
mMutated = true;
116112
}
117113

118114
/**
@@ -126,7 +122,6 @@ public BitmapDrawable(String filepath) {
126122
if (mBitmap == null) {
127123
android.util.Log.w("BitmapDrawable", "BitmapDrawable cannot decode " + filepath);
128124
}
129-
mMutated = true;
130125
}
131126

132127
/**
@@ -139,7 +134,6 @@ public BitmapDrawable(Resources res, String filepath) {
139134
if (mBitmap == null) {
140135
android.util.Log.w("BitmapDrawable", "BitmapDrawable cannot decode " + filepath);
141136
}
142-
mMutated = true;
143137
}
144138

145139
/**
@@ -153,7 +147,6 @@ public BitmapDrawable(java.io.InputStream is) {
153147
if (mBitmap == null) {
154148
android.util.Log.w("BitmapDrawable", "BitmapDrawable cannot decode " + is);
155149
}
156-
mMutated = true;
157150
}
158151

159152
/**
@@ -166,7 +159,6 @@ public BitmapDrawable(Resources res, java.io.InputStream is) {
166159
if (mBitmap == null) {
167160
android.util.Log.w("BitmapDrawable", "BitmapDrawable cannot decode " + is);
168161
}
169-
mMutated = true;
170162
}
171163

172164
/**
@@ -560,7 +552,6 @@ private BitmapDrawable(BitmapState state, Resources res) {
560552
} else {
561553
mTargetDensity = state.mTargetDensity;
562554
}
563-
mMutated = false;
564555
setBitmap(state != null ? state.mBitmap : null);
565556
}
566557
}

graphics/java/android/graphics/drawable/ColorDrawable.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ public class ColorDrawable extends Drawable {
4343
*/
4444
public ColorDrawable() {
4545
this(null);
46-
mMutated = true;
4746
}
4847

4948
/**
@@ -54,7 +53,6 @@ public ColorDrawable() {
5453
public ColorDrawable(int color) {
5554
this(null);
5655
setColor(color);
57-
mMutated = true;
5856
}
5957

6058
private ColorDrawable(ColorState state) {

graphics/java/android/graphics/drawable/GradientDrawable.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ public class GradientDrawable extends Drawable {
124124

125125
private Paint mLayerPaint; // internal, used if we use saveLayer()
126126
private boolean mRectIsDirty; // internal state
127-
private boolean mMutated = true;
127+
private boolean mMutated;
128128
private Path mRingPath;
129129
private boolean mPathIsDirty = true;
130130

graphics/java/android/graphics/drawable/NinePatchDrawable.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ public class NinePatchDrawable extends Drawable {
7777
@Deprecated
7878
public NinePatchDrawable(Bitmap bitmap, byte[] chunk, Rect padding, String srcName) {
7979
this(new NinePatchState(new NinePatch(bitmap, chunk, srcName), padding), null);
80-
mMutated = true;
8180
}
8281

8382
/**
@@ -88,7 +87,6 @@ public NinePatchDrawable(Resources res, Bitmap bitmap, byte[] chunk,
8887
Rect padding, String srcName) {
8988
this(new NinePatchState(new NinePatch(bitmap, chunk, srcName), padding), res);
9089
mNinePatchState.mTargetDensity = mTargetDensity;
91-
mMutated = true;
9290
}
9391

9492
/**
@@ -101,7 +99,6 @@ public NinePatchDrawable(Resources res, Bitmap bitmap, byte[] chunk,
10199
Rect padding, Rect layoutInsets, String srcName) {
102100
this(new NinePatchState(new NinePatch(bitmap, chunk, srcName), padding, layoutInsets), res);
103101
mNinePatchState.mTargetDensity = mTargetDensity;
104-
mMutated = true;
105102
}
106103

107104
/**
@@ -112,7 +109,6 @@ public NinePatchDrawable(Resources res, Bitmap bitmap, byte[] chunk,
112109
@Deprecated
113110
public NinePatchDrawable(NinePatch patch) {
114111
this(new NinePatchState(patch, new Rect()), null);
115-
mMutated = true;
116112
}
117113

118114
/**
@@ -122,7 +118,6 @@ public NinePatchDrawable(NinePatch patch) {
122118
public NinePatchDrawable(Resources res, NinePatch patch) {
123119
this(new NinePatchState(patch, new Rect()), res);
124120
mNinePatchState.mTargetDensity = mTargetDensity;
125-
mMutated = true;
126121
}
127122

128123
private void setNinePatchState(NinePatchState state, Resources res) {

0 commit comments

Comments
 (0)