RESOLVED FIXED Bug 59159
[chromium] Ensure compositing layers are up to date before entering doComposite
https://bugs.webkit.org/show_bug.cgi?id=59159
Summary [chromium] Ensure compositing layers are up to date before entering doComposite
James Robinson
Reported 2011-04-21 17:18:08 PDT
[chromium] Ensure compositing layers are up to date before entering doComposite
Attachments
Patch (12.21 KB, patch)
2011-04-21 17:21 PDT, James Robinson
no flags
Patch (7.00 KB, patch)
2011-04-27 16:37 PDT, James Robinson
no flags
James Robinson
Comment 1 2011-04-21 17:21:48 PDT
James Robinson
Comment 2 2011-04-21 18:15:08 PDT
My testcase for this is extremely flaky and timing-depending, but the bad case is roughly that at the start of WebViewImpl::composite() we have a composited RenderLayer inside an iframe with a dirty z order list. When we call paintContents() on that layer, it lazily updates the z order list and re-evaluates the compositing requirements on that RenderLayerCompositor which can change the GraphicsLayer tree. This patch avoids the issue by explicitly updating compositing layers for every FrameView (which is 1:1 with RenderLayerCompositor) in the patch, syncing the compositing state for all FrameViews, and then not pumping the event loop until after all the paintContents() calls complete. I've also added some assertions to make it easier to detect this case in debug builds.
Kenneth Russell
Comment 3 2011-04-26 17:10:10 PDT
Comment on attachment 90639 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=90639&action=review Looks good to me. > Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp:64 > +#ifndef NDEBUG > +bool LayerRendererChromium::s_inPaintContents = false; > +#endif Barf!
James Robinson
Comment 4 2011-04-26 17:45:41 PDT
(In reply to comment #3) > (From update of attachment 90639 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=90639&action=review > > Looks good to me. > > > Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp:64 > > +#ifndef NDEBUG > > +bool LayerRendererChromium::s_inPaintContents = false; > > +#endif > > Barf! Do you know of another way to do this?
Kenneth Russell
Comment 5 2011-04-26 18:02:11 PDT
(In reply to comment #4) > (In reply to comment #3) > > (From update of attachment 90639 [details] [details]) > > View in context: https://bugs.webkit.org/attachment.cgi?id=90639&action=review > > > > Looks good to me. > > > > > Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp:64 > > > +#ifndef NDEBUG > > > +bool LayerRendererChromium::s_inPaintContents = false; > > > +#endif > > > > Barf! > > Do you know of another way to do this? Minimally I'd scope the variable inside the LayerRendererChromium instance. But if the debugger makes it difficult to examine it in that case, don't worry about it.
James Robinson
Comment 6 2011-04-26 18:04:14 PDT
(In reply to comment #5) > (In reply to comment #4) > > (In reply to comment #3) > > > (From update of attachment 90639 [details] [details] [details]) > > > View in context: https://bugs.webkit.org/attachment.cgi?id=90639&action=review > > > > > > Looks good to me. > > > > > > > Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp:64 > > > > +#ifndef NDEBUG > > > > +bool LayerRendererChromium::s_inPaintContents = false; > > > > +#endif > > > > > > Barf! > > > > Do you know of another way to do this? > > Minimally I'd scope the variable inside the LayerRendererChromium instance. But if the debugger makes it difficult to examine it in that case, don't worry about it. LayerChromiums are constructed without a LayerRendererChromium pointer, so that doesn't trivially work.
James Robinson
Comment 7 2011-04-27 15:41:41 PDT
WebKit Review Bot
Comment 8 2011-04-27 15:59:55 PDT
http://trac.webkit.org/changeset/85112 might have broken Leopard Intel Debug (Build) and SnowLeopard Intel Release (Build)
James Robinson
Comment 9 2011-04-27 16:01:59 PDT
Reverted r85112 for reason: Broke mac compile Committed r85116: <http://trac.webkit.org/changeset/85116>
James Robinson
Comment 10 2011-04-27 16:09:39 PDT
FrameView.h is included from files in the WebKit project on Mac, so adding a header to FrameView.h requires adding that header to the forwarding headers. Given that CompositingUpdateAfterLayoutOrStyleChange and CompositingUpdateOnPaintingOrHitTest in practice do exactly the same thing I think I'll just not add the parameter to FrameView::updateCompositingLayers()
James Robinson
Comment 11 2011-04-27 16:37:33 PDT
James Robinson
Comment 12 2011-04-27 16:37:49 PDT
Take two - this patch only modifies chromium-specific code.
WebKit Review Bot
Comment 13 2011-04-27 16:54:12 PDT
http://trac.webkit.org/changeset/85116 might have broken SnowLeopard Intel Release (Tests)
Kenneth Russell
Comment 14 2011-04-27 18:32:24 PDT
Comment on attachment 91377 [details] Patch Looks fine to me.
James Robinson
Comment 15 2011-04-27 18:44:01 PDT
Comment on attachment 91377 [details] Patch Clearing flags on attachment: 91377 Committed r85136: <http://trac.webkit.org/changeset/85136>
James Robinson
Comment 16 2011-04-27 18:44:05 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.