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

Issue 2765053002: Avoid exposing cc::Layer tree to CompositorProxy (Closed)

Created:
3 years, 9 months ago by smcgruer
Modified:
3 years, 7 months ago
Reviewers:
flackr
CC:
chromium-reviews, krit, dshwang, drott+blinkwatch_chromium.org, blink-reviews-platform-graphics_chromium.org, sof, eae+blinkwatch, jbroman, fmalita+watch_chromium.org, blink-reviews-dom_chromium.org, dglazkov+blink, Rik, Stephen Chennney, Justin Novosad, pdr+graphicswatchlist_chromium.org, blink-reviews, kinuko+watch, ajuma+watch_chromium.org, danakj+watch_chromium.org, rwlbuis
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Avoid exposing cc::Layer tree to CompositorProxy This is the first step in splitting out the AnimationWorklet/CompositorWorker code to run in a separate thread. Instead of exposing LayerImpl objects to the CompositorProxy, create a snapshot of the necessary layers and their mutable properties and pass that down. After mutation, the output set of mutations is used to update the layer tree. There is a small behavioral change here. After this patch, when a single element is proxied multiple times each proxy will only see the initial input value from the layer tree and not any modifications made to it by other proxies. Competing writes by multiple proxies are currently handled in an ad-hoc last write wins approach. BUG=694532 patch from issue 2756703002 at patchset 60001 (http://crrev.com/2756703002#ps60001)

Patch Set 1 #

Patch Set 2 : Minor changes #

Total comments: 15

Patch Set 3 : Address reviewer comments #

Patch Set 4 : Fix usage of element id #

Patch Set 5 : Rebase onto blink reformat #

Total comments: 7
Unified diffs Side-by-side diffs Delta from patch set Stats (+435 lines, -189 lines) Patch
M third_party/WebKit/Source/core/dom/CompositorProxy.h View 1 2 3 4 2 chunks +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/dom/CompositorProxy.cpp View 1 2 3 4 2 chunks +7 lines, -1 line 3 comments Download
M third_party/WebKit/Source/platform/graphics/CompositorMutableProperties.h View 1 2 3 4 1 chunk +19 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/CompositorMutableState.h View 1 2 3 4 2 chunks +3 lines, -9 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/CompositorMutableState.cpp View 1 2 3 4 1 chunk +13 lines, -37 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/CompositorMutableStateProvider.h View 1 2 3 4 2 chunks +6 lines, -9 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/CompositorMutableStateProvider.cpp View 1 2 3 4 2 chunks +10 lines, -15 lines 4 comments Download
M third_party/WebKit/Source/platform/graphics/CompositorMutableStateTest.cpp View 1 2 3 4 2 chunks +34 lines, -110 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/CompositorMutation.h View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/CompositorMutatorClient.h View 1 2 3 4 3 chunks +21 lines, -1 line 0 comments Download
M third_party/WebKit/Source/platform/graphics/CompositorMutatorClient.cpp View 1 2 3 4 3 chunks +165 lines, -1 line 0 comments Download
M third_party/WebKit/Source/platform/graphics/CompositorMutatorClientTest.cpp View 1 2 3 4 3 chunks +133 lines, -5 lines 0 comments Download
M third_party/WebKit/Source/web/CompositorMutatorImpl.h View 1 2 3 4 2 chunks +4 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/web/CompositorMutatorImpl.cpp View 1 2 3 4 1 chunk +15 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/web/CompositorWorkerProxyClientImpl.cpp View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 16 (6 generated)
smcgruer
3 years, 9 months ago (2017-03-22 17:27:44 UTC) #6
flackr
https://codereview.chromium.org/2765053002/diff/20001/third_party/WebKit/Source/core/dom/CompositorProxy.h File third_party/WebKit/Source/core/dom/CompositorProxy.h (right): https://codereview.chromium.org/2765053002/diff/20001/third_party/WebKit/Source/core/dom/CompositorProxy.h#newcode76 third_party/WebKit/Source/core/dom/CompositorProxy.h:76: const uint64_t m_proxyId = 0; Do we need proxyId? ...
3 years, 8 months ago (2017-04-03 17:09:19 UTC) #7
smcgruer
https://codereview.chromium.org/2765053002/diff/20001/third_party/WebKit/Source/core/dom/CompositorProxy.h File third_party/WebKit/Source/core/dom/CompositorProxy.h (right): https://codereview.chromium.org/2765053002/diff/20001/third_party/WebKit/Source/core/dom/CompositorProxy.h#newcode76 third_party/WebKit/Source/core/dom/CompositorProxy.h:76: const uint64_t m_proxyId = 0; On 2017/04/03 17:09:19, flackr ...
3 years, 8 months ago (2017-04-03 17:57:31 UTC) #8
smcgruer
https://codereview.chromium.org/2765053002/diff/20001/third_party/WebKit/Source/platform/graphics/CompositorMutableProperties.h File third_party/WebKit/Source/platform/graphics/CompositorMutableProperties.h (right): https://codereview.chromium.org/2765053002/diff/20001/third_party/WebKit/Source/platform/graphics/CompositorMutableProperties.h#newcode16 third_party/WebKit/Source/platform/graphics/CompositorMutableProperties.h:16: class CompositorMutableProperties { On 2017/04/03 17:09:19, flackr wrote: > ...
3 years, 8 months ago (2017-04-03 19:37:11 UTC) #9
flackr
https://codereview.chromium.org/2765053002/diff/20001/third_party/WebKit/Source/core/dom/CompositorProxy.h File third_party/WebKit/Source/core/dom/CompositorProxy.h (right): https://codereview.chromium.org/2765053002/diff/20001/third_party/WebKit/Source/core/dom/CompositorProxy.h#newcode76 third_party/WebKit/Source/core/dom/CompositorProxy.h:76: const uint64_t m_proxyId = 0; On 2017/04/03 17:57:31, smcgruer ...
3 years, 8 months ago (2017-04-11 17:51:36 UTC) #10
smcgruer
https://codereview.chromium.org/2765053002/diff/80001/third_party/WebKit/Source/core/dom/CompositorProxy.cpp File third_party/WebKit/Source/core/dom/CompositorProxy.cpp (right): https://codereview.chromium.org/2765053002/diff/80001/third_party/WebKit/Source/core/dom/CompositorProxy.cpp#newcode154 third_party/WebKit/Source/core/dom/CompositorProxy.cpp:154: if (IsMainThread()) { On 2017/04/11 17:51:36, flackr wrote: > ...
3 years, 8 months ago (2017-04-19 15:38:39 UTC) #11
flackr
https://codereview.chromium.org/2765053002/diff/80001/third_party/WebKit/Source/core/dom/CompositorProxy.cpp File third_party/WebKit/Source/core/dom/CompositorProxy.cpp (right): https://codereview.chromium.org/2765053002/diff/80001/third_party/WebKit/Source/core/dom/CompositorProxy.cpp#newcode154 third_party/WebKit/Source/core/dom/CompositorProxy.cpp:154: if (IsMainThread()) { On 2017/04/19 15:38:38, smcgruer wrote: > ...
3 years, 8 months ago (2017-04-20 06:54:14 UTC) #12
smcgruer
https://codereview.chromium.org/2765053002/diff/80001/third_party/WebKit/Source/platform/graphics/CompositorMutableStateProvider.cpp File third_party/WebKit/Source/platform/graphics/CompositorMutableStateProvider.cpp (right): https://codereview.chromium.org/2765053002/diff/80001/third_party/WebKit/Source/platform/graphics/CompositorMutableStateProvider.cpp#newcode23 third_party/WebKit/Source/platform/graphics/CompositorMutableStateProvider.cpp:23: CompositorMutableStateProvider::GetMutableStateFor(uint64_t proxy_id) { On 2017/04/20 06:54:14, flackr wrote: > ...
3 years, 8 months ago (2017-04-21 14:42:25 UTC) #13
flackr
On 2017/04/21 14:42:25, smcgruer wrote: > https://codereview.chromium.org/2765053002/diff/80001/third_party/WebKit/Source/platform/graphics/CompositorMutableStateProvider.cpp > File > third_party/WebKit/Source/platform/graphics/CompositorMutableStateProvider.cpp > (right): > > ...
3 years, 8 months ago (2017-04-26 15:50:10 UTC) #14
flackr
3 years, 8 months ago (2017-04-26 15:51:13 UTC) #15
On 2017/04/26 15:50:10, flackr wrote:
> On 2017/04/21 14:42:25, smcgruer wrote:
> >
>
https://codereview.chromium.org/2765053002/diff/80001/third_party/WebKit/Sour...
> > File
> >
third_party/WebKit/Source/platform/graphics/CompositorMutableStateProvider.cpp
> > (right):
> > 
> >
>
https://codereview.chromium.org/2765053002/diff/80001/third_party/WebKit/Sour...
> >
>
third_party/WebKit/Source/platform/graphics/CompositorMutableStateProvider.cpp:23:
> > CompositorMutableStateProvider::GetMutableStateFor(uint64_t proxy_id) {
> > On 2017/04/20 06:54:14, flackr wrote:
> > > Ah I see now, can we intead store the "current" values on the
> CompositorProxy
> > > objects, copying the values into the CompositorProxy object at the same
time
> > as
> > > we give them a CompositorMutableState? I feel like this would be less
> complex.
> > 
> > I'm looking at this, but I don't really see how it simplifies things? We
have
> to
> > store per-proxy state all the way back to CompositorMutatorClient because
each
> > proxy can specify different mutable properties for the element, and we use
> that
> > list of mutable properties to decide what to snapshot in
> > CompositorMutatorClient::SnapshotLayerTree.
> > 
> > We could remove the concept of proxy id, but we would then have to snapshot
> > everything in CompositorMutatorClient::SnapshotLayerTree because there would
> be
> > no way to tell which properties are allowed for an element. That said each
> > individual CompositorProxy already filters for mutable properties in it's
> > getters/setters, so perhaps this is fine?
> 
> I think we resolve this by collecting the union of all proxied properties (in
a
> proxied property bitmask) so we know which properties we need to snapshot to
> read everything that all CompositorProxies may read.

See
https://cs.chromium.org/chromium/src/third_party/WebKit/Source/core/dom/Eleme...
where we increment the counts of proxied properties for each element.

Powered by Google App Engine
This is Rietveld 408576698