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

Unified Diff: cc/layers/picture_layer_impl_unittest.cc

Issue 322443002: cc: Refactor how picture layers are exposed to the tile manager. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix tile manager perf tests Created 6 years, 6 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/layers/picture_layer_impl.cc ('k') | cc/resources/tile_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/picture_layer_impl_unittest.cc
diff --git a/cc/layers/picture_layer_impl_unittest.cc b/cc/layers/picture_layer_impl_unittest.cc
index af9ee2d89742ac6b9f8fa886acbd87f701df11b7..e25cc122ab8902bc7b08f0917fdb341c69fc5833 100644
--- a/cc/layers/picture_layer_impl_unittest.cc
+++ b/cc/layers/picture_layer_impl_unittest.cc
@@ -298,86 +298,6 @@ TEST_F(PictureLayerImplTest, CloneNoInvalidation) {
VerifyAllTilesExistAndHavePile(tilings->tiling_at(i), active_pile.get());
}
-TEST_F(PictureLayerImplTest, TileManagerRegisterUnregister) {
- gfx::Size tile_size(100, 100);
- gfx::Size layer_bounds(400, 400);
-
- scoped_refptr<FakePicturePileImpl> pending_pile =
- FakePicturePileImpl::CreateFilledPile(tile_size, layer_bounds);
- scoped_refptr<FakePicturePileImpl> active_pile =
- FakePicturePileImpl::CreateFilledPile(tile_size, layer_bounds);
-
- SetupTrees(pending_pile, active_pile);
-
- std::vector<TileManager::PairedPictureLayer> paired_layers;
- host_impl_.tile_manager()->GetPairedPictureLayers(&paired_layers);
- EXPECT_EQ(0u, paired_layers.size());
-
- // Update tile priorities will force the layer to register itself.
- float dummy_contents_scale_x;
- float dummy_contents_scale_y;
- gfx::Size dummy_content_bounds;
- active_layer_->CalculateContentsScale(1.f,
- 1.f,
- 1.f,
- 1.f,
- false,
- &dummy_contents_scale_x,
- &dummy_contents_scale_y,
- &dummy_content_bounds);
- active_layer_->UpdateTilePriorities();
- host_impl_.pending_tree()->UpdateDrawProperties();
- pending_layer_->CalculateContentsScale(1.f,
- 1.f,
- 1.f,
- 1.f,
- false,
- &dummy_contents_scale_x,
- &dummy_contents_scale_y,
- &dummy_content_bounds);
- pending_layer_->UpdateTilePriorities();
-
- host_impl_.tile_manager()->GetPairedPictureLayers(&paired_layers);
- EXPECT_EQ(1u, paired_layers.size());
- EXPECT_EQ(active_layer_, paired_layers[0].active_layer);
- EXPECT_EQ(pending_layer_, paired_layers[0].pending_layer);
-
- // Destroy and recreate tile manager.
- host_impl_.DidLoseOutputSurface();
- scoped_ptr<TestWebGraphicsContext3D> context =
- TestWebGraphicsContext3D::Create();
- host_impl_.InitializeRenderer(
- FakeOutputSurface::Create3d(context.Pass()).PassAs<OutputSurface>());
-
- host_impl_.tile_manager()->GetPairedPictureLayers(&paired_layers);
- EXPECT_EQ(0u, paired_layers.size());
-
- active_layer_->CalculateContentsScale(1.f,
- 1.f,
- 1.f,
- 1.f,
- false,
- &dummy_contents_scale_x,
- &dummy_contents_scale_y,
- &dummy_content_bounds);
- active_layer_->UpdateTilePriorities();
- host_impl_.pending_tree()->UpdateDrawProperties();
- pending_layer_->CalculateContentsScale(1.f,
- 1.f,
- 1.f,
- 1.f,
- false,
- &dummy_contents_scale_x,
- &dummy_contents_scale_y,
- &dummy_content_bounds);
- pending_layer_->UpdateTilePriorities();
-
- host_impl_.tile_manager()->GetPairedPictureLayers(&paired_layers);
- EXPECT_EQ(1u, paired_layers.size());
- EXPECT_EQ(active_layer_, paired_layers[0].active_layer);
- EXPECT_EQ(pending_layer_, paired_layers[0].pending_layer);
-}
-
TEST_F(PictureLayerImplTest, InvalidViewportForPrioritizingTiles) {
base::TimeTicks time_ticks;
host_impl_.SetCurrentFrameTimeTicks(time_ticks);
@@ -2601,86 +2521,6 @@ TEST_F(NoLowResPictureLayerImplTest, NothingRequiredIfActiveMissingTiles) {
AssertNoTilesRequired(pending_layer_->LowResTiling());
}
-TEST_F(NoLowResPictureLayerImplTest, TileManagerRegisterUnregister) {
- gfx::Size tile_size(100, 100);
- gfx::Size layer_bounds(400, 400);
-
- scoped_refptr<FakePicturePileImpl> pending_pile =
- FakePicturePileImpl::CreateFilledPile(tile_size, layer_bounds);
- scoped_refptr<FakePicturePileImpl> active_pile =
- FakePicturePileImpl::CreateFilledPile(tile_size, layer_bounds);
-
- SetupTrees(pending_pile, active_pile);
-
- std::vector<TileManager::PairedPictureLayer> paired_layers;
- host_impl_.tile_manager()->GetPairedPictureLayers(&paired_layers);
- EXPECT_EQ(0u, paired_layers.size());
-
- // Update tile priorities will force the layer to register itself.
- float dummy_contents_scale_x;
- float dummy_contents_scale_y;
- gfx::Size dummy_content_bounds;
- active_layer_->CalculateContentsScale(1.f,
- 1.f,
- 1.f,
- 1.f,
- false,
- &dummy_contents_scale_x,
- &dummy_contents_scale_y,
- &dummy_content_bounds);
- active_layer_->UpdateTilePriorities();
- host_impl_.pending_tree()->UpdateDrawProperties();
- pending_layer_->CalculateContentsScale(1.f,
- 1.f,
- 1.f,
- 1.f,
- false,
- &dummy_contents_scale_x,
- &dummy_contents_scale_y,
- &dummy_content_bounds);
- pending_layer_->UpdateTilePriorities();
-
- host_impl_.tile_manager()->GetPairedPictureLayers(&paired_layers);
- EXPECT_EQ(1u, paired_layers.size());
- EXPECT_EQ(active_layer_, paired_layers[0].active_layer);
- EXPECT_EQ(pending_layer_, paired_layers[0].pending_layer);
-
- // Destroy and recreate tile manager.
- host_impl_.DidLoseOutputSurface();
- scoped_ptr<TestWebGraphicsContext3D> context =
- TestWebGraphicsContext3D::Create();
- host_impl_.InitializeRenderer(
- FakeOutputSurface::Create3d(context.Pass()).PassAs<OutputSurface>());
-
- host_impl_.tile_manager()->GetPairedPictureLayers(&paired_layers);
- EXPECT_EQ(0u, paired_layers.size());
-
- active_layer_->CalculateContentsScale(1.f,
- 1.f,
- 1.f,
- 1.f,
- false,
- &dummy_contents_scale_x,
- &dummy_contents_scale_y,
- &dummy_content_bounds);
- active_layer_->UpdateTilePriorities();
- host_impl_.pending_tree()->UpdateDrawProperties();
- pending_layer_->CalculateContentsScale(1.f,
- 1.f,
- 1.f,
- 1.f,
- false,
- &dummy_contents_scale_x,
- &dummy_contents_scale_y,
- &dummy_content_bounds);
- pending_layer_->UpdateTilePriorities();
-
- host_impl_.tile_manager()->GetPairedPictureLayers(&paired_layers);
- EXPECT_EQ(1u, paired_layers.size());
- EXPECT_EQ(active_layer_, paired_layers[0].active_layer);
- EXPECT_EQ(pending_layer_, paired_layers[0].pending_layer);
-}
-
TEST_F(NoLowResPictureLayerImplTest, InvalidViewportForPrioritizingTiles) {
base::TimeTicks time_ticks;
host_impl_.SetCurrentFrameTimeTicks(time_ticks);
« no previous file with comments | « cc/layers/picture_layer_impl.cc ('k') | cc/resources/tile_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698