WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
Bug 94145
[chromium] Add the ubercomp WebDelegatedRendererLayer
https://bugs.webkit.org/show_bug.cgi?id=94145
Summary
[chromium] Add the ubercomp WebDelegatedRendererLayer
Dana Jansens
Reported
2012-08-15 13:46:42 PDT
[chromium] Add boilderplate for ubercomp DelegatingRendererLayer
Attachments
Patch
(22.62 KB, patch)
2012-08-15 13:52 PDT
,
Dana Jansens
no flags
Details
Formatted Diff
Diff
Patch
(22.91 KB, patch)
2012-08-15 14:13 PDT
,
Dana Jansens
no flags
Details
Formatted Diff
Diff
Patch
(22.85 KB, patch)
2012-08-24 13:33 PDT
,
Dana Jansens
no flags
Details
Formatted Diff
Diff
Patch
(61.03 KB, patch)
2012-08-31 14:45 PDT
,
Dana Jansens
no flags
Details
Formatted Diff
Diff
Patch
(67.98 KB, patch)
2012-09-07 16:59 PDT
,
Dana Jansens
no flags
Details
Formatted Diff
Diff
Patch
(67.98 KB, patch)
2012-09-07 17:03 PDT
,
Dana Jansens
no flags
Details
Formatted Diff
Diff
Patch
(4.91 KB, patch)
2012-09-13 14:09 PDT
,
Dana Jansens
no flags
Details
Formatted Diff
Diff
Patch
(5.15 KB, patch)
2012-09-13 17:12 PDT
,
Dana Jansens
no flags
Details
Formatted Diff
Diff
Patch for landing
(5.15 KB, patch)
2012-09-14 10:35 PDT
,
Dana Jansens
no flags
Details
Formatted Diff
Diff
Show Obsolete
(8)
View All
Add attachment
proposed patch, testcase, etc.
Dana Jansens
Comment 1
2012-08-15 13:52:21 PDT
Created
attachment 158633
[details]
Patch
WebKit Review Bot
Comment 2
2012-08-15 13:56:08 PDT
Please wait for approval from
abarth@webkit.org
,
dglazkov@chromium.org
,
fishd@chromium.org
,
jamesr@chromium.org
or
tkent@chromium.org
before submitting, as this patch contains changes to the Chromium public API. See also
https://trac.webkit.org/wiki/ChromiumWebKitAPI
.
Peter Beverloo (cr-android ews)
Comment 3
2012-08-15 14:07:06 PDT
Comment on
attachment 158633
[details]
Patch
Attachment 158633
[details]
did not pass cr-android-ews (chromium-android): Output:
http://queues.webkit.org/results/13504713
Dana Jansens
Comment 4
2012-08-15 14:13:59 PDT
Created
attachment 158635
[details]
Patch
Dana Jansens
Comment 5
2012-08-24 13:33:00 PDT
Created
attachment 160489
[details]
Patch
Adrienne Walker
Comment 6
2012-08-27 10:05:33 PDT
Comment on
attachment 160489
[details]
Patch I'm confused why you want to land the boilerplate separately. I mean, it seems likely that these classes are probably going to be the ones you need, but it's hard to review something with no functionality.
Dana Jansens
Comment 7
2012-08-27 10:06:50 PDT
Oh, okay. Just trying to keep patch sizes smaller and do this incrementally. I can do it along with stuff inside the layer instead.
Dana Jansens
Comment 8
2012-08-31 14:45:22 PDT
Created
attachment 161781
[details]
Patch
Dana Jansens
Comment 9
2012-08-31 14:47:18 PDT
This is what I am picturing for the DRLayer. It has some tests showing what works (and the last test showing what doesn't yet). It depends on the copy() mechanisms for quads and renderpasses, as well as the new renderpass id pair. There's some fixmes in the CCDRLayerImpl.cpp file where things need to get filled in still. Also the logic in CCLTHI needs to be improved a bit..
Dana Jansens
Comment 10
2012-08-31 14:49:47 PDT
Rough design sketch is also available here, though it doesn't match 100% what came out in the end.
https://docs.google.com/a/google.com/document/d/1R8HOhHD6fFsqtSmH6a9bSlMOruCu5ufF7p5Og-eQGTM/edit
Dana Jansens
Comment 11
2012-09-07 16:59:43 PDT
Created
attachment 162908
[details]
Patch
Dana Jansens
Comment 12
2012-09-07 17:00:14 PDT
Here's a fully functioning ubercomp layer for your enjoyment :D
Dana Jansens
Comment 13
2012-09-07 17:03:26 PDT
Created
attachment 162910
[details]
Patch fixing a typo in assert
Adrienne Walker
Comment 14
2012-09-10 12:58:28 PDT
Comment on
attachment 162910
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=162910&action=review
In general, looks great. A few minor nits:
> Source/WebCore/platform/graphics/chromium/RenderSurfaceChromium.h:82 > + void addContributingDelegatedRenderPassLayer(LayerChromium*) { }
Maybe add a comment about why this can be a no-op?
> Source/WebCore/platform/graphics/chromium/cc/CCDelegatedRendererLayerImpl.cpp:52 > + // FIXME: This could possibly return false even though there are some > + // quads present as they could all be from a single layer (or set of > + // layers without children). If this happens, then make a test that > + // ensures the opacity is being changed on quads in the root RenderPass > + // when this layer doesn't own a RenderSurface.
Yeah, I think this is an ok false positive for now. If that FIXME gets addressed, we're probably going to need to rename descendantDrawsContent, or split it up into the three different cases that CCLTHCommon is looking for when implicitly creating a render surface.
> Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:321 > + if (it->hasContributingDelegatedRenderPasses()) {
This block of code seriously needs at least a comment or two.
> Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:322 > + for (size_t i = 0; i < frame.renderPasses.size(); ++i) {
Do you have to walk through every render pass here?
> Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:325 > + if (renderPass == targetRenderPass) > + continue;
This continue is because the delegated layer would have already been asked to append quads for its root pass as a part of whatever target that is drawing into?
> Source/WebKit/chromium/tests/CCDelegatedRendererLayerImplTest.cpp:90 > +class DrawingLayerImpl : public CCSolidColorLayerImpl { > +public: > + static PassOwnPtr<DrawingLayerImpl> create(int id) { return adoptPtr(new DrawingLayerImpl(id)); } > +protected: > + explicit DrawingLayerImpl(int id) : CCSolidColorLayerImpl(id) { setDrawsContent(true); } > +};
Where does this get used?
Antoine Labour
Comment 15
2012-09-10 13:35:08 PDT
Comment on
attachment 162910
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=162910&action=review
Awesome!
> Source/WebKit/chromium/tests/CCDelegatedRendererLayerImplTest.cpp:190 > + OwnPtr<CCDelegatedRendererLayerImpl> m_delegatedRendererLayer;
nit: it could be confusing to have all of these as members even though they're all NULL in tests. They could just be local variables in the constructor, right?
> Source/WebKit/chromium/tests/CCLayerTreeHostImplTest.cpp:2580 > + delegatedRendererLayer->setLayerTreeHostImpl(m_hostImpl.get());
As is, this currently doesn't test much. How hard would it be to add non-trivial render passes to the delegatedRendererLayer here? I think CCDelegatedRendererLayerImpl would need to clear its render passes when losing the context (and wait for the next commit to get the new render passes).
> Source/WebKit/chromium/tests/CCLayerTreeHostImplTest.cpp:2714 > + delegatedRendererLayer->setLayerTreeHostImpl(m_hostImpl.get());
Same here.
Dana Jansens
Comment 16
2012-09-13 14:04:28 PDT
(In reply to
comment #14
)
> (From update of
attachment 162910
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=162910&action=review
> > In general, looks great. A few minor nits:
ty!
> > Source/WebCore/platform/graphics/chromium/RenderSurfaceChromium.h:82 > > + void addContributingDelegatedRenderPassLayer(LayerChromium*) { } > > Maybe add a comment about why this can be a no-op?
Sure.
> > Source/WebCore/platform/graphics/chromium/cc/CCDelegatedRendererLayerImpl.cpp:52 > > + // FIXME: This could possibly return false even though there are some > > + // quads present as they could all be from a single layer (or set of > > + // layers without children). If this happens, then make a test that > > + // ensures the opacity is being changed on quads in the root RenderPass > > + // when this layer doesn't own a RenderSurface. > > Yeah, I think this is an ok false positive for now. If that FIXME gets addressed, we're probably going to need to rename descendantDrawsContent, or split it up into the three different cases that CCLTHCommon is looking for when implicitly creating a render surface. > > > Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:321 > > + if (it->hasContributingDelegatedRenderPasses()) { > > This block of code seriously needs at least a comment or two.
k.
> > Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:322 > > + for (size_t i = 0; i < frame.renderPasses.size(); ++i) { > > Do you have to walk through every render pass here?
No, we can do better.. It occurs to me that the RenderPass::id structure means we can just iterate by index and check contains() in the hash map to get them all.
> > Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:325 > > + if (renderPass == targetRenderPass) > > + continue; > > This continue is because the delegated layer would have already been asked to append quads for its root pass as a part of whatever target that is drawing into?
Yep.
> > Source/WebKit/chromium/tests/CCDelegatedRendererLayerImplTest.cpp:90 > > +class DrawingLayerImpl : public CCSolidColorLayerImpl { > > +public: > > + static PassOwnPtr<DrawingLayerImpl> create(int id) { return adoptPtr(new DrawingLayerImpl(id)); } > > +protected: > > + explicit DrawingLayerImpl(int id) : CCSolidColorLayerImpl(id) { setDrawsContent(true); } > > +}; > > Where does this get used?
Right, I made everything use solid color layer to not need this. Removed. (In reply to
comment #15
)
> (From update of
attachment 162910
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=162910&action=review
> > Awesome! > > > Source/WebKit/chromium/tests/CCDelegatedRendererLayerImplTest.cpp:190 > > + OwnPtr<CCDelegatedRendererLayerImpl> m_delegatedRendererLayer; > > nit: it could be confusing to have all of these as members even though they're all NULL in tests. They could just be local variables in the constructor, right?
Yeh true. Will do.
> > Source/WebKit/chromium/tests/CCLayerTreeHostImplTest.cpp:2580 > > + delegatedRendererLayer->setLayerTreeHostImpl(m_hostImpl.get()); > > As is, this currently doesn't test much. How hard would it be to add non-trivial render passes to the delegatedRendererLayer here? I think CCDelegatedRendererLayerImpl would need to clear its render passes when losing the context (and wait for the next commit to get the new render passes).
Ya absolutely, thanks for pointing this out.
> > Source/WebKit/chromium/tests/CCLayerTreeHostImplTest.cpp:2714 > > + delegatedRendererLayer->setLayerTreeHostImpl(m_hostImpl.get()); > > Same here.
Same :)
Dana Jansens
Comment 17
2012-09-13 14:09:02 PDT
Created
attachment 163961
[details]
Patch the WebDelegatedRendererLayer header for Platform/. the rest will move to src/cc
James Robinson
Comment 18
2012-09-13 15:23:14 PDT
Comment on
attachment 163961
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=163961&action=review
> Source/Platform/chromium/public/WebDelegatedRendererLayer.h:34 > +// This class represents a layer that renders the output of another > +// delegating compositor.
Could you expand a bit on how this is used and what it does? Do we even need this to be exposed in WebKit APIs? I.e. would WebKit ever construct one of these, or would it only be created by the browser compositor?
Dana Jansens
Comment 19
2012-09-13 16:57:44 PDT
Comment on
attachment 163961
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=163961&action=review
>> Source/Platform/chromium/public/WebDelegatedRendererLayer.h:34 >> +// delegating compositor. > > Could you expand a bit on how this is used and what it does? > > Do we even need this to be exposed in WebKit APIs? I.e. would WebKit ever construct one of these, or would it only be created by the browser compositor?
The layer holds a set of RenderPasses given to it from another compositor (via RenderWidgetHostViewAura). The current implementation of the layer is expecting to receive the passes directly on the impl thread so there's no methods here. If that changes (based on meeting just now it might) then we would add a setRenderPasses() method to this for the main thread to access from RWHVA. In my foggy planning mind it is owned by a RenderWidgetViewHostAura. I figured it needs a Web version to create and own the layer, similar to a WebContentLayer or something in the UI. It would be a child of some other aura UI layer. WebKit will never be constructing them (though I'm not sure where in WebKit we could possibly make one..WebView?).
James Robinson
Comment 20
2012-09-13 17:05:09 PDT
I meant to put that sort of information in a comment in the header file so people reading the file know what is going on.
Dana Jansens
Comment 21
2012-09-13 17:08:27 PDT
(In reply to
comment #20
)
> I meant to put that sort of information in a comment in the header file so people reading the file know what is going on.
Oh :)
Dana Jansens
Comment 22
2012-09-13 17:12:09 PDT
Created
attachment 164005
[details]
Patch
Adrienne Walker
Comment 23
2012-09-14 10:32:50 PDT
Comment on
attachment 164005
[details]
Patch R=me.
Dana Jansens
Comment 24
2012-09-14 10:35:34 PDT
Created
attachment 164186
[details]
Patch for landing
WebKit Review Bot
Comment 25
2012-09-14 10:59:19 PDT
Comment on
attachment 164186
[details]
Patch for landing Clearing flags on attachment: 164186 Committed
r128630
: <
http://trac.webkit.org/changeset/128630
>
WebKit Review Bot
Comment 26
2012-09-14 10:59:24 PDT
All reviewed patches have been landed. Closing bug.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug