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

Unified Diff: cc/tile_priority.h

Issue 11414238: implement the logic to set tile priorities based on current matrix (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: addressing comments Created 8 years 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/picture_layer_tiling_set.cc ('k') | cc/tile_priority.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/tile_priority.h
diff --git a/cc/tile_priority.h b/cc/tile_priority.h
index 8002f09be1432d7682c74f563fa73af00cb69b5a..929680e1c7e6f190cf71c702dfb2f0900e257f29 100644
--- a/cc/tile_priority.h
+++ b/cc/tile_priority.h
@@ -5,6 +5,8 @@
#ifndef CC_TILE_PRIORITY_H_
#define CC_TILE_PRIORITY_H_
+#include <limits>
+
#include "base/memory/ref_counted.h"
#include "cc/picture_pile.h"
#include "ui/gfx/rect.h"
@@ -25,7 +27,7 @@ enum TileResolution {
NON_IDEAL_RESOLUTION = 2
};
-struct TilePriority {
+struct CC_EXPORT TilePriority {
TilePriority()
: resolution(NON_IDEAL_RESOLUTION),
time_to_visible_in_seconds(std::numeric_limits<float>::max()),
@@ -58,6 +60,18 @@ struct TilePriority {
time_to_ideal_resolution_in_seconds);
}
+ static const double kMaxTimeToVisibleInSeconds;
+
+ static int manhattanDistance(const gfx::RectF& a, const gfx::RectF& b);
+
+ // Calculate the time for the |current_bounds| to intersect with the
+ // |target_bounds| given its previous location and time delta.
+ // This function should work for both scaling and scrolling case.
+ static double TimeForBoundsToIntersect(gfx::RectF previous_bounds,
+ gfx::RectF current_bounds,
+ double time_delta,
+ gfx::RectF target_bounds);
+
TileResolution resolution;
float time_to_visible_in_seconds;
float time_to_ideal_resolution_in_seconds;
« no previous file with comments | « cc/picture_layer_tiling_set.cc ('k') | cc/tile_priority.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698