diff options
author | Nicolas Roard <nicolasroard@google.com> | 2011-12-07 15:46:29 -0800 |
---|---|---|
committer | Nicolas Roard <nicolasroard@google.com> | 2011-12-07 16:15:13 -0800 |
commit | 3d0d375adaf3c93bcafebdb15fa6675e463aa565 (patch) | |
tree | 06dd0fdafe36c627b10de067e513ee3ce97a9a37 /Source/WebCore | |
parent | f288ebbc0f8b160082a78668df554a4ae7192e11 (diff) | |
download | external_webkit-3d0d375adaf3c93bcafebdb15fa6675e463aa565.zip external_webkit-3d0d375adaf3c93bcafebdb15fa6675e463aa565.tar.gz external_webkit-3d0d375adaf3c93bcafebdb15fa6675e463aa565.tar.bz2 |
Fix the repaint inval mechanism for layers - DO NOT MERGE
We only keep the scrollable layers invalidating their entire area
instead of incurring this penalty for *all* layers.
Also remove unnecessary repaint when scrolling (we have the entire
content on the UI side already).
While the entire scrollable area will be invalidated and marked
as dirty, the existing code in PaintedSurface already only look at
the visible tiles of scrollable layers to consider the layer's content
as being ready to display, so the real world penalty (while far from
optimal) is limited.
Implementing the correct approach (only invalidating what really
changed on scrollable layers) would sadly be a lot more complex,
as currently webkit will *not* send us the repaint invals if they
are on a currently clipped area, as webkit's default behaviour
to implement scrolling of such element is to repaint them anyway...
bug:5721618
Change-Id: Ia470157c716fa1c557e4a196ba014296ad9e627a
Diffstat (limited to 'Source/WebCore')
-rw-r--r-- | Source/WebCore/platform/graphics/android/BaseTile.cpp | 3 | ||||
-rw-r--r-- | Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp | 9 | ||||
-rw-r--r-- | Source/WebCore/rendering/RenderLayer.cpp | 7 |
3 files changed, 15 insertions, 4 deletions
diff --git a/Source/WebCore/platform/graphics/android/BaseTile.cpp b/Source/WebCore/platform/graphics/android/BaseTile.cpp index 2ff27bf..27bd482 100644 --- a/Source/WebCore/platform/graphics/android/BaseTile.cpp +++ b/Source/WebCore/platform/graphics/android/BaseTile.cpp @@ -205,11 +205,8 @@ void BaseTile::markAsDirty(int unsigned pictureCount, cliperator.next(); } - /* - NOT FUNCTIONING CORRECTLY, TEMPORARILY DISABLED if (!intersect) return; - */ m_dirty = true; if (m_state == UpToDate) { diff --git a/Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp b/Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp index ab45f1b..6990503 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); |