diff options
| author | Chet Haase <chet@google.com> | 2010-11-09 07:14:23 -0800 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2010-11-09 07:14:23 -0800 |
| commit | 494081aab9db951714fe4a9938000a7f93edc2ed (patch) | |
| tree | f9338ef2ef7a9b78ad45f606209bb22863500074 | |
| parent | e7f339613002ada65b220117ff87cd3c1ea41cf1 (diff) | |
| parent | 0d200833fdc53f9796698f97c18cefc4a1b82df2 (diff) | |
| download | frameworks_base-494081aab9db951714fe4a9938000a7f93edc2ed.zip frameworks_base-494081aab9db951714fe4a9938000a7f93edc2ed.tar.gz frameworks_base-494081aab9db951714fe4a9938000a7f93edc2ed.tar.bz2 | |
Merge "Fix GL rendering of translucent surfaces"
| -rw-r--r-- | core/java/android/view/ViewGroup.java | 19 | ||||
| -rw-r--r-- | libs/hwui/OpenGLRenderer.cpp | 7 |
2 files changed, 10 insertions, 16 deletions
diff --git a/core/java/android/view/ViewGroup.java b/core/java/android/view/ViewGroup.java index 17384c1..ac63742 100644 --- a/core/java/android/view/ViewGroup.java +++ b/core/java/android/view/ViewGroup.java @@ -3254,13 +3254,6 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager // through final boolean drawAnimation = (child.mPrivateFlags & DRAW_ANIMATION) == DRAW_ANIMATION; - // Check whether the child that requests the invalidate is fully opaque - final boolean isOpaque = child.isOpaque() && !drawAnimation && - child.getAnimation() == null; - // Mark the child as dirty, using the appropriate flag - // Make sure we do not set both flags at the same time - final int opaqueFlag = isOpaque ? DIRTY_OPAQUE : DIRTY; - if (dirty == null) { do { View view = null; @@ -3286,10 +3279,7 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager } else if (view != null) { if ((mPrivateFlags & DRAWN) == DRAWN) { view.mPrivateFlags &= ~DRAWING_CACHE_VALID; - if (view != null && (view.mPrivateFlags & DIRTY_MASK) != DIRTY) { - view.mPrivateFlags = - (view.mPrivateFlags & ~DIRTY_MASK) | opaqueFlag; - } + view.mPrivateFlags |= DIRTY; parent = view.mParent; } else { parent = null; @@ -3297,6 +3287,13 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager } } while (parent != null); } else { + // Check whether the child that requests the invalidate is fully opaque + final boolean isOpaque = child.isOpaque() && !drawAnimation && + child.getAnimation() == null; + // Mark the child as dirty, using the appropriate flag + // Make sure we do not set both flags at the same time + final int opaqueFlag = isOpaque ? DIRTY_OPAQUE : DIRTY; + final int[] location = attachInfo.mInvalidateChildLocation; location[CHILD_LEFT_INDEX] = child.mLeft; location[CHILD_TOP_INDEX] = child.mTop; diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp index 9a6618b..782d9b2 100644 --- a/libs/hwui/OpenGLRenderer.cpp +++ b/libs/hwui/OpenGLRenderer.cpp @@ -147,13 +147,10 @@ void OpenGLRenderer::prepare(bool opaque) { glDisable(GL_SCISSOR_TEST); glClearColor(0.0f, 0.0f, 0.0f, 0.0f); glClear(GL_COLOR_BUFFER_BIT); - glEnable(GL_SCISSOR_TEST); - } else { - glEnable(GL_SCISSOR_TEST); - glScissor(0, 0, mWidth, mHeight); - dirtyClip(); } + glEnable(GL_SCISSOR_TEST); + glScissor(0, 0, mWidth, mHeight); mSnapshot->setClip(0.0f, 0.0f, mWidth, mHeight); } |
