diff options
author | Nicolas Roard <nicolasroard@google.com> | 2011-12-09 15:19:40 -0800 |
---|---|---|
committer | Nicolas Roard <nicolasroard@google.com> | 2011-12-09 15:20:42 -0800 |
commit | 08c253c5d2dad921120c3e1ab7bc6781064ca31b (patch) | |
tree | b6ea10597c2bc259c2b53d0176a2f5d104a11bb9 /Source/WebCore/rendering | |
parent | 46ded0d896cca693053fe2459c1930de95b65cd9 (diff) | |
download | external_webkit-08c253c5d2dad921120c3e1ab7bc6781064ca31b.zip external_webkit-08c253c5d2dad921120c3e1ab7bc6781064ca31b.tar.gz external_webkit-08c253c5d2dad921120c3e1ab7bc6781064ca31b.tar.bz2 |
Fix the repaint inval mechanism for layers - cherry-pick from MR1
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: I9af240d5f42f00f9ab07710e43ef8d72dfaf8155
Diffstat (limited to 'Source/WebCore/rendering')
-rw-r--r-- | Source/WebCore/rendering/RenderLayer.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
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); |