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

Unified Diff: cc/resources/picture_layer_tiling.cc

Issue 13926008: Don't shrink starting_rect in the first round. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 years, 8 months 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 | « no previous file | cc/resources/picture_layer_tiling_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« no previous file with comments | « no previous file | cc/resources/picture_layer_tiling_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698