Subpixel rendering: Simple compositing container layer (isSimpleContainerCompositingL...
authorzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 9 Mar 2014 00:14:00 +0000 (00:14 +0000)
committerzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 9 Mar 2014 00:14:00 +0000 (00:14 +0000)
commitc8d55c1219f3575c579c80820d9c22874fbfcfaa
tree8541d3b29c6fa0cacba1c27dc55113692b6d9211
parente526b097821834e2b068a44f21687723ec72dbed
Subpixel rendering: Simple compositing container layer (isSimpleContainerCompositingLayer) paints to wrong position.
https://bugs.webkit.org/show_bug.cgi?id=129861

Reviewed by Simon Fraser.

This patch ensures that both the simple and non-simple cases paint to the same position.
Simple compositing container layer codepath needs to take the fractional device pixel offset
into account when painting. Without the fractional value, the final paint rounding could push the
paint offset to a different position.
retina example:
compositing top-left: 0px 0px.
fractional offset: 0.3px 0.3px
painting coords without offseting: 0px 0px
                   with offseting: 0.5px 0.5px

Source/WebCore:

Tests: compositing/hidpi-simple-container-layer-on-device-pixel.html

* WebCore.exp.in:
* platform/graphics/GraphicsLayer.h:
(WebCore::GraphicsLayer::contentsRect):
(WebCore::GraphicsLayer::setContentsRect):
(WebCore::GraphicsLayer::contentsClippingRect):
(WebCore::GraphicsLayer::setContentsClippingRect):
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::setContentsRect):
(WebCore::GraphicsLayerCA::setContentsClippingRect):
(WebCore::GraphicsLayerCA::updateContentsRects):
* platform/graphics/ca/GraphicsLayerCA.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateGraphicsLayerGeometry):
(WebCore::RenderLayerBacking::updateDirectlyCompositedBackgroundColor):
(WebCore::RenderLayerBacking::updateDirectlyCompositedBackgroundImage):
(WebCore::RenderLayerBacking::contentOffsetInCompostingLayer):
(WebCore::RenderLayerBacking::backgroundBoxForPainting):
* rendering/RenderLayerBacking.h:

LayoutTests:

* compositing/hidpi-simple-container-layer-on-device-pixel-expected.html: Added.
* compositing/hidpi-simple-container-layer-on-device-pixel.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@165341 268f45cc-cd09-0410-ab3c-d52691b4dbfc
17 files changed:
LayoutTests/ChangeLog
LayoutTests/compositing/hidpi-simple-container-layer-on-device-pixel-expected.html [new file with mode: 0644]
LayoutTests/compositing/hidpi-simple-container-layer-on-device-pixel.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/platform/graphics/GraphicsLayer.h
Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp
Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h
Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp
Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.h
Source/WebCore/platform/graphics/texmap/TextureMapperLayer.cpp
Source/WebCore/platform/graphics/texmap/TextureMapperLayer.h
Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp
Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h
Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h
Source/WebCore/rendering/RenderLayerBacking.cpp
Source/WebCore/rendering/RenderLayerBacking.h