diff options
Diffstat (limited to 'WebKit/android/nav')
-rw-r--r-- | WebKit/android/nav/CachedFrame.cpp | 18 | ||||
-rw-r--r-- | WebKit/android/nav/CachedLayer.cpp | 1 | ||||
-rw-r--r-- | WebKit/android/nav/WebView.cpp | 30 |
3 files changed, 35 insertions, 14 deletions
diff --git a/WebKit/android/nav/CachedFrame.cpp b/WebKit/android/nav/CachedFrame.cpp index 27eebd3..b25ad7d 100644 --- a/WebKit/android/nav/CachedFrame.cpp +++ b/WebKit/android/nav/CachedFrame.cpp @@ -50,13 +50,17 @@ WebCore::IntRect CachedFrame::adjustBounds(const CachedNode* node, mRoot->mViewBounds.x(), mRoot->mViewBounds.y(), mRoot->mViewBounds.width(), mRoot->mViewBounds.height()); #if USE(ACCELERATED_COMPOSITING) - if (mRoot) { - const CachedLayer* cachedLayer = layer(node); - const WebCore::LayerAndroid* rootLayer = mRoot->rootLayer(); - const LayerAndroid* aLayer = cachedLayer->layer(rootLayer); - if (aLayer) - return cachedLayer->adjustBounds(rootLayer, rect); - } + if (!mRoot) + return rect; + + const CachedLayer* cachedLayer = layer(node); + if (!cachedLayer) + return rect; + + const WebCore::LayerAndroid* rootLayer = mRoot->rootLayer(); + const LayerAndroid* aLayer = cachedLayer->layer(rootLayer); + if (aLayer) + return cachedLayer->adjustBounds(rootLayer, rect); #endif return rect; } diff --git a/WebKit/android/nav/CachedLayer.cpp b/WebKit/android/nav/CachedLayer.cpp index c8220b3..d5385bd 100644 --- a/WebKit/android/nav/CachedLayer.cpp +++ b/WebKit/android/nav/CachedLayer.cpp @@ -177,7 +177,6 @@ void CachedLayer::Debug::print() const { CachedLayer* b = base(); DUMP_NAV_LOGD(" // int mCachedNodeIndex=%d;\n", b->mCachedNodeIndex); - DUMP_NAV_LOGD(" // LayerAndroid* mLayer=%p;\n", b->mLayer); DUMP_NAV_LOGD(" // int mOffset=(%d, %d);\n", b->mOffset.x(), b->mOffset.y()); DUMP_NAV_LOGD(" // int mUniqueId=%p;\n", b->mUniqueId); diff --git a/WebKit/android/nav/WebView.cpp b/WebKit/android/nav/WebView.cpp index f84f8b0..948ea6b 100644 --- a/WebKit/android/nav/WebView.cpp +++ b/WebKit/android/nav/WebView.cpp @@ -206,7 +206,7 @@ WebView(JNIEnv* env, jobject javaWebView, int viewImpl) : // We must remove the m_glWebViewState prior to deleting m_baseLayer. If we // do not remove it here, we risk having BaseTiles trying to paint using a // deallocated base layer. - delete m_glWebViewState; + stopGL(); #endif delete m_frameCacheUI; delete m_navPictureUI; @@ -214,6 +214,14 @@ WebView(JNIEnv* env, jobject javaWebView, int viewImpl) : delete m_glDrawFunctor; } +void stopGL() +{ +#if USE(ACCELERATED_COMPOSITING) + delete m_glWebViewState; + m_glWebViewState = 0; +#endif +} + WebViewCore* getWebViewCore() const { return m_viewImpl; } @@ -481,9 +489,7 @@ bool drawGL(WebCore::IntRect& viewRect, float scale, int extras) SkRect visibleRect; calcOurContentVisibleRect(&visibleRect); - m_viewImpl->setVisibleScreenWidth(visibleRect.width()); - m_viewImpl->setVisibleScreenHeight(visibleRect.height()); - bool ret = m_baseLayer->drawGL(viewRect, visibleRect, scale); + bool ret = m_glWebViewState->drawGL(viewRect, visibleRect, scale); if (ret || m_glWebViewState->currentPictureCounter() != pic) return true; #endif @@ -545,8 +551,6 @@ PictureSet* draw(SkCanvas* canvas, SkColor bgColor, int extras, bool split) compositeLayer->setExtra(extra); SkRect visible; calcOurContentVisibleRect(&visible); - m_viewImpl->setVisibleScreenWidth(visible.width()); - m_viewImpl->setVisibleScreenHeight(visible.height()); // call this to be sure we've adjusted for any scrolling or animations // before we actually draw compositeLayer->updateFixedLayersPositions(visible); @@ -2207,6 +2211,11 @@ static void nativeDestroy(JNIEnv *env, jobject obj) delete view; } +static void nativeStopGL(JNIEnv *env, jobject obj) +{ + GET_NATIVE_VIEW(env, obj)->stopGL(); +} + static bool nativeMoveCursorToNextTextInput(JNIEnv *env, jobject obj) { WebView* view = GET_NATIVE_VIEW(env, obj); @@ -2395,6 +2404,11 @@ static bool nativeScrollLayer(JNIEnv* env, jobject obj, jint layerId, jint x, return false; } +static void nativeSetExpandedTileBounds(JNIEnv*, jobject, jboolean enabled) +{ + TilesManager::instance()->setExpandedTileBounds(enabled); +} + /* * JNI registration */ @@ -2559,6 +2573,8 @@ static JNINativeMethod gJavaWebViewMethods[] = { (void*) nativeShowCursorTimed }, { "nativeStartSelection", "(II)Z", (void*) nativeStartSelection }, + { "nativeStopGL", "()V", + (void*) nativeStopGL }, { "nativeSubtractLayers", "(Landroid/graphics/Rect;)Landroid/graphics/Rect;", (void*) nativeSubtractLayers }, { "nativeTextGeneration", "()I", @@ -2573,6 +2589,8 @@ static JNINativeMethod gJavaWebViewMethods[] = { (void*) nativeScrollableLayer }, { "nativeScrollLayer", "(III)Z", (void*) nativeScrollLayer }, + { "nativeSetExpandedTileBounds", "(Z)V", + (void*) nativeSetExpandedTileBounds }, }; int registerWebView(JNIEnv* env) |