summaryrefslogtreecommitdiffstats
path: root/Source/WebKit
diff options
context:
space:
mode:
authorChris Craik <ccraik@google.com>2011-08-23 13:36:18 -0700
committerChris Craik <ccraik@google.com>2011-08-25 15:08:33 -0700
commitf51a51f6ea307f4311a04aa865a42b233269540b (patch)
tree62856bffa8b6e82f229a76cc324b28c4286496ee /Source/WebKit
parent5a1bad665e3c27495e4ccb9a73996ce3a84b0a26 (diff)
downloadexternal_webkit-f51a51f6ea307f4311a04aa865a42b233269540b.zip
external_webkit-f51a51f6ea307f4311a04aa865a42b233269540b.tar.gz
external_webkit-f51a51f6ea307f4311a04aa865a42b233269540b.tar.bz2
better locking while scrolling, but disables double buffering
don't detect scrolling, query from java removes double buffering depends on CL in frameworks/base: https://android-git.corp.google.com/g/#/c/130213/ bug:5106313 Change-Id: Ibfa7f305874f4209fed001c030bb94e752d479b9
Diffstat (limited to 'Source/WebKit')
-rw-r--r--Source/WebKit/android/jni/WebViewCore.cpp18
-rw-r--r--Source/WebKit/android/nav/WebView.cpp14
2 files changed, 27 insertions, 5 deletions
diff --git a/Source/WebKit/android/jni/WebViewCore.cpp b/Source/WebKit/android/jni/WebViewCore.cpp
index 3af55a3..5bc7f48 100644
--- a/Source/WebKit/android/jni/WebViewCore.cpp
+++ b/Source/WebKit/android/jni/WebViewCore.cpp
@@ -3842,11 +3842,10 @@ void WebViewCore::setWebTextViewAutoFillable(int queryId, const string16& previe
bool WebViewCore::drawIsPaused() const
{
- JNIEnv* env = JSC::Bindings::getJNIEnv();
- AutoJObject javaObject = m_javaGlue->object(env);
- if (!javaObject.get())
- return false;
- return env->GetBooleanField(javaObject.get(), gWebViewCoreFields.m_drawIsPaused);
+ // returning true says scrollview should be offscreen, which pauses
+ // gifs. because this is not again queried when we stop scrolling, we don't
+ // use the stopping currently.
+ return false;
}
#if USE(CHROME_NETWORK_STACK)
@@ -4438,6 +4437,14 @@ static bool FocusBoundsChanged(JNIEnv* env, jobject obj)
return GET_NATIVE_VIEW(env, obj)->focusBoundsChanged();
}
+static void SetIsPaused(JNIEnv* env, jobject obj, jboolean isPaused)
+{
+ // tell the webcore thread to stop thinking while we do other work
+ // (selection and scrolling). This has nothing to do with the lifecycle
+ // pause and resume.
+ GET_NATIVE_VIEW(env, obj)->setIsPaused(isPaused);
+}
+
static void Pause(JNIEnv* env, jobject obj)
{
// This is called for the foreground tab when the browser is put to the
@@ -4685,6 +4692,7 @@ static JNINativeMethod gJavaWebViewCoreMethods[] = {
(void*) SetNewStorageLimit },
{ "nativeGeolocationPermissionsProvide", "(Ljava/lang/String;ZZ)V",
(void*) GeolocationPermissionsProvide },
+ { "nativeSetIsPaused", "(Z)V", (void*) SetIsPaused },
{ "nativePause", "()V", (void*) Pause },
{ "nativeResume", "()V", (void*) Resume },
{ "nativeFreeMemory", "()V", (void*) FreeMemory },
diff --git a/Source/WebKit/android/nav/WebView.cpp b/Source/WebKit/android/nav/WebView.cpp
index 4b18b62..577b7c6 100644
--- a/Source/WebKit/android/nav/WebView.cpp
+++ b/Source/WebKit/android/nav/WebView.cpp
@@ -1330,6 +1330,11 @@ bool scrollBy(int dx, int dy)
return result;
}
+void setIsScrolling(bool isScrolling)
+{
+ m_glWebViewState->setIsScrolling(isScrolling);
+}
+
bool hasCursorNode()
{
CachedRoot* root = getFrameCache(DontAllowNewer);
@@ -2611,6 +2616,13 @@ static bool nativeScrollLayer(JNIEnv* env, jobject obj, jint layerId, jint x,
return false;
}
+static void nativeSetIsScrolling(JNIEnv* env, jobject jwebview, jboolean isScrolling)
+{
+ WebView* view = GET_NATIVE_VIEW(env, jwebview);
+ LOG_ASSERT(view, "view not set in %s", __FUNCTION__);
+ view->setIsScrolling(isScrolling);
+}
+
static void nativeUseHardwareAccelSkia(JNIEnv*, jobject, jboolean enabled)
{
BaseRenderer::setCurrentRendererType(enabled ? BaseRenderer::Ganesh : BaseRenderer::Raster);
@@ -2825,6 +2837,8 @@ static JNINativeMethod gJavaWebViewMethods[] = {
(void*) nativeScrollableLayer },
{ "nativeScrollLayer", "(III)Z",
(void*) nativeScrollLayer },
+ { "nativeSetIsScrolling", "(Z)V",
+ (void*) nativeSetIsScrolling },
{ "nativeUseHardwareAccelSkia", "(Z)V",
(void*) nativeUseHardwareAccelSkia },
{ "nativeGetBackgroundColor", "()I",