diff options
author | Derek Sollenberger <djsollen@google.com> | 2011-08-22 13:46:32 -0400 |
---|---|---|
committer | Derek Sollenberger <djsollen@google.com> | 2011-10-10 16:11:53 -0400 |
commit | 12831797a65a96977bbb6e066cc5d258e04e2161 (patch) | |
tree | c0dedafa813f7c69029d97016127ff6bedbe18de /Source/WebCore/platform/graphics/android | |
parent | b496531c0b33b95e90aea56ea2620bbe7f5f9ae6 (diff) | |
download | external_webkit-12831797a65a96977bbb6e066cc5d258e04e2161.zip external_webkit-12831797a65a96977bbb6e066cc5d258e04e2161.tar.gz external_webkit-12831797a65a96977bbb6e066cc5d258e04e2161.tar.bz2 |
Delay sending Plugin Draw event until the surface is ready.
bug: 5436630
Change-Id: I058a0d750f185c56c0fe70ac0bff7c9781c35dc8
Diffstat (limited to 'Source/WebCore/platform/graphics/android')
-rw-r--r-- | Source/WebCore/platform/graphics/android/MediaTexture.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/Source/WebCore/platform/graphics/android/MediaTexture.cpp b/Source/WebCore/platform/graphics/android/MediaTexture.cpp index 1a5e2cc..e12518e 100644 --- a/Source/WebCore/platform/graphics/android/MediaTexture.cpp +++ b/Source/WebCore/platform/graphics/android/MediaTexture.cpp @@ -96,6 +96,21 @@ void MediaTexture::initNativeWindowIfNeeded() // create a content texture if none exists if (!m_contentTexture) { m_contentTexture = createTexture(); + + // send a message to the WebKit thread to notify the plugin that it can draw + if (m_weakWebViewRef) { + JNIEnv* env = JSC::Bindings::getJNIEnv(); + jobject localWebViewRef = env->NewLocalRef(m_weakWebViewRef); + if (localWebViewRef) { + jclass wvClass = env->GetObjectClass(localWebViewRef); + jmethodID sendPluginDrawMsg = + env->GetMethodID(wvClass, "sendPluginDrawMsg", "()V"); + env->CallVoidMethod(localWebViewRef, sendPluginDrawMsg); + env->DeleteLocalRef(wvClass); + env->DeleteLocalRef(localWebViewRef); + } + checkException(env); + } } // finally create a video texture if needed @@ -110,6 +125,8 @@ void MediaTexture::initNativeWindowIfNeeded() m_newWindowRequest = false; m_newWindow = videoTexture->nativeWindow; } + + // signal the WebKit thread in case it is waiting m_newMediaRequestCond.signal(); } @@ -253,6 +270,7 @@ void MediaTexture::setDimensions(const ANativeWindow* window, void MediaTexture::setFramerateCallback(const ANativeWindow* window, FramerateCallbackProc callback) { + XLOG("Release ANW %p (%p):(%p)", this, m_surfaceTexture.get(), m_surfaceTextureClient.get()); android::Mutex::Autolock lock(m_mediaLock); for (unsigned int i = 0; i < m_videoTextures.size(); i++) { if (m_videoTextures[i]->nativeWindow.get() == window) { |