Bug 72630

Summary: [Chromium] Calls to paintContentsIfDirty() and updateCompositorResources() should be balanced.
Product: WebKit Reporter: David Reveman <reveman>
Component: WebCore Misc.Assignee: David Reveman <reveman>
Status: RESOLVED FIXED    
Severity: Normal CC: cc-bugs, enne, jamesr, nduca, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 71388    
Attachments:
Description Flags
Patch
none
Patch
none
Patch none

David Reveman
Reported 2011-11-17 10:15:32 PST
Layer property changes during paintContent() can leave the layer in an invalid state as paintContentsIfDirty() has been called without a matching updateCompositorResources() call. Removing conditionals around these calls ensure they are balanced. This change can result in unnecessary uploads but that can be properly solved using this change: https://bugs.webkit.org/show_bug.cgi?id=72192
Attachments
Patch (8.60 KB, patch)
2011-11-17 10:44 PST, David Reveman
no flags
Patch (10.87 KB, patch)
2011-11-17 11:50 PST, David Reveman
no flags
Patch (14.49 KB, patch)
2011-11-17 14:03 PST, David Reveman
no flags
David Reveman
Comment 1 2011-11-17 10:44:06 PST
Adrienne Walker
Comment 2 2011-11-17 11:44:27 PST
Comment on attachment 115620 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=115620&action=review I wish there were some better way to assert that this never happened in practice. Do you think it'd be a good idea to store the compositor frame that is being painted in TiledLayerChromium::prepareToUpdate and assert/early-out if the frame number is different during TiledLayerChromium::updateCompositorResources? > Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp:-339 > - if (layer->drawsContent()) > - layer->paintContentsIfDirty(); Can you leave the drawsContent() check both here and in updateCompositorResources? Otherwise, you're going to trip asserts like the ASSERT(drawsContent()) in VideoLayerChromium::updateCompositorResources.
David Reveman
Comment 3 2011-11-17 11:50:09 PST
David Reveman
Comment 4 2011-11-17 11:54:15 PST
(In reply to comment #2) > (From update of attachment 115620 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=115620&action=review > > I wish there were some better way to assert that this never happened in practice. Do you think it'd be a good idea to store the compositor frame that is being painted in TiledLayerChromium::prepareToUpdate and assert/early-out if the frame number is different during TiledLayerChromium::updateCompositorResources? > > > Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp:-339 > > - if (layer->drawsContent()) > > - layer->paintContentsIfDirty(); > > Can you leave the drawsContent() check both here and in updateCompositorResources? Otherwise, you're going to trip asserts like the ASSERT(drawsContent()) in VideoLayerChromium::updateCompositorResources. Realized this just after uploading the previous patch. I think my new patch handles this properly. We need to make sure that if one of these calls are made the other needs to be made as well. It will be easy to avoid both calls when 72192 has landed.
James Robinson
Comment 5 2011-11-17 12:19:22 PST
Comment on attachment 115642 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=115642&action=review > Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp:338 > static void paintContentsIfDirty(LayerChromium* layer) > { > - if (layer->drawsContent()) > - layer->paintContentsIfDirty(); > + layer->paintContentsIfDirty(); this helper isn't useful any more, can you just inline it?
James Robinson
Comment 6 2011-11-17 13:02:11 PST
David Reveman
Comment 7 2011-11-17 14:03:38 PST
David Reveman
Comment 8 2011-11-17 14:04:19 PST
(In reply to comment #5) > (From update of attachment 115642 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=115642&action=review > > > Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp:338 > > static void paintContentsIfDirty(LayerChromium* layer) > > { > > - if (layer->drawsContent()) > > - layer->paintContentsIfDirty(); > > + layer->paintContentsIfDirty(); > > this helper isn't useful any more, can you just inline it? Fixed.
David Reveman
Comment 9 2011-11-17 14:10:21 PST
(In reply to comment #6) > Does https://bugs.webkit.org/show_bug.cgi?id=71038 simplify this? That change is great as it makes this fix less likely to cause a performance regression.
James Robinson
Comment 10 2011-11-17 14:21:17 PST
Comment on attachment 115671 [details] Patch Looks great, R=me. Could you let Enne check it over before landing?
Adrienne Walker
Comment 11 2011-11-17 14:56:01 PST
Comment on attachment 115671 [details] Patch LGTM
WebKit Review Bot
Comment 12 2011-11-17 16:49:17 PST
Comment on attachment 115671 [details] Patch Clearing flags on attachment: 115671 Committed r100702: <http://trac.webkit.org/changeset/100702>
WebKit Review Bot
Comment 13 2011-11-17 16:49:22 PST
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.