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

Unified Diff: cc/resources/tile_manager.cc

Issue 377793003: Consider occluded tiles during eviction with occluded as Tile property. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add TileManager unit test Created 6 years, 5 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
Index: cc/resources/tile_manager.cc
diff --git a/cc/resources/tile_manager.cc b/cc/resources/tile_manager.cc
index d508f6a0a17a5639290949fb9cf083eb4ffb6e10..52e25ff6f819c5599d710bb7cbb9daf8559eb418 100644
--- a/cc/resources/tile_manager.cc
+++ b/cc/resources/tile_manager.cc
@@ -1533,12 +1533,16 @@ bool TileManager::EvictionTileIterator::EvictionOrderComparator::operator()(
// Now we have to return true iff b is lower priority than a.
- // If the bin is the same but the resolution is not, then the order will be
- // determined by whether we prioritize low res or not.
+ // If the priority bin differs, b is lower priority if it has the higher
+ // priority bin.
+ if (a_priority.priority_bin != b_priority.priority_bin)
+ return b_priority.priority_bin > a_priority.priority_bin;
+
+ // Otherwise if the resolution differs, then the order will be determined by
+ // whether we prioritize low res or not.
// TODO(vmpstr): Remove this when TilePriority is no longer a member of Tile
// class but instead produced by the iterators.
- if (b_priority.priority_bin == a_priority.priority_bin &&
- b_priority.resolution != a_priority.resolution) {
+ if (b_priority.resolution != a_priority.resolution) {
// Non ideal resolution should be sorted higher than other resolutions.
if (a_priority.resolution == NON_IDEAL_RESOLUTION)
return false;
@@ -1551,7 +1555,16 @@ bool TileManager::EvictionTileIterator::EvictionOrderComparator::operator()(
return a_priority.resolution == HIGH_RESOLUTION;
}
- return a_priority.IsHigherPriorityThan(b_priority);
+
+ // Otherwise if the occlusion differs, b is lower priority if it is occluded.
+ bool a_is_occluded = a_tile->is_occluded_for_tree_priority(tree_priority_);
+ bool b_is_occluded = b_tile->is_occluded_for_tree_priority(tree_priority_);
+
danakj 2014/07/15 21:26:51 nit: drop extra whitespace
jbedley 2014/07/16 16:09:31 Done.
+ if (a_is_occluded != b_is_occluded)
+ return b_is_occluded;
+
+ // b is lower priorty if it is farther from visible.
+ return b_priority.distance_to_visible > a_priority.distance_to_visible;
}
void TileManager::SetRasterizerForTesting(Rasterizer* rasterizer) {

Powered by Google App Engine
This is Rietveld 408576698