willReadFrequently already implies this; however that can't
be enabled on Windows. We can use our own attribute to control
the value as it plumbs into the depths of Canvas2D and WebGL
Differential Revision: https://phabricator.services.mozilla.com/D212178
The WebGL spec never added this, and WebGL expects this to change via
drawingBufferColorSpace, so I don't think we should push for a spec
addition for .colorSpace.
Differential Revision: https://phabricator.services.mozilla.com/D217350
We must ensure that a SharedSurface_EGLImage outlives its
corresponding RenderEGLImageTextureHost, so that
RenderEGLImageTextureHost does not attempt to wait on an EGLSync that
has been destroyed. This can be achieved by passing the surface to
RemoteTextureOwnerClient::PushTexture(), ensuring the RemoteTextureMap
keeps it alive.
However, we must be careful not to recycle the SharedSurface_EGLImage,
as that is currently not supported. To achieve this, we make
RemoteTextureMap::RecycleTexture() only recycle SharedSurfaces whose
mDesc.canRecycle value is true.
Differential Revision: https://phabricator.services.mozilla.com/D211292
We must ensure that a SharedSurface_EGLImage outlives its
corresponding RenderEGLImageTextureHost, so that
RenderEGLImageTextureHost does not attempt to wait on an EGLSync that
has been destroyed. This can be achieved by passing the surface to
RemoteTextureOwnerClient::PushTexture(), ensuring the RemoteTextureMap
keeps it alive.
However, we must be careful not to recycle the SharedSurface_EGLImage,
as that is currently not supported. To achieve this, we make
RemoteTextureMap::RecycleTexture() only recycle SharedSurfaces whose
mDesc.canRecycle value is true.
Differential Revision: https://phabricator.services.mozilla.com/D211292
willReadFrequently already implies this; however that can't
be enabled on Windows. We can use our own attribute to control
the value as it plumbs into the depths of Canvas2D and WebGL
Differential Revision: https://phabricator.services.mozilla.com/D212178
willReadFrequently already implies this; however that can't
be enabled on Windows. We can use our own attribute to control
the value as it plumbs into the depths of Canvas2D and WebGL
Differential Revision: https://phabricator.services.mozilla.com/D212178
This reverts commit e25a5f344af32bdd689500bae7b4f24f205ba9f0.
We believe bug 1664063 was causing to hit some broken device reset
handling code.
Differential Revision: https://phabricator.services.mozilla.com/D201658
CopyToSwapChain was silently failing, causing no texture to get pushed
to RemoteTextureMap, so that when a wait on it was occurring, it would
timeout.
The failure occurred in DrawTargetWebgl::FlushFromSkia, because the
DT's size actually exceeded the value of the texture limit pref when
it was attempting to allocate a temporary texture to blend back a
Skia layer to the WebGL framebuffer. This is fixed by allowing layering
to bypass this limit, as it is always expected that layer blending
succeed.
To guard against future instances of this bug, CopyToSwapChain now returns
a boolean result so that it is fallible and can signal to CanvasTranslator
that it needs to take appropriate fallback measures on failure.
Differential Revision: https://phabricator.services.mozilla.com/D199794
During testing Bug 1863257, there were cases that test failed with timeout in RemoteTextureMap::WaitRemoteTextureReady(). In this case, RemoteTextureOwner was not registered since first Surface allocation was failed at GeckoProcessManager.getSurfaceAllocator().
Even with the case, RemoteTextureOwner should be registered as context lost.
Differential Revision: https://phabricator.services.mozilla.com/D199312
It looks like we're accidentally putting SharedSurfaces that came from a different
SurfaceFactory back into a different one recycling. This happens because on context
loss in CanvasTranslator, the old GL context may go away, though the RemoteTextureOwnerClient
has a shared recycling bin that might accidentally keep the old surfaces.
This also tries to clear the old recycled surfaces as soon as possible on a context
loss now.
Differential Revision: https://phabricator.services.mozilla.com/D198918
When a context loss occurs on DrawTargetWebgl, this may result in a fallback TextureData
being created. Each of these are currently managed by two different RemoteTextureOwnerClients.
This is not really safe at all.
To fix this, CopyToSwapChain is modified so that it can be supplied a RemoteTextureOwnerClient.
Then CanvasTranslator can inject its own RemoteTextureOwnerClient into CopyToSwapChain, rather
than letting CopyToSwapChain use its own separate internal RemoteTextureOwnerClient.
This also tries to address a few other data consistency bugs with the fallback TextureData.
Differential Revision: https://phabricator.services.mozilla.com/D198487
This was a change for bug 1872087 that somehow got lost when I was rebasing. The idea
here is that DrawTargetWebgls use a single shared WebGL context, so it makes sense for
them to share recycle texture data, much like CanvasTranslator shares recycling of
texture data for D2D. This should increase the efficiency of use-cases that create and
destroy a lot of canvases every frame and would not normally benefit from recycling.
Depends on D197375
Differential Revision: https://phabricator.services.mozilla.com/D197376
This was a change for bug 1872087 that somehow got lost when I was rebasing. The idea
here is that DrawTargetWebgls use a single shared WebGL context, so it makes sense for
them to share recycle texture data, much like CanvasTranslator shares recycling of
texture data for D2D. This should increase the efficiency of use-cases that create and
destroy a lot of canvases every frame and would not normally benefit from recycling.
Depends on D197375
Differential Revision: https://phabricator.services.mozilla.com/D197376
Since we're not using WebGL remoting, we no longer have direct knowledge of the pid across
the IPDL gap inside WebGLContext. This must be explicitly passed in.
Differential Revision: https://phabricator.services.mozilla.com/D194348
DrawTargetWebgl will use WebGLContext in a direct, non-networked capacity. Currently
there are only a few places WebGLContext actually checks for a host context, and those
are easily stubbed our or made conditional.
Differential Revision: https://phabricator.services.mozilla.com/D194347
When we call IDXGIKeyedMutex::AcquireSync, we need to check for a
general failure, WAIT_ABANDONED and WAIT_TIMEOUT. The last two are
special because Microsoft's SUCCEEDED and FAILED macros consider them
successful.
Differential Revision: https://phabricator.services.mozilla.com/D196668
Since we're not using WebGL remoting, we no longer have direct knowledge of the pid across
the IPDL gap inside WebGLContext. This must be explicitly passed in.
Differential Revision: https://phabricator.services.mozilla.com/D194348
DrawTargetWebgl will use WebGLContext in a direct, non-networked capacity. Currently
there are only a few places WebGLContext actually checks for a host context, and those
are easily stubbed our or made conditional.
Differential Revision: https://phabricator.services.mozilla.com/D194347
This patch makes it so that WebGL that runs in the compositor process
can take advantage of the fact that GPUVideoImage should have an already
created TextureHost between the compositor process and the producing
utility process. For software decoders, this will allow us to avoid a
copy into a shmem from the utility process, and another copy into a
shmem to the compositor process.
Differential Revision: https://phabricator.services.mozilla.com/D195559
Since we're not using WebGL remoting, we no longer have direct knowledge of the pid across
the IPDL gap inside WebGLContext. This must be explicitly passed in.
Differential Revision: https://phabricator.services.mozilla.com/D194348
DrawTargetWebgl will use WebGLContext in a direct, non-networked capacity. Currently
there are only a few places WebGLContext actually checks for a host context, and those
are easily stubbed our or made conditional.
Differential Revision: https://phabricator.services.mozilla.com/D194347
This allows for disabling WebGL's use of GL_KHR_no_error, rather than the default of enabled.
Use snake_case so that searching for KHR_no_error finds this more
easily.
Differential Revision: https://phabricator.services.mozilla.com/D188781
SharedSurface_DMABUF::ToSurfaceDescriptor() could return Nothing() with error. It needs to be handled as failure.
SharedSurface::ToSurfaceDescriptor() is expected to return Nothing() only with SharedSurface_Basic.
Differential Revision: https://phabricator.services.mozilla.com/D188078