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 |