diff options
author | vmpstr@chromium.org <vmpstr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-06-03 22:06:53 +0000 |
---|---|---|
committer | vmpstr@chromium.org <vmpstr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-06-03 22:06:53 +0000 |
commit | 8ae929ac42af497d1ed09eeea7f0487eeb36357f (patch) | |
tree | 4ad1d03d1e4afe8485bc7fdd154c20abe9ee9320 /cc/resources | |
parent | 356b52022f2fa7b9cd9080028ce28bba8c662aa6 (diff) | |
download | chromium_src-8ae929ac42af497d1ed09eeea7f0487eeb36357f.zip chromium_src-8ae929ac42af497d1ed09eeea7f0487eeb36357f.tar.gz chromium_src-8ae929ac42af497d1ed09eeea7f0487eeb36357f.tar.bz2 |
cc: Fix a bug in tile manager raster tile iterator.
We should only use the resolution to break ties if the actual priority
bin of the tiles is the same. Otherwise, the bin has to take priority.
This patch ensures this happens.
TBR=reveman
Review URL: https://codereview.chromium.org/311893004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@274646 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/resources')
-rw-r--r-- | cc/resources/tile_manager.cc | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/cc/resources/tile_manager.cc b/cc/resources/tile_manager.cc index d8578e7..4a4cfea 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); |