summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/platform/graphics
diff options
context:
space:
mode:
authorTeng-Hui Zhu <ztenghui@google.com>2011-09-20 09:42:53 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-09-20 09:42:53 -0700
commit6d611101f901fbf23e794fe37693e5904ed9a2bb (patch)
tree448136e62f9cbef7a76508f411b2aa40b1b4f706 /Source/WebCore/platform/graphics
parent5cfbc58a9c1b7639519272029d1d3aa452723685 (diff)
parent1723e246784a82ad97c9e0c1e99743f54fdad099 (diff)
downloadexternal_webkit-6d611101f901fbf23e794fe37693e5904ed9a2bb.zip
external_webkit-6d611101f901fbf23e794fe37693e5904ed9a2bb.tar.gz
external_webkit-6d611101f901fbf23e794fe37693e5904ed9a2bb.tar.bz2
Merge "DO NOT MERGE:Share the display from the UI thread" into ics-factoryrom
Diffstat (limited to 'Source/WebCore/platform/graphics')
-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