summaryrefslogtreecommitdiffstats
path: root/graphics
diff options
context:
space:
mode:
authorAlan Viverette <alanv@google.com>2014-12-11 00:07:20 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-12-11 00:07:20 +0000
commit1259ab3a881adb008b74e5ad81c84e088f674cf6 (patch)
tree156a91cee2bcbe1850892b0de7ad0dfb490ac926 /graphics
parent347040cf84401601b0d5cbb1d76e4648d1c8a461 (diff)
parent3d517a701cb583f59ed8deefd21ab854c3890065 (diff)
downloadframeworks_base-1259ab3a881adb008b74e5ad81c84e088f674cf6.zip
frameworks_base-1259ab3a881adb008b74e5ad81c84e088f674cf6.tar.gz
frameworks_base-1259ab3a881adb008b74e5ad81c84e088f674cf6.tar.bz2
am 3d517a70: am 62b780e8: Avoid creating futures for drawables with no constant state
* commit '3d517a701cb583f59ed8deefd21ab854c3890065': 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 {