diff options
-rw-r--r-- | WebCore/platform/graphics/android/GLWebViewState.cpp | 8 | ||||
-rw-r--r-- | WebCore/platform/graphics/android/GLWebViewState.h | 3 | ||||
-rw-r--r-- | WebKit/android/nav/WebView.cpp | 16 |
3 files changed, 18 insertions, 9 deletions
diff --git a/WebCore/platform/graphics/android/GLWebViewState.cpp b/WebCore/platform/graphics/android/GLWebViewState.cpp index 444ff17..62eab0f 100644 --- a/WebCore/platform/graphics/android/GLWebViewState.cpp +++ b/WebCore/platform/graphics/android/GLWebViewState.cpp @@ -111,13 +111,17 @@ GLWebViewState::~GLWebViewState() } void GLWebViewState::setBaseLayer(BaseLayerAndroid* layer, const SkRegion& inval, - bool showVisualIndicator) + bool showVisualIndicator, bool isPictureAfterFirstLayout) { android::Mutex::Autolock lock(m_baseLayerLock); - if (!layer) { + if (!layer || isPictureAfterFirstLayout) { m_tiledPageA->setUsable(false); m_tiledPageB->setUsable(false); } + if (isPictureAfterFirstLayout) { + m_baseLayerUpdate = true; + m_invalidateRegion.setEmpty(); + } if (m_baseLayer && layer) m_baseLayer->swapExtra(layer); m_baseLayer = layer; diff --git a/WebCore/platform/graphics/android/GLWebViewState.h b/WebCore/platform/graphics/android/GLWebViewState.h index 3f68757..e3b33f2 100644 --- a/WebCore/platform/graphics/android/GLWebViewState.h +++ b/WebCore/platform/graphics/android/GLWebViewState.h @@ -175,7 +175,8 @@ public: void resetTransitionTime() { m_transitionTime = -1; } unsigned int paintBaseLayerContent(SkCanvas* canvas); - void setBaseLayer(BaseLayerAndroid* layer, const SkRegion& inval, bool showVisualIndicator); + void setBaseLayer(BaseLayerAndroid* layer, const SkRegion& inval, bool showVisualIndicator, + bool isPictureAfterFirstLayout); void setExtra(BaseLayerAndroid*, SkPicture&, const IntRect&, bool allowSame); void scheduleUpdate(const double& currentTime, const SkIRect& viewport, float scale); diff --git a/WebKit/android/nav/WebView.cpp b/WebKit/android/nav/WebView.cpp index 6bf5558..0762fb9 100644 --- a/WebKit/android/nav/WebView.cpp +++ b/WebKit/android/nav/WebView.cpp @@ -441,7 +441,7 @@ bool drawGL(WebCore::IntRect& viewRect, float scale, int extras) SkIRect rect; rect.set(0, 0, m_baseLayer->content()->width(), m_baseLayer->content()->height()); region.setRect(rect); - m_glWebViewState->setBaseLayer(m_baseLayer, region, false); + m_glWebViewState->setBaseLayer(m_baseLayer, region, false, false); } } @@ -1386,11 +1386,13 @@ static void copyScrollPositionRecursive(const LayerAndroid* from, } #endif -void setBaseLayer(BaseLayerAndroid* layer, SkRegion& inval, bool showVisualIndicator) +void setBaseLayer(BaseLayerAndroid* layer, SkRegion& inval, bool showVisualIndicator, + bool isPictureAfterFirstLayout) { #if USE(ACCELERATED_COMPOSITING) if (m_glWebViewState) - m_glWebViewState->setBaseLayer(layer, inval, showVisualIndicator); + m_glWebViewState->setBaseLayer(layer, inval, showVisualIndicator, + isPictureAfterFirstLayout); #endif #if ENABLE(ANDROID_OVERFLOW_SCROLL) @@ -1801,13 +1803,15 @@ static bool nativeEvaluateLayersAnimations(JNIEnv *env, jobject obj) } static void nativeSetBaseLayer(JNIEnv *env, jobject obj, jint layer, jobject inval, - jboolean showVisualIndicator) + jboolean showVisualIndicator, + jboolean isPictureAfterFirstLayout) { BaseLayerAndroid* layerImpl = reinterpret_cast<BaseLayerAndroid*>(layer); SkRegion invalRegion; if (inval) invalRegion = *GraphicsJNI::getNativeRegion(env, inval); - GET_NATIVE_VIEW(env, obj)->setBaseLayer(layerImpl, invalRegion, showVisualIndicator); + GET_NATIVE_VIEW(env, obj)->setBaseLayer(layerImpl, invalRegion, showVisualIndicator, + isPictureAfterFirstLayout); } static void nativeReplaceBaseContent(JNIEnv *env, jobject obj, jint content) @@ -2599,7 +2603,7 @@ static JNINativeMethod gJavaWebViewMethods[] = { (void*) nativeSetFindIsUp }, { "nativeSetHeightCanMeasure", "(Z)V", (void*) nativeSetHeightCanMeasure }, - { "nativeSetBaseLayer", "(ILandroid/graphics/Region;Z)V", + { "nativeSetBaseLayer", "(ILandroid/graphics/Region;ZZ)V", (void*) nativeSetBaseLayer }, { "nativeReplaceBaseContent", "(I)V", (void*) nativeReplaceBaseContent }, |