summaryrefslogtreecommitdiffstats
path: root/graphics
diff options
context:
space:
mode:
authorAlan Viverette <alanv@google.com>2014-12-11 01:38:38 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-12-11 01:38:38 +0000
commitd8d9cbe3ffa3fc3c4d85c9daa549f51a04447783 (patch)
treef836e9495ec0470fb4101b740322613dc151da36 /graphics
parenta76db13fb051c9ba34595386edcb1535571eefdb (diff)
parent1259ab3a881adb008b74e5ad81c84e088f674cf6 (diff)
downloadframeworks_base-d8d9cbe3ffa3fc3c4d85c9daa549f51a04447783.zip
frameworks_base-d8d9cbe3ffa3fc3c4d85c9daa549f51a04447783.tar.gz
frameworks_base-d8d9cbe3ffa3fc3c4d85c9daa549f51a04447783.tar.bz2
am 1259ab3a: am 3d517a70: am 62b780e8: Avoid creating futures for drawables with no constant state
* commit '1259ab3a881adb008b74e5ad81c84e088f674cf6': Avoid creating futures for drawables with no constant state
Diffstat (limited to 'graphics')
-rw-r--r--graphics/java/android/graphics/drawable/DrawableContainer.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/graphics/java/android/graphics/drawable/DrawableContainer.java b/graphics/java/android/graphics/drawable/DrawableContainer.java
index 1e360d3..3fe408a 100644
--- a/graphics/java/android/graphics/drawable/DrawableContainer.java
+++ b/graphics/java/android/graphics/drawable/DrawableContainer.java
@@ -714,10 +714,17 @@ public class DrawableContainer extends Drawable implements Drawable.Callback {
mDrawableFutures = new SparseArray<ConstantStateFuture>(mNumChildren);
}
+ // Create futures for drawables with constant states. If a
+ // drawable doesn't have a constant state, then we can't clone
+ // it and we'll have to reference the original.
final int N = mNumChildren;
for (int i = 0; i < N; i++) {
if (origDr[i] != null) {
- mDrawableFutures.put(i, new ConstantStateFuture(origDr[i]));
+ if (origDr[i].getConstantState() != null) {
+ mDrawableFutures.put(i, new ConstantStateFuture(origDr[i]));
+ } else {
+ mDrawables[i] = origDr[i];
+ }
}
}
} else {