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

Unified Diff: cc/test/fake_picture_layer_impl.cc

Issue 62283012: cc: Added tile bundles (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years 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/test/fake_picture_layer_impl.h ('k') | cc/test/fake_picture_layer_tiling_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/test/fake_picture_layer_impl.cc
diff --git a/cc/test/fake_picture_layer_impl.cc b/cc/test/fake_picture_layer_impl.cc
index 6e9ffdefbd0dd9fc9959778d8239c6ae12015492..b92b8078a59efef79db666103ba63a4aa41350c9 100644
--- a/cc/test/fake_picture_layer_impl.cc
+++ b/cc/test/fake_picture_layer_impl.cc
@@ -77,14 +77,14 @@ void FakePictureLayerImpl::SetAllTilesVisible() {
for (size_t tiling_idx = 0; tiling_idx < tilings_->num_tilings();
++tiling_idx) {
PictureLayerTiling* tiling = tilings_->tiling_at(tiling_idx);
- std::vector<Tile*> tiles = tiling->AllTilesForTesting();
- for (size_t tile_idx = 0; tile_idx < tiles.size(); ++tile_idx) {
- Tile* tile = tiles[tile_idx];
+ std::vector<TileBundle*> bundles = tiling->AllTileBundlesForTesting();
+ for (size_t bundle_idx = 0; bundle_idx < bundles.size(); ++bundle_idx) {
+ TileBundle* bundle = bundles[bundle_idx];
TilePriority priority;
priority.resolution = HIGH_RESOLUTION;
priority.time_to_visible_in_seconds = 0.f;
priority.distance_to_visible_in_pixels = 0.f;
- tile->SetPriority(tree, priority);
+ bundle->SetPriority(tree, priority);
}
}
}
@@ -109,15 +109,22 @@ void FakePictureLayerImpl::SetAllTilesReadyInTiling(
}
}
-void FakePictureLayerImpl::CreateDefaultTilingsAndTiles() {
+void FakePictureLayerImpl::CreateDefaultTilingsAndTiles(WhichTree tree) {
layer_tree_impl()->UpdateDrawProperties();
if (CanHaveTilings()) {
DCHECK_EQ(tilings()->num_tilings(), 2u);
DCHECK_EQ(tilings()->tiling_at(0)->resolution(), HIGH_RESOLUTION);
DCHECK_EQ(tilings()->tiling_at(1)->resolution(), LOW_RESOLUTION);
- HighResTiling()->CreateAllTilesForTesting();
- LowResTiling()->CreateAllTilesForTesting();
+ if (tree == ACTIVE_TREE) {
+ DCHECK(layer_tree_impl()->IsActiveTree());
+ HighResTiling()->CreateTilesForTesting(ACTIVE_TREE);
+ LowResTiling()->CreateTilesForTesting(ACTIVE_TREE);
+ } else {
+ DCHECK(layer_tree_impl()->IsPendingTree());
+ HighResTiling()->CreateTilesForTesting(PENDING_TREE);
+ LowResTiling()->CreateTilesForTesting(PENDING_TREE);
+ }
} else {
DCHECK_EQ(tilings()->num_tilings(), 0u);
}
« no previous file with comments | « cc/test/fake_picture_layer_impl.h ('k') | cc/test/fake_picture_layer_tiling_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698