Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge r185152 - Subpixel rendering: Composited layer with subpixel ga…
…p does not get painted properly when its position changes. https://bugs.webkit.org/show_bug.cgi?id=145587 Reviewed by Simon Fraser. The composited layer always snaps to an enclosing device pixel (floors) while the renderer rounds. At certain positions (for example 0.5px on a 1x display), a gap is formed between the layer(0px) and its renderer(1px). In such cases, when the the renderer moves to a position (1.1px) where the gap is closed, we need to issue repaint on the layer in order to get the renderering right. Source/WebCore: Test: compositing/child-layer-with-subpixel-gap-needs-repaint-when-parent-moves.html * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::updateAfterLayout): (WebCore::devicePixelFractionGapFromRendererChanged): (WebCore::RenderLayerBacking::updateGeometry): * rendering/RenderLayerBacking.h: LayoutTests: * compositing/child-layer-with-subpixel-gap-needs-repaint-when-parent-moves-expected.html: Added. * compositing/child-layer-with-subpixel-gap-needs-repaint-when-parent-moves.html: Added.
- Loading branch information
1 parent
2387ad3
commit cbe91c9
Showing
6 changed files
with
118 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
...s/compositing/child-layer-with-subpixel-gap-needs-repaint-when-parent-moves-expected.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>This tests that we repaint child layer if the subpixel gap changes between layers when parent layer moves.</title> | ||
<style> | ||
.outer { | ||
position: relative; | ||
left: 0.7px; | ||
height: 200px; | ||
width: 200px; | ||
background-color: rgba(0, 0, 255, 1); | ||
} | ||
|
||
.container-background { | ||
position: relative; | ||
transform: translateZ(0); | ||
height: 100px; | ||
width: 100px; | ||
background-color: green; | ||
} | ||
|
||
</style> | ||
<body> | ||
<div id=container class=outer>foo | ||
<div class=container-background>bar | ||
</div> | ||
</div> | ||
</body> |
41 changes: 41 additions & 0 deletions
41
LayoutTests/compositing/child-layer-with-subpixel-gap-needs-repaint-when-parent-moves.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>This tests that we repaint child layer if the subpixel gap changes between layers when parent layer moves.</title> | ||
<style> | ||
.outer { | ||
position: relative; | ||
left: 0.3px; | ||
height: 200px; | ||
width: 200px; | ||
background-color: rgba(0, 0, 255, 1); | ||
} | ||
|
||
.container-background { | ||
position: relative; | ||
transform: translateZ(0); | ||
height: 100px; | ||
width: 100px; | ||
background-color: green; | ||
} | ||
|
||
</style> | ||
<script> | ||
if (window.testRunner) | ||
testRunner.waitUntilDone(); | ||
|
||
function runTest() { | ||
setTimeout(function () { | ||
document.getElementById("container").style.left = "0.7px"; | ||
if (window.testRunner) | ||
testRunner.notifyDone(); | ||
}, 0); | ||
} | ||
window.addEventListener('load', runTest, false); | ||
</script> | ||
<body> | ||
<div id=container class=outer>foo | ||
<div class=container-background>bar | ||
</div> | ||
</div> | ||
</body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters