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

Unified Diff: cc/resources/eviction_tile_priority_queue.cc

Issue 798973002: cc: Optimise shared tile handling in eviction tile priority queue. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Minor polish 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/resources/eviction_tile_priority_queue.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/eviction_tile_priority_queue.cc
diff --git a/cc/resources/eviction_tile_priority_queue.cc b/cc/resources/eviction_tile_priority_queue.cc
index cd681ef1455c5413cc70ccec013ecbcd5bc7ba98..fee074a50da8790bd3104d37106ada61fdb821af 100644
--- a/cc/resources/eviction_tile_priority_queue.cc
+++ b/cc/resources/eviction_tile_priority_queue.cc
@@ -152,9 +152,7 @@ Tile* EvictionTilePriorityQueue::PairedTilingSetQueue::Top(
DCHECK(next_queue && !next_queue->IsEmpty());
Tile* tile = next_queue->Top();
- DCHECK(std::find(returned_shared_tiles.begin(),
- returned_shared_tiles.end(),
- tile) == returned_shared_tiles.end());
+ DCHECK(returned_tiles_for_debug.find(tile) == returned_tiles_for_debug.end());
return tile;
}
@@ -166,25 +164,11 @@ void EvictionTilePriorityQueue::PairedTilingSetQueue::Pop(
TilingSetEvictionQueue* next_queue =
next_tree == ACTIVE_TREE ? active_queue.get() : pending_queue.get();
DCHECK(next_queue && !next_queue->IsEmpty());
- returned_shared_tiles.push_back(next_queue->Top());
+ DCHECK(returned_tiles_for_debug.insert(next_queue->Top()).second);
next_queue->Pop();
- if (IsEmpty())
- return;
-
- next_tree = NextTileIteratorTree(tree_priority);
- next_queue =
- next_tree == ACTIVE_TREE ? active_queue.get() : pending_queue.get();
- while (std::find(returned_shared_tiles.begin(),
- returned_shared_tiles.end(),
- next_queue->Top()) != returned_shared_tiles.end()) {
- next_queue->Pop();
- if (IsEmpty())
- break;
- next_tree = NextTileIteratorTree(tree_priority);
- next_queue =
- next_tree == ACTIVE_TREE ? active_queue.get() : pending_queue.get();
- }
+ // If not empty, use Top to DCHECK the next iterator.
+ DCHECK_IMPLIES(!IsEmpty(), Top(tree_priority));
}
WhichTree
« no previous file with comments | « cc/resources/eviction_tile_priority_queue.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698