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

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

Issue 2888483002: Manage registering composited elements in PaintArtifactCompositor. (Closed)
Patch Set: Sync to head and disable flaky animation test. Created 3 years, 7 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 | « third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositor.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 e1d590ff449f588a4c841221b6d1a74bdc712be8..a3e3182a4a043dd3f8cfb062e282d25ebc58f388 100644
--- a/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositorTest.cpp
+++ b/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositorTest.cpp
@@ -96,6 +96,10 @@ class PaintArtifactCompositorTestWithPropertyTrees
return *web_layer_tree_view_->GetLayerTreeHost()->property_trees();
}
+ const cc::LayerTreeHost& GetLayerTreeHost() {
+ return *web_layer_tree_view_->GetLayerTreeHost();
+ }
+
int ElementIdToEffectNodeIndex(CompositorElementId element_id) {
return web_layer_tree_view_->GetLayerTreeHost()
->property_trees()
@@ -2266,4 +2270,31 @@ TEST_F(PaintArtifactCompositorTestWithPropertyTrees,
ASSERT_EQ(0u, ContentLayerCount());
}
+TEST_F(PaintArtifactCompositorTestWithPropertyTrees,
+ UpdateManagesLayerElementIds) {
+ RefPtr<TransformPaintPropertyNode> transform =
+ CreateSampleTransformNodeWithElementId();
+ CompositorElementId element_id = transform->GetCompositorElementId();
+
+ {
+ TestPaintArtifact artifact;
+ artifact
+ .Chunk(transform, ClipPaintPropertyNode::Root(),
+ EffectPaintPropertyNode::Root())
+ .RectDrawing(FloatRect(0, 0, 100, 100), Color::kBlack);
+
+ Update(artifact.Build());
+ ASSERT_EQ(1u, ContentLayerCount());
+ ASSERT_TRUE(GetLayerTreeHost().LayerByElementId(element_id));
+ }
+
+ {
+ TestPaintArtifact artifact;
+ ASSERT_TRUE(GetLayerTreeHost().LayerByElementId(element_id));
+ Update(artifact.Build());
+ ASSERT_EQ(0u, ContentLayerCount());
+ ASSERT_FALSE(GetLayerTreeHost().LayerByElementId(element_id));
+ }
+}
+
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositor.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698