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

Issue 12865017: Makes tile-creation lazy (Closed)

Created:
7 years, 9 months ago by whunt
Modified:
7 years, 8 months ago
CC:
chromium-reviews, cc-bugs_chromium.org
Visibility:
Public.

Description

Makes tile-creation lazy This cl contains quite a few changes. I'll try to enumerate all of them here: 1) Some cleanup of the PictureLayerTiling definition (moved all members to the bottom and sorted them by lifespan) 2) Added painted_rect to Tile. This allows us to determine quickly if a new tileing can use an old tile (if the required painted rect is contained within the old painted rect). This lets us re-use partially painted tiles when the layer-bounds shrinks but nothing else changes. 3) Added an interest_rect field to PictureLayerTiling (we should determine if this is redundant with last_interest_rect 4) Added a new constructor to PictureLayerTiling for the sake of lazy cloning. This constructor copies another PictureLayerTiling but does *not* copy the tiles or interest_rect. The copy occurs lazily. 5) Added a ManageTiles function that creates all of the tiles required for a layer from its interest rect. It's interfact takes both the new and old rects, which isn't really required and could be changed if desired. This function deletes tiles outside of an old interest rect and adds tiles from the new interest rect. 6) Changed the definition of CreateTile to lazily pull from where it can. It no longer assumes we don't already have a tile for that I,J location. It first checks to see if this tiling already has a tile that has a big enough paint rect. If it doesn't, it checks its sibling for a tile in that I,J to see if it has a tile with a big enough paint rect, if not it creates a new tile. 7) Added two functions to the layer client, one lets a Tiling get its sibling and one gets the layer's invalidation. 8) Added a SimpleIterator class to iterate over a rectangular region. This iterator is substantially simpler than the current iterator and only has the functionality requried to iterate over a rectangle. We should probably rename SimpleIterator to RectIterator and Iterator to CoverageIterator because it's really part of the coverage algorithm. There's probably a few more tweaks here and there and names/APIs are final but I wanted to put this up for review now that it appears to work. BUG=190816 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=193762

Patch Set 1 #

Total comments: 29

Patch Set 2 : Addressing much of Enne's feedback and rebasing to tip of tree (still no unit tests) #

Patch Set 3 : a bug fix and removal of several now useless functions #

Total comments: 34

Patch Set 4 : removing SetLayerBounds and everything associated, also some minor cleanup #

Patch Set 5 : unit tests now compile #

Patch Set 6 : fixing unit tests and an optimization to CreateTile #

Total comments: 2

Patch Set 7 : rebasing to tip of tree and addressing new compiler warnings #

Patch Set 8 : rebased onto 13726013 #

Patch Set 9 : adding VerifyLiveTiles unit test and the required support, plus two minor fixes #

Total comments: 17

Patch Set 10 : Rebasing to tip of tree and fixing all of Enne's comments #

Total comments: 5

Patch Set 11 : addressing last round of feedback #

Unified diffs Side-by-side diffs Delta from patch set Stats (+271 lines, -281 lines) Patch
M cc/layers/picture_image_layer_impl_unittest.cc View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M cc/layers/picture_layer_impl.h View 1 2 3 4 5 6 1 chunk +4 lines, -4 lines 0 comments Download
M cc/layers/picture_layer_impl.cc View 1 2 3 4 5 6 7 8 9 10 5 chunks +29 lines, -33 lines 0 comments Download
M cc/layers/picture_layer_impl_unittest.cc View 1 2 3 4 5 6 7 8 9 10 4 chunks +11 lines, -9 lines 0 comments Download
M cc/resources/picture_layer_tiling.h View 1 2 3 4 5 6 7 8 9 10 6 chunks +33 lines, -21 lines 0 comments Download
M cc/resources/picture_layer_tiling.cc View 1 2 3 4 5 6 7 8 9 10 10 chunks +109 lines, -148 lines 0 comments Download
M cc/resources/picture_layer_tiling_set.h View 1 2 3 4 5 6 7 8 9 3 chunks +4 lines, -9 lines 0 comments Download
M cc/resources/picture_layer_tiling_set.cc View 1 2 3 4 5 6 7 3 chunks +13 lines, -41 lines 0 comments Download
M cc/resources/picture_layer_tiling_set_unittest.cc View 1 2 3 4 5 6 7 8 9 2 chunks +4 lines, -7 lines 0 comments Download
M cc/resources/picture_layer_tiling_unittest.cc View 1 2 3 4 5 6 7 8 9 10 4 chunks +48 lines, -5 lines 0 comments Download
M cc/resources/picture_pile_base.h View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M cc/test/fake_picture_layer_tiling_client.h View 1 2 3 4 1 chunk +4 lines, -1 line 0 comments Download
M cc/test/fake_picture_layer_tiling_client.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +9 lines, -1 line 0 comments Download

