Descriptioncc: Compute the inflated rect to cover a fixed number of tiles.
Currently we expand the area around the viewport in which we want to
paint tiles by a fixed amount in all 4 directions. For narrow pages,
this was designed to work well since it will expand and add a "linear"
number of pixels (relative to the width of the viewport). However,
when pinch-zoomed in, or on a wide page, the rect is expanded far
in all directions and so expands to include a quadratic number of
pixels. This creates inconsistent behaviour, and we include too many
tiles in the rect in the latter case, in order to get enough tiles in
the former case.
Instead of expanding the rect in all 4 directions by a very large amount,
we expand the rect to fill a given area, or to cover a given number of
pixels. This way we always include roughly the same number of tiles in the
rect. We expand the rect out in all 4 directions equally to cover the
target area. However, if the rect bumps into the edge of the tiling's
content rect, then we will continue to expand the rect equally along its
other edges until the rect covers the target number of pixels or completely
fills the content rect.
Tests:
PictureLayerTilingTest.ExpandRectEqual
PictureLayerTilingTest.ExpandRectSmaller
PictureLayerTilingTest.ExpandRectUnbounded
PictureLayerTilingTest.ExpandRectBoundedSmaller
PictureLayerTilingTest.ExpandRectBoundedEqual
PictureLayerTilingTest.ExpandRectBoundedSmallerStretchVertical
PictureLayerTilingTest.ExpandRectBoundedEqualStretchVertical
PictureLayerTilingTest.ExpandRectBoundedSmallerStretchHorizontal
PictureLayerTilingTest.ExpandRectBoundedEqualStretchHorizontal
PictureLayerTilingTest.ExpandRectBoundedLeft
PictureLayerTilingTest.ExpandRectBoundedRight
PictureLayerTilingTest.ExpandRectBoundedTop
PictureLayerTilingTest.ExpandRectBoundedBottom
PictureLayerTilingTest.ExpandRectSquishedHorizontally
PictureLayerTilingTest.ExpandRectSquishedVertically
BUG=176580
NOTRY=true
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=183385
Patch Set 1 : #
Total comments: 1
Patch Set 2 : Use sqrt(double) for android #
Total comments: 2
Patch Set 3 : Moved constant #
Total comments: 1
Messages
Total messages: 23 (0 generated)
|