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

Unified Diff: Source/platform/graphics/paint/DisplayItemPropertyTreeBuilderTest.cpp

Issue 1346733004: Include transform origin in the transform tree. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 3 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
Index: Source/platform/graphics/paint/DisplayItemPropertyTreeBuilderTest.cpp
diff --git a/Source/platform/graphics/paint/DisplayItemPropertyTreeBuilderTest.cpp b/Source/platform/graphics/paint/DisplayItemPropertyTreeBuilderTest.cpp
index 0db60777835416257bfa8e089e2b6c2930c3c6c5..a1f76c70f36cecc81bf5029427f78f8d95d45ad0 100644
--- a/Source/platform/graphics/paint/DisplayItemPropertyTreeBuilderTest.cpp
+++ b/Source/platform/graphics/paint/DisplayItemPropertyTreeBuilderTest.cpp
@@ -415,5 +415,28 @@ TEST_F(DisplayItemPropertyTreeBuilderTest, ScrollDisplayItemIs2DTranslation)
AllOf(hasRange(4, 5), hasTransformNode(0), hasOffset(FloatSize(0, 0)))));
}
+TEST_F(DisplayItemPropertyTreeBuilderTest, TransformTreeIncludesTransformOrigin)
+{
+ FloatPoint3D transformOrigin(1, 2, 3);
+ TransformationMatrix matrix;
+ matrix.scale3d(2, 2, 2);
+
+ auto transformClient = processBeginTransform3D(matrix, transformOrigin);
+ processDummyDisplayItem();
+ processEndTransform3D(transformClient);
+ finishPropertyTrees();
+
+ // There should be two transform nodes.
+ ASSERT_EQ(2u, transformTree().nodeCount());
+ EXPECT_TRUE(transformTree().nodeAt(0).isRoot());
+
+ // And the non-root node should have both the matrix and the origin,
+ // separately.
+ const auto& transformNode = transformTree().nodeAt(1);
+ EXPECT_EQ(0u, transformNode.parentNodeIndex);
+ EXPECT_EQ(TransformationMatrix::toSkMatrix44(matrix), transformNode.matrix);
+ EXPECT_EQ(transformOrigin, transformNode.transformOrigin);
+}
+
} // namespace
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698