Changeset 134456 in webkit


Ignore:
Timestamp:
Nov 13, 2012 11:40:31 AM (11 years ago)
Author:
commit-queue@webkit.org
Message:

Allow painting outside overflow clip in accelerated scrolling layers
https://bugs.webkit.org/show_bug.cgi?id=100524

Patch by Sami Kyostila <skyostil@chromium.org> on 2012-11-13
Reviewed by Simon Fraser.

Source/WebCore:

In preparation for avoiding repaints when scrolling child layers, make it
possible to paint outside the overflow clip.

Test: compositing/overflow/updating-scrolling-content.html

  • rendering/LayoutState.h:

(LayoutState):

  • rendering/RenderBlock.cpp:

(WebCore::RenderBlock::paint):

  • rendering/RenderBox.cpp:

(WebCore::RenderBox::applyCachedClipAndScrollOffsetForRepaint):

  • rendering/RenderLayer.cpp:

(WebCore::RenderLayer::repaintBlockSelectionGaps):

LayoutTests:

Added a test to check painting outside the overflow clip. Note that this will
not pass unless ENABLE_ACCELERATED_OVERFLOW_SCROLLING is enabled.

  • compositing/overflow/updating-scrolling-content-expected.txt: Added.
  • compositing/overflow/updating-scrolling-content.html: Added.
  • platform/chromium/TestExpectations: Mark test as expected to fail by default.
  • platform/mac/TestExpectations: Skip the test.
