WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-91472-20120717005823.patch (text/plain), 38.90 KB, created by
Shawn Singh
on 2012-07-17 00:58:23 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Shawn Singh
Created:
2012-07-17 00:58:23 PDT
Size:
38.90 KB
patch
obsolete
>Subversion Revision: 122734 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index c4e4e651db044fd9bcb5b63056d88329ab44a571..1c819b67c73769c64b538df68a8567d0202fb3c1 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,29 @@ >+2012-07-17 Shawn Singh <shawnsingh@chromium.org> >+ >+ [chromium] Remove awkward anchorPoint usage that implicity affects layer position >+ https://bugs.webkit.org/show_bug.cgi?id=91472 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ 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, that is done in calcDrawTransformsInternal. >+ (WebCore::GraphicsLayerChromium::updateLayerSize): No longer affects the computation of position. >+ (WebCore::GraphicsLayerChromium::updateAnchorPoint): No longer affects thecomputation of position. >+ * platform/graphics/chromium/cc/CCLayerTreeHostCommon.cpp: >+ (WebCore::calculateDrawTransformsInternal): explicitly use position + anchorPoint in this code, both for layer and its replica. >+ > 2012-07-16 Zoltan Horvath <zoltan@webkit.org> > > Unreviewed. Remove unnecessary executable bits after r122720. >diff --git a/Source/WebKit/chromium/ChangeLog b/Source/WebKit/chromium/ChangeLog >index ca0049168dde655df8dd9072fd0fdf115eaba0e8..0a54d147fd0fc004f7d0b773108f0958d8785d8c 100644 >--- a/Source/WebKit/chromium/ChangeLog >+++ b/Source/WebKit/chromium/ChangeLog >@@ -1,3 +1,19 @@ >+2012-07-17 Shawn Singh <shawnsingh@chromium.org> >+ >+ [chromium] Remove awkward anchorPoint usage that implicity affects layer position >+ https://bugs.webkit.org/show_bug.cgi?id=91472 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ 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: >+ > 2012-07-13 Eric Penner <epenner@google.com> > > [chromium] Add 'self-managed' option to CCPrioritizedTexture to enable render-surface and canvas use cases. >diff --git a/Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.cpp b/Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.cpp >index c21726e9f4240a61eb3c08f09162c2639ce36d3e..d5df42374cb4fd36bbc08fb4ab6ca0b5835152e6 100644 >--- a/Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.cpp >+++ b/Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.cpp >@@ -663,11 +663,7 @@ void GraphicsLayerChromium::updateChildList() > > void GraphicsLayerChromium::updateLayerPosition() > { >- // Position is offset on the layer by the layer anchor point. >- FloatPoint layerPosition(m_position.x() + m_anchorPoint.x() * m_size.width(), >- m_position.y() + m_anchorPoint.y() * m_size.height()); >- >- primaryLayer().setPosition(layerPosition); >+ primaryLayer().setPosition(m_position); > } > > void GraphicsLayerChromium::updateLayerSize() >@@ -675,26 +671,18 @@ void GraphicsLayerChromium::updateLayerSize() > IntSize layerSize(m_size.width(), m_size.height()); > if (!m_transformLayer.isNull()) { > m_transformLayer.setBounds(layerSize); >- // The anchor of the contents layer is always at 0.5, 0.5, so the position is center-relative. >- FloatPoint centerPoint(m_size.width() / 2, m_size.height() / 2); >- m_layer.setPosition(centerPoint); >+ m_layer.setPosition(FloatPoint()); > } > > m_layer.setBounds(layerSize); > > // Note that we don't resize m_contentsLayer. It's up the caller to do that. >- >- // If we've changed the bounds, we need to recalculate the position >- // of the layer, taking anchor point into account. >- updateLayerPosition(); > } > > void GraphicsLayerChromium::updateAnchorPoint() > { > primaryLayer().setAnchorPoint(FloatPoint(m_anchorPoint.x(), m_anchorPoint.y())); > primaryLayer().setAnchorPointZ(m_anchorPoint.z()); >- >- updateLayerPosition(); > } > > void GraphicsLayerChromium::updateTransform() >diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostCommon.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostCommon.cpp >index 1c677555a792525dcd1ac313a3571cc75a7e6cc3..ec7713dd32f57ea5feabc4600823a5d653552a27 100644 >--- a/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostCommon.cpp >+++ b/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostCommon.cpp >@@ -411,15 +411,7 @@ static bool calculateDrawTransformsInternal(LayerType* layer, LayerType* rootLay > // the transform to the anchor point is specified in "pixel layer space", where the bounds > // of the layer map to [bounds.width(), bounds.height()]. > // >- // 3. The value of layer->position() is actually the position of the anchor point with respect to the position >- // of the layer's origin. That is: >- // layer->position() = positionOfLayerOrigin + anchorPoint (in pixel units) >- // >- // Or, equivalently, >- // positionOfLayerOrigin.x = layer->position.x - (layer->anchorPoint.x * bounds.width) >- // positionOfLayerOrigin.y = layer->position.y - (layer->anchorPoint.y * bounds.height) >- // >- // 4. Definition of various transforms used: >+ // 3. Definition of various transforms used: > // M[parent] is the parent matrix, with respect to the nearest render surface, passed down recursively. > // M[root] is the full hierarchy, with respect to the root, passed down recursively. > // Tr[origin] is the translation matrix from the parent's origin to this layer's origin. >@@ -430,7 +422,6 @@ static bool calculateDrawTransformsInternal(LayerType* layer, LayerType* rootLay > // Tr[anchor2center] is the translation offset from the anchor point and the center of the layer > // > // Some shortcuts and substitutions are used in the code to reduce matrix multiplications: >- // Translating by the value of layer->position(), Tr[layer->position()] = Tr[origin] * Tr[origin2anchor] > // Tr[anchor2center] = Tr[origin2anchor].inverse() * Tr[origin2center] > // > // Some composite transforms can help in understanding the sequence of transforms: >@@ -440,7 +431,7 @@ static bool calculateDrawTransformsInternal(LayerType* layer, LayerType* rootLay > // In words, the layer transform is applied about the anchor point, and the sublayer transform is > // applied about the center of the layer. > // >- // 5. When a layer (or render surface) is drawn, it is drawn into a "target render surface". Therefore the draw >+ // 4. When a layer (or render surface) is drawn, it is drawn into a "target render surface". Therefore the draw > // transform does not necessarily transform from screen space to local layer space. Instead, the draw transform > // is the transform between the "target render surface space" and local layer space. Note that render surfaces, > // except for the root, also draw themselves into a different target render surface, and so their draw >@@ -484,11 +475,11 @@ static bool calculateDrawTransformsInternal(LayerType* layer, LayerType* rootLay > // M[surface2root] = M[owningLayer->screenspace] * S[contentsScale].inverse() > // > // The replica draw transform is: >- // M[replicaDraw] = M[surfaceOrigin] * S[contentsScale] * Tr[replica->position()] * Tr[replica] * Tr[anchor2center] * S[contentsScale].inverse() >- // = M[owningLayer->draw] * Tr[origin2center].inverse() * S[contentsScale] * Tr[replica->position()] * Tr[replica] * Tr[anchor2clippedCenter] * S[contentsScale].inverse() >+ // M[replicaDraw] = M[surfaceOrigin] * S[contentsScale] * Tr[replica->position() + replica->anchor()] * Tr[replica] * Tr[anchor2center] * S[contentsScale].inverse() >+ // = M[owningLayer->draw] * Tr[origin2center].inverse() * S[contentsScale] * Tr[replica->position() + replica->anchor()] * Tr[replica] * Tr[anchor2clippedCenter] * S[contentsScale].inverse() > // > // The replica origin transform to its target surface origin is: >- // M[replicaOrigin] = S[contentsScale] * M[surfaceOrigin] * Tr[replica->position()] * Tr[replica] * Tr[origin2anchor].inverse() * S[contentsScale].invers() >+ // M[replicaOrigin] = S[contentsScale] * M[surfaceOrigin] * Tr[replica->position() + replica->anchor()] * Tr[replica] * Tr[origin2anchor].inverse() * S[contentsScale].invers() > // > // The replica origin transform to the root (screen space) origin is: > // M[replica2root] = M[surface2root] * Tr[replica->position()] * Tr[replica] * Tr[origin2anchor].inverse() >@@ -513,13 +504,13 @@ static bool calculateDrawTransformsInternal(LayerType* layer, LayerType* rootLay > float centerOffsetY = (0.5 - anchorPoint.y()) * bounds.height(); > > WebTransformationMatrix layerLocalTransform; >- // LT = Tr[origin] * S[pageScaleDelta] >+ // LT = S[pageScaleDelta] > layerLocalTransform.scale(layer->pageScaleDelta()); >- // LT = Tr[origin] * S[pageScaleDelta] * Tr[origin2anchor] >- layerLocalTransform.translate3d(position.x(), position.y(), layer->anchorPointZ()); >- // LT = Tr[origin] * S[pageScaleDelta] * Tr[origin2anchor] * M[layer] >+ // LT = S[pageScaleDelta] * Tr[origin] * Tr[origin2anchor] >+ layerLocalTransform.translate3d(position.x() + anchorPoint.x() * bounds.width(), position.y() + anchorPoint.y() * bounds.height(), layer->anchorPointZ()); >+ // LT = S[pageScaleDelta] * Tr[origin] * Tr[origin2anchor] * M[layer] > layerLocalTransform.multiply(layer->transform()); >- // LT = Tr[origin] * S[pageScaleDelta] * Tr[origin2anchor] * M[layer] * Tr[anchor2center] >+ // LT = S[pageScaleDelta] * Tr[origin] * Tr[origin2anchor] * M[layer] * Tr[anchor2center] > layerLocalTransform.translate3d(centerOffsetX, centerOffsetY, -layer->anchorPointZ()); > > // The combinedTransform that gets computed below is effectively the layer's drawTransform, unless >@@ -781,20 +772,22 @@ static bool calculateDrawTransformsInternal(LayerType* layer, LayerType* rootLay > WebTransformationMatrix replicaDrawTransform = renderSurface->originTransform(); > > replicaDrawTransform.scale(contentsScale); >- replicaDrawTransform.translate(layer->replicaLayer()->position().x(), layer->replicaLayer()->position().y()); >+ replicaDrawTransform.translate(layer->replicaLayer()->position().x() + layer->replicaLayer()->anchorPoint().x() * bounds.width(), >+ layer->replicaLayer()->position().y() + layer->replicaLayer()->anchorPoint().y() * bounds.height()); > replicaDrawTransform.multiply(layer->replicaLayer()->transform()); > FloatPoint layerSpaceSurfaceCenter = surfaceCenter; > layerSpaceSurfaceCenter.scale(1 / contentsScale, 1 / contentsScale); >- replicaDrawTransform.translate(layerSpaceSurfaceCenter.x() - anchorPoint.x() * bounds.width(), layerSpaceSurfaceCenter.y() - anchorPoint.y() * bounds.height()); >+ replicaDrawTransform.translate(layerSpaceSurfaceCenter.x() - layer->replicaLayer()->anchorPoint().x() * bounds.width(), layerSpaceSurfaceCenter.y() - layer->replicaLayer()->anchorPoint().y() * bounds.height()); > replicaDrawTransform.scale(1 / contentsScale); > > renderSurface->setReplicaDrawTransform(replicaDrawTransform); > > WebTransformationMatrix surfaceOriginToReplicaOriginTransform; > surfaceOriginToReplicaOriginTransform.scale(contentsScale); >- surfaceOriginToReplicaOriginTransform.translate(layer->replicaLayer()->position().x(), layer->replicaLayer()->position().y()); >+ surfaceOriginToReplicaOriginTransform.translate(layer->replicaLayer()->position().x() + layer->replicaLayer()->anchorPoint().x() * bounds.width(), >+ layer->replicaLayer()->position().y() + layer->replicaLayer()->anchorPoint().y() * bounds.height()); > surfaceOriginToReplicaOriginTransform.multiply(layer->replicaLayer()->transform()); >- surfaceOriginToReplicaOriginTransform.translate(-anchorPoint.x() * bounds.width(), -anchorPoint.y() * bounds.height()); >+ surfaceOriginToReplicaOriginTransform.translate(-layer->replicaLayer()->anchorPoint().x() * bounds.width(), -layer->replicaLayer()->anchorPoint().y() * bounds.height()); > surfaceOriginToReplicaOriginTransform.scale(1 / contentsScale); > > // Compute the replica's "originTransform" that maps from the replica's origin space to the target surface origin space. >diff --git a/Source/WebKit/chromium/tests/CCDamageTrackerTest.cpp b/Source/WebKit/chromium/tests/CCDamageTrackerTest.cpp >index f498069f0eea79f3289fd64b405ad976a91a8690..384607315dffd8ab3d3c98281a70dc32f5c9b895 100644 >--- a/Source/WebKit/chromium/tests/CCDamageTrackerTest.cpp >+++ b/Source/WebKit/chromium/tests/CCDamageTrackerTest.cpp >@@ -311,11 +311,9 @@ TEST_F(CCDamageTrackerTest, verifyDamageForTransformedLayer) > WebTransformationMatrix rotation; > rotation.rotate(45); > >- // Note carefully, the anchor is actually part of layer->position(). By setting anchor >- // to (0.5, 0.5), the layer's position (100, 100) now refers to the center of the >- // layer, not the corner. This means the layer has actually changed position. > clearDamageForAllSurfaces(root.get()); > child->setAnchorPoint(FloatPoint(0.5, 0.5)); >+ child->setPosition(FloatPoint(85, 85)); > emulateDrawingOneFrame(root.get()); > > // Sanity check that the layer actually moved to (85, 85), damaging its old location and new location. >@@ -1030,13 +1028,10 @@ TEST_F(CCDamageTrackerTest, verifyDamageForReplicaMaskWithAnchor) > CCLayerImpl* child1 = root->children()[0].get(); > CCLayerImpl* grandChild1 = child1->children()[0].get(); > >- // Verify that the correct replicaOriginTransform is used for the replicaMask; the >- // incorrect old code incorrectly accounted for the anchor for the replica. A >- // non-zero anchor point should not affect the replica reflection. >- >+ // Verify that the correct replicaOriginTransform is used for the replicaMask; > clearDamageForAllSurfaces(root.get()); > >- grandChild1->setAnchorPoint(FloatPoint(1.0, 0.0)); // This is the anchor being tested. >+ grandChild1->setAnchorPoint(FloatPoint(1.0, 0.0)); // This is the anchor being tested, will cause reflection about the right edge of the layer > > { > OwnPtr<CCLayerImpl> grandChild1Replica = CCLayerImpl::create(6); >@@ -1071,7 +1066,7 @@ TEST_F(CCDamageTrackerTest, verifyDamageForReplicaMaskWithAnchor) > emulateDrawingOneFrame(root.get()); > > FloatRect childDamageRect = child1->renderSurface()->damageTracker()->currentDamageRect(); >- EXPECT_FLOAT_RECT_EQ(FloatRect(194, 200, 6, 8), childDamageRect); >+ EXPECT_FLOAT_RECT_EQ(FloatRect(206, 200, 6, 8), childDamageRect); > } > > TEST_F(CCDamageTrackerTest, verifyDamageWhenForcedFullDamage) >diff --git a/Source/WebKit/chromium/tests/CCLayerTreeHostCommonTest.cpp b/Source/WebKit/chromium/tests/CCLayerTreeHostCommonTest.cpp >index 54409514ce63389d08a6d17ede6b8ab9767b8d4d..c0fb387355e6c511b2b232afd7d382bece3b2634 100644 >--- a/Source/WebKit/chromium/tests/CCLayerTreeHostCommonTest.cpp >+++ b/Source/WebKit/chromium/tests/CCLayerTreeHostCommonTest.cpp >@@ -170,11 +170,6 @@ TEST(CCLayerTreeHostCommonTest, verifyTransformsForNoOpLayer) > > TEST(CCLayerTreeHostCommonTest, verifyTransformsForSingleLayer) > { >- // NOTE CAREFULLY: >- // LayerChromium::position is actually the sum of anchorPoint (in pixel space) and actual position. Because of this, the >- // value of LayerChromium::position() changes if the anchor changes, even though the layer is not actually located in a >- // different position. When we initialize layers for testing here, we need to initialize that unintutive position value. >- > WebTransformationMatrix identityMatrix; > RefPtr<LayerChromium> layer = LayerChromium::create(); > layer->createRenderSurface(); >@@ -197,15 +192,15 @@ TEST(CCLayerTreeHostCommonTest, verifyTransformsForSingleLayer) > EXPECT_TRANSFORMATION_MATRIX_EQ(identityMatrix, layer->screenSpaceTransform()); > > // Case 3: The anchor point by itself (without a layer transform) should have no effect on the transforms. >- setLayerPropertiesForTesting(layer.get(), identityMatrix, identityMatrix, FloatPoint(0.25f, 0.25f), FloatPoint(2.5f, 3.0f), IntSize(10, 12), false); >+ setLayerPropertiesForTesting(layer.get(), identityMatrix, identityMatrix, FloatPoint(0.25f, 0.25f), FloatPoint(0.0f, 0.0f), IntSize(10, 12), false); > executeCalculateDrawTransformsAndVisibility(layer.get()); > EXPECT_TRANSFORMATION_MATRIX_EQ(translationToCenter, layer->drawTransform()); > EXPECT_TRANSFORMATION_MATRIX_EQ(identityMatrix, layer->screenSpaceTransform()); > >- // Case 4: A change in "actual" position affects both the draw transform and screen space transform. >+ // Case 4: A change in actual position affects both the draw transform and screen space transform. > WebTransformationMatrix positionTransform; > positionTransform.translate(0.0, 1.2); >- setLayerPropertiesForTesting(layer.get(), identityMatrix, identityMatrix, FloatPoint(0.25f, 0.25f), FloatPoint(2.5f, 4.2f), IntSize(10, 12), false); >+ setLayerPropertiesForTesting(layer.get(), identityMatrix, identityMatrix, FloatPoint(0.25f, 0.25f), FloatPoint(0.0f, 1.2f), IntSize(10, 12), false); > executeCalculateDrawTransformsAndVisibility(layer.get()); > EXPECT_TRANSFORMATION_MATRIX_EQ(positionTransform * translationToCenter, layer->drawTransform()); > EXPECT_TRANSFORMATION_MATRIX_EQ(positionTransform, layer->screenSpaceTransform()); >@@ -223,7 +218,7 @@ TEST(CCLayerTreeHostCommonTest, verifyTransformsForSingleLayer) > WebTransformationMatrix translationToAnchor; > translationToAnchor.translate(5.0, 0.0); > WebTransformationMatrix expectedResult = translationToAnchor * layerTransform * translationToAnchor.inverse(); >- setLayerPropertiesForTesting(layer.get(), layerTransform, identityMatrix, FloatPoint(0.5f, 0.0f), FloatPoint(5.0f, 0.0f), IntSize(10, 12), false); >+ setLayerPropertiesForTesting(layer.get(), layerTransform, identityMatrix, FloatPoint(0.5f, 0.0f), FloatPoint(0.0f, 0.0f), IntSize(10, 12), false); > executeCalculateDrawTransformsAndVisibility(layer.get()); > EXPECT_TRANSFORMATION_MATRIX_EQ(expectedResult * translationToCenter, layer->drawTransform()); > EXPECT_TRANSFORMATION_MATRIX_EQ(expectedResult, layer->screenSpaceTransform()); >@@ -232,7 +227,7 @@ TEST(CCLayerTreeHostCommonTest, verifyTransformsForSingleLayer) > // The current implementation of calculateDrawTransforms does this implicitly, but it is > // still worth testing to detect accidental regressions. > expectedResult = positionTransform * translationToAnchor * layerTransform * translationToAnchor.inverse(); >- setLayerPropertiesForTesting(layer.get(), layerTransform, identityMatrix, FloatPoint(0.5f, 0.0f), FloatPoint(5.0f, 1.2f), IntSize(10, 12), false); >+ setLayerPropertiesForTesting(layer.get(), layerTransform, identityMatrix, FloatPoint(0.5f, 0.0f), FloatPoint(0.0f, 1.2f), IntSize(10, 12), false); > executeCalculateDrawTransformsAndVisibility(layer.get()); > EXPECT_TRANSFORMATION_MATRIX_EQ(expectedResult * translationToCenter, layer->drawTransform()); > EXPECT_TRANSFORMATION_MATRIX_EQ(expectedResult, layer->screenSpaceTransform()); >@@ -252,7 +247,7 @@ TEST(CCLayerTreeHostCommonTest, verifyTransformsForSimpleHierarchy) > WebTransformationMatrix childTranslationToCenter, grandChildTranslationToCenter; > childTranslationToCenter.translate(8.0, 9.0); > grandChildTranslationToCenter.translate(38.0, 39.0); >- setLayerPropertiesForTesting(parent.get(), identityMatrix, identityMatrix, FloatPoint(0.25f, 0.25f), FloatPoint(2.5f, 3.0f), IntSize(10, 12), false); >+ setLayerPropertiesForTesting(parent.get(), identityMatrix, identityMatrix, FloatPoint(0.25f, 0.25f), FloatPoint(0.0f, 0.0f), IntSize(10, 12), false); > setLayerPropertiesForTesting(child.get(), identityMatrix, identityMatrix, FloatPoint(0.0f, 0.0f), FloatPoint(0.0f, 0.0f), IntSize(16, 18), false); > setLayerPropertiesForTesting(grandChild.get(), identityMatrix, identityMatrix, FloatPoint(0.0f, 0.0f), FloatPoint(0.0f, 0.0f), IntSize(76, 78), false); > executeCalculateDrawTransformsAndVisibility(parent.get()); >@@ -264,7 +259,7 @@ TEST(CCLayerTreeHostCommonTest, verifyTransformsForSimpleHierarchy) > // Case 2: parent's position affects child and grandChild. > WebTransformationMatrix parentPositionTransform; > parentPositionTransform.translate(0.0, 1.2); >- setLayerPropertiesForTesting(parent.get(), identityMatrix, identityMatrix, FloatPoint(0.25f, 0.25f), FloatPoint(2.5f, 4.2f), IntSize(10, 12), false); >+ setLayerPropertiesForTesting(parent.get(), identityMatrix, identityMatrix, FloatPoint(0.25f, 0.25f), FloatPoint(0.0f, 1.2f), IntSize(10, 12), false); > setLayerPropertiesForTesting(child.get(), identityMatrix, identityMatrix, FloatPoint(0.0f, 0.0f), FloatPoint(0.0f, 0.0f), IntSize(16, 18), false); > setLayerPropertiesForTesting(grandChild.get(), identityMatrix, identityMatrix, FloatPoint(0.0f, 0.0f), FloatPoint(0.0f, 0.0f), IntSize(76, 78), false); > executeCalculateDrawTransformsAndVisibility(parent.get()); >@@ -279,7 +274,7 @@ TEST(CCLayerTreeHostCommonTest, verifyTransformsForSimpleHierarchy) > WebTransformationMatrix parentTranslationToAnchor; > parentTranslationToAnchor.translate(2.5, 3.0); > WebTransformationMatrix parentCompositeTransform = parentTranslationToAnchor * parentLayerTransform * parentTranslationToAnchor.inverse(); >- setLayerPropertiesForTesting(parent.get(), parentLayerTransform, identityMatrix, FloatPoint(0.25f, 0.25f), FloatPoint(2.5f, 3.0f), IntSize(10, 12), false); >+ setLayerPropertiesForTesting(parent.get(), parentLayerTransform, identityMatrix, FloatPoint(0.25f, 0.25f), FloatPoint(0.0f, 0.0f), IntSize(10, 12), false); > setLayerPropertiesForTesting(child.get(), identityMatrix, identityMatrix, FloatPoint(0.0f, 0.0f), FloatPoint(0.0f, 0.0f), IntSize(16, 18), false); > setLayerPropertiesForTesting(grandChild.get(), identityMatrix, identityMatrix, FloatPoint(0.0f, 0.0f), FloatPoint(0.0f, 0.0f), IntSize(76, 78), false); > executeCalculateDrawTransformsAndVisibility(parent.get()); >@@ -300,7 +295,7 @@ TEST(CCLayerTreeHostCommonTest, verifyTransformsForSimpleHierarchy) > parentCompositeTransform = parentTranslationToAnchor * parentLayerTransform * parentTranslationToAnchor.inverse() > * parentTranslationToCenter * parentSublayerMatrix * parentTranslationToCenter.inverse(); > WebTransformationMatrix flattenedCompositeTransform = remove3DComponentOfMatrix(parentCompositeTransform); >- setLayerPropertiesForTesting(parent.get(), parentLayerTransform, parentSublayerMatrix, FloatPoint(0.25f, 0.25f), FloatPoint(2.5f, 3.0f), IntSize(10, 12), false); >+ setLayerPropertiesForTesting(parent.get(), parentLayerTransform, parentSublayerMatrix, FloatPoint(0.25f, 0.25f), FloatPoint(0.0f, 0.0f), IntSize(10, 12), false); > setLayerPropertiesForTesting(child.get(), identityMatrix, identityMatrix, FloatPoint(0.0f, 0.0f), FloatPoint(0.0f, 0.0f), IntSize(16, 18), false); > setLayerPropertiesForTesting(grandChild.get(), identityMatrix, identityMatrix, FloatPoint(0.0f, 0.0f), FloatPoint(0.0f, 0.0f), IntSize(76, 78), false); > executeCalculateDrawTransformsAndVisibility(parent.get()); >@@ -311,7 +306,7 @@ TEST(CCLayerTreeHostCommonTest, verifyTransformsForSimpleHierarchy) > > // Case 5: same as Case 4, except that child does preserve 3D, so the grandChild should receive the non-flattened composite transform. > // >- setLayerPropertiesForTesting(parent.get(), parentLayerTransform, parentSublayerMatrix, FloatPoint(0.25f, 0.25f), FloatPoint(2.5f, 3.0f), IntSize(10, 12), false); >+ setLayerPropertiesForTesting(parent.get(), parentLayerTransform, parentSublayerMatrix, FloatPoint(0.25f, 0.25f), FloatPoint(0.0f, 0.0f), IntSize(10, 12), false); > setLayerPropertiesForTesting(child.get(), identityMatrix, identityMatrix, FloatPoint(0.0f, 0.0f), FloatPoint(0.0f, 0.0f), IntSize(16, 18), true); > setLayerPropertiesForTesting(grandChild.get(), identityMatrix, identityMatrix, FloatPoint(0.0f, 0.0f), FloatPoint(0.0f, 0.0f), IntSize(76, 78), false); > executeCalculateDrawTransformsAndVisibility(parent.get()); >@@ -350,7 +345,7 @@ TEST(CCLayerTreeHostCommonTest, verifyTransformsForSingleRenderSurface) > // Child's render surface should not exist yet. > ASSERT_FALSE(child->renderSurface()); > >- setLayerPropertiesForTesting(parent.get(), parentLayerTransform, parentSublayerMatrix, FloatPoint(0.25f, 0.25f), FloatPoint(2.5f, 3.0f), IntSize(10, 12), false); >+ setLayerPropertiesForTesting(parent.get(), parentLayerTransform, parentSublayerMatrix, FloatPoint(0.25f, 0.25f), FloatPoint(0.0f, 0.0f), IntSize(10, 12), false); > setLayerPropertiesForTesting(child.get(), identityMatrix, identityMatrix, FloatPoint(0.0f, 0.0f), FloatPoint(0.0f, 0.0f), IntSize(16, 18), false); > setLayerPropertiesForTesting(grandChild.get(), identityMatrix, identityMatrix, FloatPoint(0.0f, 0.0f), FloatPoint(-0.5f, -0.5f), IntSize(1, 1), false); > executeCalculateDrawTransformsAndVisibility(parent.get()); >@@ -958,7 +953,7 @@ TEST(CCLayerTreeHostCommonTest, verifyTransformsForReplica) > // Child's render surface should not exist yet. > ASSERT_FALSE(child->renderSurface()); > >- setLayerPropertiesForTesting(parent.get(), parentLayerTransform, parentSublayerMatrix, FloatPoint(0.25f, 0.25f), FloatPoint(2.5f, 3.0f), IntSize(10, 12), false); >+ setLayerPropertiesForTesting(parent.get(), parentLayerTransform, parentSublayerMatrix, FloatPoint(0.25f, 0.25f), FloatPoint(0.0f, 0.0f), IntSize(10, 12), false); > setLayerPropertiesForTesting(child.get(), identityMatrix, identityMatrix, FloatPoint(0.0f, 0.0f), FloatPoint(0.0f, 0.0f), IntSize(16, 18), false); > setLayerPropertiesForTesting(grandChild.get(), identityMatrix, identityMatrix, FloatPoint(0.0f, 0.0f), FloatPoint(-0.5f, -0.5f), IntSize(1, 1), false); > setLayerPropertiesForTesting(childReplica.get(), replicaLayerTransform, identityMatrix, FloatPoint(0.0f, 0.0f), FloatPoint(0.0f, 0.0f), IntSize(0, 0), false); >@@ -1008,7 +1003,7 @@ TEST(CCLayerTreeHostCommonTest, verifyTransformsForRenderSurfaceHierarchy) > renderSurface1->setOpacity(0.5f); > renderSurface2->setOpacity(0.33f); > >- // All layers in the tree are initialized with an anchor at 2.5 and a size of (10,10). >+ // All layers in the tree are initialized with an anchor at .25 and a size of (10,10). > // matrix "A" is the composite layer transform used in all layers, centered about the anchor point > // matrix "B" is the sublayer transform used in all layers, centered about the center position of the layer. > // matrix "R" is the composite replica transform used in all replica layers. >@@ -1030,17 +1025,17 @@ TEST(CCLayerTreeHostCommonTest, verifyTransformsForRenderSurfaceHierarchy) > WebTransformationMatrix B = translationToCenter * sublayerTransform * translationToCenter.inverse(); > WebTransformationMatrix R = A * translationToAnchor * replicaLayerTransform * translationToAnchor.inverse(); > >- setLayerPropertiesForTesting(parent.get(), layerTransform, sublayerTransform, FloatPoint(0.25f, 0.0f), FloatPoint(2.5f, 0.0f), IntSize(10, 10), false); >- setLayerPropertiesForTesting(renderSurface1.get(), layerTransform, sublayerTransform, FloatPoint(0.25f, 0.0f), FloatPoint(2.5f, 0.0f), IntSize(10, 10), false); >- setLayerPropertiesForTesting(renderSurface2.get(), layerTransform, sublayerTransform, FloatPoint(0.25f, 0.0f), FloatPoint(2.5f, 0.0f), IntSize(10, 10), false); >- setLayerPropertiesForTesting(childOfRoot.get(), layerTransform, sublayerTransform, FloatPoint(0.25f, 0.0f), FloatPoint(2.5f, 0.0f), IntSize(10, 10), false); >- setLayerPropertiesForTesting(childOfRS1.get(), layerTransform, sublayerTransform, FloatPoint(0.25f, 0.0f), FloatPoint(2.5f, 0.0f), IntSize(10, 10), false); >- setLayerPropertiesForTesting(childOfRS2.get(), layerTransform, sublayerTransform, FloatPoint(0.25f, 0.0f), FloatPoint(2.5f, 0.0f), IntSize(10, 10), false); >- setLayerPropertiesForTesting(grandChildOfRoot.get(), layerTransform, sublayerTransform, FloatPoint(0.25f, 0.0f), FloatPoint(2.5f, 0.0f), IntSize(10, 10), false); >- setLayerPropertiesForTesting(grandChildOfRS1.get(), layerTransform, sublayerTransform, FloatPoint(0.25f, 0.0f), FloatPoint(2.5f, 0.0f), IntSize(10, 10), false); >- setLayerPropertiesForTesting(grandChildOfRS2.get(), layerTransform, sublayerTransform, FloatPoint(0.25f, 0.0f), FloatPoint(2.5f, 0.0f), IntSize(10, 10), false); >- setLayerPropertiesForTesting(replicaOfRS1.get(), replicaLayerTransform, sublayerTransform, FloatPoint(), FloatPoint(2.5f, 0.0f), IntSize(), false); >- setLayerPropertiesForTesting(replicaOfRS2.get(), replicaLayerTransform, sublayerTransform, FloatPoint(), FloatPoint(2.5f, 0.0f), IntSize(), false); >+ setLayerPropertiesForTesting(parent.get(), layerTransform, sublayerTransform, FloatPoint(0.25f, 0.0f), FloatPoint(0.0f, 0.0f), IntSize(10, 10), false); >+ setLayerPropertiesForTesting(renderSurface1.get(), layerTransform, sublayerTransform, FloatPoint(0.25f, 0.0f), FloatPoint(0.0f, 0.0f), IntSize(10, 10), false); >+ setLayerPropertiesForTesting(renderSurface2.get(), layerTransform, sublayerTransform, FloatPoint(0.25f, 0.0f), FloatPoint(0.0f, 0.0f), IntSize(10, 10), false); >+ setLayerPropertiesForTesting(childOfRoot.get(), layerTransform, sublayerTransform, FloatPoint(0.25f, 0.0f), FloatPoint(0.0f, 0.0f), IntSize(10, 10), false); >+ setLayerPropertiesForTesting(childOfRS1.get(), layerTransform, sublayerTransform, FloatPoint(0.25f, 0.0f), FloatPoint(0.0f, 0.0f), IntSize(10, 10), false); >+ setLayerPropertiesForTesting(childOfRS2.get(), layerTransform, sublayerTransform, FloatPoint(0.25f, 0.0f), FloatPoint(0.0f, 0.0f), IntSize(10, 10), false); >+ setLayerPropertiesForTesting(grandChildOfRoot.get(), layerTransform, sublayerTransform, FloatPoint(0.25f, 0.0f), FloatPoint(0.0f, 0.0f), IntSize(10, 10), false); >+ setLayerPropertiesForTesting(grandChildOfRS1.get(), layerTransform, sublayerTransform, FloatPoint(0.25f, 0.0f), FloatPoint(0.0f, 0.0f), IntSize(10, 10), false); >+ setLayerPropertiesForTesting(grandChildOfRS2.get(), layerTransform, sublayerTransform, FloatPoint(0.25f, 0.0f), FloatPoint(0.0f, 0.0f), IntSize(10, 10), false); >+ setLayerPropertiesForTesting(replicaOfRS1.get(), replicaLayerTransform, sublayerTransform, FloatPoint(), FloatPoint(0.0f, 0.0f), IntSize(), false); >+ setLayerPropertiesForTesting(replicaOfRS2.get(), replicaLayerTransform, sublayerTransform, FloatPoint(), FloatPoint(0.0f, 0.0f), IntSize(), false); > > executeCalculateDrawTransformsAndVisibility(parent.get()); > >diff --git a/Source/WebKit/chromium/tests/CCLayerTreeHostImplTest.cpp b/Source/WebKit/chromium/tests/CCLayerTreeHostImplTest.cpp >index cb2b7f36fa7543909b00281d5d9b159268d86558..c1d21a2e06e8dd8db465a73df474e614e48d35d1 100644 >--- a/Source/WebKit/chromium/tests/CCLayerTreeHostImplTest.cpp >+++ b/Source/WebKit/chromium/tests/CCLayerTreeHostImplTest.cpp >@@ -910,11 +910,11 @@ TEST_F(CCLayerTreeHostImplTest, scrollMissesBackfacingChild) > TEST_F(CCLayerTreeHostImplTest, scrollBlockedByContentLayer) > { > IntSize surfaceSize(10, 10); >- OwnPtr<CCLayerImpl> contentLayer = createScrollableLayer(1, FloatPoint(5, 5), surfaceSize); >+ OwnPtr<CCLayerImpl> contentLayer = createScrollableLayer(1, FloatPoint(0, 0), surfaceSize); > contentLayer->setShouldScrollOnMainThread(true); > contentLayer->setScrollable(false); > >- OwnPtr<CCLayerImpl> scrollLayer = createScrollableLayer(2, FloatPoint(5, 5), surfaceSize); >+ OwnPtr<CCLayerImpl> scrollLayer = createScrollableLayer(2, FloatPoint(0, 0), surfaceSize); > scrollLayer->addChild(contentLayer.release()); > > m_hostImpl->setRootLayer(scrollLayer.release()); >@@ -929,7 +929,7 @@ TEST_F(CCLayerTreeHostImplTest, scrollRootAndChangePageScaleOnMainThread) > { > IntSize surfaceSize(10, 10); > float pageScale = 2; >- OwnPtr<CCLayerImpl> root = createScrollableLayer(1, FloatPoint(5, 5), surfaceSize); >+ OwnPtr<CCLayerImpl> root = createScrollableLayer(1, FloatPoint(0, 0), surfaceSize); > m_hostImpl->setRootLayer(root.release()); > m_hostImpl->setViewportSize(surfaceSize); > initializeLayerRendererAndDrawFrame(); >@@ -960,7 +960,7 @@ TEST_F(CCLayerTreeHostImplTest, scrollRootAndChangePageScaleOnImplThread) > { > IntSize surfaceSize(10, 10); > float pageScale = 2; >- OwnPtr<CCLayerImpl> root = createScrollableLayer(1, FloatPoint(5, 5), surfaceSize); >+ OwnPtr<CCLayerImpl> root = createScrollableLayer(1, FloatPoint(0, 0), surfaceSize); > m_hostImpl->setRootLayer(root.release()); > m_hostImpl->setViewportSize(surfaceSize); > m_hostImpl->setPageScaleFactorAndLimits(1, 1, pageScale); >@@ -996,7 +996,7 @@ TEST_F(CCLayerTreeHostImplTest, scrollChildAndChangePageScaleOnMainThread) > // Also mark the root scrollable so it becomes the root scroll layer. > root->setScrollable(true); > int scrollLayerId = 2; >- root->addChild(createScrollableLayer(scrollLayerId, FloatPoint(5, 5), surfaceSize)); >+ root->addChild(createScrollableLayer(scrollLayerId, FloatPoint(0, 0), surfaceSize)); > m_hostImpl->setRootLayer(root.release()); > m_hostImpl->setViewportSize(surfaceSize); > initializeLayerRendererAndDrawFrame(); >@@ -1031,12 +1031,12 @@ TEST_F(CCLayerTreeHostImplTest, scrollChildBeyondLimit) > // parent layer is scrolled on the axis on which the child was unable to > // scroll. > IntSize surfaceSize(10, 10); >- OwnPtr<CCLayerImpl> root = createScrollableLayer(1, FloatPoint(5, 5), surfaceSize); >+ OwnPtr<CCLayerImpl> root = createScrollableLayer(1, FloatPoint(0, 0), surfaceSize); > >- OwnPtr<CCLayerImpl> grandChild = createScrollableLayer(3, FloatPoint(5, 5), surfaceSize); >+ OwnPtr<CCLayerImpl> grandChild = createScrollableLayer(3, FloatPoint(0, 0), surfaceSize); > grandChild->setScrollPosition(IntPoint(0, 5)); > >- OwnPtr<CCLayerImpl> child = createScrollableLayer(2, FloatPoint(5, 5), surfaceSize); >+ OwnPtr<CCLayerImpl> child = createScrollableLayer(2, FloatPoint(0, 0), surfaceSize); > child->setScrollPosition(IntPoint(3, 0)); > child->addChild(grandChild.release()); > >@@ -1067,8 +1067,8 @@ TEST_F(CCLayerTreeHostImplTest, scrollEventBubbling) > // When we try to scroll a non-scrollable child layer, the scroll delta > // should be applied to one of its ancestors if possible. > IntSize surfaceSize(10, 10); >- OwnPtr<CCLayerImpl> root = createScrollableLayer(1, FloatPoint(5, 5), surfaceSize); >- OwnPtr<CCLayerImpl> child = createScrollableLayer(2, FloatPoint(5, 5), surfaceSize); >+ OwnPtr<CCLayerImpl> root = createScrollableLayer(1, FloatPoint(0, 0), surfaceSize); >+ OwnPtr<CCLayerImpl> child = createScrollableLayer(2, FloatPoint(0, 0), surfaceSize); > > child->setScrollable(false); > root->addChild(child.release()); >@@ -1093,13 +1093,13 @@ TEST_F(CCLayerTreeHostImplTest, scrollEventBubbling) > TEST_F(CCLayerTreeHostImplTest, scrollBeforeRedraw) > { > IntSize surfaceSize(10, 10); >- m_hostImpl->setRootLayer(createScrollableLayer(1, FloatPoint(5, 5), surfaceSize)); >+ m_hostImpl->setRootLayer(createScrollableLayer(1, FloatPoint(0, 0), surfaceSize)); > m_hostImpl->setViewportSize(surfaceSize); > > // Draw one frame and then immediately rebuild the layer tree to mimic a tree synchronization. > initializeLayerRendererAndDrawFrame(); > m_hostImpl->detachLayerTree(); >- m_hostImpl->setRootLayer(createScrollableLayer(2, FloatPoint(5, 5), surfaceSize)); >+ m_hostImpl->setRootLayer(createScrollableLayer(2, FloatPoint(0, 0), surfaceSize)); > > // Scrolling should still work even though we did not draw yet. > EXPECT_EQ(m_hostImpl->scrollBegin(IntPoint(5, 5), CCInputHandlerClient::Wheel), CCInputHandlerClient::ScrollStarted); >diff --git a/Source/WebKit/chromium/tests/TiledLayerChromiumTest.cpp b/Source/WebKit/chromium/tests/TiledLayerChromiumTest.cpp >index f152ab4fbe7891e053679ebf31226477840cdd6f..94aabf91120d73e95cf0253eb17c212b9dd49fda 100644 >--- a/Source/WebKit/chromium/tests/TiledLayerChromiumTest.cpp >+++ b/Source/WebKit/chromium/tests/TiledLayerChromiumTest.cpp >@@ -840,10 +840,10 @@ TEST_F(TiledLayerChromiumTest, skipsDrawGetsReset) > > rootLayer->setBounds(contentBounds); > rootLayer->setVisibleContentRect(contentRect); >- rootLayer->setPosition(FloatPoint(150, 150)); >+ rootLayer->setPosition(FloatPoint(0, 0)); > childLayer->setBounds(contentBounds); > childLayer->setVisibleContentRect(contentRect); >- childLayer->setPosition(FloatPoint(150, 150)); >+ childLayer->setPosition(FloatPoint(0, 0)); > rootLayer->invalidateContentRect(contentRect); > childLayer->invalidateContentRect(contentRect); > >@@ -921,7 +921,7 @@ TEST_F(TiledLayerChromiumTest, partialUpdates) > > RefPtr<FakeTiledLayerChromium> layer = adoptRef(new FakeTiledLayerChromium(ccLayerTreeHost->contentsTextureManager())); > layer->setBounds(contentBounds); >- layer->setPosition(FloatPoint(150, 150)); >+ layer->setPosition(FloatPoint(0, 0)); > layer->setVisibleContentRect(contentRect); > layer->invalidateContentRect(contentRect); > >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 1bb3d36f8028046400c223e6b71b1c2714238911..4cdd9337dfa86130d19ddc8f3b183ad4354d2a18 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,12 @@ >+2012-07-17 Shawn Singh <shawnsingh@chromium.org> >+ >+ [chromium] Remove awkward anchorPoint usage that implicity affects layer position >+ https://bugs.webkit.org/show_bug.cgi?id=91472 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * platform/chromium/TestExpectations: marked one test case as needs rebaselining. Its behavior should now be similar to Safari. >+ > 2012-07-16 Adam Barth <abarth@webkit.org> > > jquery/manipulation.html times out in release too. >diff --git a/LayoutTests/platform/chromium/TestExpectations b/LayoutTests/platform/chromium/TestExpectations >index 7efa18a4768e08b85921b0192a988ff9ab89383a..4f82d70b0534d48160bc204ec7c5349caa39f866 100644 >--- a/LayoutTests/platform/chromium/TestExpectations >+++ b/LayoutTests/platform/chromium/TestExpectations >@@ -3768,3 +3768,6 @@ BUGWK90951 : fast/text/shaping/shaping-script-order.html = MISSING > > // Recently(?) started crashing on occassion > BUGWK91275 WIN : storage/indexeddb/cursor-key-order.html = PASS CRASH >+ >+// Needs rebaseline. Behavior should now be the same as Safari. >+BUGWK91472 : compositing/reflections/nested-reflection-anchor-point.html >\ No newline at end of file
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 91472
:
152709
|
152711
|
152719
|
152796