| Index: cc/tile_priority.h
|
| diff --git a/cc/tile_priority.h b/cc/tile_priority.h
|
| index fb900608eb175b42ce0ba5d587378ab923b93a31..e5e0bb8a41c6f4b43fc711438b1d2d02df200c00 100644
|
| --- a/cc/tile_priority.h
|
| +++ b/cc/tile_priority.h
|
| @@ -61,17 +61,30 @@ struct CC_EXPORT TilePriority {
|
| time_to_ideal_resolution_in_seconds);
|
| }
|
|
|
| - static const double kMaxTimeToVisibleInSeconds;
|
| -
|
| - static int manhattanDistance(const gfx::RectF& a, const gfx::RectF& b);
|
| + static const float kMaxTimeToVisibleInSeconds;
|
| +
|
| + static inline float manhattanDistance(const gfx::RectF& a, const gfx::RectF& b) {
|
| + // Compute the union explicitly.
|
| + gfx::RectF c = gfx::RectF(
|
| + std::min(a.x(), b.x()),
|
| + std::min(a.y(), b.y()),
|
| + std::max(a.right(), b.right() - std::min(a.x(), b.x())),
|
| + std::max(a.bottom(), b.bottom() - std::min(a.y(), b.y())));
|
| +
|
| + // Rects touching the edge of the screen should not be considered visible.
|
| + // So we add 1 pixel here to avoid that situation.
|
| + float x = std::max(0.0f, c.width() - a.width() - b.width() + 1.0f);
|
| + float y = std::max(0.0f, c.height() - a.height() - b.height() + 1.0f);
|
| + return (x + y);
|
| + }
|
|
|
| // 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);
|
| + static float TimeForBoundsToIntersect(const gfx::RectF& previous_bounds,
|
| + const gfx::RectF& current_bounds,
|
| + float time_delta,
|
| + const gfx::RectF& target_bounds);
|
|
|
| TileResolution resolution;
|
| float time_to_visible_in_seconds;
|
|
|