From bd7014f80539c945baa9bdad996b24ee02545963 Mon Sep 17 00:00:00 2001 From: Teng-Hui Zhu Date: Thu, 4 Aug 2011 13:26:06 -0700 Subject: Better driver bug workaround It seems like the FBO operation is out of sync in some GL driver. Instead of doing a readPixel, we can also force a read after write by calling an extra draw. bug:5118763 Change-Id: Idaf259f84b0dcc0f3bc94bcf1bd1a4adf5250350 --- Source/WebCore/platform/graphics/android/TransferQueue.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'Source/WebCore/platform/graphics/android/TransferQueue.cpp') diff --git a/Source/WebCore/platform/graphics/android/TransferQueue.cpp b/Source/WebCore/platform/graphics/android/TransferQueue.cpp index 0d48175..ae94b2e 100644 --- a/Source/WebCore/platform/graphics/android/TransferQueue.cpp +++ b/Source/WebCore/platform/graphics/android/TransferQueue.cpp @@ -154,12 +154,14 @@ void TransferQueue::blitTileFromQueue(GLuint fboID, BaseTileTexture* destTex, GL TilesManager::instance()->shader()->drawQuad(rect, srcTexId, 1.0, srcTexTarget); - // Need to WAR a driver bug to add a sync point here - GLubyte readBackPixels[4]; - glReadPixels(0, 0, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, readBackPixels); - // Clean up FBO setup. glBindFramebuffer(GL_FRAMEBUFFER, 0); // rebind the standard FBO + + // Add a sync point here to WAR a driver bug. + glViewport(0,0,0,0); + TilesManager::instance()->shader()->drawQuad(rect, destTex->m_ownTextureId, + 1.0, GL_TEXTURE_2D); + GLUtils::checkGlError("copy the surface texture into the normal one"); } -- cgit v1.1