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 4d6698745897caaa320a0584b2e8a4bae120ccac..cd681ef1455c5413cc70ccec013ecbcd5bc7ba98 100644 |
--- a/cc/resources/eviction_tile_priority_queue.cc |
+++ b/cc/resources/eviction_tile_priority_queue.cc |
@@ -200,6 +200,8 @@ EvictionTilePriorityQueue::PairedTilingSetQueue::NextTileIteratorTree( |
const Tile* active_tile = active_queue->Top(); |
const Tile* pending_tile = pending_queue->Top(); |
+ |
+ // If tiles are the same, it doesn't matter which tree we return. |
if (active_tile == pending_tile) |
return ACTIVE_TREE; |
@@ -208,6 +210,15 @@ EvictionTilePriorityQueue::PairedTilingSetQueue::NextTileIteratorTree( |
const TilePriority& pending_priority = |
pending_tile->priority_for_tree_priority(tree_priority); |
+ // If the bins are the same and activation differs, then return the tree of |
+ // the tile not required for activation. |
+ if (active_priority.priority_bin == pending_priority.priority_bin && |
+ active_tile->required_for_activation() != |
+ pending_tile->required_for_activation()) { |
+ return active_tile->required_for_activation() ? PENDING_TREE : ACTIVE_TREE; |
+ } |
+ |
+ // Return tile with a lower priority. |
if (pending_priority.IsHigherPriorityThan(active_priority)) |
return ACTIVE_TREE; |
return PENDING_TREE; |