Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(96)

Unified Diff: Source/WebKit/chromium/tests/CCLayerTreeHostCommonTest.cpp

Issue 10829322: Merge 125486 - [chromium] renderSurface in incorrect space if owning layer has empty but non-zero b… (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1229/
Patch Set: Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostCommon.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebKit/chromium/tests/CCLayerTreeHostCommonTest.cpp
===================================================================
--- Source/WebKit/chromium/tests/CCLayerTreeHostCommonTest.cpp (revision 125578)
+++ Source/WebKit/chromium/tests/CCLayerTreeHostCommonTest.cpp (working copy)
@@ -948,6 +948,36 @@
EXPECT_TRANSFORMATION_MATRIX_EQ(expectedGrandChildScreenSpaceTransform, grandChild->screenSpaceTransform());
}
+TEST(CCLayerTreeHostCommonTest, verifyTransformsForDegenerateIntermediateLayer)
+{
+ // A layer that is empty in one axis, but not the other, was accidentally skipping a necessary translation.
+ // Without that translation, the coordinate space of the layer's drawTransform is incorrect.
+ //
+ // Normally this isn't a problem, because the layer wouldn't be drawn anyway, but if that layer becomes a renderSurface, then
+ // its drawTransform is implicitly inherited by the rest of the subtree, which then is positioned incorrectly as a result.
+
+ RefPtr<LayerChromium> root = LayerChromium::create();
+ RefPtr<LayerChromium> child = LayerChromium::create();
+ RefPtr<LayerChromiumWithForcedDrawsContent> grandChild = adoptRef(new LayerChromiumWithForcedDrawsContent());
+
+ // The child height is zero, but has non-zero width that should be accounted for while computing drawTransforms.
+ const WebTransformationMatrix identityMatrix;
+ setLayerPropertiesForTesting(root.get(), identityMatrix, identityMatrix, FloatPoint::zero(), FloatPoint::zero(), IntSize(100, 100), false);
+ setLayerPropertiesForTesting(child.get(), identityMatrix, identityMatrix, FloatPoint::zero(), FloatPoint::zero(), IntSize(10, 0), false);
+ setLayerPropertiesForTesting(grandChild.get(), identityMatrix, identityMatrix, FloatPoint::zero(), FloatPoint::zero(), IntSize(10, 10), false);
+
+ root->addChild(child);
+ child->addChild(grandChild);
+ child->setForceRenderSurface(true);
+
+ executeCalculateDrawTransformsAndVisibility(root.get());
+
+ ASSERT_TRUE(child->renderSurface());
+ EXPECT_TRANSFORMATION_MATRIX_EQ(identityMatrix, child->renderSurface()->drawTransform()); // This is the real test, the rest are sanity checks.
+ EXPECT_TRANSFORMATION_MATRIX_EQ(identityMatrix, child->drawTransform());
+ EXPECT_TRANSFORMATION_MATRIX_EQ(identityMatrix, grandChild->drawTransform());
+}
+
TEST(CCLayerTreeHostCommonTest, verifyRenderSurfaceListForRenderSurfaceWithClippedLayer)
{
RefPtr<LayerChromium> parent = LayerChromium::create();
« no previous file with comments | « Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostCommon.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698