[chromium] Remove awkward anchorPoint usage that implicity affects layer position
authorshawnsingh@chromium.org <shawnsingh@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 18 Jul 2012 16:34:11 +0000 (16:34 +0000)
committershawnsingh@chromium.org <shawnsingh@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 18 Jul 2012 16:34:11 +0000 (16:34 +0000)
commit8a89d73bfba9f7b064b3e1b2199694b85012f779
tree3e1f6132a7f0cdac51ce9a44df92363aab03df0d
parent4e247f797f5fd3fccd2b7fa1aef47e957abb13c3
[chromium] Remove awkward anchorPoint usage that implicity affects layer position
https://bugs.webkit.org/show_bug.cgi?id=91472

Reviewed by Adrienne Walker.

Source/WebCore:

Covered by existing layout tests and unit tests, several existing unit tests updated.

In GraphicsLayerChromium, anchorPoint() implicity affects
position(). Therefore, unit tests needed to remember to set
anchorPoint correctly when trying to position layers for
testing. However, it's easy to forget that initialization, and
probably shouldn't be necessary anyway since conceptually
anchorPoint does not affect layer position.

This patch removes the "actualPosition + anchorPoint" quirk in
GraphicsLayerChromium, so that this problem is avoided.

* platform/graphics/chromium/GraphicsLayerChromium.cpp:
(WebCore::GraphicsLayerChromium::updateLayerPosition): No longer computes position + anchorPoint. Instead this is done in calcDrawTransformsInternal.
(WebCore::GraphicsLayerChromium::updateLayerSize): No longer affects computation of position.
(WebCore::GraphicsLayerChromium::updateAnchorPoint): No longer affects computation of position
(WebCore::GraphicsLayerChromium::updateLayerPreserves3D): Position is initialized to zero instead of relative to anchorPoint
* platform/graphics/chromium/cc/CCLayerTreeHostCommon.cpp:
(WebCore::calculateDrawTransformsInternal): explicitly use position + anchorPoint in this code, for both layer and replica.
    Note that replicaLayer now uses its own anchorPoint, which seems to be more consistent with Safari behavior.

Source/WebKit/chromium:

Unit tests were updated to account for the fact that anchorPoint
and position are now separated.

* tests/CCDamageTrackerTest.cpp:
(WebKitTests::TEST_F):
* tests/CCLayerTreeHostCommonTest.cpp:
* tests/CCLayerTreeHostImplTest.cpp:
* tests/TiledLayerChromiumTest.cpp:

LayoutTests:

* platform/chromium/TestExpectations: marked compositing/reflections/nested-reflection-anchor-point.html as needing
                                      rebaselining.  Its behavior should now be similar to Safari.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@122980 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/platform/chromium/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.cpp
Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostCommon.cpp
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/tests/CCDamageTrackerTest.cpp
Source/WebKit/chromium/tests/CCLayerTreeHostCommonTest.cpp
Source/WebKit/chromium/tests/CCLayerTreeHostImplTest.cpp
Source/WebKit/chromium/tests/TiledLayerChromiumTest.cpp