diff options
author | Cary Clark <cary@android.com> | 2010-08-24 12:34:40 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2010-08-24 12:34:40 -0700 |
commit | 2e3b217097682f42fc27a0ba29d089740353a7ea (patch) | |
tree | 9ed2287ca9e45bdc559cfe701aa0f4362ab1e276 /WebKit | |
parent | 021eb475906bf08d90d93e6a3434fe2439e42cf0 (diff) | |
parent | 016ea440f1b61a966483fc809a078dd28b784e46 (diff) | |
download | external_webkit-2e3b217097682f42fc27a0ba29d089740353a7ea.zip external_webkit-2e3b217097682f42fc27a0ba29d089740353a7ea.tar.gz external_webkit-2e3b217097682f42fc27a0ba29d089740353a7ea.tar.bz2 |
Merge "communicate drawing pause to webkit to pause gif animation"
Diffstat (limited to 'WebKit')
-rw-r--r-- | WebKit/android/jni/WebViewCore.cpp | 26 | ||||
-rw-r--r-- | WebKit/android/jni/WebViewCore.h | 2 |
2 files changed, 28 insertions, 0 deletions
diff --git a/WebKit/android/jni/WebViewCore.cpp b/WebKit/android/jni/WebViewCore.cpp index 3b4872f..e81e335 100644 --- a/WebKit/android/jni/WebViewCore.cpp +++ b/WebKit/android/jni/WebViewCore.cpp @@ -210,6 +210,7 @@ struct WebViewCoreFields { jfieldID m_viewportUserScalable; jfieldID m_viewportDensityDpi; jfieldID m_webView; + jfieldID m_drawIsPaused; } gWebViewCoreFields; // ---------------------------------------------------------------------------- @@ -918,6 +919,13 @@ void WebViewCore::contentInvalidate(const WebCore::IntRect &r) contentDraw(); } +void WebViewCore::contentInvalidateAll() +{ + WebCore::FrameView* view = m_mainFrame->view(); + contentInvalidate(WebCore::IntRect(0, 0, + view->contentsWidth(), view->contentsHeight())); +} + void WebViewCore::offInvalidate(const WebCore::IntRect &r) { // FIXME: these invalidates are offscreen, and can be throttled or @@ -2858,6 +2866,13 @@ void WebViewCore::notifyWebAppCanBeInstalled() checkException(env); } +bool WebViewCore::drawIsPaused() const +{ + JNIEnv* env = JSC::Bindings::getJNIEnv(); + return env->GetBooleanField(m_javaGlue->object(env).get(), + gWebViewCoreFields.m_drawIsPaused); +} + //---------------------------------------------------------------------- // Native JNI methods //---------------------------------------------------------------------- @@ -2952,6 +2967,11 @@ static void Click(JNIEnv *env, jobject obj, int framePtr, int nodePtr) reinterpret_cast<WebCore::Node*>(nodePtr)); } +static void ContentInvalidateAll(JNIEnv *env, jobject obj) +{ + GET_NATIVE_VIEW(env, obj)->contentInvalidateAll(); +} + static void DeleteSelection(JNIEnv *env, jobject obj, jint start, jint end, jint textGeneration) { @@ -3512,6 +3532,8 @@ static JNINativeMethod gJavaWebViewCoreMethods[] = { (void*) Key }, { "nativeClick", "(II)V", (void*) Click }, + { "nativeContentInvalidateAll", "()V", + (void*) ContentInvalidateAll }, { "nativeSendListBoxChoices", "([ZI)V", (void*) SendListBoxChoices }, { "nativeSendListBoxChoice", "(I)V", @@ -3639,6 +3661,10 @@ int register_webviewcore(JNIEnv* env) "mWebView", "Landroid/webkit/WebView;"); LOG_ASSERT(gWebViewCoreFields.m_webView, "Unable to find android/webkit/WebViewCore.mWebView"); + gWebViewCoreFields.m_drawIsPaused = env->GetFieldID(widget, + "mDrawIsPaused", "Z"); + LOG_ASSERT(gWebViewCoreFields.m_drawIsPaused, + "Unable to find android/webkit/WebViewCore.mDrawIsPaused"); return jniRegisterNativeMethods(env, "android/webkit/WebViewCore", gJavaWebViewCoreMethods, NELEM(gJavaWebViewCoreMethods)); diff --git a/WebKit/android/jni/WebViewCore.h b/WebKit/android/jni/WebViewCore.h index 11a7228..89cdc8a 100644 --- a/WebKit/android/jni/WebViewCore.h +++ b/WebKit/android/jni/WebViewCore.h @@ -131,6 +131,7 @@ namespace android { * Record the invalid rectangle */ void contentInvalidate(const WebCore::IntRect &rect); + void contentInvalidateAll(); /** * Satisfy any outstanding invalidates, so that the current state @@ -494,6 +495,7 @@ namespace android { WTF::Vector<Container> m_buttons; bool isPaused() const { return m_isPaused; } void setIsPaused(bool isPaused) { m_isPaused = isPaused; } + bool drawIsPaused() const; // end of shared members // internal functions |