diff options
Diffstat (limited to 'Source')
6 files changed, 6 insertions, 99 deletions
diff --git a/Source/WebCore/platform/graphics/android/layers/Layer.h b/Source/WebCore/platform/graphics/android/layers/Layer.h index 996547b..d87c699 100644 --- a/Source/WebCore/platform/graphics/android/layers/Layer.h +++ b/Source/WebCore/platform/graphics/android/layers/Layer.h @@ -157,6 +157,9 @@ protected: bool m_hasOverflowChildren; + // invalidation region + SkRegion m_dirtyRegion; +private: bool isAncestor(const Layer*) const; Layer* fParent; @@ -173,9 +176,6 @@ protected: SkTDArray<Layer*> m_children; - // invalidation region - SkRegion m_dirtyRegion; - WebCore::GLWebViewState* m_state; typedef SkRefCnt INHERITED; diff --git a/Source/WebCore/platform/graphics/android/layers/LayerAndroid.cpp b/Source/WebCore/platform/graphics/android/layers/LayerAndroid.cpp index df3fa42..81427b8 100644 --- a/Source/WebCore/platform/graphics/android/layers/LayerAndroid.cpp +++ b/Source/WebCore/platform/graphics/android/layers/LayerAndroid.cpp @@ -254,7 +254,7 @@ void LayerAndroid::addDirtyArea() area.intersect(clip); IntRect dirtyArea(area.x(), area.y(), area.width(), area.height()); - m_state->addDirtyArea(dirtyArea); + state()->addDirtyArea(dirtyArea); } void LayerAndroid::addAnimation(PassRefPtr<AndroidAnimation> prpAnim) @@ -411,7 +411,6 @@ void LayerAndroid::updatePositions() void LayerAndroid::updateGLPositionsAndScale(const TransformationMatrix& parentMatrix, const FloatRect& clipping, float opacity, float scale) { - m_atomicSync.lock(); IntSize layerSize(getSize().width(), getSize().height()); FloatPoint anchorPoint(getAnchorPoint().fX, getAnchorPoint().fY); FloatPoint position(getPosition().fX - m_offset.x(), getPosition().fY - m_offset.y()); @@ -428,7 +427,6 @@ void LayerAndroid::updateGLPositionsAndScale(const TransformationMatrix& parentM -originY, -anchorPointZ()); - m_atomicSync.unlock(); setDrawTransform(localMatrix); if (m_drawTransform.isIdentityOrTranslation()) { // adjust the translation coordinates of the draw transform matrix so @@ -610,50 +608,6 @@ void LayerAndroid::mergeInvalsInto(LayerAndroid* replacementTree) replacementLayer->markAsDirty(m_dirtyRegion); } -bool LayerAndroid::updateWithTree(LayerAndroid* newTree) -{ -// Disable fast update for now -#if (0) - bool needsRepaint = false; - int count = this->countChildren(); - for (int i = 0; i < count; i++) - needsRepaint |= this->getChild(i)->updateWithTree(newTree); - - if (newTree) { - LayerAndroid* newLayer = newTree->findById(uniqueId()); - needsRepaint |= updateWithLayer(newLayer); - } - return needsRepaint; -#else - return true; -#endif -} - -// Return true to indicate to WebViewCore that the updates -// are too complicated to be fully handled and we need a full -// call to webkit (e.g. handle repaints) -bool LayerAndroid::updateWithLayer(LayerAndroid* layer) -{ - if (!layer) - return true; - - android::AutoMutex lock(m_atomicSync); - m_position = layer->m_position; - m_anchorPoint = layer->m_anchorPoint; - m_size = layer->m_size; - m_opacity = layer->m_opacity; - m_transform = layer->m_transform; - - if (m_imageCRC != layer->m_imageCRC) - m_visible = false; - - if ((m_content != layer->m_content) - || (m_imageCRC != layer->m_imageCRC)) - return true; - - return false; -} - static inline bool compareLayerZ(const LayerAndroid* a, const LayerAndroid* b) { return a->zValue() > b->zValue(); @@ -857,7 +811,7 @@ bool LayerAndroid::drawGL(bool layerTilesDisabled) ImagesManager::instance()->releaseImage(m_imageCRC); } - m_state->glExtras()->drawGL(this); + state()->glExtras()->drawGL(this); bool askScreenUpdate = false; m_atomicSync.lock(); diff --git a/Source/WebCore/platform/graphics/android/layers/LayerAndroid.h b/Source/WebCore/platform/graphics/android/layers/LayerAndroid.h index 6239418..9a803a9 100644 --- a/Source/WebCore/platform/graphics/android/layers/LayerAndroid.h +++ b/Source/WebCore/platform/graphics/android/layers/LayerAndroid.h @@ -257,12 +257,6 @@ public: friend LayerAndroid* android::deserializeLayer(int version, SkStream* stream); friend void android::cleanupImageRefs(LayerAndroid* layer); - // Update layers using another tree. Only works for basic properties - // such as the position, the transform. Return true if anything more - // complex is needed. - bool updateWithTree(LayerAndroid*); - virtual bool updateWithLayer(LayerAndroid*); - LayerType type() { return m_type; } virtual SubclassType subclassType() { return LayerAndroid::StandardLayer; } diff --git a/Source/WebCore/platform/graphics/android/layers/ScrollableLayerAndroid.h b/Source/WebCore/platform/graphics/android/layers/ScrollableLayerAndroid.h index 1f289e6..52f5e7e 100644 --- a/Source/WebCore/platform/graphics/android/layers/ScrollableLayerAndroid.h +++ b/Source/WebCore/platform/graphics/android/layers/ScrollableLayerAndroid.h @@ -43,8 +43,6 @@ public: virtual LayerAndroid* copy() const { return new ScrollableLayerAndroid(*this); } virtual SubclassType subclassType() { return LayerAndroid::ScrollableLayer; } - virtual bool updateWithLayer(LayerAndroid*) { return true; } - // Scrolls to the given position in the layer. // Returns whether or not any scrolling was required. virtual bool scrollTo(int x, int y); diff --git a/Source/WebKit/android/WebCoreSupport/ChromeClientAndroid.cpp b/Source/WebKit/android/WebCoreSupport/ChromeClientAndroid.cpp index 207fe9a..c10f5b3 100644 --- a/Source/WebKit/android/WebCoreSupport/ChromeClientAndroid.cpp +++ b/Source/WebKit/android/WebCoreSupport/ChromeClientAndroid.cpp @@ -95,7 +95,7 @@ void ChromeClientAndroid::scheduleCompositingLayerSync() m_needsLayerSync = true; WebViewCore* webViewCore = WebViewCore::getWebViewCore(m_webFrame->page()->mainFrame()->view()); if (webViewCore) - webViewCore->layersDraw(); + webViewCore->contentDraw(); } void ChromeClientAndroid::setNeedsOneShotDrawingSynchronization() diff --git a/Source/WebKit/android/jni/WebViewCore.cpp b/Source/WebKit/android/jni/WebViewCore.cpp index 558f424..212bd38 100644 --- a/Source/WebKit/android/jni/WebViewCore.cpp +++ b/Source/WebKit/android/jni/WebViewCore.cpp @@ -323,7 +323,6 @@ struct WebViewCore::JavaGlue { jweak m_obj; jmethodID m_scrollTo; jmethodID m_contentDraw; - jmethodID m_layersDraw; jmethodID m_requestListBox; jmethodID m_openFileChooser; jmethodID m_requestSingleListBox; @@ -456,7 +455,6 @@ WebViewCore::WebViewCore(JNIEnv* env, jobject javaWebViewCore, WebCore::Frame* m m_javaGlue->m_obj = env->NewWeakGlobalRef(javaWebViewCore); m_javaGlue->m_scrollTo = GetJMethod(env, clazz, "contentScrollTo", "(IIZZ)V"); m_javaGlue->m_contentDraw = GetJMethod(env, clazz, "contentDraw", "()V"); - m_javaGlue->m_layersDraw = GetJMethod(env, clazz, "layersDraw", "()V"); m_javaGlue->m_requestListBox = GetJMethod(env, clazz, "requestListBox", "([Ljava/lang/String;[I[I)V"); m_javaGlue->m_openFileChooser = GetJMethod(env, clazz, "openFileChooser", "(Ljava/lang/String;)Ljava/lang/String;"); m_javaGlue->m_requestSingleListBox = GetJMethod(env, clazz, "requestListBox", "([Ljava/lang/String;[II)V"); @@ -858,18 +856,6 @@ 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) { - LayerAndroid* updatedLayer = root->contentLayer(); - return layers->updateWithTree(updatedLayer); - } - return true; -} - void WebViewCore::notifyAnimationStarted() { // We notify webkit that the animations have begun @@ -1020,16 +1006,6 @@ void WebViewCore::contentDraw() checkException(env); } -void WebViewCore::layersDraw() -{ - JNIEnv* env = JSC::Bindings::getJNIEnv(); - AutoJObject javaObject = m_javaGlue->object(env); - if (!javaObject.get()) - return; - env->CallVoidMethod(javaObject.get(), m_javaGlue->m_layersDraw); - checkException(env); -} - void WebViewCore::contentInvalidate(const WebCore::IntRect &r) { DBG_SET_LOGD("rect={%d,%d,w=%d,h=%d}", r.x(), r.y(), r.width(), r.height()); @@ -4573,19 +4549,6 @@ void WebViewCore::addVisitedLink(const UChar* string, int length) m_groupForVisitedLinks->addVisitedLink(string, length); } -static bool UpdateLayers(JNIEnv* env, jobject obj, jint nativeClass, - jint jbaseLayer) -{ - WebViewCore* viewImpl = (WebViewCore*) nativeClass; - BaseLayerAndroid* baseLayer = (BaseLayerAndroid*) jbaseLayer; - if (baseLayer) { - LayerAndroid* root = static_cast<LayerAndroid*>(baseLayer->getChild(0)); - if (root) - return viewImpl->updateLayers(root); - } - return true; -} - static void NotifyAnimationStarted(JNIEnv* env, jobject obj, jint nativeClass) { WebViewCore* viewImpl = (WebViewCore*) nativeClass; @@ -5123,8 +5086,6 @@ static JNINativeMethod gJavaWebViewCoreMethods[] = { (void*) RetrieveImageSource }, { "nativeGetContentMinPrefWidth", "(I)I", (void*) GetContentMinPrefWidth }, - { "nativeUpdateLayers", "(II)Z", - (void*) UpdateLayers }, { "nativeNotifyAnimationStarted", "(I)V", (void*) NotifyAnimationStarted }, { "nativeRecordContent", "(ILandroid/graphics/Region;Landroid/graphics/Point;)I", |