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

Unified Diff: cc/resources/picture_layer_tiling.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: Rebase 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
« no previous file with comments | « cc/layers/picture_layer_impl_unittest.cc ('k') | cc/resources/tile.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/picture_layer_tiling.cc
diff --git a/cc/resources/picture_layer_tiling.cc b/cc/resources/picture_layer_tiling.cc
index 3076489afa00049a33c0b7804b502ff0775249b7..a3b154bc50ed97aeab1fb24b80d899d8bd5c8d5c 100644
--- a/cc/resources/picture_layer_tiling.cc
+++ b/cc/resources/picture_layer_tiling.cc
@@ -35,11 +35,23 @@ class TileEvictionOrder {
const TilePriority& b_priority =
b->priority_for_tree_priority(tree_priority_);
- if (a_priority.priority_bin == b_priority.priority_bin &&
- a->required_for_activation() != b->required_for_activation()) {
+ // Evict a before b if their priority bins differ and a has the higher
+ // priority bin.
+ if (a_priority.priority_bin != b_priority.priority_bin)
+ return a_priority.priority_bin > b_priority.priority_bin;
+
+ // Or if a is not required and b is required.
+ if (a->required_for_activation() != b->required_for_activation())
return b->required_for_activation();
- }
- return b_priority.IsHigherPriorityThan(a_priority);
+
+ // Or if a is occluded and b is unoccluded.
+ bool a_is_occluded = a->is_occluded_for_tree_priority(tree_priority_);
+ bool b_is_occluded = b->is_occluded_for_tree_priority(tree_priority_);
+ if (a_is_occluded != b_is_occluded)
+ return a_is_occluded;
+
+ // Or if a is farther away from visible.
+ return a_priority.distance_to_visible > b_priority.distance_to_visible;
}
private:
« no previous file with comments | « cc/layers/picture_layer_impl_unittest.cc ('k') | cc/resources/tile.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698