| Differences between
and this patch
- a/Source/WebCore/ChangeLog +19 lines
Lines 1-3 a/Source/WebCore/ChangeLog_sec1
1
2012-10-26  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 NOBODY (OOPS!).
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
1
2012-11-14  Pavel Feldman  <pfeldman@chromium.org>
20
2012-11-14  Pavel Feldman  <pfeldman@chromium.org>
2
21
3
        Web Inspector: "Reveal in Element Panel" doesn't work if Elements panel hasn't been opened
22
        Web Inspector: "Reveal in Element Panel" doesn't work if Elements panel hasn't been opened
- a/Source/WebCore/platform/graphics/GraphicsLayer.cpp -2 / +3 lines
Lines 296-302 void GraphicsLayer::setReplicatedByLayer(GraphicsLayer* layer) a/Source/WebCore/platform/graphics/GraphicsLayer.cpp_sec1
296
    m_replicaLayer = layer;
296
    m_replicaLayer = layer;
297
}
297
}
298
298
299
void GraphicsLayer::setOffsetFromRenderer(const IntSize& offset)
299
void GraphicsLayer::setOffsetFromRenderer(const IntSize& offset, ShouldSetNeedsDisplay shouldSetNeedsDisplay)
300
{
300
{
301
    if (offset == m_offsetFromRenderer)
301
    if (offset == m_offsetFromRenderer)
302
        return;
302
        return;
Lines 304-310 void GraphicsLayer::setOffsetFromRenderer(const IntSize& offset) a/Source/WebCore/platform/graphics/GraphicsLayer.cpp_sec2
304
    m_offsetFromRenderer = offset;
304
    m_offsetFromRenderer = offset;
305
305
306
    // If the compositing layer offset changes, we need to repaint.
306
    // If the compositing layer offset changes, we need to repaint.
307
    setNeedsDisplay();
307
    if (shouldSetNeedsDisplay == SetNeedsDisplay)
308
        setNeedsDisplay();
308
}
309
}
309
310
310
void GraphicsLayer::setBackgroundColor(const Color& color)
311
void GraphicsLayer::setBackgroundColor(const Color& color)
- a/Source/WebCore/platform/graphics/GraphicsLayer.h -1 / +6 lines
Lines 242-250 public: a/Source/WebCore/platform/graphics/GraphicsLayer.h_sec1
242
    const FloatPoint& replicatedLayerPosition() const { return m_replicatedLayerPosition; }
242
    const FloatPoint& replicatedLayerPosition() const { return m_replicatedLayerPosition; }
243
    void setReplicatedLayerPosition(const FloatPoint& p) { m_replicatedLayerPosition = p; }
243
    void setReplicatedLayerPosition(const FloatPoint& p) { m_replicatedLayerPosition = p; }
244
244
245
    enum ShouldSetNeedsDisplay {
246
        DontSetNeedsDisplay,
247
        SetNeedsDisplay
248
    };
249
245
    // Offset is origin of the renderer minus origin of the graphics layer (so either zero or negative).
250
    // Offset is origin of the renderer minus origin of the graphics layer (so either zero or negative).
246
    IntSize offsetFromRenderer() const { return m_offsetFromRenderer; }
251
    IntSize offsetFromRenderer() const { return m_offsetFromRenderer; }
247
    void setOffsetFromRenderer(const IntSize&);
252
    void setOffsetFromRenderer(const IntSize&, ShouldSetNeedsDisplay = SetNeedsDisplay);
248
253
249
    // The position of the layer (the location of its top-left corner in its parent)
254
    // The position of the layer (the location of its top-left corner in its parent)
250
    const FloatPoint& position() const { return m_position; }
255
    const FloatPoint& position() const { return m_position; }
- a/Source/WebCore/rendering/RenderLayerBacking.cpp -2 / +1 lines
Lines 742-750 void RenderLayerBacking::updateGraphicsLayerGeometry() a/Source/WebCore/rendering/RenderLayerBacking.cpp_sec1
742
            compositor()->scrollingLayerDidChange(m_owningLayer);
