summaryrefslogtreecommitdiffstats
path: root/libs/hwui/OpenGLRenderer.cpp
diff options
context:
space:
mode:
authorRomain Guy <romainguy@google.com>2012-04-25 20:02:53 -0700
committerRomain Guy <romainguy@google.com>2012-04-25 20:02:53 -0700
commitc189ef53220059acf2adedc92ac4ac7e6a993e6b (patch)
treefaf8d04864c0276bf4d5166cc72eb0b5fe77e68b /libs/hwui/OpenGLRenderer.cpp
parent1b8f499a14a4340d3422d95c7f6fdc8c0c72b3a4 (diff)
downloadframeworks_base-c189ef53220059acf2adedc92ac4ac7e6a993e6b.zip
frameworks_base-c189ef53220059acf2adedc92ac4ac7e6a993e6b.tar.gz
frameworks_base-c189ef53220059acf2adedc92ac4ac7e6a993e6b.tar.bz2
Ensure we start every frame in the proper GL state
Bug #6345013, #6314960 Change-Id: I6985f7f233eb6a5f9223e9f4be3f323154b5dbf0
Diffstat (limited to 'libs/hwui/OpenGLRenderer.cpp')
-rw-r--r--libs/hwui/OpenGLRenderer.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp
index f8bb70a..55e962a 100644
--- a/libs/hwui/OpenGLRenderer.cpp
+++ b/libs/hwui/OpenGLRenderer.cpp
@@ -278,6 +278,13 @@ 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;
}
@@ -2787,6 +2794,7 @@ void OpenGLRenderer::drawTextureMesh(float left, float top, float right, float b
void OpenGLRenderer::chooseBlending(bool blend, SkXfermode::Mode mode,
ProgramDescription& description, bool swapSrcDst) {
blend = blend || mode != SkXfermode::kSrcOver_Mode;
+
if (blend) {
// These blend modes are not supported by OpenGL directly and have
// to be implemented using shaders. Since the shader will perform