summaryrefslogtreecommitdiffstats
path: root/cc
diff options
context:
space:
mode:
authorvmpstr <vmpstr@chromium.org>2015-06-15 16:20:13 -0700
committerCommit bot <commit-bot@chromium.org>2015-06-15 23:20:43 +0000
commit65d8098f4449c3a556b8ca588a2ab0ec6c702eff (patch)
tree0280bba0cfbdf8ec2c05f800b9a27b3bc3234329 /cc
parentdc26caf19a94c8ed1bade529471cb5caaac6357d (diff)
downloadchromium_src-65d8098f4449c3a556b8ca588a2ab0ec6c702eff.zip
chromium_src-65d8098f4449c3a556b8ca588a2ab0ec6c702eff.tar.gz
chromium_src-65d8098f4449c3a556b8ca588a2ab0ec6c702eff.tar.bz2
cc: Clip projected tile priorities viewport to padded bounds.
This patch ensures that when we project a visible rect to be used for tile priorities, we clip it to a padded bounds to ensure that scaling math doesn't overflow/dcheck later on. We cannot use bounds directly, since we have to allow for offscreen content. R=enne, danakj BUG=497874 CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel Review URL: https://codereview.chromium.org/1184183004 Cr-Commit-Position: refs/heads/master@{#334489}
Diffstat (limited to 'cc')
-rw-r--r--cc/layers/picture_layer_impl.cc15
1 files changed, 15 insertions, 0 deletions
diff --git a/cc/layers/picture_layer_impl.cc b/cc/layers/picture_layer_impl.cc
index 88cf1fb..b476714 100644
--- a/cc/layers/picture_layer_impl.cc
+++ b/cc/layers/picture_layer_impl.cc
@@ -477,6 +477,21 @@ void PictureLayerImpl::UpdateViewportRectForTilePriorityInContentSpace() {
visible_rect_in_content_space =
gfx::ToEnclosingRect(MathUtil::ProjectClippedRect(
view_to_layer, viewport_rect_for_tile_priority));
+
+ // We have to allow for a viewport that is outside of the layer bounds in
+ // order to compute tile priorities correctly for offscreen content that
+ // is going to make it on screen. However, we also have to limit the
+ // viewport since it can be very large due to screen_space_transforms. As
+ // a heuristic, we clip to bounds padded by skewport_extrapolation_limit *
+ // maximum tiling scale, since this should allow sufficient room for
+ // skewport calculations.
+ gfx::Rect padded_bounds(bounds());
+ int padding_amount = layer_tree_impl()
+ ->settings()
+ .skewport_extrapolation_limit_in_content_pixels *
+ MaximumTilingContentsScale();
+ padded_bounds.Inset(-padding_amount, -padding_amount);
+ visible_rect_in_content_space.Intersect(padded_bounds);
}
}
viewport_rect_for_tile_priority_in_content_space_ =