summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorTeng-Hui Zhu <ztenghui@google.com>2011-09-15 13:58:26 -0700
committerTeng-Hui Zhu <ztenghui@google.com>2011-09-16 10:50:57 -0700
commit8da5f07dec1d3812a318f192284fad39f7215194 (patch)
tree5379b0d6e553d0ef7fb0e5ba167a29336147bfca /Source
parente58b3f68036f1c961ed4c2c65a547481d8fde3e3 (diff)
downloadexternal_webkit-8da5f07dec1d3812a318f192284fad39f7215194.zip
external_webkit-8da5f07dec1d3812a318f192284fad39f7215194.tar.gz
external_webkit-8da5f07dec1d3812a318f192284fad39f7215194.tar.bz2
Share the display from the UI thread
Currently disable the wait b/c b/5332112. For now it should be the same functionality as the original workaround by using glDraw. bug:5270526 Change-Id: Ia6d6739909994d6ed756c6b195e6cf7ee9518c54
Diffstat (limited to 'Source')
-rw-r--r--Source/WebCore/platform/graphics/android/TransferQueue.cpp38
-rw-r--r--Source/WebCore/platform/graphics/android/TransferQueue.h2
2 files changed, 27 insertions, 13 deletions
diff --git a/Source/WebCore/platform/graphics/android/TransferQueue.cpp b/Source/WebCore/platform/graphics/android/TransferQueue.cpp
index df9aede..918d484 100644
--- a/Source/WebCore/platform/graphics/android/TransferQueue.cpp
+++ b/Source/WebCore/platform/graphics/android/TransferQueue.cpp
@@ -60,6 +60,7 @@ TransferQueue::TransferQueue()
, m_fboID(0)
, m_sharedSurfaceTextureId(0)
, m_hasGLContext(true)
+ , m_currentDisplay(EGL_NO_DISPLAY)
{
memset(&m_GLStateBeforeBlit, 0, sizeof(m_GLStateBeforeBlit));
@@ -164,14 +165,16 @@ void TransferQueue::blitTileFromQueue(GLuint fboID, BaseTileTexture* destTex,
// thread will then have to wait for this buffer to finish before writing
// into the same memory.
EGLDisplay dpy = eglGetCurrentDisplay();
- if (m_transferQueue[index].m_syncKHR != EGL_NO_SYNC_KHR)
- eglDestroySyncKHR(dpy, m_transferQueue[index].m_syncKHR);
- m_transferQueue[index].m_syncKHR = eglCreateSyncKHR(eglGetCurrentDisplay(),
- EGL_SYNC_FENCE_KHR,
- 0);
- if (m_transferQueue[index].m_syncKHR == EGL_NO_SYNC_KHR)
- XLOGC("ERROR: eglClientWaitSyncKHR return error");
-
+ if (m_currentDisplay != dpy)
+ m_currentDisplay = dpy;
+ if (m_currentDisplay != EGL_NO_DISPLAY) {
+ if (m_transferQueue[index].m_syncKHR != EGL_NO_SYNC_KHR)
+ eglDestroySyncKHR(m_currentDisplay, m_transferQueue[index].m_syncKHR);
+ m_transferQueue[index].m_syncKHR = eglCreateSyncKHR(m_currentDisplay,
+ EGL_SYNC_FENCE_KHR,
+ 0);
+ }
+ GLUtils::checkEglError("CreateSyncKHR");
// Clean up FBO setup.
glBindFramebuffer(GL_FRAMEBUFFER, 0); // rebind the standard FBO
@@ -207,11 +210,20 @@ bool TransferQueue::readyForUpdate()
if (!getHasGLContext())
return false;
- // Check the GPU fence
- eglClientWaitSyncKHR(eglGetCurrentDisplay(),
- m_transferQueue[getNextTransferQueueIndex()].m_syncKHR,
- EGL_SYNC_FLUSH_COMMANDS_BIT_KHR,
- EGL_FOREVER_KHR);
+ // Disable this wait until we figure out why this didn't work on some
+ // drivers b/5332112.
+#if 0
+ if (m_currentDisplay != EGL_NO_DISPLAY) {
+ // Check the GPU fence
+ EGLSyncKHR syncKHR = m_transferQueue[getNextTransferQueueIndex()].m_syncKHR;
+ if (syncKHR != EGL_NO_SYNC_KHR)
+ eglClientWaitSyncKHR(m_currentDisplay,
+ syncKHR,
+ EGL_SYNC_FLUSH_COMMANDS_BIT_KHR,
+ EGL_FOREVER_KHR);
+ }
+ GLUtils::checkEglError("WaitSyncKHR");
+#endif
return true;
}
diff --git a/Source/WebCore/platform/graphics/android/TransferQueue.h b/Source/WebCore/platform/graphics/android/TransferQueue.h
index dbe29f8..f773e41 100644
--- a/Source/WebCore/platform/graphics/android/TransferQueue.h
+++ b/Source/WebCore/platform/graphics/android/TransferQueue.h
@@ -127,6 +127,8 @@ private:
// is destroyed.
android::Mutex m_transferQueueItemLocks;
android::Condition m_transferQueueItemCond;
+
+ EGLDisplay m_currentDisplay;
};
} // namespace WebCore