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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 priority_bin == other.priority_bin && | 90 priority_bin == other.priority_bin && |
91 distance_to_visible == other.distance_to_visible && | 91 distance_to_visible == other.distance_to_visible && |
92 required_for_activation == other.required_for_activation; | 92 required_for_activation == other.required_for_activation; |
93 } | 93 } |
94 | 94 |
95 bool operator !=(const TilePriority& other) const { | 95 bool operator !=(const TilePriority& other) const { |
96 return !(*this == other); | 96 return !(*this == other); |
97 } | 97 } |
98 | 98 |
99 bool IsHigherPriorityThan(const TilePriority& other) const { | 99 bool IsHigherPriorityThan(const TilePriority& other) const { |
100 return priority_bin > other.priority_bin || | 100 return priority_bin < other.priority_bin || |
101 (priority_bin == other.priority_bin && | 101 (priority_bin == other.priority_bin && |
102 distance_to_visible > other.distance_to_visible); | 102 distance_to_visible < other.distance_to_visible); |
103 } | 103 } |
104 | 104 |
105 TileResolution resolution; | 105 TileResolution resolution; |
106 bool required_for_activation; | 106 bool required_for_activation; |
107 PriorityBin priority_bin; | 107 PriorityBin priority_bin; |
108 float distance_to_visible; | 108 float distance_to_visible; |
109 }; | 109 }; |
110 | 110 |
111 scoped_ptr<base::Value> TilePriorityBinAsValue(TilePriority::PriorityBin bin); | 111 scoped_ptr<base::Value> TilePriorityBinAsValue(TilePriority::PriorityBin bin); |
112 | 112 |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 bool operator!=(const GlobalStateThatImpactsTilePriority& other) const { | 170 bool operator!=(const GlobalStateThatImpactsTilePriority& other) const { |
171 return !(*this == other); | 171 return !(*this == other); |
172 } | 172 } |
173 | 173 |
174 scoped_ptr<base::Value> AsValue() const; | 174 scoped_ptr<base::Value> AsValue() const; |
175 }; | 175 }; |
176 | 176 |
177 } // namespace cc | 177 } // namespace cc |
178 | 178 |
179 #endif // CC_RESOURCES_TILE_PRIORITY_H_ | 179 #endif // CC_RESOURCES_TILE_PRIORITY_H_ |
OLD | NEW |