Chromium Code Reviews| Index: cc/resources/picture_layer_tiling.cc |
| diff --git a/cc/resources/picture_layer_tiling.cc b/cc/resources/picture_layer_tiling.cc |
| index c3a2ffe17d6a604b94cab4b2f09199202b9115cd..01f933ec0c48f1bf5316e6543adad05c0cd316be 100644 |
| --- a/cc/resources/picture_layer_tiling.cc |
| +++ b/cc/resources/picture_layer_tiling.cc |
| @@ -375,6 +375,17 @@ void PictureLayerTiling::UpdateTilePriorities( |
| viewport_in_content_space, |
| prioritized_rect_area, |
| ContentRect()); |
| + |
| + if (prioritized_rect.IsEmpty()) { |
| + // For a layer out of the viewport, prioritize its tiles near to the |
| + // viewport border so that they could be available when scrolled in. |
| + prioritized_rect = ExpandRectBySizeBoundedBy( |
|
danakj
2013/04/03 23:08:34
NAK: Using the viewport rect (or something at most
|
| + viewport_in_content_space, |
| + tile_size.width() * 2, |
| + tile_size.height() * 2, |
| + ContentRect()); |
| + } |
| + |
| DCHECK(ContentRect().Contains(prioritized_rect)); |
| // Iterate through all of the tiles that were live last frame but will |
| @@ -531,6 +542,7 @@ gfx::Rect PictureLayerTiling::ExpandRectEquallyToAreaBoundedBy( |
| DCHECK_GT(target_area, 0); |
| gfx::Rect rect = IntersectRects(starting_rect, bounding_rect); |
| + |
| if (rect.IsEmpty()) |
|
enne (OOO)
2013/04/03 23:41:49
I think this patch should really just remove this
|
| return rect; |
| @@ -614,4 +626,13 @@ gfx::Rect PictureLayerTiling::ExpandRectEquallyToAreaBoundedBy( |
| return gfx::Rect(origin_x, origin_y, width, height); |
| } |
| +gfx::Rect PictureLayerTiling::ExpandRectBySizeBoundedBy( |
| + gfx::Rect starting_rect, |
| + int horizontal_expansion, |
| + int vertical_expansion, |
| + gfx::Rect bounding_rect) { |
| + starting_rect.Inset(-horizontal_expansion, -vertical_expansion); |
| + return IntersectRects(starting_rect, bounding_rect); |
| +} |
| + |
| } // namespace cc |