From 08837c246c9c27902c59b41c8661c2f27a4aa2bc Mon Sep 17 00:00:00 2001 From: Chet Haase Date: Mon, 28 Nov 2011 11:53:21 -0800 Subject: Fix flashing wifi dialog after rotating back from landscape. There was an error in some of the OpenGL layer logic such that we would occasionally set up a layer for rendering and then not clean up when it was done. This caused future OpenGL rendering to go into that layer instead of to the buffers being displayed on the screen, resulting in artifacts including flashes and displaying of stale content. This happened specifically when using the wifi settings dialog with the InputMethod keyboard displayed, but it was probably visible in other situations as well. Issue #5628248: Flickering/flashing after entering password for WiFi Change-Id: I38139f620b310f4309570fa7224552d2ee633999 --- libs/hwui/OpenGLRenderer.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'libs/hwui/OpenGLRenderer.cpp') diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp index 7561a47fa533..4d226461a02a 100644 --- a/libs/hwui/OpenGLRenderer.cpp +++ b/libs/hwui/OpenGLRenderer.cpp @@ -201,14 +201,16 @@ void OpenGLRenderer::interrupt() { } void OpenGLRenderer::resume() { - glViewport(0, 0, mSnapshot->viewport.getWidth(), mSnapshot->viewport.getHeight()); + sp snapshot = (mSnapshot != NULL) ? mSnapshot : mFirstSnapshot; + + glViewport(0, 0, snapshot->viewport.getWidth(), snapshot->viewport.getHeight()); glEnable(GL_SCISSOR_TEST); dirtyClip(); glDisable(GL_DITHER); - glBindFramebuffer(GL_FRAMEBUFFER, mSnapshot->fbo); + glBindFramebuffer(GL_FRAMEBUFFER, snapshot->fbo); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); mCaches.blend = true; -- cgit v1.2.3-59-g8ed1b