742
            compositor()->scrollingLayerDidChange(m_owningLayer);
743
743
744
        m_scrollingContentsLayer->setSize(scrollSize);
744
        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.
746
        // FIXME: The paint offset and the scroll offset should really be separate concepts.
745
        // 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);
748
    }
747
    }
749
748
750
    m_graphicsLayer->setContentsRect(contentsBox());
749
    m_graphicsLayer->setContentsRect(contentsBox());
- a/LayoutTests/ChangeLog +17 lines
Lines 1-3 a/LayoutTests/ChangeLog_sec1
1
2012-10-26  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 NOBODY (OOPS!).
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
1
2012-11-14  Raphael Kubo da Costa  <raphael.kubo.da.costa@intel.com>
18
2012-11-14  Raphael Kubo da Costa  <raphael.kubo.da.costa@intel.com>
2
19
3
        [EFL] Add some missing pixel expectations.
20
        [EFL] Add some missing pixel expectations.
- a/LayoutTests/compositing/overflow/scrolling-without-painting-expected.txt +47 lines
Line 0 a/LayoutTests/compositing/overflow/scrolling-without-painting-expected.txt_sec1
1
(GraphicsLayer
2
  (bounds 800.00 600.00)
3
  (children 1
4
    (GraphicsLayer
5
      (bounds 800.00 600.00)
6
      (children 1
7
        (GraphicsLayer
8
          (position 8.00 8.00)
9
          (bounds 202.00 202.00)
10
          (drawsContent 1)
11
          (children 4
12
            (GraphicsLayer
13
              (position 1.00 1.00)
14
              (bounds 200.00 200.00)
15
              (children 1
16
                (GraphicsLayer
17
                  (position 0.00 -25.00)
18
                  (bounds 185.00 1025.00)
19
                  (drawsContent 1)
20
                )
21
              )
22
            )
23
            (GraphicsLayer
24
              (position 1.00 186.00)
25
              (bounds 185.00 15.00)
26
              (drawsContent 1)
27
            )
28
            (GraphicsLayer
29
              (position 186.00 1.00)
30
              (bounds 15.00 185.00)
31
              (drawsContent 1)
32
              (repaint rects
33
                (rect 0.00 0.00 15.00 185.00)
34
              )
35
            )
36
            (GraphicsLayer
37
              (position 186.00 186.00)
38
              (bounds 15.00 15.00)
39
              (drawsContent 1)
40
            )
41
          )
42
        )
43
      )
44
    )
45
  )
46
)
47
- a/LayoutTests/compositing/overflow/scrolling-without-painting.html +54 lines
Line 0 a/LayoutTests/compositing/overflow/scrolling-without-painting.html_sec1
1
<!DOCTYPE html>
2
3
<!--
4
This test checks that accelerated scrolling layers can be scrolled without
5
repainting their contents. See https://bugs.webkit.org/show_bug.cgi?id=96087.
6
-->
7
8
<html>
9
<head>
10
  <style type="text/css">
11
    #scroller {
12
        overflow: scroll;
13
        -webkit-overflow-scrolling: touch;
14
        width: 200px;
15
        height: 200px;
16
        border: solid thin blue;
17
    }
18
19
    #content {
20
        height: 1000px;
21
        margin-top: 25px;
22
    }
23
  </style>
24
  <script type="text/javascript">
25
      window.addEventListener('load', function() {
26
          if (!window.testRunner || !window.internals) {
27
              alert('This test requires testRunner to run!');
28
              return;
29
          }
30
          testRunner.dumpAsText(false);
31
32
          // First paint the entire view including the scrolling element.
33
          var scroller = document.getElementById('scroller');
34
          scroller.offsetTop;
35
36
          // Scroll down. This should not cause any more repaints to the
37
          // scrolling contents.
38
          window.internals.startTrackingRepaints(document);
39
          scroller.scrollTop = 25;
40
41
          var layerTree = document.getElementById('layerTree');
42
          layerTree.innerText =
43
              window.internals.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_REPAINT_RECTS);
44
          window.internals.stopTrackingRepaints(document);
45
      });
