From 8598c9fb9f861f25ab14efde9efb19cb91d7df1c Mon Sep 17 00:00:00 2001 From: Patrick Scott Date: Fri, 3 Dec 2010 10:00:15 -0500 Subject: Attempt to scroll layers everytime the user drags. This is part of a frameworks/base change. Use the composite root bounds for the inval region when updating the UI picture. This fixes several drawing issues with outdated pictures. Bug: 3022562 Change-Id: Ic28cfbbe381fdd59368a6d83bb73b01df912b530 --- WebKit/android/jni/WebViewCore.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'WebKit/android/jni') diff --git a/WebKit/android/jni/WebViewCore.cpp b/WebKit/android/jni/WebViewCore.cpp index 5f5bb53..f134cb6 100644 --- a/WebKit/android/jni/WebViewCore.cpp +++ b/WebKit/android/jni/WebViewCore.cpp @@ -3557,10 +3557,17 @@ void WebViewCore::addVisitedLink(const UChar* string, int length) m_groupForVisitedLinks->addVisitedLink(string, length); } -static jint UpdateLayers(JNIEnv *env, jobject obj) +static jint UpdateLayers(JNIEnv *env, jobject obj, jobject region) { WebViewCore* viewImpl = GET_NATIVE_VIEW(env, obj); BaseLayerAndroid* result = viewImpl->createBaseLayer(); + SkRegion* nativeRegion = GraphicsJNI::getNativeRegion(env, region); + if (result) { + SkIRect bounds; + LayerAndroid* root = static_cast(result->getChild(0)); + root->bounds().roundOut(&bounds); + nativeRegion->setRect(bounds); + } return reinterpret_cast(result); } @@ -4096,7 +4103,7 @@ static JNINativeMethod gJavaWebViewCoreMethods[] = { (void*) UpdateFrameCache }, { "nativeGetContentMinPrefWidth", "()I", (void*) GetContentMinPrefWidth }, - { "nativeUpdateLayers", "()I", + { "nativeUpdateLayers", "(Landroid/graphics/Region;)I", (void*) UpdateLayers }, { "nativeRecordContent", "(Landroid/graphics/Region;Landroid/graphics/Point;)I", (void*) RecordContent }, -- cgit v1.1