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

Issue 12287027: cc: Compute the inflated rect to cover a fixed number of tiles. (Closed)

Created:
7 years, 10 months ago by danakj
Modified:
7 years, 10 months ago
CC:
chromium-reviews, cc-bugs_chromium.org, piman, backer
Visibility:
Public.

Description

cc: 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
Unified diffs Side-by-side diffs Delta from patch set Stats (+411 lines, -13 lines) Patch
M cc/picture_layer_tiling.h View 1 chunk +5 lines, -0 lines 0 comments Download
M cc/picture_layer_tiling.cc View 1 2 6 chunks +226 lines, -13 lines 1 comment Download
M cc/picture_layer_tiling_unittest.cc View 1 2 1 chunk +175 lines, -0 lines 0 comments Download
M cc/tile_priority.h View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M cc/tile_priority.cc View 1 2 1 chunk +4 lines, -0 lines 0 comments Download

Messages

Total messages: 23 (0 generated)
danakj
https://codereview.chromium.org/12287027/diff/5001/cc/picture_layer_tiling.cc File cc/picture_layer_tiling.cc (right): https://codereview.chromium.org/12287027/diff/5001/cc/picture_layer_tiling.cc#newcode397 cc/picture_layer_tiling.cc:397: static const int64 kMaxTilesForPrioritizedRect = 80; I got 80 ...
7 years, 10 months ago (2013-02-16 12:39:49 UTC) #1
nduca
yaaay! Thank you Dana!!!! https://codereview.chromium.org/12287027/diff/5017/cc/picture_layer_tiling.cc File cc/picture_layer_tiling.cc (right): https://codereview.chromium.org/12287027/diff/5017/cc/picture_layer_tiling.cc#newcode397 cc/picture_layer_tiling.cc:397: static const int64 kMaxTilesForPrioritizedRect = ...
7 years, 10 months ago (2013-02-16 22:30:59 UTC) #2
danakj
https://codereview.chromium.org/12287027/diff/5017/cc/picture_layer_tiling.cc File cc/picture_layer_tiling.cc (right): https://codereview.chromium.org/12287027/diff/5017/cc/picture_layer_tiling.cc#newcode397 cc/picture_layer_tiling.cc:397: static const int64 kMaxTilesForPrioritizedRect = 80; On 2013/02/16 22:30:59, ...
7 years, 10 months ago (2013-02-18 19:26:20 UTC) #3
danakj
Moved the constant to TilePriority. PTAL
7 years, 10 months ago (2013-02-19 16:38:51 UTC) #4
ccameron
Very nice. I'm a bit worried about CPU overhead here. We found in crbug.com/176150 that ...
7 years, 10 months ago (2013-02-19 20:01:09 UTC) #5
nduca
If it helps, low-risk is key as this is slotted for m25. Thus, if it ...
7 years, 10 months ago (2013-02-19 20:05:27 UTC) #6
vangelis
The problem with this squishy expansion is that when we're at the top (or bottom) ...
7 years, 10 months ago (2013-02-19 20:15:57 UTC) #7
nduca
I think thats an acceptable tradeoff for now.
7 years, 10 months ago (2013-02-19 20:23:52 UTC) #8
nduca
Or, hmm, we could assume that the layer's content rect goes off in the negative ...
7 years, 10 months ago (2013-02-19 20:24:43 UTC) #9
danakj
On Tue, Feb 19, 2013 at 3:15 PM, <vangelis@google.com> wrote: > The problem with this ...
7 years, 10 months ago (2013-02-19 20:24:46 UTC) #10
danakj
On Tue, Feb 19, 2013 at 3:24 PM, <nduca@chromium.org> wrote: > Or, hmm, we could ...
7 years, 10 months ago (2013-02-19 20:26:19 UTC) #11
enne (OOO)
The math to scale that rect was introduced in r181029 (https://codereview.chromium.org/12225054). Previously, it just used ...
7 years, 10 months ago (2013-02-19 20:28:53 UTC) #12
ccameron
On 2013/02/19 20:15:57, vangelis wrote: > We may be able to get around this if ...
7 years, 10 months ago (2013-02-19 20:37:50 UTC) #13
ccameron
On 2013/02/19 20:28:53, enne wrote: > The math to scale that rect was introduced in ...
7 years, 10 months ago (2013-02-19 20:46:37 UTC) #14
nduca
Folks, we need this. How do we get it landed? I'm going to go verify ...
7 years, 10 months ago (2013-02-20 00:39:49 UTC) #15
vangelis
https://codereview.chromium.org/12287027/diff/3021/cc/picture_layer_tiling.cc File cc/picture_layer_tiling.cc (right): https://codereview.chromium.org/12287027/diff/3021/cc/picture_layer_tiling.cc#newcode583 cc/picture_layer_tiling.cc:583: int add_each_axis = (-b + sqrt_part) / 2 / ...
7 years, 10 months ago (2013-02-20 01:26:56 UTC) #16
vangelis
On 2013/02/20 01:26:56, vangelis wrote: > https://codereview.chromium.org/12287027/diff/3021/cc/picture_layer_tiling.cc > File cc/picture_layer_tiling.cc (right): > > https://codereview.chromium.org/12287027/diff/3021/cc/picture_layer_tiling.cc#newcode583 > ...
7 years, 10 months ago (2013-02-20 01:28:52 UTC) #17
danakj
Ugh lost my reply by taking too long on it :( On 2013/02/19 20:28:53, enne ...
7 years, 10 months ago (2013-02-20 01:40:05 UTC) #18
danakj
https://codereview.chromium.org/12287027/diff/3021/cc/picture_layer_tiling.cc File cc/picture_layer_tiling.cc (right): https://codereview.chromium.org/12287027/diff/3021/cc/picture_layer_tiling.cc#newcode583 cc/picture_layer_tiling.cc:583: int add_each_axis = (-b + sqrt_part) / 2 / ...
7 years, 10 months ago (2013-02-20 01:44:39 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/danakj@chromium.org/12287027/13001
7 years, 10 months ago (2013-02-20 02:29:17 UTC) #20
nduca
also lgtm
7 years, 10 months ago (2013-02-20 02:30:20 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/danakj@chromium.org/12287027/13001
7 years, 10 months ago (2013-02-20 02:44:17 UTC) #22
commit-bot: I haz the power
7 years, 10 months ago (2013-02-20 02:47:41 UTC) #23
Message was sent while issue was closed.
Change committed as 183385

Powered by Google App Engine
This is Rietveld 408576698