| 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 #ifndef CC_RESOURCES_TILE_PRIORITY_H_ | 5 #ifndef CC_RESOURCES_TILE_PRIORITY_H_ |
| 6 #define CC_RESOURCES_TILE_PRIORITY_H_ | 6 #define CC_RESOURCES_TILE_PRIORITY_H_ |
| 7 | 7 |
| 8 #include <algorithm> | 8 #include <algorithm> |
| 9 #include <limits> | 9 #include <limits> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 // Be sure to update TreePriorityAsValue when adding new fields. | 122 // Be sure to update TreePriorityAsValue when adding new fields. |
| 123 }; | 123 }; |
| 124 std::string TreePriorityToString(TreePriority prio); | 124 std::string TreePriorityToString(TreePriority prio); |
| 125 | 125 |
| 126 class GlobalStateThatImpactsTilePriority { | 126 class GlobalStateThatImpactsTilePriority { |
| 127 public: | 127 public: |
| 128 GlobalStateThatImpactsTilePriority() | 128 GlobalStateThatImpactsTilePriority() |
| 129 : memory_limit_policy(ALLOW_NOTHING), | 129 : memory_limit_policy(ALLOW_NOTHING), |
| 130 soft_memory_limit_in_bytes(0), | 130 soft_memory_limit_in_bytes(0), |
| 131 hard_memory_limit_in_bytes(0), | 131 hard_memory_limit_in_bytes(0), |
| 132 num_resources_limit(0), | |
| 133 tree_priority(SAME_PRIORITY_FOR_BOTH_TREES) {} | 132 tree_priority(SAME_PRIORITY_FOR_BOTH_TREES) {} |
| 134 | 133 |
| 135 TileMemoryLimitPolicy memory_limit_policy; | 134 TileMemoryLimitPolicy memory_limit_policy; |
| 136 | 135 |
| 137 size_t soft_memory_limit_in_bytes; | 136 size_t soft_memory_limit_in_bytes; |
| 138 size_t hard_memory_limit_in_bytes; | 137 size_t hard_memory_limit_in_bytes; |
| 139 size_t num_resources_limit; | |
| 140 | 138 |
| 141 TreePriority tree_priority; | 139 TreePriority tree_priority; |
| 142 | 140 |
| 143 bool operator==(const GlobalStateThatImpactsTilePriority& other) const { | 141 bool operator==(const GlobalStateThatImpactsTilePriority& other) const { |
| 144 return memory_limit_policy == other.memory_limit_policy && | 142 return memory_limit_policy == other.memory_limit_policy && |
| 145 soft_memory_limit_in_bytes == other.soft_memory_limit_in_bytes && | 143 soft_memory_limit_in_bytes == other.soft_memory_limit_in_bytes && |
| 146 hard_memory_limit_in_bytes == other.hard_memory_limit_in_bytes && | 144 hard_memory_limit_in_bytes == other.hard_memory_limit_in_bytes && |
| 147 num_resources_limit == other.num_resources_limit && | |
| 148 tree_priority == other.tree_priority; | 145 tree_priority == other.tree_priority; |
| 149 } | 146 } |
| 150 bool operator!=(const GlobalStateThatImpactsTilePriority& other) const { | 147 bool operator!=(const GlobalStateThatImpactsTilePriority& other) const { |
| 151 return !(*this == other); | 148 return !(*this == other); |
| 152 } | 149 } |
| 153 | 150 |
| 154 void AsValueInto(base::debug::TracedValue* dict) const; | 151 void AsValueInto(base::debug::TracedValue* dict) const; |
| 155 }; | 152 }; |
| 156 | 153 |
| 157 } // namespace cc | 154 } // namespace cc |
| 158 | 155 |
| 159 #endif // CC_RESOURCES_TILE_PRIORITY_H_ | 156 #endif // CC_RESOURCES_TILE_PRIORITY_H_ |
| OLD | NEW |