diff options
author | Chet Haase <chet@google.com> | 2011-01-26 23:49:23 -0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-01-26 23:49:23 -0800 |
commit | a45c056e62be0ca97edbdd6f6660822cf453c886 (patch) | |
tree | 4bd46b25738c401070275c90ee33a84f8710edc1 | |
parent | f02853f211f0b7f698f82305e30c23e527192584 (diff) | |
parent | 678e0adbdbac5fa3f25ca8371fdff1b3182f67e9 (diff) | |
download | frameworks_base-a45c056e62be0ca97edbdd6f6660822cf453c886.zip frameworks_base-a45c056e62be0ca97edbdd6f6660822cf453c886.tar.gz frameworks_base-a45c056e62be0ca97edbdd6f6660822cf453c886.tar.bz2 |
Merge "Fix display List bugs" into honeycomb
-rw-r--r-- | api/11.xml | 11 | ||||
-rw-r--r-- | api/current.xml | 11 | ||||
-rw-r--r-- | core/java/android/view/View.java | 13 | ||||
-rw-r--r-- | core/java/android/view/ViewGroup.java | 19 | ||||
-rw-r--r-- | libs/hwui/LayerRenderer.cpp | 2 |
5 files changed, 23 insertions, 33 deletions
@@ -215665,17 +215665,6 @@ visibility="public" > </method> -<method name="getOnLayoutChangeListeners" - return="java.util.List<android.view.View.OnLayoutChangeListener>" - abstract="false" - native="false" - synchronized="false" - static="false" - final="false" - deprecated="not deprecated" - visibility="public" -> -</method> <method name="getOverScrollMode" return="int" abstract="false" diff --git a/api/current.xml b/api/current.xml index 5c3a8e4..248a1e2 100644 --- a/api/current.xml +++ b/api/current.xml @@ -215687,17 +215687,6 @@ visibility="public" > </method> -<method name="getOnLayoutChangeListeners" - return="java.util.List<android.view.View.OnLayoutChangeListener>" - abstract="false" - native="false" - synchronized="false" - static="false" - final="false" - deprecated="not deprecated" - visibility="public" -> -</method> <method name="getOverScrollMode" return="int" abstract="false" diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java index 0898045..c64f564 100644 --- a/core/java/android/view/View.java +++ b/core/java/android/view/View.java @@ -2937,13 +2937,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility } /** - * Gets the current list of listeners for layout changes. - */ - public List<OnLayoutChangeListener> getOnLayoutChangeListeners() { - return mOnLayoutChangeListeners; - } - - /** * Returns the focus-change callback registered for this view. * * @return The callback, or null if one is not registered. @@ -6011,6 +6004,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility invalidate(true); } mBackgroundSizeChanged = true; + invalidateParentIfNeeded(); } } @@ -6077,6 +6071,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility invalidate(true); } mBackgroundSizeChanged = true; + invalidateParentIfNeeded(); } } @@ -6137,6 +6132,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility invalidate(true); } mBackgroundSizeChanged = true; + invalidateParentIfNeeded(); } } @@ -6194,6 +6190,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility invalidate(true); } mBackgroundSizeChanged = true; + invalidateParentIfNeeded(); } } @@ -6438,6 +6435,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility mPrivateFlags |= DRAWN; // force another invalidation with the new orientation invalidate(false); } + invalidateParentIfNeeded(); } } @@ -6476,6 +6474,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility mPrivateFlags |= DRAWN; // force another invalidation with the new orientation invalidate(false); } + invalidateParentIfNeeded(); } } diff --git a/core/java/android/view/ViewGroup.java b/core/java/android/view/ViewGroup.java index 9e5b23c..d4efdb6 100644 --- a/core/java/android/view/ViewGroup.java +++ b/core/java/android/view/ViewGroup.java @@ -17,6 +17,7 @@ package android.view; import android.animation.LayoutTransition; +import android.view.animation.AlphaAnimation; import com.android.internal.R; import com.android.internal.util.Predicate; @@ -2364,6 +2365,7 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager DisplayList displayList = null; Bitmap cache = null; + boolean hasDisplayList = false; if (caching) { if (!canvas.isHardwareAccelerated()) { if (layerType != LAYER_TYPE_NONE) { @@ -2376,12 +2378,13 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager child.buildDrawingCache(true); cache = child.getDrawingCache(true); } else if (layerType == LAYER_TYPE_NONE) { - displayList = child.getDisplayList(); + // Delay getting the display list until animation-driven alpha values are + // set up and possibly passed on to the view + hasDisplayList = true; } } } - final boolean hasDisplayList = displayList != null && displayList.isReady(); final boolean hasNoCache = cache == null || hasDisplayList; final int restoreTo = canvas.save(); @@ -2472,6 +2475,10 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager } } + if (hasDisplayList) { + displayList = child.getDisplayList(); + } + if (hasNoCache) { boolean layerRendered = false; if (layerType == LAYER_TYPE_HARDWARE) { @@ -2529,7 +2536,9 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager canvas.restoreToCount(restoreTo); if (a != null && !more) { - child.onSetAlpha(255); + if (!canvas.isHardwareAccelerated() && !a.getFillAfter()) { + child.onSetAlpha(255); + } finishAnimatingView(child, a); } @@ -2538,6 +2547,10 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager // display lists to render, force an invalidate to allow the animation to // continue drawing another frame invalidate(); + if (a instanceof AlphaAnimation) { + // alpha animations should cause the child to recreate its display list + child.invalidate(); + } } child.mRecreateDisplayList = false; diff --git a/libs/hwui/LayerRenderer.cpp b/libs/hwui/LayerRenderer.cpp index 2dd4dca..691f649 100644 --- a/libs/hwui/LayerRenderer.cpp +++ b/libs/hwui/LayerRenderer.cpp @@ -43,7 +43,7 @@ void LayerRenderer::finish() { generateMesh(); - LAYER_RENDERER_LOGD("Finished rendering into layer, fbo = %d", mLayer->mFbo); + LAYER_RENDERER_LOGD("Finished rendering into layer, fbo = %d", mLayer->fbo); // No need to unbind our FBO, this will be taken care of by the caller // who will invoke OpenGLRenderer::resume() |