46
  </script>
47
</head>
48
<body>
49
  <div id="scroller">
50
    <div id="content"></div>
51
  </div>
52
  <pre id="layerTree">This text will be replaced with the layer tree.</pre>
53
</body>
54
</html>
- a/LayoutTests/compositing/overflow/updating-scrolling-content-expected.txt -1 lines
Lines 18-24 a/LayoutTests/compositing/overflow/updating-scrolling-content-expected.txt_sec1
18
                    (rect 0.00 0.00 185.00 200.00)
18
                    (rect 0.00 0.00 185.00 200.00)
19
                    (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)
20
                    (rect 0.00 0.00 185.00 200.00)
21
                    (rect 0.00 0.00 185.00 1200.00)
22
                  )
21
                  )
23
                )
22
                )
24
              )
23
              )
- a/LayoutTests/platform/chromium/TestExpectations +2 lines
Lines 3768-3773 webkit.org/b/99734 [ Mac ] http/tests/xmlhttprequest/request-encoding2.html [ Pa a/LayoutTests/platform/chromium/TestExpectations_sec1
3768
# ENABLE_ACCELERATED_OVERFLOW_SCROLLING is not currently enabled in Chromium.
3768
# ENABLE_ACCELERATED_OVERFLOW_SCROLLING is not currently enabled in Chromium.
3769
webkit.org/b/94353 compositing/overflow/scrolling-content-clip-to-viewport.html [ Failure ]
3769
webkit.org/b/94353 compositing/overflow/scrolling-content-clip-to-viewport.html [ Failure ]
3770
webkit.org/b/94353 platform/chromium/virtual/softwarecompositing/overflow/scrolling-content-clip-to-viewport.html [ Failure ]
3770
webkit.org/b/94353 platform/chromium/virtual/softwarecompositing/overflow/scrolling-content-clip-to-viewport.html [ Failure ]
3771
webkit.org/b/94353 compositing/overflow/scrolling-without-painting.html [ Failure ]
3772
webkit.org/b/94353 platform/chromium/virtual/softwarecompositing/overflow/scrolling-without-painting.html [ Failure ]
3771
webkit.org/b/94353 compositing/overflow/updating-scrolling-content.html [ Failure ]
3773
webkit.org/b/94353 compositing/overflow/updating-scrolling-content.html [ Failure ]
3772
webkit.org/b/94353 platform/chromium/virtual/softwarecompositing/overflow/updating-scrolling-content.html [ Failure ]
3774
webkit.org/b/94353 platform/chromium/virtual/softwarecompositing/overflow/updating-scrolling-content.html [ Failure ]
3773
webkit.org/b/94353 compositing/overflow/textarea-scroll-touch.html [ Failure ]
3775
webkit.org/b/94353 compositing/overflow/textarea-scroll-touch.html [ Failure ]
- a/LayoutTests/platform/mac/TestExpectations +1 lines
Lines 856-861 compositing/overflow/overflow-overlay-with-touch.html a/LayoutTests/platform/mac/TestExpectations_sec1
856
compositing/overflow/scrolling-content-clip-to-viewport.html
856
compositing/overflow/scrolling-content-clip-to-viewport.html
857
compositing/overflow/textarea-scroll-touch.html
857
compositing/overflow/textarea-scroll-touch.html
858
compositing/overflow/updating-scrolling-content.html
858
compositing/overflow/updating-scrolling-content.html
859
compositing/overflow/scrolling-without-painting.html
859
860
860
# https://bugs.webkit.org/show_bug.cgi?id=95027
861
# https://bugs.webkit.org/show_bug.cgi?id=95027
861
fast/block/float/016.html
862
fast/block/float/016.html

Return to Bug 96087