diff options
author | Teng-Hui Zhu <ztenghui@google.com> | 2011-08-04 13:26:06 -0700 |
---|---|---|
committer | Teng-Hui Zhu <ztenghui@google.com> | 2011-08-04 13:29:21 -0700 |
commit | bd7014f80539c945baa9bdad996b24ee02545963 (patch) | |
tree | 8847de9b1521e0f9eac13d28ef2be4e982065dc0 /Source/WebCore/platform/graphics/android/TransferQueue.cpp | |
parent | 82b16301ec89989ef436f317f2f23f57ed2e2660 (diff) | |
download | external_webkit-bd7014f80539c945baa9bdad996b24ee02545963.zip external_webkit-bd7014f80539c945baa9bdad996b24ee02545963.tar.gz external_webkit-bd7014f80539c945baa9bdad996b24ee02545963.tar.bz2 |
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
Diffstat (limited to 'Source/WebCore/platform/graphics/android/TransferQueue.cpp')
-rw-r--r-- | Source/WebCore/platform/graphics/android/TransferQueue.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
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"); } |