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/WebKit/android/jni | |
| 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/WebKit/android/jni')
| -rw-r--r-- | Source/WebKit/android/jni/WebViewCore.cpp | 18 | ||||
| -rw-r--r-- | Source/WebKit/android/jni/WebViewCore.h | 3 |
2 files changed, 21 insertions, 0 deletions
diff --git a/Source/WebKit/android/jni/WebViewCore.cpp b/Source/WebKit/android/jni/WebViewCore.cpp index 527d596..17a8bc5 100644 --- a/Source/WebKit/android/jni/WebViewCore.cpp +++ b/Source/WebKit/android/jni/WebViewCore.cpp @@ -2044,6 +2044,15 @@ void WebViewCore::sendPluginVisibleScreen() } } +void WebViewCore::sendPluginSurfaceReady() +{ + PluginWidgetAndroid** iter = m_plugins.begin(); + PluginWidgetAndroid** stop = m_plugins.end(); + for (; iter < stop; ++iter) { + (*iter)->checkSurfaceReady(); + } +} + void WebViewCore::sendPluginEvent(const ANPEvent& evt) { /* The list of plugins may be manipulated as we iterate through the list. @@ -4544,6 +4553,13 @@ static void ProvideVisitedHistory(JNIEnv *env, jobject obj, jobject hist) } } +static void PluginSurfaceReady(JNIEnv* env, jobject obj) +{ + WebViewCore* viewImpl = GET_NATIVE_VIEW(env, obj); + if (viewImpl) + viewImpl->sendPluginSurfaceReady(); +} + // Notification from the UI thread that the plugin's full-screen surface has been discarded static void FullScreenPluginHidden(JNIEnv* env, jobject obj, jint npp) { @@ -4740,6 +4756,8 @@ static JNINativeMethod gJavaWebViewCoreMethods[] = { (void*) ProvideVisitedHistory }, { "nativeFullScreenPluginHidden", "(I)V", (void*) FullScreenPluginHidden }, + { "nativePluginSurfaceReady", "()V", + (void*) PluginSurfaceReady }, { "nativeValidNodeAndBounds", "(IILandroid/graphics/Rect;)Z", (void*) ValidNodeAndBounds }, { "nativeGetTouchHighlightRects", "(III)Ljava/util/ArrayList;", diff --git a/Source/WebKit/android/jni/WebViewCore.h b/Source/WebKit/android/jni/WebViewCore.h index 6d65957..491a0ad 100644 --- a/Source/WebKit/android/jni/WebViewCore.h +++ b/Source/WebKit/android/jni/WebViewCore.h @@ -444,6 +444,9 @@ namespace android { // send the current screen size/zoom to all of the plugins in our list void sendPluginVisibleScreen(); + // notify plugin that a new drawing surface was created in the UI thread + void sendPluginSurfaceReady(); + // send onLoad event to plugins who are descendents of the given frame void notifyPluginsOnFrameLoad(const Frame*); |
