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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
116 | 116 |
117 // You might be made visible, but you're not being interacted with. | 117 // You might be made visible, but you're not being interacted with. |
118 ALLOW_ABSOLUTE_MINIMUM = 1, // Tall. | 118 ALLOW_ABSOLUTE_MINIMUM = 1, // Tall. |
119 | 119 |
120 // You're being interacted with, but we're low on memory. | 120 // You're being interacted with, but we're low on memory. |
121 ALLOW_PREPAINT_ONLY = 2, // Grande. | 121 ALLOW_PREPAINT_ONLY = 2, // Grande. |
122 | 122 |
123 // You're the only thing in town. Go crazy. | 123 // You're the only thing in town. Go crazy. |
124 ALLOW_ANYTHING = 3, // Venti. | 124 ALLOW_ANYTHING = 3, // Venti. |
125 | 125 |
126 NUM_TILE_MEMORY_LIMIT_POLICIES = 4, | 126 NUM_TILE_MEMORY_LIMIT_POLICIES = 4, |
reveman
2014/05/28 16:04:12
Remove this enum value
| |
127 | 127 |
128 // NOTE: Be sure to update TreePriorityAsValue and kBinPolicyMap when adding | 128 // NOTE: Be sure to update TreePriorityAsValue and kBinPolicyMap when adding |
129 // or reordering fields. | 129 // or reordering fields. |
reveman
2014/05/28 16:04:12
and update this comment.
| |
130 }; | 130 }; |
131 scoped_ptr<base::Value> TileMemoryLimitPolicyAsValue( | 131 scoped_ptr<base::Value> TileMemoryLimitPolicyAsValue( |
132 TileMemoryLimitPolicy policy); | 132 TileMemoryLimitPolicy policy); |
133 | 133 |
134 enum TreePriority { | 134 enum TreePriority { |
135 SAME_PRIORITY_FOR_BOTH_TREES, | 135 SAME_PRIORITY_FOR_BOTH_TREES, |
136 SMOOTHNESS_TAKES_PRIORITY, | 136 SMOOTHNESS_TAKES_PRIORITY, |
137 NEW_CONTENT_TAKES_PRIORITY | 137 NEW_CONTENT_TAKES_PRIORITY |
138 | 138 |
139 // Be sure to update TreePriorityAsValue when adding new fields. | 139 // Be sure to update TreePriorityAsValue when adding new fields. |
(...skipping 10 matching lines...) Expand all Loading... | |
150 tree_priority(SAME_PRIORITY_FOR_BOTH_TREES) {} | 150 tree_priority(SAME_PRIORITY_FOR_BOTH_TREES) {} |
151 | 151 |
152 TileMemoryLimitPolicy memory_limit_policy; | 152 TileMemoryLimitPolicy memory_limit_policy; |
153 | 153 |
154 size_t soft_memory_limit_in_bytes; | 154 size_t soft_memory_limit_in_bytes; |
155 size_t hard_memory_limit_in_bytes; | 155 size_t hard_memory_limit_in_bytes; |
156 size_t num_resources_limit; | 156 size_t num_resources_limit; |
157 | 157 |
158 TreePriority tree_priority; | 158 TreePriority tree_priority; |
159 | 159 |
160 bool operator==(const GlobalStateThatImpactsTilePriority& other) const { | |
161 return memory_limit_policy == other.memory_limit_policy && | |
162 soft_memory_limit_in_bytes == other.soft_memory_limit_in_bytes && | |
163 hard_memory_limit_in_bytes == other.hard_memory_limit_in_bytes && | |
164 num_resources_limit == other.num_resources_limit && | |
165 tree_priority == other.tree_priority; | |
166 } | |
167 bool operator!=(const GlobalStateThatImpactsTilePriority& other) const { | |
168 return !(*this == other); | |
169 } | |
170 | |
171 scoped_ptr<base::Value> AsValue() const; | 160 scoped_ptr<base::Value> AsValue() const; |
172 }; | 161 }; |
173 | 162 |
174 } // namespace cc | 163 } // namespace cc |
175 | 164 |
176 #endif // CC_RESOURCES_TILE_PRIORITY_H_ | 165 #endif // CC_RESOURCES_TILE_PRIORITY_H_ |
OLD | NEW |