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

Side by Side Diff: cc/resources/tile_manager_unittest.cc

Issue 793693003: Tile Compression (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 unified diff | Download patch
« no previous file with comments | « cc/resources/tile_manager.cc ('k') | cc/resources/tile_task_worker_pool.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/resources/eviction_tile_priority_queue.h" 5 #include "cc/resources/eviction_tile_priority_queue.h"
6 #include "cc/resources/raster_tile_priority_queue.h" 6 #include "cc/resources/raster_tile_priority_queue.h"
7 #include "cc/resources/tile.h" 7 #include "cc/resources/tile.h"
8 #include "cc/resources/tile_priority.h" 8 #include "cc/resources/tile_priority.h"
9 #include "cc/test/fake_impl_proxy.h" 9 #include "cc/test/fake_impl_proxy.h"
10 #include "cc/test/fake_layer_tree_host_impl.h" 10 #include "cc/test/fake_layer_tree_host_impl.h"
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 queue.Pop(); 189 queue.Pop();
190 } 190 }
191 EXPECT_EQ(all_tiles, smoothness_tiles); 191 EXPECT_EQ(all_tiles, smoothness_tiles);
192 EXPECT_TRUE(had_low_res); 192 EXPECT_TRUE(had_low_res);
193 193
194 Region invalidation(gfx::Rect(0, 0, 500, 500)); 194 Region invalidation(gfx::Rect(0, 0, 500, 500));
195 195
196 // Invalidate the pending tree. 196 // Invalidate the pending tree.
197 pending_layer_->set_invalidation(invalidation); 197 pending_layer_->set_invalidation(invalidation);
198 pending_layer_->HighResTiling()->UpdateTilesToCurrentRasterSource( 198 pending_layer_->HighResTiling()->UpdateTilesToCurrentRasterSource(
199 pending_layer_->raster_source(), invalidation, gfx::Size(1000, 1000)); 199 pending_layer_->raster_source(), invalidation, gfx::Size(1000, 1000),
200 base::TimeTicks());
200 pending_layer_->LowResTiling()->UpdateTilesToCurrentRasterSource( 201 pending_layer_->LowResTiling()->UpdateTilesToCurrentRasterSource(
201 pending_layer_->raster_source(), invalidation, gfx::Size(1000, 1000)); 202 pending_layer_->raster_source(), invalidation, gfx::Size(1000, 1000),
203 base::TimeTicks());
202 204
203 active_layer_->ResetAllTilesPriorities(); 205 active_layer_->ResetAllTilesPriorities();
204 pending_layer_->ResetAllTilesPriorities(); 206 pending_layer_->ResetAllTilesPriorities();
205 207
206 // Renew all of the tile priorities. 208 // Renew all of the tile priorities.
207 gfx::Rect viewport(50, 50, 100, 100); 209 gfx::Rect viewport(50, 50, 100, 100);
208 pending_layer_->HighResTiling()->ComputeTilePriorityRects(viewport, 1.0f, 1.0, 210 pending_layer_->HighResTiling()->ComputeTilePriorityRects(viewport, 1.0f, 1.0,
209 Occlusion()); 211 Occlusion());
210 pending_layer_->LowResTiling()->ComputeTilePriorityRects(viewport, 1.0f, 1.0, 212 pending_layer_->LowResTiling()->ComputeTilePriorityRects(viewport, 1.0f, 1.0,
211 Occlusion()); 213 Occlusion());
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
439 EXPECT_EQ(all_tiles, smoothness_tiles); 441 EXPECT_EQ(all_tiles, smoothness_tiles);
440 442
441 tile_manager()->ReleaseTileResourcesForTesting( 443 tile_manager()->ReleaseTileResourcesForTesting(
442 std::vector<Tile*>(all_tiles.begin(), all_tiles.end())); 444 std::vector<Tile*>(all_tiles.begin(), all_tiles.end()));
443 445
444 Region invalidation(gfx::Rect(0, 0, 500, 500)); 446 Region invalidation(gfx::Rect(0, 0, 500, 500));
445 447
446 // Invalidate the pending tree. 448 // Invalidate the pending tree.
447 pending_layer_->set_invalidation(invalidation); 449 pending_layer_->set_invalidation(invalidation);
448 pending_layer_->HighResTiling()->UpdateTilesToCurrentRasterSource( 450 pending_layer_->HighResTiling()->UpdateTilesToCurrentRasterSource(
449 pending_layer_->raster_source(), invalidation, gfx::Size(1000, 1000)); 451 pending_layer_->raster_source(), invalidation, gfx::Size(1000, 1000),
452 base::TimeTicks());
450 pending_layer_->LowResTiling()->UpdateTilesToCurrentRasterSource( 453 pending_layer_->LowResTiling()->UpdateTilesToCurrentRasterSource(
451 pending_layer_->raster_source(), invalidation, gfx::Size(1000, 1000)); 454 pending_layer_->raster_source(), invalidation, gfx::Size(1000, 1000),
455 base::TimeTicks());
452 456
453 active_layer_->ResetAllTilesPriorities(); 457 active_layer_->ResetAllTilesPriorities();
454 pending_layer_->ResetAllTilesPriorities(); 458 pending_layer_->ResetAllTilesPriorities();
455 459
456 // Renew all of the tile priorities. 460 // Renew all of the tile priorities.
457 gfx::Rect viewport(50, 50, 100, 100); 461 gfx::Rect viewport(50, 50, 100, 100);
458 pending_layer_->HighResTiling()->ComputeTilePriorityRects(viewport, 1.0f, 1.0, 462 pending_layer_->HighResTiling()->ComputeTilePriorityRects(viewport, 1.0f, 1.0,
459 Occlusion()); 463 Occlusion());
460 pending_layer_->LowResTiling()->ComputeTilePriorityRects(viewport, 1.0f, 1.0, 464 pending_layer_->LowResTiling()->ComputeTilePriorityRects(viewport, 1.0f, 1.0,
461 Occlusion()); 465 Occlusion());
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after
868 all_tiles.insert(queue.Top()); 872 all_tiles.insert(queue.Top());
869 ++tile_count; 873 ++tile_count;
870 queue.Pop(); 874 queue.Pop();
871 } 875 }
872 EXPECT_EQ(tile_count, all_tiles.size()); 876 EXPECT_EQ(tile_count, all_tiles.size());
873 EXPECT_EQ(16u, tile_count); 877 EXPECT_EQ(16u, tile_count);
874 } 878 }
875 879
876 } // namespace 880 } // namespace
877 } // namespace cc 881 } // namespace cc
OLDNEW
« no previous file with comments | « cc/resources/tile_manager.cc ('k') | cc/resources/tile_task_worker_pool.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698