Changeset 134628 in webkit


Ignore:
Timestamp:
Nov 14, 2012 10:51:51 AM (11 years ago)
Author:
commit-queue@webkit.org
Message:

Optimize painting of composited scrolling layers
https://bugs.webkit.org/show_bug.cgi?id=96087

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

Source/WebCore:

Don't completely repaint accelerated scrolling layers when the scroll offset
changes.

Test: compositing/overflow/scrolling-without-painting.html

  • platform/graphics/GraphicsLayer.cpp:

(WebCore::GraphicsLayer::setOffsetFromRenderer):

  • platform/graphics/GraphicsLayer.h:

(GraphicsLayer):

  • rendering/RenderLayerBacking.cpp:

(WebCore::RenderLayerBacking::updateGraphicsLayerGeometry):

LayoutTests:

Test that accelerated scrolling layers can be scrolled without repainting
their contents. Note that this test will not pass unless
ENABLE_ACCELERATED_OVERFLOW_SCROLLING is enabled.

  • compositing/overflow/scrolling-without-painting-expected.txt: Added.
  • compositing/overflow/scrolling-without-painting.html: Added.
  • platform/chromium/TestExpectations: Mark test as expected to fail by default.
  • platform/mac/TestExpectations: Skip the test.
Location:
trunk
Files:
1 added
8 edited
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r134625 r134628  
     12012-11-14  Sami Kyostila  <skyostil@chromium.org>
     2
     3        Optimize painting of composited scrolling layers
     4        https://bugs.webkit.org/show_bug.cgi?id=96087
     5
     6        Reviewed by Simon Fraser.
     7
     8        Test that accelerated scrolling layers can be scrolled without repainting
     9        their contents. Note that this test will not pass unless
     10        ENABLE_ACCELERATED_OVERFLOW_SCROLLING is enabled.
     11
     12        * compositing/overflow/scrolling-without-painting-expected.txt: Added.
     13        * compositing/overflow/scrolling-without-painting.html: Added.
     14        * platform/chromium/TestExpectations: Mark test as expected to fail
     15          by default.
     16        * platform/mac/TestExpectations: Skip the test.
     17
    1182012-11-14  Dimitri Glazkov  <dglazkov@chromium.org>
    219
  • trunk/LayoutTests/compositing/overflow/scrolling-without-painting-expected.txt

    r134627 r134628  
    77        (GraphicsLayer
    88          (position 8.00 8.00)
    9           (bounds 200.00 200.00)
     9          (bounds 202.00 202.00)
     10          (drawsContent 1)
    1011          (children 4
    1112            (GraphicsLayer
     13              (position 1.00 1.00)
    1214              (bounds 200.00 200.00)
    1315              (children 1
    1416                (GraphicsLayer
    15                   (bounds 185.00 1200.00)
     17                  (position 0.00 -25.00)
     18                  (bounds 185.00 1025.00)
    1619                  (drawsContent 1)
    17                   (repaint rects
    18                     (rect 0.00 0.00 185.00 200.00)
    19                     (rect 0.00 0.00 185.00 200.00)
    20                     (rect 0.00 0.00 185.00 200.00)
    21                     (rect 0.00 0.00 185.00 1200.00)
    22                   )
    2320                )
    2421              )
    2522            )
    2623            (GraphicsLayer
    27               (position 0.00 185.00)
     24              (position 1.00 186.00)
    2825              (bounds 185.00 15.00)
    2926              (drawsContent 1)
    3027            )
    3128            (GraphicsLayer
    32               (position 185.00 0.00)
     29              (position 186.00 1.00)
    3330              (bounds 15.00 185.00)
    3431              (drawsContent 1)
     
    3835            )
    3936            (GraphicsLayer
    40               (position 185.00 185.00)
     37              (position 186.00 186.00)
    4138              (bounds 15.00 15.00)
    4239              (drawsContent 1)
  • trunk/LayoutTests/compositing/overflow/updating-scrolling-content-expected.txt

    r134456 r134628  
    1919                    (rect 0.00 0.00 185.00 200.00)
    2020                    (rect 0.00 0.00 185.00 200.00)
    21                     (rect 0.00 0.00 185.00 1200.00)
    2221                  )
    2322                )
  • trunk/LayoutTests/platform/chromium/TestExpectations

    r134625 r134628  
    37693769webkit.org/b/94353 compositing/overflow/scrolling-content-clip-to-viewport.html [ Failure ]
    37703770webkit.org/b/94353 platform/chromium/virtual/softwarecompositing/overflow/scrolling-content-clip-to-viewport.html [ Failure ]
     3771webkit.org/b/94353 compositing/overflow/scrolling-without-painting.html [ Failure ]
     3772webkit.org/b/94353 platform/chromium/virtual/softwarecompositing/overflow/scrolling-without-painting.html [ Failure ]
    37713773webkit.org/b/94353 compositing/overflow/updating-scrolling-content.html [ Failure ]
    37723774webkit.org/b/94353 platform/chromium/virtual/softwarecompositing/overflow/updating-scrolling-content.html [ Failure ]
  • trunk/LayoutTests/platform/mac/TestExpectations

    r134586 r134628  
    857857compositing/overflow/textarea-scroll-touch.html
    858858compositing/overflow/updating-scrolling-content.html
     859compositing/overflow/scrolling-without-painting.html
    859860
    860861# https://bugs.webkit.org/show_bug.cgi?id=95027
  • trunk/Source/WebCore/ChangeLog

    r134627 r134628  
     12012-11-14  Sami Kyostila  <skyostil@chromium.org>
     2
     3        Optimize painting of composited scrolling layers
     4        https://bugs.webkit.org/show_bug.cgi?id=96087
     5
     6        Reviewed by Simon Fraser.
     7
     8        Don't completely repaint accelerated scrolling layers when the scroll offset
     9        changes.
     10
     11        Test: compositing/overflow/scrolling-without-painting.html
     12
     13        * platform/graphics/GraphicsLayer.cpp:
     14        (WebCore::GraphicsLayer::setOffsetFromRenderer):
     15        * platform/graphics/GraphicsLayer.h:
     16        (GraphicsLayer):
     17        * rendering/RenderLayerBacking.cpp:
     18        (WebCore::RenderLayerBacking::updateGraphicsLayerGeometry):
     19
    1202012-11-14  Pavel Feldman  <pfeldman@chromium.org>
    221
  • trunk/Source/WebCore/platform/graphics/GraphicsLayer.cpp

    r133779 r134628  
    297297}
    298298
    299 void GraphicsLayer::setOffsetFromRenderer(const IntSize& offset)
     299void GraphicsLayer::setOffsetFromRenderer(const IntSize& offset, ShouldSetNeedsDisplay shouldSetNeedsDisplay)
    300300{
    301301    if (offset == m_offsetFromRenderer)
     
    305305
    306306    // If the compositing layer offset changes, we need to repaint.
    307     setNeedsDisplay();
     307    if (shouldSetNeedsDisplay == SetNeedsDisplay)
     308        setNeedsDisplay();
    308309}
    309310
  • trunk/Source/WebCore/platform/graphics/GraphicsLayer.h

    r134147 r134628  
    243243    void setReplicatedLayerPosition(const FloatPoint& p) { m_replicatedLayerPosition = p; }
    244244
     245    enum ShouldSetNeedsDisplay {
     246        DontSetNeedsDisplay,
     247        SetNeedsDisplay
     248    };
     249
    245250    // Offset is origin of the renderer minus origin of the graphics layer (so either zero or negative).
    246251    IntSize offsetFromRenderer() const { return m_offsetFromRenderer; }
    247     void setOffsetFromRenderer(const IntSize&);
     252    void setOffsetFromRenderer(const IntSize&, ShouldSetNeedsDisplay = SetNeedsDisplay);
    248253
    249254    // The position of the layer (the location of its top-left corner in its parent)
  • trunk/Source/WebCore/rendering/RenderLayerBacking.cpp

    r134311 r134628  
    743743
    744744        m_scrollingContentsLayer->setSize(scrollSize);
    745         // FIXME: Scrolling the content layer does not need to trigger a repaint. The offset will be compensated away during painting.
    746745        // FIXME: The paint offset and the scroll offset should really be separate concepts.
    747         m_scrollingContentsLayer->setOffsetFromRenderer(scrollingContentsOffset);
     746        m_scrollingContentsLayer->setOffsetFromRenderer(scrollingContentsOffset, GraphicsLayer::DontSetNeedsDisplay);
    748747    }
    749748
Note: See TracChangeset for help on using the changeset viewer.