summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Romain Guy <romainguy@google.com> 2011-02-03 11:43:17 -0800
committer Android (Google) Code Review <android-gerrit@google.com> 2011-02-03 11:43:17 -0800
commit3b66e43e8c5671c646ccc6d52b0f2dec13898c91 (patch)
tree29971405c64adbc7738e87082ab89cd2606df7de
parent5e76e0aea28042287553ffa21826f59f601a3d2b (diff)
parent9d18f2d189aa2670d96462f2220ee7fd7950ebe5 (diff)
Merge "Refresh display lists when turning off layers rendering. Bug #3420565" into honeycomb
-rw-r--r--core/java/android/view/ViewGroup.java20
1 files changed, 18 insertions, 2 deletions
diff --git a/core/java/android/view/ViewGroup.java b/core/java/android/view/ViewGroup.java
index 09e1d89bb8a2..6981b9cd8526 100644
--- a/core/java/android/view/ViewGroup.java
+++ b/core/java/android/view/ViewGroup.java
@@ -2562,8 +2562,24 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
* @hide
*/
public void setChildrenLayersEnabled(boolean enabled) {
- mDrawLayers = enabled;
- invalidate(true);
+ if (enabled != mDrawLayers) {
+ mDrawLayers = enabled;
+ invalidate(true);
+
+ // We need to invalidate any child with a layer. For instance,
+ // if a child is backed by a hardware layer and we disable layers
+ // the child is marked as not dirty (flags cleared the last time
+ // the child was drawn inside its layer.) However, that child might
+ // never have created its own display list or have an obsolete
+ // display list. By invalidating the child we ensure the display
+ // list is in sync with the content of the hardware layer.
+ for (int i = 0; i < mChildrenCount; i++) {
+ View child = mChildren[i];
+ if (child.mLayerType != LAYER_TYPE_NONE) {
+ child.invalidate(true);
+ }
+ }
+ }
}
/**