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

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: 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..f2ec6579712867f924008e501c4cf14ceec92f77 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 no empty, use Top to do DCHECK the next iterator.
vmpstr 2014/12/15 17:33:31 nit: If not empty
USE eero AT chromium.org 2014/12/16 08:50:31 Done.
+ DCHECK(IsEmpty() || Top(tree_priority));
vmpstr 2014/12/15 17:33:31 nit: DCHECK_IMPLIES(!IsEmpty(), Top(tree_priority)
USE eero AT chromium.org 2014/12/16 08:50:31 Done.
}
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