Subpixel rendering: Composited layer with subpixel gap does not get painted properly...
authorzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 3 Jun 2015 15:36:41 +0000 (15:36 +0000)
committerzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 3 Jun 2015 15:36:41 +0000 (15:36 +0000)
commit6501c7a68a79ed82a0dfc2d16d4e295ad1b05ca4
treec8c271b39150d83075e9e4cbbfb0a8d8662ab802
parent8784980dc85da7d13505ff24b69e429c8ed10c63
Subpixel rendering: Composited layer with subpixel gap 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.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@185152 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/compositing/child-layer-with-subpixel-gap-needs-repaint-when-parent-moves-expected.html [new file with mode: 0644]
LayoutTests/compositing/child-layer-with-subpixel-gap-needs-repaint-when-parent-moves.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderLayerBacking.cpp
Source/WebCore/rendering/RenderLayerBacking.h