| Index: third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositorTest.cpp
|
| diff --git a/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositorTest.cpp b/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositorTest.cpp
|
| index 6fdb064badbc151deabc4acf4f4e4f3957001362..8b326cb0a5e58f58c13eac921f31d4fb20371a63 100644
|
| --- a/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositorTest.cpp
|
| +++ b/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositorTest.cpp
|
| @@ -715,6 +715,15 @@ TEST_F(PaintArtifactCompositorTestWithPropertyTrees, OneScrollNode) {
|
| propertyTrees().scroll_tree.FindNodeIndexFromOwningLayerId(layer->id());
|
| EXPECT_EQ(scrollNodeIndex, scrollNode.id);
|
|
|
| + // Only one content layer, and the first child layer is the dummy layer for
|
| + // the transform node.
|
| + const cc::Layer* transformNodeLayer = rootLayer()->children()[0].get();
|
| + EXPECT_EQ(transformNodeLayer->id(), transformNode.owning_layer_id);
|
| + auto transformNodeIndex =
|
| + propertyTrees().transform_tree.FindNodeIndexFromOwningLayerId(
|
| + transformNodeLayer->id());
|
| + EXPECT_EQ(transformNodeIndex, transformNode.id);
|
| +
|
| EXPECT_EQ(0u, scrollClient.didScrollCount);
|
| layer->SetScrollOffsetFromImplSide(gfx::ScrollOffset(1, 2));
|
| EXPECT_EQ(1u, scrollClient.didScrollCount);
|
| @@ -1589,6 +1598,34 @@ TEST_F(PaintArtifactCompositorTestWithPropertyTrees, TransformWithElementId) {
|
| EXPECT_EQ(2, elementIdToTransformNodeIndex(expectedCompositorElementId));
|
| }
|
|
|
| +TEST_F(PaintArtifactCompositorTestWithPropertyTrees,
|
| + TransformNodeHasOwningLayerId) {
|
| + RefPtr<TransformPaintPropertyNode> transform =
|
| + TransformPaintPropertyNode::create(
|
| + TransformPaintPropertyNode::root(), TransformationMatrix().rotate(90),
|
| + FloatPoint3D(100, 100, 0), false, 0, CompositingReason3DTransform);
|
| +
|
| + TestPaintArtifact artifact;
|
| + artifact
|
| + .chunk(transform, ClipPaintPropertyNode::root(),
|
| + EffectPaintPropertyNode::root())
|
| + .rectDrawing(FloatRect(100, 100, 200, 100), Color::black);
|
| + update(artifact.build());
|
| +
|
| + // Only one content layer, and the first child layer is the dummy layer for
|
| + // the transform node.
|
| + ASSERT_EQ(1u, contentLayerCount());
|
| + const cc::Layer* transformNodeLayer = rootLayer()->children()[0].get();
|
| + const cc::TransformNode* ccTransformNode =
|
| + propertyTrees().transform_tree.Node(
|
| + transformNodeLayer->transform_tree_index());
|
| + EXPECT_EQ(transformNodeLayer->id(), ccTransformNode->owning_layer_id);
|
| + auto transformNodeIndex =
|
| + propertyTrees().transform_tree.FindNodeIndexFromOwningLayerId(
|
| + transformNodeLayer->id());
|
| + EXPECT_EQ(transformNodeIndex, ccTransformNode->id);
|
| +}
|
| +
|
| TEST_F(PaintArtifactCompositorTestWithPropertyTrees, EffectWithElementId) {
|
| CompositorElementId expectedCompositorElementId(2, 0);
|
| float opacity = 2.0 / 255.0;
|
|
|