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

Unified Diff: cc/resources/tile_manager_unittest.cc

Issue 651503004: cc: Bump up pending tree now tiles order for smoothness mode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update Created 6 years, 2 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/resources/tile_manager.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/tile_manager_unittest.cc
diff --git a/cc/resources/tile_manager_unittest.cc b/cc/resources/tile_manager_unittest.cc
index fb2c823a115bf060b53ac9a62dfd7c4b610983c2..46f2e146454fdd9a911e26c139ee90127125dc49 100644
--- a/cc/resources/tile_manager_unittest.cc
+++ b/cc/resources/tile_manager_unittest.cc
@@ -221,7 +221,7 @@ TEST_F(TileManagerTilePriorityQueueTest, RasterTilePriorityQueue) {
Tile* last_tile = NULL;
smoothness_tiles.clear();
tile_count = 0;
- size_t increasing_distance_tiles = 0u;
+ size_t correct_order_tiles = 0u;
// Here we expect to get increasing ACTIVE_TREE priority_bin.
queue.Reset();
host_impl_.BuildRasterQueue(&queue, SMOOTHNESS_TAKES_PRIORITY);
@@ -234,11 +234,19 @@ TEST_F(TileManagerTilePriorityQueueTest, RasterTilePriorityQueue) {
EXPECT_LE(last_tile->priority(ACTIVE_TREE).priority_bin,
tile->priority(ACTIVE_TREE).priority_bin);
+ bool skip_updating_last_tile = false;
if (last_tile->priority(ACTIVE_TREE).priority_bin ==
tile->priority(ACTIVE_TREE).priority_bin) {
- increasing_distance_tiles +=
+ correct_order_tiles +=
last_tile->priority(ACTIVE_TREE).distance_to_visible <=
tile->priority(ACTIVE_TREE).distance_to_visible;
+ } else if (tile->priority(ACTIVE_TREE).priority_bin ==
+ TilePriority::EVENTUALLY &&
+ tile->priority(PENDING_TREE).priority_bin == TilePriority::NOW) {
+ // Since we'd return pending tree now tiles before the eventually tiles on
+ // the active tree, update the value.
+ ++correct_order_tiles;
+ skip_updating_last_tile = true;
}
if (tile->priority(ACTIVE_TREE).priority_bin == TilePriority::NOW &&
@@ -248,7 +256,8 @@ TEST_F(TileManagerTilePriorityQueueTest, RasterTilePriorityQueue) {
EXPECT_EQ(LOW_RESOLUTION, last_tile->priority(ACTIVE_TREE).resolution);
}
- last_tile = tile;
+ if (!skip_updating_last_tile)
+ last_tile = tile;
++tile_count;
smoothness_tiles.insert(tile);
queue.Pop();
@@ -258,11 +267,11 @@ TEST_F(TileManagerTilePriorityQueueTest, RasterTilePriorityQueue) {
EXPECT_EQ(all_tiles, smoothness_tiles);
// Since we don't guarantee increasing distance due to spiral iterator, we
// should check that we're _mostly_ right.
- EXPECT_GT(increasing_distance_tiles, 3 * tile_count / 4);
+ EXPECT_GT(correct_order_tiles, 3 * tile_count / 4);
std::set<Tile*> new_content_tiles;
last_tile = NULL;
- increasing_distance_tiles = 0u;
+ size_t increasing_distance_tiles = 0u;
// Here we expect to get increasing PENDING_TREE priority_bin.
queue.Reset();
host_impl_.BuildRasterQueue(&queue, NEW_CONTENT_TAKES_PRIORITY);
« no previous file with comments | « cc/resources/tile_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698