Index: cc/resources/picture_layer_tiling.cc |
diff --git a/cc/resources/picture_layer_tiling.cc b/cc/resources/picture_layer_tiling.cc |
index 90250403b65b4e687fcacb085c782acc3e334ff4..594b0238af6206ef4de7b9301aea1c1943f64bb3 100644 |
--- a/cc/resources/picture_layer_tiling.cc |
+++ b/cc/resources/picture_layer_tiling.cc |
@@ -530,14 +530,18 @@ gfx::Rect PictureLayerTiling::ExpandRectEquallyToAreaBoundedBy( |
int delta = ComputeExpansionDelta( |
2, 2, starting_rect.width(), starting_rect.height(), target_area); |
gfx::Rect expanded_starting_rect = starting_rect; |
- expanded_starting_rect.Inset(-delta, -delta); |
+ |
+ // Expand but not shink the starting_rect to include small layers that are |
+ // in viewport but target_area is smaller than the viewport. |
+ if (delta > 0) |
+ expanded_starting_rect.Inset(-delta, -delta); |
gfx::Rect rect = IntersectRects(expanded_starting_rect, bounding_rect); |
if (rect.IsEmpty()) { |
// The starting_rect and bounding_rect are far away. |
return rect; |
} |
- if (rect == expanded_starting_rect) { |
+ if (delta >= 0 && rect == expanded_starting_rect) { |
// The expanded starting rect already covers target_area on bounding_rect. |
return rect; |
} |