Messages

Total messages: 38 (0 generated)
whunt
Just making sure an email goes out.
7 years, 9 months ago (2013-03-27 00:32:20 UTC) #1
enne (OOO)
Thanks for the patch! I like the direction that this is going in moving the ...
7 years, 9 months ago (2013-03-27 16:16:27 UTC) #2
whunt
https://codereview.chromium.org/12865017/diff/1/cc/layers/picture_layer_impl.cc File cc/layers/picture_layer_impl.cc (right): https://codereview.chromium.org/12865017/diff/1/cc/layers/picture_layer_impl.cc#newcode322 cc/layers/picture_layer_impl.cc:322: const gfx::Rect& content_rect, On 2013/03/27 16:16:27, enne wrote: > ...
7 years, 9 months ago (2013-03-27 17:42:02 UTC) #3
enne (OOO)
https://codereview.chromium.org/12865017/diff/1/cc/layers/picture_layer_impl.cc File cc/layers/picture_layer_impl.cc (right): https://codereview.chromium.org/12865017/diff/1/cc/layers/picture_layer_impl.cc#newcode322 cc/layers/picture_layer_impl.cc:322: const gfx::Rect& content_rect, On 2013/03/27 17:42:02, whunt wrote: > ...
7 years, 9 months ago (2013-03-27 18:03:19 UTC) #4
epenner
This sounds awesome. Just one drive by comment. 5) Added a ManageTiles function that creates ...
7 years, 9 months ago (2013-03-27 20:27:45 UTC) #5
enne (OOO)
On 2013/03/27 20:27:45, epenner wrote: > This sounds awesome. Just one drive by comment. > ...
7 years, 9 months ago (2013-03-27 22:15:39 UTC) #6
whunt
7 years, 8 months ago (2013-03-29 17:59:14 UTC) #7
enne (OOO)
https://codereview.chromium.org/12865017/diff/15001/cc/layers/picture_layer_impl.cc File cc/layers/picture_layer_impl.cc (left): https://codereview.chromium.org/12865017/diff/15001/cc/layers/picture_layer_impl.cc#oldcode854 cc/layers/picture_layer_impl.cc:854: pending_layer->tilings_->Invalidate(gfx::Rect(bounds())); This is incorrect to remove wholesale. Invalidate both ...
7 years, 8 months ago (2013-03-29 20:50:58 UTC) #8
whunt
https://codereview.chromium.org/12865017/diff/15001/cc/layers/picture_layer_impl.cc File cc/layers/picture_layer_impl.cc (left): https://codereview.chromium.org/12865017/diff/15001/cc/layers/picture_layer_impl.cc#oldcode854 cc/layers/picture_layer_impl.cc:854: pending_layer->tilings_->Invalidate(gfx::Rect(bounds())); On 2013/03/29 20:50:58, enne wrote: > This is ...
7 years, 8 months ago (2013-03-29 21:52:04 UTC) #9
whunt
https://codereview.chromium.org/12865017/diff/15001/cc/layers/picture_layer_impl.cc File cc/layers/picture_layer_impl.cc (left): https://codereview.chromium.org/12865017/diff/15001/cc/layers/picture_layer_impl.cc#oldcode854 cc/layers/picture_layer_impl.cc:854: pending_layer->tilings_->Invalidate(gfx::Rect(bounds())); On 2013/03/29 21:52:04, whunt wrote: > On 2013/03/29 ...
7 years, 8 months ago (2013-03-29 22:17:55 UTC) #10
enne (OOO)
https://codereview.chromium.org/12865017/diff/15001/cc/resources/picture_layer_tiling.cc File cc/resources/picture_layer_tiling.cc (left): https://codereview.chromium.org/12865017/diff/15001/cc/resources/picture_layer_tiling.cc#oldcode387 cc/resources/picture_layer_tiling.cc:387: DCHECK(!priority.is_live); On 2013/03/29 21:52:04, whunt wrote: > On 2013/03/29 ...
7 years, 8 months ago (2013-03-29 22:34:19 UTC) #11
whunt
https://codereview.chromium.org/12865017/diff/15001/cc/resources/picture_layer_tiling.cc File cc/resources/picture_layer_tiling.cc (left): https://codereview.chromium.org/12865017/diff/15001/cc/resources/picture_layer_tiling.cc#oldcode387 cc/resources/picture_layer_tiling.cc:387: DCHECK(!priority.is_live); On 2013/03/29 22:34:20, enne wrote: > On 2013/03/29 ...
7 years, 8 months ago (2013-03-29 23:17:36 UTC) #12
whunt
7 years, 8 months ago (2013-04-05 18:46:44 UTC) #13
enne (OOO)
https://codereview.chromium.org/12865017/diff/32001/cc/layers/picture_layer_impl.cc File cc/layers/picture_layer_impl.cc (left): https://codereview.chromium.org/12865017/diff/32001/cc/layers/picture_layer_impl.cc#oldcode854 cc/layers/picture_layer_impl.cc:854: pending_layer->tilings_->Invalidate(gfx::Rect(bounds())); Where do tiles get recreated here because of ...
7 years, 8 months ago (2013-04-05 21:30:02 UTC) #14
whunt
https://codereview.chromium.org/12865017/diff/32001/cc/layers/picture_layer_impl.cc File cc/layers/picture_layer_impl.cc (left): https://codereview.chromium.org/12865017/diff/32001/cc/layers/picture_layer_impl.cc#oldcode854 cc/layers/picture_layer_impl.cc:854: pending_layer->tilings_->Invalidate(gfx::Rect(bounds())); On 2013/04/05 21:30:02, enne wrote: > Where do ...
7 years, 8 months ago (2013-04-05 21:33:25 UTC) #15
enne (OOO)
On 2013/04/05 21:33:25, whunt wrote: > https://codereview.chromium.org/12865017/diff/32001/cc/layers/picture_layer_impl.cc > File cc/layers/picture_layer_impl.cc (left): > > https://codereview.chromium.org/12865017/diff/32001/cc/layers/picture_layer_impl.cc#oldcode854 > ...
7 years, 8 months ago (2013-04-05 21:39:58 UTC) #16
whunt
7 years, 8 months ago (2013-04-08 20:47:04 UTC) #17
whunt
7 years, 8 months ago (2013-04-08 20:47:05 UTC) #18
enne (OOO)
The code looks pretty reasonable. Do you have any measurements on performance change here? Does ...
7 years, 8 months ago (2013-04-08 21:11:48 UTC) #19
whunt
On 2013/04/08 21:11:48, enne wrote: > The code looks pretty reasonable. Do you have any ...
7 years, 8 months ago (2013-04-09 18:27:13 UTC) #20
whunt
On 2013/04/09 18:27:13, whunt wrote: > On 2013/04/08 21:11:48, enne wrote: > > The code ...
7 years, 8 months ago (2013-04-09 21:26:07 UTC) #21
enne (OOO)
Could you share the absolute numbers here too, just for reference? I'm assuming that ManageTiles ...
7 years, 8 months ago (2013-04-09 21:36:37 UTC) #22
whunt
On 2013/04/09 21:36:37, enne wrote: > Could you share the absolute numbers here too, just ...
7 years, 8 months ago (2013-04-09 21:53:21 UTC) #23
enne (OOO)
Ok, thanks for all the detailed info. lgtm
7 years, 8 months ago (2013-04-09 22:04:08 UTC) #24
whunt
7 years, 8 months ago (2013-04-10 18:37:58 UTC) #25
enne (OOO)
Are you looking for another review here? What were you fixing?
7 years, 8 months ago (2013-04-10 19:27:07 UTC) #26
whunt
On 2013/04/10 19:27:07, enne wrote: > Are you looking for another review here? What were ...
7 years, 8 months ago (2013-04-10 20:10:01 UTC) #27
enne (OOO)
https://codereview.chromium.org/12865017/diff/61001/cc/resources/picture_layer_tiling.cc File cc/resources/picture_layer_tiling.cc (right): https://codereview.chromium.org/12865017/diff/61001/cc/resources/picture_layer_tiling.cc#newcode84 cc/resources/picture_layer_tiling.cc:84: tiles_.erase(key); I liked the dcheck better. https://codereview.chromium.org/12865017/diff/61001/cc/resources/picture_layer_tiling.cc#newcode438 cc/resources/picture_layer_tiling.cc:438: const ...
7 years, 8 months ago (2013-04-10 20:25:30 UTC) #28
whunt
https://codereview.chromium.org/12865017/diff/61001/cc/resources/picture_layer_tiling.cc File cc/resources/picture_layer_tiling.cc (right): https://codereview.chromium.org/12865017/diff/61001/cc/resources/picture_layer_tiling.cc#newcode84 cc/resources/picture_layer_tiling.cc:84: tiles_.erase(key); On 2013/04/10 20:25:30, enne wrote: > I liked ...
7 years, 8 months ago (2013-04-10 20:52:30 UTC) #29
enne (OOO)
https://codereview.chromium.org/12865017/diff/61001/cc/resources/picture_layer_tiling.cc File cc/resources/picture_layer_tiling.cc (right): https://codereview.chromium.org/12865017/diff/61001/cc/resources/picture_layer_tiling.cc#newcode84 cc/resources/picture_layer_tiling.cc:84: tiles_.erase(key); On 2013/04/10 20:52:30, whunt wrote: > On 2013/04/10 ...
7 years, 8 months ago (2013-04-10 21:21:24 UTC) #30
whunt
https://codereview.chromium.org/12865017/diff/61001/cc/resources/picture_layer_tiling.cc File cc/resources/picture_layer_tiling.cc (right): https://codereview.chromium.org/12865017/diff/61001/cc/resources/picture_layer_tiling.cc#newcode84 cc/resources/picture_layer_tiling.cc:84: tiles_.erase(key); On 2013/04/10 21:21:24, enne wrote: > On 2013/04/10 ...
7 years, 8 months ago (2013-04-10 21:45:59 UTC) #31
enne (OOO)
Yeah, that's exactly what I was trying to say. They should all be all entirely ...
7 years, 8 months ago (2013-04-10 21:56:34 UTC) #32
whunt
7 years, 8 months ago (2013-04-10 23:58:21 UTC) #33
enne (OOO)
https://codereview.chromium.org/12865017/diff/79001/cc/resources/picture_layer_tiling.cc File cc/resources/picture_layer_tiling.cc (right): https://codereview.chromium.org/12865017/diff/79001/cc/resources/picture_layer_tiling.cc#newcode441 cc/resources/picture_layer_tiling.cc:441: DCHECK(content_rect.Contains(new_live_tiles_rect)); s/content_rect/ContentRect()/ https://codereview.chromium.org/12865017/diff/79001/cc/resources/picture_layer_tiling_unittest.cc File cc/resources/picture_layer_tiling_unittest.cc (right): https://codereview.chromium.org/12865017/diff/79001/cc/resources/picture_layer_tiling_unittest.cc#newcode52 cc/resources/picture_layer_tiling_unittest.cc:52: tiling_->SetLiveTilesRect(live_tiles_rect); ...
7 years, 8 months ago (2013-04-11 00:16:02 UTC) #34
whunt
7 years, 8 months ago (2013-04-11 18:48:49 UTC) #35
enne (OOO)
lgtm
7 years, 8 months ago (2013-04-11 20:03:31 UTC) #36
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/whunt@chromium.org/12865017/91001
7 years, 8 months ago (2013-04-11 20:05:30 UTC) #37
commit-bot: I haz the power
7 years, 8 months ago (2013-04-11 21:45:33 UTC) #38
Message was sent while issue was closed.
Change committed as 193762

Powered by Google App Engine
This is Rietveld 408576698