diff options
author | Nicolas Roard <nicolasroard@google.com> | 2011-12-09 15:28:27 -0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-12-09 15:28:27 -0800 |
commit | d5d80ef0209b981f86c532ffc148cc4f38173e46 (patch) | |
tree | 62f4623228c765d799b0145c65d210faba2182d3 /Source | |
parent | 8ea7c9d3a963adc59355a0ef4d59d6bfc6ad192f (diff) | |
parent | 08c253c5d2dad921120c3e1ab7bc6781064ca31b (diff) | |
download | external_webkit-d5d80ef0209b981f86c532ffc148cc4f38173e46.zip external_webkit-d5d80ef0209b981f86c532ffc148cc4f38173e46.tar.gz external_webkit-d5d80ef0209b981f86c532ffc148cc4f38173e46.tar.bz2 |
Merge "Fix the repaint inval mechanism for layers - cherry-pick from MR1"
Diffstat (limited to 'Source')
-rw-r--r-- | Source/WebCore/platform/graphics/android/BaseTile.cpp | 1 | ||||
-rw-r--r-- | Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp | 9 | ||||
-rw-r--r-- | Source/WebCore/rendering/RenderLayer.cpp | 7 |
3 files changed, 16 insertions, 1 deletions
diff --git a/Source/WebCore/platform/graphics/android/BaseTile.cpp b/Source/WebCore/platform/graphics/android/BaseTile.cpp index df96657..27bd482 100644 --- a/Source/WebCore/platform/graphics/android/BaseTile.cpp +++ b/Source/WebCore/platform/graphics/android/BaseTile.cpp @@ -204,6 +204,7 @@ void BaseTile::markAsDirty(int unsigned pictureCount, } cliperator.next(); } + if (!intersect) return; diff --git a/Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp b/Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp index de9fcae..ef74521 100644 --- a/Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp +++ b/Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp @@ -611,7 +611,14 @@ bool GraphicsLayerAndroid::repaint() m_foregroundLayer->setPosition(-x, -y); // Set the scrollable bounds of the layer. m_foregroundLayer->setScrollLimits(-x, -y, m_size.width(), m_size.height()); - m_foregroundLayer->markAsDirty(m_dirtyRegion); + + // Invalidate the entire layer for now, as webkit will only send the + // setNeedsDisplayInRect() for the visible (clipped) scrollable area, + // offsetting the invals by the scroll position would not be enough. + // TODO: have webkit send us invals even for non visible area + SkRegion region; + region.setRect(0, 0, contentsRect.width(), contentsRect.height()); + m_foregroundLayer->markAsDirty(region); m_foregroundLayer->needsRepaint(); } else { // If there is no contents clip, we can draw everything into one diff --git a/Source/WebCore/rendering/RenderLayer.cpp b/Source/WebCore/rendering/RenderLayer.cpp index 904b1b2..cdc4c05 100644 --- a/Source/WebCore/rendering/RenderLayer.cpp +++ b/Source/WebCore/rendering/RenderLayer.cpp @@ -1419,8 +1419,15 @@ void RenderLayer::scrollTo(int x, int y) } // Just schedule a full repaint of our object. +#if ENABLE(ANDROID_OVERFLOW_SCROLL) + // On android, scrollable areas are put on composited layers, so we + // do not need to repaint simply because we are scrolling + if (view && !hasOverflowScroll()) + renderer()->repaintUsingContainer(repaintContainer, rectForRepaint); +#else if (view) renderer()->repaintUsingContainer(repaintContainer, rectForRepaint); +#endif // Schedule the scroll DOM event. renderer()->node()->document()->eventQueue()->enqueueOrDispatchScrollEvent(renderer()->node(), EventQueue::ScrollEventElementTarget); |