Commit 8c3fc9c7 authored by chrishtr@chromium.org's avatar chrishtr@chromium.org

Use the correct method for computing a repaint rect that takes into account squashing.

This fixes a mistake in crrev.com/301843002

Includes a test.

BUG=370664

Review URL: https://codereview.chromium.org/306093002

git-svn-id: svn://svn.chromium.org/blink/trunk@175189 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent b74ab8f0
......@@ -62,6 +62,9 @@ crbug.com/245611 [ Linux ] fast/hidpi/video-controls-in-hidpi.html [ ImageOnlyFa
crbug.com/304953 fast/css/font-face-download-error.html [ Pass Timeout ]
crbug.com/370664 compositing/squashing/invalidations-with-large-negative-margin.html [ NeedsRebaseline ]
crbug.com/370664 virtual/softwarecompositing/squashing/invalidations-with-large-negative-margin.html [ NeedsRebaseline ]
# This batch were marked as NeedsRebaseline for crbug.com/133097 but are flaky:
crbug.com/310679 [ Mac ] compositing/fixed-body-background-positioned.html [ Failure Pass ]
crbug.com/310679 [ Mac ] compositing/rubberbanding/transform-overhang-e.html [ ImageOnlyFailure Pass ]
......
......@@ -6,7 +6,7 @@
(contentsOpaque 1)
(drawsContent 1)
(repaint rects
(rect 25.00 25.00 50.00 150.00)
(rect 45.00 45.00 50.00 150.00)
)
(children 1
(GraphicsLayer
......
......@@ -55,10 +55,10 @@ CASE 2, overlap3 gets added:
(bounds 260.00 260.00)
(drawsContent 1)
(repaint rects
(rect 140.00 140.00 40.00 40.00)
(rect 80.00 80.00 100.00 100.00)
(rect 0.00 0.00 100.00 100.00)
(rect 0.00 0.00 100.00 100.00)
(rect 0.00 0.00 100.00 100.00)
)
)
)
......@@ -92,7 +92,6 @@ CASE 3, overlap2 gets removed. Since this does not resize the layer, there shoul
(repaint rects
(rect 160.00 160.00 100.00 100.00)
(rect 80.00 80.00 100.00 100.00)
(rect 0.00 0.00 100.00 100.00)
)
)
)
......@@ -200,6 +199,7 @@ CASE 6, overlap1 gets added back, and overlap3 gets removed:
(rect 0.00 0.00 100.00 100.00)
(rect 0.00 0.00 100.00 100.00)
(rect 0.00 0.00 100.00 100.00)
(rect 0.00 0.00 20.00 20.00)
)
)
)
......
......@@ -120,7 +120,7 @@ div:hover {
return;
// Case 1
document.getElementById('Case1').textContent = window.internals.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_REPAINT_RECTS);
document.getElementById('Case1').textContent = window.internals.layerTreeAsText(document);
// Case 2
window.internals.startTrackingRepaints(document);
......
<!DOCTYPE html>
<div style="height:200px;width:600px;overflow:scroll">
<div style="position:relative">
<div style="height:400px;margin-bottom:-400px;position:relative">
<div id="chip" style="width:50px;height:50px;position:absolute;background:lightblue;margin:0"></div>
</div>
</div>
</div>
<div id="testResults" style="display:none">
<pre id="output"></pre>
</div>
<script>
// Test that moving a div in this situation generates the correct repaint invalidaitons before and after
// the move.
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
window.internals.settings.setLayerSquashingEnabled(true);
}
setTimeout(function() {
if (window.internals)
window.internals.startTrackingRepaints(document);
document.getElementById('chip').style.left = "400px";
var data = window.internals.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_REPAINT_RECTS);
window.internals.stopTrackingRepaints(document);
document.getElementById('output').textContent = data;
document.getElementById('testResults').style.display = "block";
if (window.testRunner)
testRunner.notifyDone();
}, 400);
</script>
\ No newline at end of file
......@@ -20,6 +20,7 @@
(bounds 100.00 100.00)
(drawsContent 1)
(repaint rects
(rect 8.00 8.00 92.00 92.00)
(rect 0.00 0.00 100.00 100.00)
(rect 0.00 0.00 100.00 100.00)
)
......
(GraphicsLayer
(bounds 785.00 30020.00)
(children 1
(GraphicsLayer
(bounds 785.00 30020.00)
(contentsOpaque 1)
(drawsContent 1)
(repaint rects
(rect 25.00 25.00 50.00 150.00)
)
(children 1
(GraphicsLayer
(children 2
(GraphicsLayer
(position 8.00 8.00)
(bounds 500.00 500.00)
(contentsOpaque 1)
(drawsContent 1)
(backgroundColor #00FFFF)
)
(GraphicsLayer
(position 20.00 20.00)
(bounds 100.00 30000.00)
(drawsContent 1)
)
)
)
)
)
)
)
......@@ -108,13 +108,14 @@ void RenderLayerRepainter::clearRepaintRects()
void RenderLayerRepainter::computeRepaintRects()
{
const RenderLayerModelObject* repaintContainer = m_renderer.containerForRepaint();
LayoutRect repaintRect = m_renderer.boundsRectForRepaint(repaintContainer);
if (RuntimeEnabledFeatures::repaintAfterLayoutEnabled()) {
// FIXME: We want RenderLayerRepainter to go away when
// repaint-after-layout is on by default so we need to figure out how to
// handle this update.
m_renderer.setPreviousRepaintRect(m_renderer.computeRepaintRect());
m_renderer.setPreviousRepaintRect(repaintRect);
} else {
m_repaintRect = m_renderer.computeRepaintRect();
m_repaintRect = repaintRect;
m_offset = m_renderer.positionFromRepaintContainer(repaintContainer);
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment