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

Unified Diff: cc/trees/layer_tree_host_impl_unittest.cc

Issue 900073003: cc: Rework how picture layer tiling set gets into raster queues. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update Created 5 years, 10 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 | « cc/trees/layer_tree_host_impl.cc ('k') | cc/trees/layer_tree_host_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host_impl_unittest.cc
diff --git a/cc/trees/layer_tree_host_impl_unittest.cc b/cc/trees/layer_tree_host_impl_unittest.cc
index 23e90e11134d4e6fc405418ddd0e1a7b463c2306..9db3023fa51f2334eb94fbec4c3f5d44eedda9af 100644
--- a/cc/trees/layer_tree_host_impl_unittest.cc
+++ b/cc/trees/layer_tree_host_impl_unittest.cc
@@ -8044,78 +8044,6 @@ TEST_F(LayerTreeHostImplTest, ScrollAnimated) {
EXPECT_EQ(NULL, host_impl_->CurrentlyScrollingLayer());
}
-TEST_F(LayerTreeHostImplTest, GetPictureLayerImplPairs) {
- host_impl_->CreatePendingTree();
-
- scoped_ptr<PictureLayerImpl> layer =
- FakePictureLayerImpl::Create(host_impl_->pending_tree(), 10);
- layer->SetBounds(gfx::Size(10, 10));
-
- scoped_refptr<RasterSource> pile(FakePicturePileImpl::CreateEmptyPile(
- gfx::Size(10, 10), gfx::Size(10, 10)));
- Region empty_invalidation;
- const PictureLayerTilingSet* null_tiling_set = nullptr;
- layer->UpdateRasterSource(pile, &empty_invalidation, null_tiling_set);
-
- host_impl_->pending_tree()->SetRootLayer(layer.Pass());
-
- LayerTreeImpl* pending_tree = host_impl_->pending_tree();
- LayerImpl* pending_layer = pending_tree->root_layer();
-
- std::vector<PictureLayerImpl::Pair> layer_pairs;
- host_impl_->GetPictureLayerImplPairs(&layer_pairs, true);
- EXPECT_EQ(1u, layer_pairs.size());
- EXPECT_EQ(pending_layer, layer_pairs[0].pending);
- EXPECT_EQ(nullptr, layer_pairs[0].active);
-
- host_impl_->ActivateSyncTree();
-
- LayerTreeImpl* active_tree = host_impl_->active_tree();
- LayerImpl* active_layer = active_tree->root_layer();
- EXPECT_NE(active_tree, pending_tree);
- EXPECT_NE(active_layer, pending_layer);
- EXPECT_NE(nullptr, active_tree);
- EXPECT_NE(nullptr, active_layer);
-
- host_impl_->CreatePendingTree();
-
- layer_pairs.clear();
- host_impl_->GetPictureLayerImplPairs(&layer_pairs, true);
- EXPECT_EQ(1u, layer_pairs.size());
- EXPECT_EQ(active_layer, layer_pairs[0].active);
- EXPECT_EQ(pending_layer, layer_pairs[0].pending);
-
- // Activate, the active layer has no twin now.
- host_impl_->ActivateSyncTree();
-
- layer_pairs.clear();
- host_impl_->GetPictureLayerImplPairs(&layer_pairs, true);
- EXPECT_EQ(1u, layer_pairs.size());
- EXPECT_EQ(active_layer, layer_pairs[0].active);
- EXPECT_EQ(nullptr, layer_pairs[0].pending);
-
- // Create another layer in the pending tree that's not in the active tree. We
- // should get two pairs.
- host_impl_->CreatePendingTree();
- host_impl_->pending_tree()->root_layer()->AddChild(
- FakePictureLayerImpl::Create(host_impl_->pending_tree(), 11));
-
- LayerImpl* new_pending_layer = pending_tree->root_layer()->children()[0];
-
- layer_pairs.clear();
- host_impl_->GetPictureLayerImplPairs(&layer_pairs, true);
- EXPECT_EQ(2u, layer_pairs.size());
-
- // The pair ordering is flaky, so make it consistent.
- if (layer_pairs[0].active != active_layer)
- std::swap(layer_pairs[0], layer_pairs[1]);
-
- EXPECT_EQ(active_layer, layer_pairs[0].active);
- EXPECT_EQ(pending_layer, layer_pairs[0].pending);
- EXPECT_EQ(new_pending_layer, layer_pairs[1].pending);
- EXPECT_EQ(nullptr, layer_pairs[1].active);
-}
-
TEST_F(LayerTreeHostImplTest, DidBecomeActive) {
host_impl_->CreatePendingTree();
host_impl_->ActivateSyncTree();
« no previous file with comments | « cc/trees/layer_tree_host_impl.cc ('k') | cc/trees/layer_tree_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698