Chromium Code Reviews| 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 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 523 MemoryUsage* usage) { | 523 MemoryUsage* usage) { |
| 524 while (usage->Exceeds(limit)) { | 524 while (usage->Exceeds(limit)) { |
| 525 if (!eviction_priority_queue) { | 525 if (!eviction_priority_queue) { |
| 526 eviction_priority_queue = | 526 eviction_priority_queue = |
| 527 client_->BuildEvictionQueue(global_state_.tree_priority); | 527 client_->BuildEvictionQueue(global_state_.tree_priority); |
| 528 } | 528 } |
| 529 if (eviction_priority_queue->IsEmpty()) | 529 if (eviction_priority_queue->IsEmpty()) |
| 530 break; | 530 break; |
| 531 | 531 |
| 532 Tile* tile = eviction_priority_queue->Top(); | 532 Tile* tile = eviction_priority_queue->Top(); |
| 533 if (!other_priority.IsHigherPriorityThan(tile->combined_priority())) | 533 const TilePriority& current_priority = tile->combined_priority(); |
| 534 if (!tile->is_occluded_combined() && | |
| 535 (current_priority.resolution != NON_IDEAL_RESOLUTION) && | |
|
vmiura
2015/02/12 22:18:41
What are the implications of these additional chec
vmpstr
2015/02/12 23:38:19
This is just making us be able to have more memory
| |
| 536 !other_priority.IsHigherPriorityThan(tile->combined_priority())) { | |
| 534 break; | 537 break; |
| 538 } | |
| 535 | 539 |
| 536 *usage -= MemoryUsage::FromTile(tile); | 540 *usage -= MemoryUsage::FromTile(tile); |
| 537 FreeResourcesForTileAndNotifyClientIfTileWasReadyToDraw(tile); | 541 FreeResourcesForTileAndNotifyClientIfTileWasReadyToDraw(tile); |
| 538 eviction_priority_queue->Pop(); | 542 eviction_priority_queue->Pop(); |
| 539 } | 543 } |
| 540 return eviction_priority_queue; | 544 return eviction_priority_queue; |
| 541 } | 545 } |
| 542 | 546 |
| 543 bool TileManager::TilePriorityViolatesMemoryPolicy( | 547 bool TileManager::TilePriorityViolatesMemoryPolicy( |
| 544 const TilePriority& priority) { | 548 const TilePriority& priority) { |
| (...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1049 result -= other; | 1053 result -= other; |
| 1050 return result; | 1054 return result; |
| 1051 } | 1055 } |
| 1052 | 1056 |
| 1053 bool TileManager::MemoryUsage::Exceeds(const MemoryUsage& limit) const { | 1057 bool TileManager::MemoryUsage::Exceeds(const MemoryUsage& limit) const { |
| 1054 return memory_bytes_ > limit.memory_bytes_ || | 1058 return memory_bytes_ > limit.memory_bytes_ || |
| 1055 resource_count_ > limit.resource_count_; | 1059 resource_count_ > limit.resource_count_; |
| 1056 } | 1060 } |
| 1057 | 1061 |
| 1058 } // namespace cc | 1062 } // namespace cc |
| OLD | NEW |