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

Unified Diff: cc/resources/tile_manager.cc

Issue 311893004: cc: Fix a bug in tile manager raster tile iterator. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/tile_manager.cc
diff --git a/cc/resources/tile_manager.cc b/cc/resources/tile_manager.cc
index d8578e727f76489039e12c37cd10e74b84d5f189..4a4cfeaf27e340f9680c2260e4bdc4b92bb0aeb3 100644
--- a/cc/resources/tile_manager.cc
+++ b/cc/resources/tile_manager.cc
@@ -1446,10 +1446,23 @@ bool TileManager::RasterTileIterator::RasterOrderComparator::operator()(
b_tile->priority_for_tree_priority(tree_priority_);
bool prioritize_low_res = tree_priority_ == SMOOTHNESS_TAKES_PRIORITY;
- if (b_priority.resolution != a_priority.resolution) {
- return (prioritize_low_res && b_priority.resolution == LOW_RESOLUTION) ||
- (!prioritize_low_res && b_priority.resolution == HIGH_RESOLUTION) ||
- (a_priority.resolution == NON_IDEAL_RESOLUTION);
+ // Now we have to return true iff b is higher 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 (b_priority.priority_bin == a_priority.priority_bin &&
+ b_priority.resolution != a_priority.resolution) {
+ // Non ideal resolution should be sorted lower than other resolutions.
+ if (a_priority.resolution == NON_IDEAL_RESOLUTION)
+ return true;
+
+ if (b_priority.resolution == NON_IDEAL_RESOLUTION)
+ return false;
+
+ if (prioritize_low_res)
+ return b_priority.resolution == LOW_RESOLUTION;
+
+ return b_priority.resolution == HIGH_RESOLUTION;
}
return b_priority.IsHigherPriorityThan(a_priority);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698