Move the initialization of SharedSurfacesParent from the compositor
thread creation to mirror the other WebRender-specific components, such
as the render thread creation. Now it will only be created if WebRender
is in use. Also prevent shared surfaces from being used by the image
frame allocator, even if image.mem.shared is set -- there is no purpose
in allowing this at present. It was causing startup crashes for users
who requested image.mem.shared and/or WebRender via gfx.webrender.all
but did not actually get WebRender at all. Surfaces would get allocated
in the shared memory, try to register themselves with the WR render
thread, and then crash since that thread was never created.
Move the initialization of SharedSurfacesParent from the compositor
thread creation to mirror the other WebRender-specific components, such
as the render thread creation. Now it will only be created if WebRender
is in use. Also prevent shared surfaces from being used by the image
frame allocator, even if image.mem.shared is set -- there is no purpose
in allowing this at present. It was causing startup crashes for users
who requested image.mem.shared and/or WebRender via gfx.webrender.all
but did not actually get WebRender at all. Surfaces would get allocated
in the shared memory, try to register themselves with the WR render
thread, and then crash since that thread was never created.
SourceSurfaceSharedData objects have a WrImageKey associated with each
WebRenderBridgeChild/WebRenderLayerManager pairing. Normally this key is
only regenerated when the surface itself needs to invalidate. However
when a tab is moved (e.g. dragged into a new/different window), the
WebRenderBridgeChild's state will be reset. Any existing keys were
discarded and it has a new namespace. SourceSurfaceSharedData needs to
take this into account, and generate a new key when there is a namespace
mismatch.
The flag of force update is only for fallback items. Fallback items can't share the images with other items.
So I replace 'aForceUpdate' with 'aFallback' and remove some unnecessary checks.
MozReview-Commit-ID: Dcu95FZXlUz
--HG--
extra : rebase_source : 1ec96e0b5d39cc5760b4b5490c5ca9ccbc1933c6