Chromium Code Reviews| Index: cc/tile_priority.h |
| diff --git a/cc/tile_priority.h b/cc/tile_priority.h |
| index 8002f09be1432d7682c74f563fa73af00cb69b5a..c6eb2dbde124c3b7e0128e49b75f9c7d747a44a0 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> |
|
danakj
2012/12/01 02:37:37
seems unused
qinmin
2012/12/01 02:45:24
this is for the std::numeric_limits in TilePriorit
|
| + |
| #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,16 @@ struct TilePriority { |
| time_to_ideal_resolution_in_seconds); |
| } |
| + 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; |