| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "cc/resources/tile_manager.h" | 5 #include "cc/resources/tile_manager.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <limits> | 8 #include <limits> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 1428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1439 | 1439 |
| 1440 Tile* a_tile = **a_pair.first; | 1440 Tile* a_tile = **a_pair.first; |
| 1441 Tile* b_tile = **b_pair.first; | 1441 Tile* b_tile = **b_pair.first; |
| 1442 | 1442 |
| 1443 const TilePriority& a_priority = | 1443 const TilePriority& a_priority = |
| 1444 a_tile->priority_for_tree_priority(tree_priority_); | 1444 a_tile->priority_for_tree_priority(tree_priority_); |
| 1445 const TilePriority& b_priority = | 1445 const TilePriority& b_priority = |
| 1446 b_tile->priority_for_tree_priority(tree_priority_); | 1446 b_tile->priority_for_tree_priority(tree_priority_); |
| 1447 bool prioritize_low_res = tree_priority_ == SMOOTHNESS_TAKES_PRIORITY; | 1447 bool prioritize_low_res = tree_priority_ == SMOOTHNESS_TAKES_PRIORITY; |
| 1448 | 1448 |
| 1449 if (b_priority.resolution != a_priority.resolution) { | 1449 // Now we have to return true iff b is higher priority than a. |
| 1450 return (prioritize_low_res && b_priority.resolution == LOW_RESOLUTION) || | 1450 |
| 1451 (!prioritize_low_res && b_priority.resolution == HIGH_RESOLUTION) || | 1451 // If the bin is the same but the resolution is not, then the order will be |
| 1452 (a_priority.resolution == NON_IDEAL_RESOLUTION); | 1452 // determined by whether we prioritize low res or not. |
| 1453 if (b_priority.priority_bin == a_priority.priority_bin && |
| 1454 b_priority.resolution != a_priority.resolution) { |
| 1455 // Non ideal resolution should be sorted lower than other resolutions. |
| 1456 if (a_priority.resolution == NON_IDEAL_RESOLUTION) |
| 1457 return true; |
| 1458 |
| 1459 if (b_priority.resolution == NON_IDEAL_RESOLUTION) |
| 1460 return false; |
| 1461 |
| 1462 if (prioritize_low_res) |
| 1463 return b_priority.resolution == LOW_RESOLUTION; |
| 1464 |
| 1465 return b_priority.resolution == HIGH_RESOLUTION; |
| 1453 } | 1466 } |
| 1454 | 1467 |
| 1455 return b_priority.IsHigherPriorityThan(a_priority); | 1468 return b_priority.IsHigherPriorityThan(a_priority); |
| 1456 } | 1469 } |
| 1457 | 1470 |
| 1458 TileManager::EvictionTileIterator::EvictionTileIterator() | 1471 TileManager::EvictionTileIterator::EvictionTileIterator() |
| 1459 : comparator_(SAME_PRIORITY_FOR_BOTH_TREES) {} | 1472 : comparator_(SAME_PRIORITY_FOR_BOTH_TREES) {} |
| 1460 | 1473 |
| 1461 TileManager::EvictionTileIterator::EvictionTileIterator( | 1474 TileManager::EvictionTileIterator::EvictionTileIterator( |
| 1462 TileManager* tile_manager, | 1475 TileManager* tile_manager, |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1640 TRACE_EVENT0("cc", "TileManager::CheckIfReadyToActivate"); | 1653 TRACE_EVENT0("cc", "TileManager::CheckIfReadyToActivate"); |
| 1641 | 1654 |
| 1642 rasterizer_->CheckForCompletedTasks(); | 1655 rasterizer_->CheckForCompletedTasks(); |
| 1643 did_check_for_completed_tasks_since_last_schedule_tasks_ = true; | 1656 did_check_for_completed_tasks_since_last_schedule_tasks_ = true; |
| 1644 | 1657 |
| 1645 if (IsReadyToActivate()) | 1658 if (IsReadyToActivate()) |
| 1646 client_->NotifyReadyToActivate(); | 1659 client_->NotifyReadyToActivate(); |
| 1647 } | 1660 } |
| 1648 | 1661 |
| 1649 } // namespace cc | 1662 } // namespace cc |
| OLD | NEW |