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

Unified Diff: cc/resources/tile_priority.h

Issue 12912008: Check if priority actually changed in Tile::SetPriority() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix nits Created 7 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/resources/tile.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/tile_priority.h
diff --git a/cc/resources/tile_priority.h b/cc/resources/tile_priority.h
index c998624704d2abe9ca65bdee276e082cf1e438dc..a9558ef98c62f4daaae2156ebbb3ee5e76cec271 100644
--- a/cc/resources/tile_priority.h
+++ b/cc/resources/tile_priority.h
@@ -122,6 +122,20 @@ struct CC_EXPORT TilePriority {
float time_delta,
const gfx::RectF& target_bounds);
+ bool operator ==(const TilePriority& other) const {
+ if (is_live != other.is_live) return false;
+ if (!is_live) return true; // All non-live priorities are the same.
+ return resolution == other.resolution &&
+ time_to_visible_in_seconds == other.time_to_visible_in_seconds &&
+ distance_to_visible_in_pixels == other.distance_to_visible_in_pixels;
+ // No need to compare current_screen_quad which is for debug only and
+ // never changes by itself.
+ }
+
+ bool operator !=(const TilePriority& other) const {
+ return !(*this == other);
+ }
+
// If a tile is not live, then all other fields are invalid.
bool is_live;
TileResolution resolution;
« no previous file with comments | « cc/resources/tile.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698