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 | 10 |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 // Be sure to update TreePriorityAsValue when adding new fields. | 139 // Be sure to update TreePriorityAsValue when adding new fields. |
140 }; | 140 }; |
141 scoped_ptr<base::Value> TreePriorityAsValue(TreePriority prio); | 141 scoped_ptr<base::Value> TreePriorityAsValue(TreePriority prio); |
142 | 142 |
143 class GlobalStateThatImpactsTilePriority { | 143 class GlobalStateThatImpactsTilePriority { |
144 public: | 144 public: |
145 GlobalStateThatImpactsTilePriority() | 145 GlobalStateThatImpactsTilePriority() |
146 : memory_limit_policy(ALLOW_NOTHING), | 146 : memory_limit_policy(ALLOW_NOTHING), |
147 soft_memory_limit_in_bytes(0), | 147 soft_memory_limit_in_bytes(0), |
148 hard_memory_limit_in_bytes(0), | 148 hard_memory_limit_in_bytes(0), |
149 unused_memory_limit_in_bytes(0), | |
150 num_resources_limit(0), | 149 num_resources_limit(0), |
151 tree_priority(SAME_PRIORITY_FOR_BOTH_TREES) {} | 150 tree_priority(SAME_PRIORITY_FOR_BOTH_TREES) {} |
152 | 151 |
153 TileMemoryLimitPolicy memory_limit_policy; | 152 TileMemoryLimitPolicy memory_limit_policy; |
154 | 153 |
155 size_t soft_memory_limit_in_bytes; | 154 size_t soft_memory_limit_in_bytes; |
156 size_t hard_memory_limit_in_bytes; | 155 size_t hard_memory_limit_in_bytes; |
157 size_t unused_memory_limit_in_bytes; | |
158 size_t num_resources_limit; | 156 size_t num_resources_limit; |
159 | 157 |
160 TreePriority tree_priority; | 158 TreePriority tree_priority; |
161 | 159 |
162 bool operator==(const GlobalStateThatImpactsTilePriority& other) const { | 160 bool operator==(const GlobalStateThatImpactsTilePriority& other) const { |
163 return memory_limit_policy == other.memory_limit_policy && | 161 return memory_limit_policy == other.memory_limit_policy && |
164 soft_memory_limit_in_bytes == other.soft_memory_limit_in_bytes && | 162 soft_memory_limit_in_bytes == other.soft_memory_limit_in_bytes && |
165 hard_memory_limit_in_bytes == other.hard_memory_limit_in_bytes && | 163 hard_memory_limit_in_bytes == other.hard_memory_limit_in_bytes && |
166 unused_memory_limit_in_bytes == other.unused_memory_limit_in_bytes && | |
167 num_resources_limit == other.num_resources_limit && | 164 num_resources_limit == other.num_resources_limit && |
168 tree_priority == other.tree_priority; | 165 tree_priority == other.tree_priority; |
169 } | 166 } |
170 bool operator!=(const GlobalStateThatImpactsTilePriority& other) const { | 167 bool operator!=(const GlobalStateThatImpactsTilePriority& other) const { |
171 return !(*this == other); | 168 return !(*this == other); |
172 } | 169 } |
173 | 170 |
174 scoped_ptr<base::Value> AsValue() const; | 171 scoped_ptr<base::Value> AsValue() const; |
175 }; | 172 }; |
176 | 173 |
177 } // namespace cc | 174 } // namespace cc |
178 | 175 |
179 #endif // CC_RESOURCES_TILE_PRIORITY_H_ | 176 #endif // CC_RESOURCES_TILE_PRIORITY_H_ |
OLD | NEW |