diff options
author | Derek Sollenberger <djsollen@google.com> | 2011-02-05 08:38:03 -0500 |
---|---|---|
committer | Derek Sollenberger <djsollen@google.com> | 2011-02-05 08:38:03 -0500 |
commit | 79f07c999ff47d31cb788a64e35bfc04e7ed394d (patch) | |
tree | 3047a7d25945cef4c9f8627ea6b5919335b5efc3 /WebCore/platform | |
parent | 2bac1e45807d68b80f4a5cc7a62d0e3c24a4b6f6 (diff) | |
download | external_webkit-79f07c999ff47d31cb788a64e35bfc04e7ed394d.zip external_webkit-79f07c999ff47d31cb788a64e35bfc04e7ed394d.tar.gz external_webkit-79f07c999ff47d31cb788a64e35bfc04e7ed394d.tar.bz2 |
Fix to post an inval when plugins request a native video surface.
Change-Id: If9295a37ae19e7cb913e4cfa75b2a021bcda988f
Diffstat (limited to 'WebCore/platform')
-rw-r--r-- | WebCore/platform/graphics/android/MediaTexture.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/WebCore/platform/graphics/android/MediaTexture.cpp b/WebCore/platform/graphics/android/MediaTexture.cpp index c994e78..a92b570 100644 --- a/WebCore/platform/graphics/android/MediaTexture.cpp +++ b/WebCore/platform/graphics/android/MediaTexture.cpp @@ -158,8 +158,23 @@ ANativeWindow* VideoTexture::requestNewWindow() } m_newWindowRequest = true; + + // post an inval message to the UI thread to fulfill the request + if (m_weakWebViewRef) { + JNIEnv* env = JSC::Bindings::getJNIEnv(); + jobject localWebViewRef = env->NewLocalRef(m_weakWebViewRef); + if (localWebViewRef) { + jclass wvClass = env->GetObjectClass(localWebViewRef); + jmethodID postInvalMethod = env->GetMethodID(wvClass, "postInvalidate", "()V"); + env->CallVoidMethod(localWebViewRef, postInvalMethod); + env->DeleteLocalRef(wvClass); + env->DeleteLocalRef(localWebViewRef); + } + checkException(env); + } + //block until the request can be fulfilled or we time out - m_newVideoRequestCond.waitRelative(m_videoLock, 1000000000); // 1 sec + m_newVideoRequestCond.waitRelative(m_videoLock, 500000000); // .5 sec if (m_surfaceTextureClient.get()) m_newWindowReady = false; |