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

Unified Diff: cc/resources/raster_tile_priority_queue.cc

Issue 670183003: Update from chromium 62675d9fb31fb8cedc40f68e78e8445a74f362e7 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 2 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/resources/priority_calculator.cc ('k') | cc/resources/resource.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/raster_tile_priority_queue.cc
diff --git a/cc/resources/raster_tile_priority_queue.cc b/cc/resources/raster_tile_priority_queue.cc
index daf4567a9b8178fe78d9372ef8a9f1c80229b1e5..667d54d89c1efffb6fbab4ffa1059443559aae42 100644
--- a/cc/resources/raster_tile_priority_queue.cc
+++ b/cc/resources/raster_tile_priority_queue.cc
@@ -17,7 +17,7 @@ class RasterOrderComparator {
const RasterTilePriorityQueue::PairedPictureLayerQueue* a,
const RasterTilePriorityQueue::PairedPictureLayerQueue* b) const {
// Note that in this function, we have to return true if and only if
- // b is strictly lower priority than a. Note that for the sake of
+ // a is strictly lower priority than b. Note that for the sake of
// completeness, empty queue is considered to have lowest priority.
if (a->IsEmpty() || b->IsEmpty())
return b->IsEmpty() < a->IsEmpty();
@@ -39,6 +39,22 @@ class RasterOrderComparator {
b_tile->priority_for_tree_priority(tree_priority_);
bool prioritize_low_res = tree_priority_ == SMOOTHNESS_TAKES_PRIORITY;
+ // In smoothness mode, we should return pending NOW tiles before active
+ // EVENTUALLY tiles. So if both priorities here are eventually, we need to
+ // check the pending priority.
+ if (prioritize_low_res &&
+ a_priority.priority_bin == TilePriority::EVENTUALLY &&
+ b_priority.priority_bin == TilePriority::EVENTUALLY) {
+ bool a_is_pending_now =
+ a_tile->priority(PENDING_TREE).priority_bin == TilePriority::NOW;
+ bool b_is_pending_now =
+ b_tile->priority(PENDING_TREE).priority_bin == TilePriority::NOW;
+ if (a_is_pending_now || b_is_pending_now)
+ return a_is_pending_now < b_is_pending_now;
+
+ // In case neither one is pending now, fall through.
+ }
+
// 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.
// TODO(vmpstr): Remove this when TilePriority is no longer a member of Tile
@@ -56,6 +72,7 @@ class RasterOrderComparator {
return b_priority.resolution == LOW_RESOLUTION;
return b_priority.resolution == HIGH_RESOLUTION;
}
+
return b_priority.IsHigherPriorityThan(a_priority);
}
« no previous file with comments | « cc/resources/priority_calculator.cc ('k') | cc/resources/resource.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698