Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(535)

Side by Side Diff: cc/resources/tile_priority.h

Issue 230983004: cc: Fix TilePriority::IsHigherPriorityThan to be correct. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « cc/resources/picture_layer_tiling.cc ('k') | cc/resources/tile_priority_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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_
OLDNEW
« no previous file with comments | « cc/resources/picture_layer_tiling.cc ('k') | cc/resources/tile_priority_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698