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

Unified Diff: third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositorTest.cpp

Issue 2667373002: Ensure PaintArtifactCompositor assigns a scroll tree index to all cc layers (Closed)
Patch Set: Created 3 years, 11 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: 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 889a1b6298b3d70396609c2e53162d003ff355ce..5dd795ed2319cda2be1b601ba235d95e66dfd712 100644
--- a/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositorTest.cpp
+++ b/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositorTest.cpp
@@ -705,6 +705,47 @@ TEST_F(PaintArtifactCompositorTestWithPropertyTrees, OneScrollNode) {
scrollNode.main_thread_scrolling_reasons);
}
+TEST_F(PaintArtifactCompositorTestWithPropertyTrees, TransformUnderScrollNode) {
+ RefPtr<TransformPaintPropertyNode> scrollTranslation =
+ TransformPaintPropertyNode::createScrollTranslation(
+ TransformPaintPropertyNode::root(),
+ TransformationMatrix().translate(7, 9), FloatPoint3D(), false, 0,
+ CompositingReasonNone, CompositorElementId(),
+ ScrollPaintPropertyNode::root(), IntSize(11, 13), IntSize(27, 31),
+ true, false, 0 /* mainThreadScrollingReasons */);
+
+ RefPtr<TransformPaintPropertyNode> transform =
+ TransformPaintPropertyNode::create(
+ scrollTranslation, TransformationMatrix(), FloatPoint3D(), false, 0,
+ CompositingReason3DTransform);
+
+ TestPaintArtifact artifact;
+ artifact
+ .chunk(scrollTranslation, ClipPaintPropertyNode::root(),
+ EffectPaintPropertyNode::root())
+ .rectDrawing(FloatRect(2, 4, 6, 8), Color::black)
+ .chunk(transform, ClipPaintPropertyNode::root(),
+ EffectPaintPropertyNode::root())
+ .rectDrawing(FloatRect(1, 3, 5, 7), Color::white);
+ update(artifact.build());
+
+ const cc::ScrollTree& scrollTree = propertyTrees().scroll_tree;
+ // Node #0 reserved for null; #1 for root render surface.
+ ASSERT_EQ(3u, scrollTree.size());
+ const cc::ScrollNode& scrollNode = *scrollTree.Node(2);
+
+ // Both layers should refer to the same scroll tree node.
+ EXPECT_EQ(scrollNode.id, contentLayerAt(0)->scroll_tree_index());
+ EXPECT_EQ(scrollNode.id, contentLayerAt(1)->scroll_tree_index());
+
+ const cc::TransformTree& transformTree = propertyTrees().transform_tree;
+ const cc::TransformNode& scrollTransformNode =
+ *transformTree.Node(scrollNode.transform_id);
+ // The layers have different transform nodes.
+ EXPECT_EQ(scrollTransformNode.id, contentLayerAt(0)->transform_tree_index());
pdr. 2017/02/02 04:22:32 There is not yet any end-to-end infrastructure for
+ EXPECT_NE(scrollTransformNode.id, contentLayerAt(1)->transform_tree_index());
+}
+
TEST_F(PaintArtifactCompositorTestWithPropertyTrees, NestedScrollNodes) {
RefPtr<EffectPaintPropertyNode> effect =
createOpacityOnlyEffect(EffectPaintPropertyNode::root(), 0.5);

Powered by Google App Engine
This is Rietveld 408576698