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

Issue 11447028: cc: Split out calcDrawEtc from drawLayers (Closed)

Created:
8 years ago by enne (OOO)
Modified:
8 years ago
Reviewers:
danakj
CC:
chromium-reviews, cc-bugs_chromium.org, nduca, shawnsingh
Visibility:
Public.

Description

cc: Split out calcDrawEtc from drawLayers Previously, calcDrawEtc was coupled to drawLayers. Immediately before drawing, it would get called to update layer state based on any impl-side input that came in after the commit. Impl-side painting needs to update layer transforms / visible content rect state prior to rasterizing contents. And, if input comes in, it might also need to re-update prior to drawing. LayerTreeHostImpl then gets a needsUpdateLayers() flag, and updateLayers() (which calls calcDraw) is a no-op if nothing has changed on the tree. Additionally, the calculate render surface layer list is persisted since the last updateLayers() call. The LayerTreeHostImpl now sets the needsUpdate flag after commit, scroll, pinch zoom, and animation. These are the easy ones. Unfortunately, this creates an amazing foot gun where you can manipulate the impl tree on the impl thread and updateLayers won't get called, because the needsUpdate flag hasn't been called explicitly. This mostly happens in tests, but could happen elsewhere. To fix this, setFoo calls on LayerImpl now calls setNeedsUpdate() on its host. BUG=155209 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=172005

Patch Set 1 #

Total comments: 5

Patch Set 2 : Rename, recursive setLTHI #

Patch Set 3 : Clean up unnecessary test changes #

Total comments: 25

Patch Set 4 : Address most review comments #

Total comments: 3

Patch Set 5 : Rebase #

Patch Set 6 : Fix TODO comment about animations #

Total comments: 10

Patch Set 7 : Testing #

Total comments: 6

Patch Set 8 : Nits #

Patch Set 9 : Rebased #

