From 9044ef05d542a4f99b4be7ecefbe5e676bd3ea7f Mon Sep 17 00:00:00 2001 From: Mathias Agopian Date: Tue, 18 Oct 2011 14:49:27 -0700 Subject: Make sure set GL state properly when taking a screenshot, in particular, we could end up with stale GL state when drawing LayerDim which resulted in incortect rendering. Bug: 5467587 Change-Id: Id9fbed2843481d31063620f3662b364c7e3ac781 --- services/surfaceflinger/LayerBase.cpp | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'services/surfaceflinger/LayerBase.cpp') diff --git a/services/surfaceflinger/LayerBase.cpp b/services/surfaceflinger/LayerBase.cpp index 7a47f620f392..f04add148c76 100644 --- a/services/surfaceflinger/LayerBase.cpp +++ b/services/surfaceflinger/LayerBase.cpp @@ -388,14 +388,9 @@ void LayerBase::clearWithOpenGL(const Region& clip, GLclampf red, const uint32_t fbHeight = hw.getHeight(); glColor4f(red,green,blue,alpha); -#if defined(GL_OES_EGL_image_external) - if (GLExtensions::getInstance().haveTextureExternal()) { - glDisable(GL_TEXTURE_EXTERNAL_OES); - } -#endif + glDisable(GL_TEXTURE_EXTERNAL_OES); glDisable(GL_TEXTURE_2D); glDisable(GL_BLEND); - glDisable(GL_DITHER); Region::const_iterator it = clip.begin(); Region::const_iterator const end = clip.end(); @@ -457,12 +452,6 @@ void LayerBase::drawWithOpenGL(const Region& clip) const texCoords[3].u = 1; texCoords[3].v = 1; - if (needsDithering()) { - glEnable(GL_DITHER); - } else { - glDisable(GL_DITHER); - } - glEnableClientState(GL_TEXTURE_COORD_ARRAY); glVertexPointer(2, GL_FLOAT, 0, mVertices); glTexCoordPointer(2, GL_FLOAT, 0, texCoords); @@ -476,6 +465,7 @@ void LayerBase::drawWithOpenGL(const Region& clip) const glDrawArrays(GL_TRIANGLE_FAN, 0, 4); } glDisableClientState(GL_TEXTURE_COORD_ARRAY); + glDisable(GL_BLEND); } void LayerBase::dump(String8& result, char* buffer, size_t SIZE) const -- cgit v1.2.3-59-g8ed1b