Location:
trunk
Files:
2 added
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r134454 r134456  
     12012-11-13  Sami Kyostila  <skyostil@chromium.org>
     2
     3        Allow painting outside overflow clip in accelerated scrolling layers
     4        https://bugs.webkit.org/show_bug.cgi?id=100524
     5
     6        Reviewed by Simon Fraser.
     7
     8        Added a test to check painting outside the overflow clip. Note that this will
     9        not pass unless ENABLE_ACCELERATED_OVERFLOW_SCROLLING is enabled.
     10
     11        * compositing/overflow/updating-scrolling-content-expected.txt: Added.
     12        * compositing/overflow/updating-scrolling-content.html: Added.
     13        * platform/chromium/TestExpectations: Mark test as expected to fail
     14          by default.
     15        * platform/mac/TestExpectations: Skip the test.
     16
    1172012-11-13  Dimitri Glazkov  <dglazkov@chromium.org>
    218
  • trunk/LayoutTests/platform/chromium/TestExpectations

    r134454 r134456  
    37293729webkit.org/b/94353 compositing/overflow/scrolling-content-clip-to-viewport.html [ Failure ]
    37303730webkit.org/b/94353 platform/chromium/virtual/softwarecompositing/overflow/scrolling-content-clip-to-viewport.html [ Failure ]
     3731webkit.org/b/94353 compositing/overflow/updating-scrolling-content.html [ Failure ]
     3732webkit.org/b/94353 platform/chromium/virtual/softwarecompositing/overflow/updating-scrolling-content.html [ Failure ]
    37313733webkit.org/b/94353 compositing/overflow/textarea-scroll-touch.html [ Failure ]
    37323734webkit.org/b/94353 platform/chromium/virtual/softwarecompositing/overflow/textarea-scroll-touch.html [ Failure ]
  • trunk/LayoutTests/platform/mac/TestExpectations

    r134198 r134456  
    853853compositing/overflow/scrolling-content-clip-to-viewport.html
    854854compositing/overflow/textarea-scroll-touch.html
     855compositing/overflow/updating-scrolling-content.html
    855856
    856857# https://bugs.webkit.org/show_bug.cgi?id=95027
  • trunk/Source/WebCore/ChangeLog

    r134453 r134456  
     12012-11-13  Sami Kyostila  <skyostil@chromium.org>
     2
     3        Allow painting outside overflow clip in accelerated scrolling layers
     4        https://bugs.webkit.org/show_bug.cgi?id=100524
     5
     6        Reviewed by Simon Fraser.
     7
     8        In preparation for avoiding repaints when scrolling child layers, make it
     9        possible to paint outside the overflow clip.
     10
     11        Test: compositing/overflow/updating-scrolling-content.html
     12
     13        * rendering/LayoutState.h:
     14        (LayoutState):
     15        * rendering/RenderBlock.cpp:
     16        (WebCore::RenderBlock::paint):
     17        * rendering/RenderBox.cpp:
     18        (WebCore::RenderBox::applyCachedClipAndScrollOffsetForRepaint):
     19        * rendering/RenderLayer.cpp:
     20        (WebCore::RenderLayer::repaintBlockSelectionGaps):
     21
    1222012-11-13  Patrick Gansterer  <paroga@webkit.org>
    223
  • trunk/Source/WebCore/rendering/LayoutState.h

    r133779 r134456  
    130130#endif
    131131
     132    // FIXME: Distinguish between the layout clip rect and the paint clip rect which may be larger,
     133    // e.g., because of composited scrolling.
    132134    LayoutRect m_clipRect;
    133135   
  • trunk/Source/WebCore/rendering/RenderBlock.cpp

    r133845 r134456  
    27592759    // paints the root's background.
    27602760    if (!isRoot()) {
    2761         LayoutRect overflowBox = visualOverflowRect();
     2761        LayoutRect overflowBox = overflowRectForPaintRejection();
    27622762        flipForWritingMode(overflowBox);
    27632763        overflowBox.inflate(maximalOutlineSize(paintInfo.phase));
  • trunk/Source/WebCore/rendering/RenderBox.cpp

    r133845 r134456  
    618618}
    619619
     620bool RenderBox::usesCompositedScrolling() const
     621{
     622    return hasOverflowClip() && hasLayer() && layer()->usesCompositedScrolling();
     623}
     624
    620625void RenderBox::autoscroll()
    621626{
     
    652657{
    653658    paintRect.move(-scrolledContentOffset()); // For overflow:auto/scroll/hidden.
     659
     660    // Do not clip scroll layer contents to reduce the number of repaints while scrolling.
     661    if (usesCompositedScrolling())
     662        return;
    654663
    655664    // height() is inaccurate if we're in the middle of a layout of this RenderBox, so use the
     
    39293938}
    39303939
     3940LayoutRect RenderBox::overflowRectForPaintRejection() const
     3941{
     3942    LayoutRect overflowRect = visualOverflowRect();
     3943    if (!m_overflow || !usesCompositedScrolling())
     3944        return overflowRect;
     3945
     3946    overflowRect.unite(layoutOverflowRect());
     3947    overflowRect.move(-scrolledContentOffset());
     3948    return overflowRect;
     3949}
     3950
    39313951LayoutUnit RenderBox::offsetLeft() const
    39323952{
  • trunk/Source/WebCore/rendering/RenderBox.h

    r133845 r134456  
    176176    LayoutUnit logicalLeftVisualOverflow() const { return style()->isHorizontalWritingMode() ? visualOverflowRect().x() : visualOverflowRect().y(); }
    177177    LayoutUnit logicalRightVisualOverflow() const { return style()->isHorizontalWritingMode() ? visualOverflowRect().maxX() : visualOverflowRect().maxY(); }
     178
     179    LayoutRect overflowRectForPaintRejection() const;
    178180   
    179181    void addLayoutOverflow(const LayoutRect&);
     
    434436    bool scrollsOverflowX() const { return hasOverflowClip() && (style()->overflowX() == OSCROLL || hasAutoHorizontalScrollbar()); }
    435437    bool scrollsOverflowY() const { return hasOverflowClip() && (style()->overflowY() == OSCROLL || hasAutoVerticalScrollbar()); }
     438    bool usesCompositedScrolling() const;
    436439   
    437440    bool hasUnsplittableScrollingOverflow() const;
  • trunk/Source/WebCore/rendering/RenderLayer.cpp

    r134356 r134456  
    43274327    LayoutRect rect = m_blockSelectionGapsBounds;
    43284328    rect.move(-scrolledContentOffset());
    4329     if (renderer()->hasOverflowClip())
     4329    if (renderer()->hasOverflowClip() && !usesCompositedScrolling())
    43304330        rect.intersect(toRenderBox(renderer())->overflowClipRect(LayoutPoint(), 0)); // FIXME: Regions not accounted for.
    43314331    if (renderer()->hasClip())
Note: See TracChangeset for help on using the changeset viewer.