summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/platform/graphics/android/TransferQueue.cpp
diff options
context:
space:
mode:
authorTeng-Hui Zhu <ztenghui@google.com>2011-08-04 17:10:50 -0700
committerTeng-Hui Zhu <ztenghui@google.com>2011-08-08 10:12:30 -0700
commit9989426944ed18f171dbbf71234ed5c53b2d450b (patch)
treed419fbc4dadf48c6565a78e0490ad2ebf1b4395d /Source/WebCore/platform/graphics/android/TransferQueue.cpp
parentbd7014f80539c945baa9bdad996b24ee02545963 (diff)
downloadexternal_webkit-9989426944ed18f171dbbf71234ed5c53b2d450b.zip
external_webkit-9989426944ed18f171dbbf71234ed5c53b2d450b.tar.gz
external_webkit-9989426944ed18f171dbbf71234ed5c53b2d450b.tar.bz2
Fix a potential sync problem for TransferQueue
bug:5044597 Change-Id: Id8cd326774a174a537f2b104d934539269395151
Diffstat (limited to 'Source/WebCore/platform/graphics/android/TransferQueue.cpp')
-rw-r--r--Source/WebCore/platform/graphics/android/TransferQueue.cpp21
1 files changed, 19 insertions, 2 deletions
diff --git a/Source/WebCore/platform/graphics/android/TransferQueue.cpp b/Source/WebCore/platform/graphics/android/TransferQueue.cpp
index ae94b2e..a4fd594 100644
--- a/Source/WebCore/platform/graphics/android/TransferQueue.cpp
+++ b/Source/WebCore/platform/graphics/android/TransferQueue.cpp
@@ -158,21 +158,38 @@ void TransferQueue::blitTileFromQueue(GLuint fboID, BaseTileTexture* destTex, GL
glBindFramebuffer(GL_FRAMEBUFFER, 0); // rebind the standard FBO
// Add a sync point here to WAR a driver bug.
- glViewport(0,0,0,0);
+ 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");
}
+void TransferQueue::interruptTransferQueue(bool interrupt)
+{
+ m_transferQueueItemLocks.lock();
+ m_interruptedByRemovingOp = interrupt;
+ if (m_interruptedByRemovingOp)
+ m_transferQueueItemCond.signal();
+ m_transferQueueItemLocks.unlock();
+}
+
+// This function must be called inside the m_transferQueueItemLocks, for the
+// wait, m_interruptedByRemovingOp and getHasGLContext().
+// Only called by updateQueueWithBitmap() for now.
bool TransferQueue::readyForUpdate()
{
if (!getHasGLContext())
return false;
// Don't use a while loop since when the WebView tear down, the emptyCount
// will still be 0, and we bailed out b/c of GL context lost.
- if (!m_emptyItemCount)
+ if (!m_emptyItemCount) {
+ if (m_interruptedByRemovingOp)
+ return false;
m_transferQueueItemCond.wait(m_transferQueueItemLocks);
+ if (m_interruptedByRemovingOp)
+ return false;
+ }
if (!getHasGLContext())
return false;