summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/platform/graphics/android
diff options
context:
space:
mode:
authorDerek Sollenberger <djsollen@google.com>2011-10-10 13:28:07 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-10-10 13:28:07 -0700
commit8242049005e7219ea9846eff8eff3cead8e2461e (patch)
tree064fdc9dedcded63e950dfe4a184548e92921c2a /Source/WebCore/platform/graphics/android
parent62e2515c022e538e62d28aa1bc7ee4986a64a2a4 (diff)
parent12831797a65a96977bbb6e066cc5d258e04e2161 (diff)
downloadexternal_webkit-8242049005e7219ea9846eff8eff3cead8e2461e.zip
external_webkit-8242049005e7219ea9846eff8eff3cead8e2461e.tar.gz
external_webkit-8242049005e7219ea9846eff8eff3cead8e2461e.tar.bz2
Merge "Delay sending Plugin Draw event until the surface is ready."
Diffstat (limited to 'Source/WebCore/platform/graphics/android')
-rw-r--r--Source/WebCore/platform/graphics/android/MediaTexture.cpp18
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) {