diff options
Diffstat (limited to 'Source/WebKit/android')
-rw-r--r-- | Source/WebKit/android/jni/WebViewCore.cpp | 33 | ||||
-rw-r--r-- | Source/WebKit/android/jni/WebViewCore.h | 1 |
2 files changed, 22 insertions, 12 deletions
diff --git a/Source/WebKit/android/jni/WebViewCore.cpp b/Source/WebKit/android/jni/WebViewCore.cpp index 26c73b2..6d6b81c 100644 --- a/Source/WebKit/android/jni/WebViewCore.cpp +++ b/Source/WebKit/android/jni/WebViewCore.cpp @@ -919,6 +919,19 @@ void WebViewCore::rebuildPictureSet(PictureSet* pictureSet) #endif } +bool WebViewCore::updateLayers(LayerAndroid* layers) +{ + // We update the layers + ChromeClientAndroid* chromeC = static_cast<ChromeClientAndroid*>(m_mainFrame->page()->chrome()->client()); + GraphicsLayerAndroid* root = static_cast<GraphicsLayerAndroid*>(chromeC->layersSync()); + if (root) { + root->notifyClientAnimationStarted(); + LayerAndroid* updatedLayer = root->contentLayer(); + return layers->updateWithTree(updatedLayer); + } + return true; +} + BaseLayerAndroid* WebViewCore::createBaseLayer() { BaseLayerAndroid* base = new BaseLayerAndroid(); @@ -4119,20 +4132,16 @@ void WebViewCore::addVisitedLink(const UChar* string, int length) m_groupForVisitedLinks->addVisitedLink(string, length); } -static jint UpdateLayers(JNIEnv *env, jobject obj, jobject region) +static bool UpdateLayers(JNIEnv *env, jobject obj, jint jbaseLayer) { 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<LayerAndroid*>(result->getChild(0)); - if (root) { - root->bounds().roundOut(&bounds); - nativeRegion->setRect(bounds); - } + BaseLayerAndroid* baseLayer = (BaseLayerAndroid*) jbaseLayer; + if (baseLayer) { + LayerAndroid* root = static_cast<LayerAndroid*>(baseLayer->getChild(0)); + if (root) + return viewImpl->updateLayers(root); } - return reinterpret_cast<jint>(result); + return true; } static jint RecordContent(JNIEnv *env, jobject obj, jobject region, jobject pt) @@ -4707,7 +4716,7 @@ static JNINativeMethod gJavaWebViewCoreMethods[] = { (void*) UpdateFrameCache }, { "nativeGetContentMinPrefWidth", "()I", (void*) GetContentMinPrefWidth }, - { "nativeUpdateLayers", "(Landroid/graphics/Region;)I", + { "nativeUpdateLayers", "(I)Z", (void*) UpdateLayers }, { "nativeRecordContent", "(Landroid/graphics/Region;Landroid/graphics/Point;)I", (void*) RecordContent }, diff --git a/Source/WebKit/android/jni/WebViewCore.h b/Source/WebKit/android/jni/WebViewCore.h index 877f716..a25c5bb 100644 --- a/Source/WebKit/android/jni/WebViewCore.h +++ b/Source/WebKit/android/jni/WebViewCore.h @@ -525,6 +525,7 @@ namespace android { // and doing a copy of the layers. The layers' content may be updated // as we are calling layersSync(). BaseLayerAndroid* createBaseLayer(); + bool updateLayers(LayerAndroid*); int textWrapWidth() const { return m_textWrapWidth; } float scale() const { return m_scale; } |