Unified diffs Side-by-side diffs Delta from patch set Stats (+193 lines, -28 lines) Patch
M cc/layer_impl.h View 1 2 3 4 5 6 7 8 2 chunks +5 lines, -0 lines 0 comments Download
M cc/layer_impl.cc View 1 2 3 4 5 6 7 8 13 chunks +33 lines, -9 lines 0 comments Download
M cc/layer_impl_unittest.cc View 1 2 3 4 5 6 7 8 2 chunks +94 lines, -0 lines 0 comments Download
M cc/layer_tree_host_impl.h View 1 2 3 4 5 6 7 8 3 chunks +7 lines, -0 lines 0 comments Download
M cc/layer_tree_host_impl.cc View 1 2 3 4 5 6 7 8 17 chunks +48 lines, -16 lines 0 comments Download
M cc/layer_tree_host_impl_unittest.cc View 1 2 3 4 5 6 7 8 3 chunks +4 lines, -3 lines 0 comments Download
M cc/test/fake_layer_tree_host_impl.h View 1 2 3 4 5 6 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 28 (0 generated)
enne (OOO)
This change really needs some tests like the verify set needs commit tests for cc::Layer, ...
8 years ago (2012-12-06 02:51:32 UTC) #1
danakj
Before reading the code: - What if a test calls prepareToDraw but doesn't drawLayers. willDraw ...
8 years ago (2012-12-06 03:04:47 UTC) #2
danakj
On 2012/12/06 03:04:47, danakj wrote: > Before reading the code: > > - What if ...
8 years ago (2012-12-06 03:09:39 UTC) #3
danakj
What if we: - make addChild and removeChild set the LTHImpl on the child - ...
8 years ago (2012-12-06 03:23:04 UTC) #4
enne (OOO)
I can make setLayerTreeHostImpl more implicit. It felt a little like overkill, but that does ...
8 years ago (2012-12-06 17:20:22 UTC) #5
danakj
https://codereview.chromium.org/11447028/diff/1/cc/layer_tree_host_impl.cc File cc/layer_tree_host_impl.cc (right): https://codereview.chromium.org/11447028/diff/1/cc/layer_tree_host_impl.cc#newcode386 cc/layer_tree_host_impl.cc:386: if (!needsUpdateLayers()) On 2012/12/06 17:20:23, enne wrote: > On ...
8 years ago (2012-12-06 17:38:50 UTC) #6
enne (OOO)
For what it's worth, the reason to not do it recursively is to avoid unnecessary ...
8 years ago (2012-12-06 18:01:05 UTC) #7
danakj
On Thu, Dec 6, 2012 at 1:01 PM, <enne@chromium.org> wrote: > For what it's worth, ...
8 years ago (2012-12-06 18:02:53 UTC) #8
enne (OOO)
Yeah, ok, my mistake. I think that would work and not be so bad.
8 years ago (2012-12-06 18:06:18 UTC) #9
enne (OOO)
updateLayers => updateDrawProperties PTAL
8 years ago (2012-12-06 18:50:34 UTC) #10
danakj
https://codereview.chromium.org/11447028/diff/16001/cc/layer_impl.cc File cc/layer_impl.cc (right): https://codereview.chromium.org/11447028/diff/16001/cc/layer_impl.cc#newcode427 cc/layer_impl.cc:427: for (size_t i = 0; i < m_children.size(); ++i) ...
8 years ago (2012-12-06 19:12:10 UTC) #11
enne (OOO)
https://codereview.chromium.org/11447028/diff/16001/cc/layer_impl.cc File cc/layer_impl.cc (right): https://codereview.chromium.org/11447028/diff/16001/cc/layer_impl.cc#newcode427 cc/layer_impl.cc:427: for (size_t i = 0; i < m_children.size(); ++i) ...
8 years ago (2012-12-06 19:25:42 UTC) #12
danakj
https://codereview.chromium.org/11447028/diff/16001/cc/layer_tree_host_impl_unittest.cc File cc/layer_tree_host_impl_unittest.cc (left): https://codereview.chromium.org/11447028/diff/16001/cc/layer_tree_host_impl_unittest.cc#oldcode1935 cc/layer_tree_host_impl_unittest.cc:1935: m_hostImpl->didDrawAllLayers(frame); On 2012/12/06 19:25:42, enne wrote: > On 2012/12/06 ...
8 years ago (2012-12-06 19:32:19 UTC) #13
enne (OOO)
https://codereview.chromium.org/11447028/diff/16001/cc/tree_synchronizer.cc File cc/tree_synchronizer.cc (right): https://codereview.chromium.org/11447028/diff/16001/cc/tree_synchronizer.cc#newcode67 cc/tree_synchronizer.cc:67: layerImpl->setLayerTreeHostImpl(hostImpl); On 2012/12/06 19:32:20, danakj wrote: > On 2012/12/06 ...
8 years ago (2012-12-06 19:34:09 UTC) #14
danakj
https://codereview.chromium.org/11447028/diff/16001/cc/tree_synchronizer.cc File cc/tree_synchronizer.cc (right): https://codereview.chromium.org/11447028/diff/16001/cc/tree_synchronizer.cc#newcode67 cc/tree_synchronizer.cc:67: layerImpl->setLayerTreeHostImpl(hostImpl); On 2012/12/06 19:34:09, enne wrote: > On 2012/12/06 ...
8 years ago (2012-12-06 19:36:20 UTC) #15
enne (OOO)
https://codereview.chromium.org/11447028/diff/16001/cc/tree_synchronizer.cc File cc/tree_synchronizer.cc (right): https://codereview.chromium.org/11447028/diff/16001/cc/tree_synchronizer.cc#newcode67 cc/tree_synchronizer.cc:67: layerImpl->setLayerTreeHostImpl(hostImpl); "I had to do something another way because ...
8 years ago (2012-12-06 19:49:02 UTC) #16
danakj
https://codereview.chromium.org/11447028/diff/16001/cc/tree_synchronizer.cc File cc/tree_synchronizer.cc (right): https://codereview.chromium.org/11447028/diff/16001/cc/tree_synchronizer.cc#newcode67 cc/tree_synchronizer.cc:67: layerImpl->setLayerTreeHostImpl(hostImpl); On 2012/12/06 19:49:02, enne wrote: > "I had ...
8 years ago (2012-12-06 19:51:56 UTC) #17
danakj
https://codereview.chromium.org/11447028/diff/16001/cc/layer_tree_host_impl.cc File cc/layer_tree_host_impl.cc (right): https://codereview.chromium.org/11447028/diff/16001/cc/layer_tree_host_impl.cc#newcode1195 cc/layer_tree_host_impl.cc:1195: setNeedsUpdateDrawProperties(); On 2012/12/06 19:25:42, enne wrote: > On 2012/12/06 ...
8 years ago (2012-12-06 19:56:22 UTC) #18
enne (OOO)
After offline conversations with jamesr/danakj, I will change LayerImpl to take its host in its ...
8 years ago (2012-12-06 20:37:50 UTC) #19
enne (OOO)
LayerImpl being changed to take the LTHI in its ctor: https://codereview.chromium.org/11472021
8 years ago (2012-12-07 07:13:39 UTC) #20
enne (OOO)
Rebased on top of that other patch. PTAL. Re: ensureRenderSurfaceLayerList. This patch minimally changes that ...
8 years ago (2012-12-07 20:59:08 UTC) #21
enne (OOO)
Actually, scratch that. I want to add a few unit tests in layer_impl_unittests.cc to make ...
8 years ago (2012-12-07 21:09:03 UTC) #22
danakj
https://codereview.chromium.org/11447028/diff/14027/cc/layer_tree_host_impl.cc File cc/layer_tree_host_impl.cc (right): https://codereview.chromium.org/11447028/diff/14027/cc/layer_tree_host_impl.cc#newcode939 cc/layer_tree_host_impl.cc:939: setNeedsUpdateDrawProperties(); nit: 4 space indents https://codereview.chromium.org/11447028/diff/14027/cc/layer_tree_host_impl.cc#newcode1149 cc/layer_tree_host_impl.cc:1149: setNeedsUpdateDrawProperties(); Ok, ...
8 years ago (2012-12-07 21:14:02 UTC) #23
enne (OOO)
Added testing, addressed comments. PTAL. https://codereview.chromium.org/11447028/diff/14027/cc/layer_tree_host_impl.cc File cc/layer_tree_host_impl.cc (right): https://codereview.chromium.org/11447028/diff/14027/cc/layer_tree_host_impl.cc#newcode939 cc/layer_tree_host_impl.cc:939: setNeedsUpdateDrawProperties(); On 2012/12/07 21:14:02, ...
8 years ago (2012-12-07 23:03:00 UTC) #24
danakj
LGTM and thanks for the tests! 2 small questions left. https://codereview.chromium.org/11447028/diff/15008/cc/layer_impl.cc File cc/layer_impl.cc (right): https://codereview.chromium.org/11447028/diff/15008/cc/layer_impl.cc#newcode99 ...
8 years ago (2012-12-07 23:12:49 UTC) #25
enne (OOO)
https://codereview.chromium.org/11447028/diff/15008/cc/layer_impl.cc File cc/layer_impl.cc (right): https://codereview.chromium.org/11447028/diff/15008/cc/layer_impl.cc#newcode99 cc/layer_impl.cc:99: { On 2012/12/07 23:12:49, danakj wrote: > should this ...
8 years ago (2012-12-07 23:25:04 UTC) #26
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/enne@chromium.org/11447028/26001
8 years ago (2012-12-09 00:47:18 UTC) #27
commit-bot: I haz the power
8 years ago (2012-12-09 09:14:41 UTC) #28
Message was sent while issue was closed.
Change committed as 172005

Powered by Google App Engine
This is Rietveld 408576698