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

Unified Diff: cc/layers/surface_layer_unittest.cc

Issue 2905533002: cc : Store surface layer ids on LayerTreeHost and push them at commit (Closed)
Patch Set: comments 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
Index: cc/layers/surface_layer_unittest.cc
diff --git a/cc/layers/surface_layer_unittest.cc b/cc/layers/surface_layer_unittest.cc
index 4c354a7a5f6100ddd6a008a9972d3b2b2ab9aaab..ff34ffd6dd20d061fa9533d901baa45d394efae5 100644
--- a/cc/layers/surface_layer_unittest.cc
+++ b/cc/layers/surface_layer_unittest.cc
@@ -173,7 +173,26 @@ TEST_F(SurfaceLayerTest, SurfaceInfoPushProperties) {
LocalSurfaceId(2, base::UnguessableToken::Create())),
2.f, gfx::Size(10, 10));
layer->SetFallbackSurfaceInfo(fallback_info);
- layer->PushPropertiesTo(layer_impl.get());
+
+ // Verify that surface layer ids are recorded on the layer tree host and need
+ // to be pushed.
+ EXPECT_TRUE(layer_tree_host_->needs_surface_ids_sync());
+ EXPECT_EQ(layer_tree_host_->SurfaceLayerIds().size(), 1u);
+
+ // Verify that pending tree has no surface ids already.
+ EXPECT_FALSE(host_impl_.pending_tree()->needs_surface_ids_sync());
+ EXPECT_EQ(host_impl_.pending_tree()->SurfaceLayerIds().size(), 0u);
+
+ TreeSynchronizer::PushLayerProperties(layer_tree_host_.get(),
+ host_impl_.pending_tree());
+
+ // Verify that pending tree received the surface ids and also has
+ // needs_surface_ids_sync set to true as it needs to sync with active tree.
+ EXPECT_TRUE(host_impl_.pending_tree()->needs_surface_ids_sync());
+ EXPECT_EQ(host_impl_.pending_tree()->SurfaceLayerIds().size(), 1u);
+
+ // Verify we have reset the state on layer tree host.
+ EXPECT_FALSE(layer_tree_host_->needs_surface_ids_sync());
// Verify that the primary SurfaceInfo stays the same and the new fallback
// SurfaceInfo is pushed through.

Powered by Google App Engine
This is Rietveld 408576698