REGRESSION(SUBPIXEL_LAYOUT) Composited layers can cause one pixel shifts
authorallan.jensen@digia.com <allan.jensen@digia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 13 Aug 2013 17:08:19 +0000 (17:08 +0000)
committerallan.jensen@digia.com <allan.jensen@digia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 13 Aug 2013 17:08:19 +0000 (17:08 +0000)
commit94dd8ff7b7f05b52e02119c76520cbd88f18e5c1
tree207dcf5f06d0f345cd07d547f3efdb8d1fb1f7c2
parent27bedf166b772963ba0c3fb850d5917fc8866039
REGRESSION(SUBPIXEL_LAYOUT) Composited layers can cause one pixel shifts
https://bugs.webkit.org/show_bug.cgi?id=115304

Reviewed by David Hyatt.

Source/WebCore:

Accelerated layers can cause blocks at subpixel offsets to shift because
accumulated subpixel offsets are lost between each layers.

To solve this layer bounds are now calculated in LayoutUnits, and their
subpixel offset saved so it can be used to ensure correct pixel-snapping
during painting.

Test: fast/sub-pixel/sub-pixel-composited-layers.html

* WebCore.exp.in:
* inspector/InspectorLayerTreeAgent.cpp:
(WebCore::InspectorLayerTreeAgent::buildObjectForLayer):
* platform/graphics/LayoutPoint.h:
(WebCore::LayoutPoint::fraction):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::setupClipPath):
(WebCore::RenderLayer::setupFilters):
(WebCore::RenderLayer::paintLayerContents):
(WebCore::RenderLayer::calculateLayerBounds):
* rendering/RenderLayer.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateCompositedBounds):
(WebCore::RenderLayerBacking::updateAfterWidgetResize):
(WebCore::RenderLayerBacking::updateGraphicsLayerGeometry):
(WebCore::RenderLayerBacking::resetContentsRect):
(WebCore::RenderLayerBacking::contentOffsetInCompostingLayer):
(WebCore::RenderLayerBacking::contentsBox):
(WebCore::RenderLayerBacking::backgroundBox):
(WebCore::RenderLayerBacking::paintIntoLayer):
(WebCore::RenderLayerBacking::paintContents):
(WebCore::RenderLayerBacking::compositedBounds):
(WebCore::RenderLayerBacking::setCompositedBounds):
* rendering/RenderLayerBacking.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::logLayerInfo):
(WebCore::RenderLayerCompositor::calculateCompositedBounds):
* rendering/RenderLayerCompositor.h:
* rendering/RenderTreeAsText.cpp:
(WebCore::operator<<):
* rendering/RenderTreeAsText.h:

LayoutTests:

* fast/sub-pixel/sub-pixel-composited-layers-expected.html: Added.
* fast/sub-pixel/sub-pixel-composited-layers.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@154009 268f45cc-cd09-0410-ab3c-d52691b4dbfc
15 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/sub-pixel/sub-pixel-composited-layers-expected.html [new file with mode: 0644]
LayoutTests/fast/sub-pixel/sub-pixel-composited-layers.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/inspector/InspectorLayerTreeAgent.cpp
Source/WebCore/platform/graphics/LayoutPoint.h
Source/WebCore/rendering/RenderLayer.cpp
Source/WebCore/rendering/RenderLayer.h
Source/WebCore/rendering/RenderLayerBacking.cpp
Source/WebCore/rendering/RenderLayerBacking.h
Source/WebCore/rendering/RenderLayerCompositor.cpp
Source/WebCore/rendering/RenderLayerCompositor.h
Source/WebCore/rendering/RenderTreeAsText.cpp
Source/WebCore/rendering/RenderTreeAsText.h