RESOLVED FIXED 76675
[chromium] Remove setLayerTreeHost nonsense on lost context
https://bugs.webkit.org/show_bug.cgi?id=76675
Summary [chromium] Remove setLayerTreeHost nonsense on lost context
James Robinson
Reported 2012-01-19 17:19:09 PST
[chromium] Remove setLayerTreeHost nonsense on lost context
Attachments
Patch (1.62 KB, patch)
2012-01-19 17:20 PST, James Robinson
kbr: review+
James Robinson
Comment 1 2012-01-19 17:20:30 PST
James Robinson
Comment 2 2012-01-19 17:22:38 PST
Pretty simple. This codepath used to do more back when layers managed their own textures, but since everything either uses managed textures (content/image/video layers) or has its own context lost management (webgl/plugin) we don't have to do anything special when losing a context. setLayerTreeHost() is now only called when: *) A layer enters a tree *) A layer leaves a tree *) A layer moves from one tree to another (for example moves from being inside a tab to a window.open()'d popup)
James Robinson
Comment 3 2012-01-19 17:23:33 PST
Tested by: platform/chromium/compositing/*lost-context* manually opening poster circle, a page with html5 video, and a webgl sample and killing the GPU process
Nat Duca
Comment 4 2012-01-19 17:23:39 PST
Comment on attachment 123226 [details] Patch Looks highly amusing to me. Which should rhyme with LGTM but doesnt.
Vangelis Kokkevis
Comment 5 2012-01-19 22:59:46 PST
Comment on attachment 123226 [details] Patch Do we end up calling evictAndDeleteAllTextures and if so are we trying to delete textures in a context that no longer exists?
James Robinson
Comment 6 2012-01-20 11:08:29 PST
(In reply to comment #5) > (From update of attachment 123226 [details]) > Do we end up calling evictAndDeleteAllTextures and if so are we trying to delete textures in a context that no longer exists? We do and we are (relying on all GL calls on a lost context being no-ops, which they are). We could add a path that goes through the normal eviction path but doesn't actually issue any GL calls if we were concerned about this.
Adrienne Walker
Comment 7 2012-01-20 11:47:07 PST
LGTM2. Now that all layer types are using ManagedTexture, this should be safe to do.
Alok Priyadarshi
Comment 8 2012-01-26 13:38:32 PST
(In reply to comment #2) > Pretty simple. This codepath used to do more back when layers managed their own textures, but since everything either uses managed textures (content/image/video layers) or has its own context lost management (webgl/plugin) we don't have to do anything special when losing a context. > > setLayerTreeHost() is now only called when: > *) A layer enters a tree > *) A layer leaves a tree > *) A layer moves from one tree to another (for example moves from being inside a tab to a window.open()'d popup) This is a good change. I just wanted point out a slightly related bug: https://bugs.webkit.org/show_bug.cgi?id=77135 setLayerTreeHost() also get called even when a layer remains in the same tree: 1. Moving a layer within the tree. See WebCore::RenderLayer::removeOnlyThisLayer(). 2. GraphicsLayer::setChildren() removes-adds the layers common in the current child-list and the new child-list Since setLayerTreeHost(0) also triggers resource cleanup, these two cases sometimes severely affect performance due to unnecessary work.
Kenneth Russell
Comment 9 2012-01-26 14:42:58 PST
Comment on attachment 123226 [details] Patch r=me based on enne's review.
James Robinson
Comment 10 2012-01-26 14:47:09 PST
Note You need to log in before you can comment on or make changes to this bug.