diff options
author | Romain Guy <romainguy@google.com> | 2012-05-22 14:28:58 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-05-22 14:28:58 -0700 |
commit | e5a4a3dc1648844f06d29efd42c9306c3cdf177e (patch) | |
tree | bf396dc3918ac55847b1929599cbd3c632e24b0f /libs/hwui/OpenGLRenderer.cpp | |
parent | 638e012d2b5c2b075b48f86d08daec9b36319cfc (diff) | |
parent | ddf74373616c89e0880a28a2185fd7ce3db91de6 (diff) | |
download | frameworks_base-e5a4a3dc1648844f06d29efd42c9306c3cdf177e.zip frameworks_base-e5a4a3dc1648844f06d29efd42c9306c3cdf177e.tar.gz frameworks_base-e5a4a3dc1648844f06d29efd42c9306c3cdf177e.tar.bz2 |
Merge "Ensure we always set the proper blending mode Bug #6527305" into jb-dev
Diffstat (limited to 'libs/hwui/OpenGLRenderer.cpp')
-rw-r--r-- | libs/hwui/OpenGLRenderer.cpp | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp index 766a199..2a8b32c 100644 --- a/libs/hwui/OpenGLRenderer.cpp +++ b/libs/hwui/OpenGLRenderer.cpp @@ -176,14 +176,26 @@ void OpenGLRenderer::prepareDirty(float left, float top, float right, float bott mSnapshot->fbo = getTargetFbo(); mSaveCount = 1; - glViewport(0, 0, mWidth, mHeight); - mCaches.setScissor(left, mSnapshot->height - bottom, right - left, bottom - top); - mSnapshot->setClip(left, top, right, bottom); - mDirtyClip = false; + mDirtyClip = opaque; + + syncState(); if (!opaque) { + mCaches.setScissor(left, mSnapshot->height - bottom, right - left, bottom - top); glClear(GL_COLOR_BUFFER_BIT); + } else { + mCaches.resetScissor(); + } +} + +void OpenGLRenderer::syncState() { + glViewport(0, 0, mWidth, mHeight); + + if (mCaches.blend) { + glEnable(GL_BLEND); + } else { + glDisable(GL_BLEND); } } @@ -290,11 +302,6 @@ status_t OpenGLRenderer::invokeFunctors(Rect& dirty) { } } - // Restore state possibly changed by the functors in process mode - GLboolean value; - glGetBooleanv(GL_BLEND, &value); - mCaches.blend = value; - mCaches.activeTexture(0); return result; |