Граф коммитов

2600 Коммитов

Автор SHA1 Сообщение Дата
stransky 8753e5afaf Bug 1833855 [Linux] Build dmabuf support on Linux/Gtk and don't request Wayland for it r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D178634
2023-06-22 11:17:23 +00:00
Cristian Tuns 684fec2fef Backed out 14 changesets (bug 1833855) for causing build bustages in SharedSurface.cpp CLOSED TREE
Backed out changeset c3f7d1963902 (bug 1833855)
Backed out changeset 347c47f5542a (bug 1833855)
Backed out changeset 2c0807d0b39a (bug 1833855)
Backed out changeset 013d1d16194d (bug 1833855)
Backed out changeset 2e49d43a627c (bug 1833855)
Backed out changeset ea21e90a71dd (bug 1833855)
Backed out changeset 8d5d0690668c (bug 1833855)
Backed out changeset 4eb11068275d (bug 1833855)
Backed out changeset 15120d9c5b24 (bug 1833855)
Backed out changeset b75750bb7596 (bug 1833855)
Backed out changeset 6f94e3f002ed (bug 1833855)
Backed out changeset 3235825211f9 (bug 1833855)
Backed out changeset 47a6e9ed8828 (bug 1833855)
Backed out changeset b8013c43aa20 (bug 1833855)
2023-06-22 05:29:12 -04:00
stransky 46005fd4fc Bug 1833855 [Linux] Replace kIsX11 and kIsWayland with kIsLinux r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D178647
2023-06-22 08:35:58 +00:00
stransky a5e8bfe6b4 Bug 1833855 [Linux] Build dmabuf support on Linux/Gtk and don't request Wayland for it r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D178634
2023-06-22 08:35:56 +00:00
Brad Werth 2af89d148a Bug 1834922: Update GLContextEAGL method signature to match superclass definition. r=jgilbert
Matching the pointer type for the unused parameter ensures that compilers
will recognize this as an override method.

Differential Revision: https://phabricator.services.mozilla.com/D179983
2023-06-16 22:21:24 +00:00
Emilio Cobos Álvarez cea323d30e Bug 1837816 - Make selector cache not tied to a document. r=media-playback-reviewers,karlt,mstange
It doesn't really need to.

Differential Revision: https://phabricator.services.mozilla.com/D180591
2023-06-16 17:20:42 +00:00
stransky 1e42fec5f4 Bug 1829414 [Wayland] Don't crash if we're getting EGL window for hidden GtkWindow on Wayland r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D177689
2023-05-11 07:36:08 +00:00
stransky 851dc88347 Bug 1828071 [Linux] Rename nsDMABufDevice to DMABufDevice and nsGbmLib to GbmLib r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D176508
2023-04-26 12:52:09 +00:00
stransky 9e813895f1 Bug 1828071 [Linux] Update DMABuf setup r=emilio
- Make dmabuf preferences static so we don't need GetDMABufDevice() to access them.
- Configure GetDMABufDevice() when it's created.
- Init dmabuf members directly in class.
- Removed unused methods.

Differential Revision: https://phabricator.services.mozilla.com/D176404
2023-04-26 12:52:09 +00:00
Cristina Horotan 91e7aee4b8 Backed out 6 changesets (bug 1829303, bug 1828071) for causing causing Linux crashes (bug 1829462) a=backout
Backed out changeset 90256c29ed1f (bug 1829303)
Backed out changeset 9c6ea77a90eb (bug 1828071)
Backed out changeset b71c46d9b101 (bug 1828071)
Backed out changeset c333d6127dfe (bug 1828071)
Backed out changeset c2c5841b88e0 (bug 1828071)
Backed out changeset 0b2180c4f9a5 (bug 1828071)
2023-04-24 12:50:04 +03:00
stransky 769c1d4630 Bug 1828071 [Linux] Use static preferences in nsDMABufDevice r=emilio
There's no need to create nsDMABufDevice just to get/set dmabuf config.

Differential Revision: https://phabricator.services.mozilla.com/D175469
2023-04-21 10:25:37 +00:00
Natalia Csoregi 06077d4459 Backed out 3 changesets (bug 1828071) for causing leaks. CLOSED TREE
Backed out changeset 1e49ad06cd44 (bug 1828071)
Backed out changeset 12d28dd0b9e2 (bug 1828071)
Backed out changeset 328ba92c5afe (bug 1828071)
2023-04-19 01:22:06 +03:00
stransky 1132652264 Bug 1828071 [Linux] Use static preferences in nsDMABufDevice r=emilio
There's no need to create nsDMABufDevice just to get/set dmabuf config.

Differential Revision: https://phabricator.services.mozilla.com/D175469
2023-04-18 20:53:44 +00:00
Jamie Nicol 942a3f5367 Bug 1826134 - Avoid interleaving glBufferSubData calls with draw calls in DrawTargetWebgl. r=gfx-reviewers,jgilbert,lsalzman
DrawTargetWebgl renders a path by uploading vertex data to the back of
a large VBO using glBufferSubData then issuing a draw call, orphaning
the buffer when it becomes full. This results in many glBufferSubData
calls being interleaved with draw calls. On Mali GPUs this causes
severe performance issues as the driver is unable to determine that
any pending draw calls do not reference the updated region of the
buffer, and therefore must create a copy of the buffer for each
update.

However, since *we* know that we never overwrite a region that is
referenced by a submitted draw call, we can force the driver to avoid
making these copies. We do so by adding a new function
UnsynchronizedBufferSubData(), which acts like BufferSubData so long
as this rule is followed. Internally, this uses glMapBufferRange with
GL_MAP_UNSYNCHRONIZED_BIT, allowing the driver to omit the extraneous
copies.

Differential Revision: https://phabricator.services.mozilla.com/D174685
2023-04-07 07:25:50 +00:00
Kelsey Gilbert 58bc15010f Bug 1804368 - Add webgl.forbid-software/forbid-hardware on Mac. r=gfx-reviewers,lsalzman
I would prefer to leave "this doesn't work on linux/windows/android as open bugs to be handled later.

Differential Revision: https://phabricator.services.mozilla.com/D164016
2023-04-03 21:25:41 +00:00
Kelsey Gilbert 7a17e909ef Bug 1825673 - Implement WEBGL_provoking_vertex. r=gfx-reviewers,webidl,lsalzman,saschanaz
Differential Revision: https://phabricator.services.mozilla.com/D174197
2023-04-01 00:33:25 +00:00
Noemi Erli c41e3f4330 Backed out changeset bc8c5f1973ff (bug 1825673) for causing mochitest failures in test_GridElementWidthResizer.html CLOSED TREE 2023-03-31 23:14:09 +03:00
Kelsey Gilbert 91a9368bb8 Bug 1825673 - Implement WEBGL_provoking_vertex. r=gfx-reviewers,webidl,lsalzman,saschanaz
Differential Revision: https://phabricator.services.mozilla.com/D174197
2023-03-31 18:48:20 +00:00
Kelsey Gilbert 0cf95f0cba Bug 1805625 - BindAttribLocation on the correct attrib name. r=gfx-reviewers,lsalzman
This changed a while back, and though it should default to 0 anyway,
it's best to do the right thing here.

Differential Revision: https://phabricator.services.mozilla.com/D174188
2023-03-30 23:19:52 +00:00
Emilio Cobos Álvarez 35becb740f Bug 1825170 - [wayland] Improve access to nsWaylandDisplay. r=stransky
As above, but with a bit more type safety, plus a TLS cache so we don't
need to lock in the common case we have already initialized the wayland
display.

Differential Revision: https://phabricator.services.mozilla.com/D173964
2023-03-30 09:36:31 +00:00
serge-sans-paille 132015154f Bug 1824068 - Make gfx/gl buildable outside of a unified build environment r=andi
Differential Revision: https://phabricator.services.mozilla.com/D173395
2023-03-24 07:01:07 +00:00
Kelsey Gilbert c59bf462da Bug 1820914 - Don't require WGL_ARB_extensions_string on WGL. r=gfx-reviewers,lsalzman
I think this is a driver bug, since we are literally asking
`dlsym('wglGetExtensionsStringARB')()` for the list of extensions, but
on my AMD 6950xt windows machine with angle disabled, the string list
only has WGL_EXT_extensions_string listed, not the _ARB_ version.
But there's not much reason to assert this pedantically in the face of
driver bugs here.

Differential Revision: https://phabricator.services.mozilla.com/D172817
2023-03-20 20:19:00 +00:00
Kelsey Gilbert 4b467818c8 Bug 1799258 - Fix constexpr issue on base toolchain builds. r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D171623
2023-03-13 21:04:13 +00:00
Kelsey Gilbert 06c8141322 Bug 1799258 - Support outByIn.size()<2 in SampleOutByIn. r=bradwerth
This makes it easier to apply transform functions, even when they are
not defined/present.

Differential Revision: https://phabricator.services.mozilla.com/D167472
2023-03-13 21:04:11 +00:00
Kelsey Gilbert b18204020a Bug 1799258 - No-op equal tfs rather than inverting. r=bradwerth
Differential Revision: https://phabricator.services.mozilla.com/D167471
2023-03-13 21:04:10 +00:00
Kelsey Gilbert 000ff9b4e5 Bug 1799258 - Add prereq Colorspaces stuff, including generic gamma->linear LUT inversion approximation. r=gfx-reviewers,bradwerth
Differential Revision: https://phabricator.services.mozilla.com/D163664
2023-03-13 21:04:10 +00:00
stransky 626d67ee7b Bug 1809026 [Linux] Implement fast DMABuf WebGL textures upload r=jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D167240
2023-02-27 11:20:09 +00:00
Stanca Serban aaea911dc4 Backed out 9 changesets (bug 1799258) for causing multiple failures. CLOSED TREE
Backed out changeset 40351b5987a5 (bug 1799258)
Backed out changeset 87f3532bfbcd (bug 1799258)
Backed out changeset 9c1d9405e8bf (bug 1799258)
Backed out changeset 60a0351d9092 (bug 1799258)
Backed out changeset 5f911de66ec0 (bug 1799258)
Backed out changeset 294a00d1c7b7 (bug 1799258)
Backed out changeset 228200dcaf93 (bug 1799258)
Backed out changeset b25110652394 (bug 1799258)
Backed out changeset 3c3c7366cc40 (bug 1799258)
2023-02-15 12:18:44 +02:00
Kelsey Gilbert 5de0b6d195 Bug 1799258 - Support outByIn.size()<2 in SampleOutByIn. r=bradwerth
This makes it easier to apply transform functions, even when they are
not defined/present.

Differential Revision: https://phabricator.services.mozilla.com/D167472
2023-02-15 08:29:42 +00:00
Kelsey Gilbert f598978814 Bug 1799258 - No-op equal tfs rather than inverting. r=bradwerth
Differential Revision: https://phabricator.services.mozilla.com/D167471
2023-02-15 08:29:42 +00:00
Kelsey Gilbert c68b5dd286 Bug 1799258 - Add prereq Colorspaces stuff, including generic gamma->linear LUT inversion approximation. r=gfx-reviewers,bradwerth
Differential Revision: https://phabricator.services.mozilla.com/D163664
2023-02-15 08:29:41 +00:00
Norisz Fay ed1015daf1 Backed out 9 changesets (bug 1799258) for causing build bustages CLOSED TREE
Backed out changeset a48db1421c6d (bug 1799258)
Backed out changeset 7707637480e7 (bug 1799258)
Backed out changeset 0141b29bf5df (bug 1799258)
Backed out changeset cd9af26bb314 (bug 1799258)
Backed out changeset 4e68a54c6410 (bug 1799258)
Backed out changeset 52afd24d2338 (bug 1799258)
Backed out changeset b4b4977857c7 (bug 1799258)
Backed out changeset 2c23929f52f2 (bug 1799258)
Backed out changeset 83744e1e372b (bug 1799258)
2023-02-07 00:36:41 +02:00
Kelsey Gilbert 10e1d1a8d0 Bug 1799258 - Support outByIn.size()<2 in SampleOutByIn. r=bradwerth
This makes it easier to apply transform functions, even when they are
not defined/present.

Differential Revision: https://phabricator.services.mozilla.com/D167472
2023-02-06 19:58:55 +00:00
Kelsey Gilbert 1c58e179b5 Bug 1799258 - No-op equal tfs rather than inverting. r=bradwerth
Differential Revision: https://phabricator.services.mozilla.com/D167471
2023-02-06 19:58:54 +00:00
Kelsey Gilbert a1c5ea24c5 Bug 1799258 - Add prereq Colorspaces stuff, including generic gamma->linear LUT inversion approximation. r=gfx-reviewers,bradwerth
Differential Revision: https://phabricator.services.mozilla.com/D163664
2023-02-06 19:58:53 +00:00
sotaro 2f26b6d07c Bug 1811456 - Fix srcOrigin of Android SurfaceTexture Blit r=gfx-reviewers,jnicol
It is short term fix. Using SurfaceTexture.getTransform() is long term fix.

Differential Revision: https://phabricator.services.mozilla.com/D168933
2023-02-06 11:23:38 +00:00
sotaro d55f5ec846 Bug 1810097 - Support AHardwareBuffer of out-of-process WebGL on Android r=lsalzman,gfx-reviewers
Modify AHardwareBuffer implementation as to support gl::SharedSurface of out-of-process WebGL. And remove unused AHardwareBuffer implementation.

By limiting AHardwareBuffer only in GPU process, AHardwareBuffer implementation becomes simpler. We do not need to handle cross process AHardwareBuffer delivery and cross process android Fence delivery.

Differential Revision: https://phabricator.services.mozilla.com/D167911
2023-01-27 21:35:26 +00:00
Jeff Muizelaar 3a46da3d80 Bug 1803375. Use different coordinates when running on AMD. r=lsalzman,jgilbert
This updates the version wpf-gpu-raster which adds support for
GPUs/drivers that use truncation instead of rounding when converting
vertices to fixed point.

It also adds the GL vendor to InitContextResult so that we can detect
AMD on macOS and tell wpf-gpu-raster that truncation is going to happen.

Differential Revision: https://phabricator.services.mozilla.com/D167503
2023-01-27 01:45:17 +00:00
Csoregi Natalia f822f99642 Backed out 6 changesets (bug 1799258) for failures on gfx.color_management.display_profile. CLOSED TREE
Backed out changeset 22351f36b74b (bug 1799258)
Backed out changeset 9bbbe3ed2794 (bug 1799258)
Backed out changeset e05c809f58d0 (bug 1799258)
Backed out changeset 791eeb52f034 (bug 1799258)
Backed out changeset 353ef4721bba (bug 1799258)
Backed out changeset b5157d950aa7 (bug 1799258)
2023-01-24 02:08:51 +02:00
Kelsey Gilbert 3a068f509a Bug 1799258 - Support outByIn.size()<2 in SampleOutByIn. r=bradwerth
This makes it easier to apply transform functions, even when they are
not defined/present.

Differential Revision: https://phabricator.services.mozilla.com/D167472
2023-01-23 22:13:18 +00:00
Kelsey Gilbert d27ed44f80 Bug 1799258 - No-op equal tfs rather than inverting. r=bradwerth
Differential Revision: https://phabricator.services.mozilla.com/D167471
2023-01-23 22:13:17 +00:00
Kelsey Gilbert 70f8fd53cc Bug 1799258 - Add prereq Colorspaces stuff, including generic gamma->linear LUT inversion approximation. r=gfx-reviewers,bradwerth
Differential Revision: https://phabricator.services.mozilla.com/D163664
2023-01-23 22:13:16 +00:00
Erich Gubler d6a6a3a83d Bug 1753349 (4/9): refactor: rename `CreateEGLPBufferOffscreenContext` to `CreateWithoutSurface` r=jgilbert
This was interesting enough that @jgilbert wanted this, so I'm including this for completeness in
the current patch stack.

Split out from @jgilbert's D164308.

Differential Revision: https://phabricator.services.mozilla.com/D166709
2023-01-19 04:47:52 +00:00
Erich Gubler 63eead4dae Bug 1753349 (3/9): feat(gfx): use `EGL_KHR_no_config_context` in `CreateEGLPBufferOffscreenContext` r=jgilbert
When available, we should use the [`EGL_KHR_no_config_context` extension] inside of
`GLContextEGL::CreateEGLPBufferOffscreenContext`. The usage of this extension will be necessary to
accommodate incoming upstream changes in ANGLE, which have [migrated away][incoming-breakage] from
[our usage of `EGL_FLEXIBLE_SURFACE_COMPATIBILITY_SUPPORTED_ANGLE` in
`gfx/webrender_bindings/RenderCompositorANGLE.cpp`][what-will-be-broken] in favor of this standard
extension. Luckily it's forwards-compatible to start consuming it now!

This revision changes a few things that are linked:

- Separate assignment and usage of a surface context from that of a context.
- Rename `GLContextEGL::mConfig` to `mSurfaceConfig` to better reflect its usage; it's only ever
  used to create surfaces, not contexts.

Split out from @jgilbert's D164308 and D164309.

[`EGL_KHR_no_config_context` extension]: https://registry.khronos.org/EGL/extensions/KHR/EGL_KHR_no_config_context.txt
[incoming-breakage]: ad8e4d99a9
[what-will-be-broken]: https://searchfox.org/mozilla-central/rev/b19830c6b22f73758862d34d2c64f57735890e90/gfx/webrender_bindings/RenderCompositorANGLE.cpp#668

Differential Revision: https://phabricator.services.mozilla.com/D166708
2023-01-19 04:47:52 +00:00
Erich Gubler 5ae49e0bf7 Bug 1753349 (2/9): refactor: inline `size` argument to `GLContextEGL::CreateEGLPBufferOffscreenContext` r=jgilbert
This is basically an implementation detail that the existing callers doesn't really need to know.
Factor it out.

Split out from @jgilbert's D164308.

Differential Revision: https://phabricator.services.mozilla.com/D166707
2023-01-19 04:47:51 +00:00
Erich Gubler 2d888dbae4 Bug 1753349 (1/9): refactor: inline `GLContextEGL::CreateEGLPBufferOffscreenContext` into `WithUseGles` closure r=jgilbert
This lets us omit implementation details in a header, and avoid needing to pass some arguments when
only the decision to try using GLES changes.

Split out from @jgilbert's [D164308].

[D164308]: https://phabricator.services.mozilla.com/D164308

Differential Revision: https://phabricator.services.mozilla.com/D166706
2023-01-19 04:47:51 +00:00
Stanca Serban cee760ed88 Backed out 9 changesets (bug 1753349) for causing failures in PoolAlloc.cpp. CLOSED TREE
Backed out changeset 84a5f26fe60b (bug 1753349)
Backed out changeset 28e0175becf4 (bug 1753349)
Backed out changeset 0ffcaedc8046 (bug 1753349)
Backed out changeset 2043cc15deec (bug 1753349)
Backed out changeset 556557955d59 (bug 1753349)
Backed out changeset cbb9e6545343 (bug 1753349)
Backed out changeset bed90cd9beb6 (bug 1753349)
Backed out changeset 1b71f995ae95 (bug 1753349)
Backed out changeset 1ad75c8ea7a4 (bug 1753349)
2023-01-18 23:58:22 +02:00
Erich Gubler d420b3bbab Bug 1753349 (4/9): refactor: rename `CreateEGLPBufferOffscreenContext` to `CreateWithoutSurface` r=jgilbert
This was interesting enough that @jgilbert wanted this, so I'm including this for completeness in
the current patch stack.

Split out from @jgilbert's D164308.

Differential Revision: https://phabricator.services.mozilla.com/D166709
2023-01-18 20:56:10 +00:00
Erich Gubler cea0bdd332 Bug 1753349 (3/9): feat(gfx): use `EGL_KHR_no_config_context` in `CreateEGLPBufferOffscreenContext` r=jgilbert
When available, we should use the [`EGL_KHR_no_config_context` extension] inside of
`GLContextEGL::CreateEGLPBufferOffscreenContext`. The usage of this extension will be necessary to
accommodate incoming upstream changes in ANGLE, which have [migrated away][incoming-breakage] from
[our usage of `EGL_FLEXIBLE_SURFACE_COMPATIBILITY_SUPPORTED_ANGLE` in
`gfx/webrender_bindings/RenderCompositorANGLE.cpp`][what-will-be-broken] in favor of this standard
extension. Luckily it's forwards-compatible to start consuming it now!

This revision changes a few things that are linked:

- Separate assignment and usage of a surface context from that of a context.
- Rename `GLContextEGL::mConfig` to `mSurfaceConfig` to better reflect its usage; it's only ever
  used to create surfaces, not contexts.

Split out from @jgilbert's D164308 and D164309.

[`EGL_KHR_no_config_context` extension]: https://registry.khronos.org/EGL/extensions/KHR/EGL_KHR_no_config_context.txt
[incoming-breakage]: ad8e4d99a9
[what-will-be-broken]: https://searchfox.org/mozilla-central/rev/b19830c6b22f73758862d34d2c64f57735890e90/gfx/webrender_bindings/RenderCompositorANGLE.cpp#668

Differential Revision: https://phabricator.services.mozilla.com/D166708
2023-01-18 20:56:09 +00:00
Erich Gubler 80acad2332 Bug 1753349 (2/9): refactor: inline `size` argument to `GLContextEGL::CreateEGLPBufferOffscreenContext` r=jgilbert
This is basically an implementation detail that the existing callers doesn't really need to know.
Factor it out.

Split out from @jgilbert's D164308.

Differential Revision: https://phabricator.services.mozilla.com/D166707
2023-01-18 20:56:09 +00:00
Erich Gubler 521c62bbe5 Bug 1753349 (1/9): refactor: inline `GLContextEGL::CreateEGLPBufferOffscreenContext` into `WithUseGles` closure r=jgilbert
This lets us omit implementation details in a header, and avoid needing to pass some arguments when
only the decision to try using GLES changes.

Split out from @jgilbert's [D164308].

[D164308]: https://phabricator.services.mozilla.com/D164308

Differential Revision: https://phabricator.services.mozilla.com/D166706
2023-01-18 20:56:08 +00:00
Jamie Nicol 04d1292832 Bug 1706656 - Avoid creating SurfaceTextures in isolated content processes on old android versions. r=geckoview-reviewers,ohall
Due to a bug on versions of Android prior to 8.0, attempting to create
a SurfaceTexture from an isolated process results in an infinite
hang. We must therefore avoid doing this.

We currently create a dummy SurfaceTexture in order to call the
Surface constructor when instantiating a GeckoSurface from a
Parcel. This patch avoids this by making GeckoSurface own a Surface
rather than inherit from one.

Additionally, for every Surface allocated we create a corresponding
"sync" SurfaceTexture in the content processes. This is used when the
texture data is required in the content process, eg using video as a
WebGL texture upload source. This patch prevents us allocating such
SurfaceTextures. If out-of-process WebGL is enabled, video data can
still be used as a texture upload source as WebGL resides in the GPU
process. However, if out-of-process WebGL is disabled the texture
upload will fail.

Prior to shipping isolated content processes on affected Android
versions, we must therefore ensure we have an alternative solution to
using video as a WebGL texture upload source, or that out-of-process
WebGL can be relied upon.

Differential Revision: https://phabricator.services.mozilla.com/D165970
2023-01-17 18:54:25 +00:00
Marian-Vasile Laza 0b87861aca Backed out changeset 9759c11fa52f (bug 1706656) for causing gv-junit geckoview failures. CLOSED TREE 2023-01-17 14:55:04 +02:00
Jamie Nicol 619dc044f1 Bug 1706656 - Avoid creating SurfaceTextures in isolated content processes on old android versions. r=geckoview-reviewers,ohall
Due to a bug on versions of Android prior to 8.0, attempting to create
a SurfaceTexture from an isolated process results in an infinite
hang. We must therefore avoid doing this.

We currently create a dummy SurfaceTexture in order to call the
Surface constructor when instantiating a GeckoSurface from a
Parcel. This patch avoids this by making GeckoSurface own a Surface
rather than inherit from one.

Additionally, for every Surface allocated we create a corresponding
"sync" SurfaceTexture in the content processes. This is used when the
texture data is required in the content process, eg using video as a
WebGL texture upload source. This patch prevents us allocating such
SurfaceTextures. If out-of-process WebGL is enabled, video data can
still be used as a texture upload source as WebGL resides in the GPU
process. However, if out-of-process WebGL is disabled the texture
upload will fail.

Prior to shipping isolated content processes on affected Android
versions, we must therefore ensure we have an alternative solution to
using video as a WebGL texture upload source, or that out-of-process
WebGL can be relied upon.

Differential Revision: https://phabricator.services.mozilla.com/D165970
2023-01-17 11:40:16 +00:00
Erich Gubler 88b452f2a7 Bug 1809216: add missing refcount increment for `GLBlitHelperD3D::mD3D11` in `GLBlitHelperD3D::getD3D11` r=jgilbert,jrmuizel,gfx-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D166385
2023-01-09 21:31:02 +00:00
Marco Castelluccio 68e935a7d0 Bug 1790816 - Reformat gfx/gl/GLConsts.py with isort. r=linter-reviewers,ahal DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D165289
2022-12-21 16:25:54 +00:00
Marian-Vasile Laza 74bda87ddf Backed out 3 changesets (bug 1799258) for causing GTest-1proc failures on Span. CLOSED TREE
Backed out changeset 0facab7b9a1d (bug 1799258)
Backed out changeset 4f9ee3537468 (bug 1799258)
Backed out changeset 12e98a3054d0 (bug 1799258)
2022-12-21 01:41:43 +02:00
Kelsey Gilbert 2bda23086f Bug 1799258 - Add prereq Colorspaces stuff, including generic gamma->linear LUT inversion approximation. r=gfx-reviewers,bradwerth
No-op all-equal tfs rather than inverting.

Differential Revision: https://phabricator.services.mozilla.com/D163664
2022-12-20 22:47:52 +00:00
Kelsey Gilbert 6d120d162b Bug 1805626 - Query vert attrib buffer binding directly. r=gfx-reviewers,lsalzman
Previously we were querying the current ARRAY_BUFFER_BINDING, which
would fail if you did:
```
BindBuffer(ARRAY_BUFFER, a)
VertexAttribPointer(...)
BindBuffer(ARRAY_BUFFER, b)
```
We would assume we should call VeretxAttribPointer again with `b` bound,
when we need to bind `a` instead.

Unfortunately, this is hard to test, and we only hit this on drivers
where we don't use VAOs, which are rare now.

Differential Revision: https://phabricator.services.mozilla.com/D164744
2022-12-14 23:08:41 +00:00
sotaro ad6c294e3c Bug 1794380 - Fix RemoteTexture with WebGL sync present on Android r=gfx-reviewers,lsalzman
The change addressed followings problems.

- Recycling of gl::SharedSurface by RemoteTextureMap is not handled by gl::SwapChain.
- PrepareForUse()/NotifyNotUsed() of remote texture's TextureHost(SurfaceTextureHost) is not handled
- Wrapping of RenderAndroidSurfaceTextureHost by RenderTextureHostWrapper is not handled

PrepareForUse()/NotifyNotUsed() is called based on compositor ref count of TextureHost. Normally TextureHost is wrapped by WebRenderTextureHost, then the WebRenderTextureHost handles PrepareForUse()/NotifyNotUsed(). But in remote texture case, WebRenderTextureHost wraps RemoteTextureHostWrapper. And compositable ref of remote texture's TextureHost is updated within RemoteTextureMap::mMutex. Then PrepareForUse()/NotifyNotUsed() happen outside of WebRenderTextureHost in non compositor thread.

With pref gfx.canvas.accelerated=true, canvas renderings were broken on android emulator. The boroken rendering seemed to happen by GL of android emulator. The boroken rendering did not happen with tests on android hardware.

Differential Revision: https://phabricator.services.mozilla.com/D159261
2022-12-07 12:40:02 +00:00
Marco Castelluccio 11b87fc0cb Bug 1790816 - Reformat gfx/ with isort. r=jgilbert DONTBUILD
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D162641
2022-11-22 12:54:40 +00:00
Butkovits Atila 14c4666a5f Backed out changeset 0a2985a48339 (bug 1769747) for causing gl failures. 2022-10-05 01:38:13 +03:00
Kelsey Gilbert 5e0abe1b97 Bug 1769747 - Support non-RGBA video-to-texture fastpath. r=gfx-reviewers,nical
Also scale back some asserts from debug-fatal to just warnings, because
I kept hitting them during testing because of our poor surface lifetime
handling.

Differential Revision: https://phabricator.services.mozilla.com/D157993
2022-10-04 20:31:42 +00:00
stransky cb46f7b2dd Bug 1645677 [Wayland] Update EGLSurface when wl_surface is deleted r=emilio,jgilbert
When GtkWidget is hidden, underlying wl_surface is deleted. We need to also update EGLSurface of GtkWidget (GtkCompositorWidget)
as EGLSurface is directly linked to wl_surface:

- When GtkWidget is hidden, call GtkCompositorWidget::DisableRendering(). That releases GtkCompositorWidget resources
  related to GtkWidget (XWindow/XVisual etc.) and marks the widget as hidden.
- If GtkWidget is backed by EGL call compositor resume which forces compositor to create new EGLSurface.
- Make sure GLContextEGL can create EGLSurface even when GtkWidget is hidden and wl_surface is missing.
  It prevents fallback to SW rendering or pause RenderCompositorEGL which leads to Bug 1777664 (whole browser UI freeze).
- Return early from RenderCompositorEGL::BeginFrame()/RenderCompositorEGL::EndFrame() when GtkCompositorWidget is hidden.

Depends on D157357

Differential Revision: https://phabricator.services.mozilla.com/D157358
2022-09-22 09:41:04 +00:00
Butkovits Atila 7d55852039 Backed out 5 changesets (bug 1645677) for causing build bustages at nsWindow.cpp.
Backed out changeset 4f164c3d0ba9 (bug 1645677)
Backed out changeset 27a918234048 (bug 1645677)
Backed out changeset ca32ff38fc67 (bug 1645677)
Backed out changeset 6841dc516087 (bug 1645677)
Backed out changeset 5ba3a56b3038 (bug 1645677)
2022-09-21 18:26:03 +03:00
stransky 4a3192c560 Bug 1645677 [Wayland] Update EGLSurface when wl_surface is deleted r=emilio,jgilbert
When GtkWidget is hidden, underlying wl_surface is deleted. We need to also update EGLSurface of GtkWidget (GtkCompositorWidget)
as EGLSurface is directly linked to wl_surface:

- When GtkWidget is hidden, call GtkCompositorWidget::DisableRendering(). That releases GtkCompositorWidget resources
  related to GtkWidget (XWindow/XVisual etc.) and marks the widget as hidden.
- If GtkWidget is backed by EGL call compositor resume which forces compositor to create new EGLSurface.
- Make sure GLContextEGL can create EGLSurface even when GtkWidget is hidden and wl_surface is missing.
  It prevents fallback to SW rendering or pause RenderCompositorEGL which leads to Bug 1777664 (whole browser UI freeze).
- Return early from RenderCompositorEGL::BeginFrame()/RenderCompositorEGL::EndFrame() when GtkCompositorWidget is hidden.

Depends on D157357

Differential Revision: https://phabricator.services.mozilla.com/D157358
2022-09-21 10:32:44 +00:00
Kelsey Gilbert a32dfd5297 Bug 1785925 - Add LUT and Colorspace support to GLBlitHelper. r=lsalzman,media-playback-reviewers,alwu
This code was originally developed in bug 1771374, but here we omit the
DCLayerTree changes for later.

Differential Revision: https://phabricator.services.mozilla.com/D155027
2022-09-13 17:40:43 +00:00
Jamie Nicol 50310d33ee Bug 1784109 - Override SurfaceTexture transform for videos on Mediatek 6735. r=gfx-reviewers,media-playback-reviewers,lsalzman,alwu
On Android, SurfaceTextures provide a transform matrix that should be
applied to texture coordinates when sampling from the texture. Prior
to bug 1731980 we ignored this value, and simply y-flipped the video
instead. On most devices the transform is just a y-flip, so this
produced the correct results. However, on some devices the transform
included a scale as well as the y-flip, meaning that we rendered
videos at an incorrect size.

The fix for bug 1731980 was to correctly apply the transformation.
However, it now appears that on Mediatek 6735 devices the transform
provided by the system is incorrect. On these devices, videos were
rendered correctly when we ignored the transform and just did a
y-flip, and now that we apply the transform videos are rendered at the
wrong size.

This patch makes it so that we override the system-provided transform
on these devices with a simple y-flip. The existing mIgnoreTransform
flag has been changed to an optional "transform override" value to
achieve this. We ensure that we only override the transform for
SurfaceTextures that are output from a MediaCodec, to ensure that we
don't accidentally apply the wrong transform to SurfaceTextures
attached to other sources.

Differential Revision: https://phabricator.services.mozilla.com/D155706
2022-09-09 14:43:21 +00:00
Marian-Vasile Laza 7ec7dec6f1 Backed out changeset f1e6746037f7 (bug 1785925) for causing reftest failures on DCLayerTree.cpp. CLOSED TREE 2022-09-06 23:35:51 +03:00
Kelsey Gilbert 24a9bc97bb Bug 1785925 - Add LUT and Colorspace support to GLBlitHelper. r=lsalzman,media-playback-reviewers,alwu
This code was originally developed in bug 1771374, but here we omit the
DCLayerTree changes for later.

Differential Revision: https://phabricator.services.mozilla.com/D155027
2022-09-06 18:36:34 +00:00
Cristian Tuns 3d56a1da28 Backed out changeset b14b975aa6d7 (bug 1785925) for causing build bustages on GLBlitHelper.cpp CLOSED TREE 2022-09-02 20:12:33 -04:00
Kelsey Gilbert 75cccdd5cb Bug 1785925 - Add LUT and Colorspace support to GLBlitHelper. r=lsalzman,media-playback-reviewers,alwu
This code was originally developed in bug 1771374, but here we omit the
DCLayerTree changes for later.

Differential Revision: https://phabricator.services.mozilla.com/D155027
2022-09-02 22:15:58 +00:00
alwu efe35b01d5 Bug 1771011 - part2 : wrap media engine's dcomp handle, and use it on our gfx pipeline in the GPU process.r=jolin,sotaro
In this patch, we ask the media engine to return a handle for shareable
dcomp surface, which will then be packaged into a new texture data type
and being shared with the GPU process via the video bridge.

DcompSurfaceImage is the image which contains the handle texture data,
which doesn't support being accessed in the content process. When the
compositor uploads the image to the GPU process, the corresponding
texture host will be created.

The render texture host will be created by that texture host, and it
will be used in DCLayerTree. In DCLayerTree, we create a new type of
surface for our dcomp handle. DCSurfaceHandle will ask the render
texture host to reconstruct the surface by the handle shared from the
remote process (the handle is actually duplicated to the parent process
first due to the sandbox policy, and then be duplicated to the GPU
process later)

DCSurfaceHandle will attach that surface to its visual in order to
display the video frame directly. In the whole process, it's not
possible for Gecko to access any decoded video data which is protected by the
media engine itself.

Depends on D149941

Differential Revision: https://phabricator.services.mozilla.com/D151019
2022-08-13 23:48:07 +00:00
Kelsey Gilbert c44ca09d78 Bug 1779355 - Check for owning thead in GLContext::MakeCurrent and EGLLibrary::fMakeCurrent. r=gfx-reviewers,bradwerth
Differential Revision: https://phabricator.services.mozilla.com/D151700
2022-08-11 05:46:45 +00:00
Norisz Fay 89a67864b3 Backed out changeset 2d815b082a34 (bug 1779355) for causing build bustage on GLLibraryEGL.h CLOSED TREE 2022-08-11 06:29:14 +03:00
Kelsey Gilbert db21c776cd Bug 1779355 - Check for owning thead in GLContext::MakeCurrent and EGLLibrary::fMakeCurrent. r=gfx-reviewers,bradwerth
Differential Revision: https://phabricator.services.mozilla.com/D151700
2022-08-11 03:00:45 +00:00
Sandor Molnar f252a7427e Backed out changeset c54004d2c229 (bug 1779355) for causing build bustage in gfx/gl/GLLibraryEGL.h 2022-08-10 02:28:59 +03:00
Kelsey Gilbert f03687c024 Bug 1779355 - Check for owning thead in GLContext::MakeCurrent and EGLLibrary::fMakeCurrent. r=gfx-reviewers,bradwerth
Differential Revision: https://phabricator.services.mozilla.com/D151700
2022-08-09 23:13:06 +00:00
Lee Salzman c51cfd2cac Bug 1771159 - Don't use gfxXlibSurface in GLContextGLX. r=jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D153696
2022-08-08 16:06:43 +00:00
Fabrice Desré c50cb528fc Bug 1761040 - Prefix thread safety macros with MOZ_ r=geckoview-reviewers,media-playback-reviewers,alwu,jesup,m_kato
Differential Revision: https://phabricator.services.mozilla.com/D152575
2022-08-03 16:39:41 +00:00
Andreea Pavel 3ccd75af8d Backed out changeset b9d2965591b9 (bug 1761040) for landing with wrong author CLOSED TREE DONTBUILD 2022-08-03 18:55:00 +03:00
Andreea Pavel fdb7cb2ecd Bug 1761040 - Prefix thread safety macros with MOZ_ r=geckoview-reviewers,media-playback-reviewers,alwu,jesup,m_kato
Differential Revision: https://phabricator.services.mozilla.com/D152575
2022-08-03 15:27:43 +00:00
Andreea Pavel 89d63c91e6 Backed out changeset a907159a482f (bug 1761040) for causing build bustages on a CLOSED TREE 2022-08-02 04:59:08 +03:00
Fabrice Desré 0f4ac7ad97 Bug 1761040 - Prefix thread safety macros with MOZ_ r=geckoview-reviewers,media-playback-reviewers,alwu,jesup,m_kato
Differential Revision: https://phabricator.services.mozilla.com/D152575
2022-08-02 00:49:41 +00:00
Iulian Moraru 27d760c7c2 Backed out 9 changesets (bug 1771374) for causing mochitest-webgl failures. CLOSED TREE
Backed out changeset ded977dd1896 (bug 1771374)
Backed out changeset adeb8b7d48f9 (bug 1771374)
Backed out changeset 7767340872c5 (bug 1771374)
Backed out changeset 33282b4ffaae (bug 1771374)
Backed out changeset 75db498cd0e7 (bug 1771374)
Backed out changeset 70035903ea37 (bug 1771374)
Backed out changeset 7c7de0fb66e1 (bug 1771374)
Backed out changeset 615df05e016f (bug 1771374)
Backed out changeset ac3411d21928 (bug 1771374)
2022-08-02 03:38:09 +03:00
Kelsey Gilbert 5108ab70bf Bug 1771374 - Create swapchain with premult-alpha if hasAlpha. r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D152445
2022-08-01 19:49:28 +00:00
Kelsey Gilbert 0bd05e8c5c Bug 1771374 - Fix build and lint warnings. r=gfx-reviewers,aosmond
Differential Revision: https://phabricator.services.mozilla.com/D150620
2022-08-01 19:49:27 +00:00
Kelsey Gilbert fa6e66aedd Bug 1771374 - Support display-p3 output via DirectComposition on Windows. r=sotaro,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D150275
2022-08-01 19:49:26 +00:00
Nicolas Silva 73a5fa066e Bug 1780803 - Avoid uninitialized enum in error path. r=gfx-reviewers,jgilbert
Addresses a coverity warning. The problem looks very benign but the work around is simple and it's good to keep the volume static analysis warnings in check.

Differential Revision: https://phabricator.services.mozilla.com/D152525
2022-07-28 13:45:14 +00:00
Owen Rafferty d08627e1b0 Bug 1776724 - fix wayland-only build r=jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D150485
2022-07-21 09:10:59 +00:00
Kelsey Gilbert b5f2464c70 Bug 1779166 - Mark two GLContexts as not owned by single threads. r=gfx-reviewers,lsalzman
1. In AndroidSharedBlitGL.
2. In DMABufSurface.

Differential Revision: https://phabricator.services.mozilla.com/D152141
2022-07-19 02:53:56 +00:00
Norisz Fay 12f6ce9a82 Backed out changeset ff417c667b5b (bug 1779355) for causing build bustages on GLLibraryEGL.h CLOSED TREE 2022-07-18 20:48:26 +03:00
Kelsey Gilbert 992f515c41 Bug 1779355 - Check for owning thead in GLContext::MakeCurrent and EGLLibrary::fMakeCurrent. r=gfx-reviewers,bradwerth
Differential Revision: https://phabricator.services.mozilla.com/D151700
2022-07-18 17:35:03 +00:00
Narcis Beleuzu a9e7761934 Backed out 4 changesets (bug 1771374) for causing Google docs and maps rendering regressions. a=backout
Backed out changeset 9c65411d1843 (bug 1771374)
Backed out changeset 9f5cf953fcc8 (bug 1771374)
Backed out changeset 8b39f60971e4 (bug 1771374)
Backed out changeset ef52a6c462b6 (bug 1771374)
2022-07-14 00:43:56 +03:00
Kelsey Gilbert f35027d825 Bug 1771374 - Fix build and lint warnings. r=gfx-reviewers,aosmond
Differential Revision: https://phabricator.services.mozilla.com/D150620
2022-07-12 23:55:51 +00:00
Kelsey Gilbert 8eb05ff04b Bug 1771374 - Support display-p3 output via DirectComposition on Windows. r=sotaro,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D150275
2022-07-12 23:55:50 +00:00
Lee Salzman 1d9820a99d Bug 1777426 - Support fast readbacks in CopyToSwapChain with async present. r=sotaro,jgilbert
Currently CopyToSwapChain creates spurious copies of the back buffer when SharedSurfaces aren't exportable (= ToSurfaceDescriptor returns Nothing from SharedSurface_Basic). These then later get read back into a CPU memory buffer when PresentFrontBufferToCompositor is used to send the buffer to RemoteTextureMap. This has associated performance and memory costs.

Conceptually, we want Present/CopyToSwapChain to just do the right thing and automatically push buffers to RemoteTextureMap, rather than secondarily needing a hidden call to PresentFrontBufferToCompositor. Then we can get rid of the need to create front buffers whose only purpose is to shuttle data to PresentFrontBufferToCompositor which then shuttles it RemoteTextureMap.

This patch achieves this by refactoring the guts of PresentFrontBufferToCompositor into Present/CopyToSwapChain. The remote texture ids are sent along inside SwapChainOptions if async present is enabled. Those remote texture ids are cached in ClientWebGLContext so that GetFrontBuffer can return them without any subsequent need for an IPDL call.

On the parent side, CopyToSwapChain will now notice if async present is to be used and if a SurfaceFactory does not generate SharedSurfaces that can be exported. In that case it cuts out the middle man and reads from the WebGLFramebuffer's back buffer directly into a CPU buffer to send to RemoteTextureMap.

This also adds a forceAsyncPresent option to SwapChainOptions so that in the future we can have a separate pref for Accelerated Canvas2D that will allow enabling async present independent of the global WebGL pref.

Differential Revision: https://phabricator.services.mozilla.com/D150720
2022-07-12 06:56:19 +00:00
Kelsey Gilbert a8ef6e3480 Bug 1779069 - Assert that we only ever use a GLContext on its original thread. r=gfx-reviewers,aosmond
Differential Revision: https://phabricator.services.mozilla.com/D151540
2022-07-12 00:00:28 +00:00
Kelsey Gilbert 925ea31507 Bug 1778855 - Use e.g. gfxEnv::MOZ_GL_DEBUG() instead of gfxEnv::GlDebug(). r=gfx-reviewers,jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D151547
2022-07-11 23:59:53 +00:00
Jamie Nicol 0cffcc7253 Bug 1777952 - Namespace SurfaceTexture handles by the process they were allocated in. r=gfx-reviewers,geckoview-reviewers,aosmond,calu
When Surfaces/SurfaceTextures are allocated they are given a handle,
which is a monotonically increasing 32-bit integer. To render
Surfaces, we typically pass the Surface handle to the compositor,
which then looks it up in a map to find the corresponding
SurfaceTexture.

Following a GPU process restart, content may be left with stale
handles referencing SurfaceTextures which no longer exist. Once new
SurfaceTextures are allocated, these stale handles may reference new
SurfaceTextures with no relation to the old handle. This can lead to
rendering the wrong texture. Additionally, we may crash when
allocating "sync" SurfaceTextures, as the previous sync texture for a
certain handle may not have been released yet.

To fix this, this patch combines the existing handle with a new ID
uniquely identifying the process in which the SurfaceTexture was
allocated (or 0 for the parent process). We use a monotonically
increasing value rather than the pid to guard against the new GPU
process possibly having the same pid as the previous instance. We
combine these two 32-bit integers and use the resulting 64-bit integer
as the Surface handle.

Differential Revision: https://phabricator.services.mozilla.com/D150963
2022-07-07 08:12:55 +00:00
Kelsey Gilbert 4f87812c0f Bug 1778232 - ImageFormat::s/CAIRO_SURFACE/MOZ2D_SURFACE/. r=jrmuizel
Also remove comment that says it can't be off-main-thread.

Differential Revision: https://phabricator.services.mozilla.com/D151087
2022-07-06 07:46:17 +00:00
Kelsey Gilbert 98e17790db Bug 1776470 - Explicitly ask for ANGLE debug layer iff d3d11 debug layer pref enabled. r=gfx-reviewers,bradwerth
Differential Revision: https://phabricator.services.mozilla.com/D150274
2022-07-06 07:45:29 +00:00
smolnar 3fa084ce2f Backed out 3 changesets (bug 1771374) for causing build bustage in gfx/gl/gtest/TestColorspaces.cpp CLOSED TREE
Backed out changeset 4d01f260c43a (bug 1771374)
Backed out changeset fc62679f0a6c (bug 1771374)
Backed out changeset f4f12470f8b7 (bug 1771374)
2022-06-30 21:19:17 +03:00
Kelsey Gilbert ec0b1e1d29 Bug 1771374 - Fix lint warnings. r=gfx-reviewers,aosmond
Differential Revision: https://phabricator.services.mozilla.com/D150620
2022-06-30 17:56:27 +00:00
Kelsey Gilbert bb48a57a8a Bug 1771374 - Support display-p3 output via DirectComposition on Windows. r=sotaro,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D150275
2022-06-30 17:56:26 +00:00
criss d5ece910a9 Backed out 3 changesets (bug 1771374) for causing bustages on Colorspaces.h. CLOSED TREE
Backed out changeset 498c27656dc3 (bug 1771374)
Backed out changeset 6f97bc39643f (bug 1771374)
Backed out changeset b4fdb70808b6 (bug 1771374)
2022-06-30 05:28:11 +03:00
Kelsey Gilbert 8fdac7788a Bug 1771374 - Fix lint warnings. r=gfx-reviewers,aosmond
Differential Revision: https://phabricator.services.mozilla.com/D150620
2022-06-29 23:38:23 +00:00
Kelsey Gilbert c4f86e2e33 Bug 1771374 - Support display-p3 output via DirectComposition on Windows. r=sotaro,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D150275
2022-06-29 23:38:22 +00:00
criss efb5f18b59 Backed out 3 changesets (bug 1771374) for causing build bustages on GLBlitHelper.cpp. CLOSED TREE
Backed out changeset 71d40a0a3c9c (bug 1771374)
Backed out changeset 6a42df6834fe (bug 1771374)
Backed out changeset be888d0fd0bf (bug 1771374)
2022-06-30 01:12:46 +03:00
Kelsey Gilbert 7cf061700c Bug 1771374 - Fix lint warnings. r=gfx-reviewers,aosmond
Differential Revision: https://phabricator.services.mozilla.com/D150620
2022-06-29 21:48:53 +00:00
Kelsey Gilbert bad5d9146c Bug 1771374 - Support display-p3 output via DirectComposition on Windows. r=sotaro,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D150275
2022-06-29 21:48:52 +00:00
sotaro a807c798e9 Bug 1712486 - Add async front buffer posting for out-of-process WebGL r=jgilbert,lsalzman,gfx-reviewers
The async front buffer posting is going to be enabled by another bug.

Async IPC was added for async front buffer posting for out-of-process WebGL.
Client does not use TextureClient for storing SurfaceDescriptor.
It works basically same way as to in-process WebGL around nsDisplayCanvas, WebRenderCanvasData, WebRenderCommandBuilder and WebRenderBridgeParent.
SharedSurfaces of SurfaceDescriptorD3D10 are kept alive during their usage. It is for keeping a shread handle valid.
Copied data buffers of SharedShurface_Basics are kept alive during their usage. It is for keeping RenderBufferTextureHost valid.

Differential Revision: https://phabricator.services.mozilla.com/D150197
2022-06-29 09:32:29 +00:00
Norisz Fay f70f5a4b0f Backed out changeset af98fb4ff148 (bug 1712486) for causing build bustages on LayersSurfaces CLOSED TREE 2022-06-29 09:06:45 +03:00
sotaro 8a8d04cce2 Bug 1712486 - Add async front buffer posting for out-of-process WebGL r=jgilbert,lsalzman,gfx-reviewers
The async front buffer posting is going to be enabled by another bug.

Async IPC was added for async front buffer posting for out-of-process WebGL.
Client does not use TextureClient for storing SurfaceDescriptor.
It works basically same way as to in-process WebGL around nsDisplayCanvas, WebRenderCanvasData, WebRenderCommandBuilder and WebRenderBridgeParent.
SharedSurfaces of SurfaceDescriptorD3D10 are kept alive during their usage. It is for keeping a shread handle valid.
Copied data buffers of SharedShurface_Basics are kept alive during their usage. It is for keeping RenderBufferTextureHost valid.

Differential Revision: https://phabricator.services.mozilla.com/D150197
2022-06-29 05:05:47 +00:00
Kelsey Gilbert c6b76d3b9a Bug 1776465 - GLBlitHelper link failure should go down link failure branch. r=gfx-reviewers,lsalzman
Also, no reason not to complete iteration across uTex[012], as opposed
to breaking early once we hit the first one that isn't present.
A shader with e.g. uTex1 but not uTex0 is weird, but there's no reason
for it not to work.

Differential Revision: https://phabricator.services.mozilla.com/D150270
2022-06-24 18:29:58 +00:00
stransky 1cdfeeec54 Bug 1774075 [Linux] Don't use EGL_MESA_image_dma_buf_export on mesa/radeonsi driver r=jgilbert
Don't use EGL_MESA_image_dma_buf_export on Mesa/radeonsi driver due to multi-thread crash there (https://gitlab.freedesktop.org/mesa/mesa/-/issues/6666)

Differential Revision: https://phabricator.services.mozilla.com/D149238
2022-06-20 10:14:41 +00:00
Robert Mader d8d4d7a87a Bug 1773377 - Try EGL device platform for headless contexts, r=stransky,jgilbert
On multi-GPU setups, EGLs "surfaceless" platform may pick the wrong device.
There is a very recent extension which solves this issue,
`EGL_EXT_explicit_device`, however it states:
> Using EGL_EXT_explicit_device with EGL_MESA_platform_surfaceless is
> functionally identical to EGL_EXT_platform_device.

Thus, if we previously detected a render node device, use
`EGL_EXT_platform_device` to create the display in headless scenarios.

For all other cases, notably ARM SOCs where
`EGL_DRM_RENDER_NODE_FILE_EXT` is not yet availble, continue to
fall back to the surfaceless platform.

Note: this patch also does some cleanups. Most importantly,
`EGL_MESA_platform_surfaceless` is a client extension, not a
display extension. The check for it must thus always have failed.
Instead, check for it before trying to use it when creating the
display.
Also remove the rendundant redifinition in `GLDefs.h` - it's
already included in the upstream EGL headers.

Differential Revision: https://phabricator.services.mozilla.com/D148946
2022-06-13 23:15:37 +00:00
stransky b887666c92 Bug 1735929 [Linux] Use EGL_MESA_image_dma_buf_export in SharedSurfaceDMABUF r=jgilbert,aosmond
- Update SharedSurfaceDMABUF for EGL_MESA_image_dma_buf_export DMABufSurface interface.
- Test surface export and import in SurfaceFactory_DMABUF::CanCreateSurface() to make sure it really works.

Depends on D147636

Differential Revision: https://phabricator.services.mozilla.com/D147637
2022-06-09 08:37:20 +00:00
stransky 08d59365a9 Bug 1735929 [Linux] Add support of EGL_MESA_image_dma_buf_export to GLLibraryEGL r=jgilbert,aosmond
Differential Revision: https://phabricator.services.mozilla.com/D147635
2022-06-09 08:37:19 +00:00
Sylvestre Ledru 42f6811d95 Bug 1519636 - Reformat recent changes to the Google coding style r=andi,media-playback-reviewers,necko-reviewers,padenot,dragana
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D148375
2022-06-07 12:32:55 +00:00
Ashley Hale 2879b04886 Bug 1772947 - Remove dead code DecomposeIntoNoRepeatTriangles. r=gfx-reviewers,jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D148455
2022-06-07 00:07:28 +00:00
Jamie Nicol 68af928298 Bug 1772849 - Annotate crash reports with eglCreateWindowSurface error code on Android. r=gfx-reviewers,jgilbert,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D148410
2022-06-06 18:12:39 +00:00
stransky b292c031de Bug 1770560 [Linux] Implement GLBlitHelper::Blit(DMABufSurface* surface,...) to blit DMABufSurface directly r=sotaro,jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D146989
2022-06-06 13:31:03 +00:00
stransky a3d16af2f2 Bug 1770407 [Linux] Remove GBM GL backend r=jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D147421
2022-05-28 20:13:42 +00:00
stransky c85f81924d Bug 1770407 [Linux] Use MESA_platform_surfaceless GL backed on Linux instead of GBM one r=jgilbert
MESA_platform_surfaceless provides better alternative to GBM GL backend so let's use that instead of GBM.

Differential Revision: https://phabricator.services.mozilla.com/D147420
2022-05-28 20:13:42 +00:00
Emilio Cobos Álvarez ddb8e6f491 Bug 1771146 - Check for gbm availability correctly before trying to create a surface. r=stransky,jgilbert
(And try to make it cheaper).

Differential Revision: https://phabricator.services.mozilla.com/D147312
2022-05-27 07:35:44 +00:00
Lee Salzman 8aba061809 Bug 1685375 - Remove ScopedXErrorHandler. r=jgilbert
Avoid relying on X11 errors to detect failures where alternative means would
suffice (i.e. checking results for failure or MakeCurrent failures). All other
users of ScopedXErrorHandler outside of GLContextProviderGLX use it only to
ignore errors rather than actually check the error result. Given those concerns,
we also change the default X11 error handler to merely ignore errors rather than
abort, such that X11 calls in Gecko no longer require an error trap by default.
This also avoids contention with other libraries that may temporarily override
the error handler such as GDK or Cairo since Gecko will never touch the handler
after startup.

Differential Revision: https://phabricator.services.mozilla.com/D147247
2022-05-26 16:13:27 +00:00
Cristian Tuns 21e50ef423 Backed out changeset b1345ce6dcd3 (bug 1685375) for causing xpcshell failures on test_crash_backgroundtask_moz_crash.js,nsX11ErrorHandler.cpp CLOSED TREE 2022-05-26 00:25:00 -04:00
Lee Salzman 2d5de179cb Bug 1685375 - Remove ScopedXErrorHandler. r=jgilbert
Avoid relying on X11 errors to detect failures where alternative means would
suffice (i.e. checking results for failure or MakeCurrent failures). All other
users of ScopedXErrorHandler outside of GLContextProviderGLX use it only to
ignore errors rather than actually check the error result. Given those concerns,
we also change the default X11 error handler to merely ignore errors rather than
abort, such that X11 calls in Gecko no longer require an error trap by default.
This also avoids contention with other libraries that may temporarily override
the error handler such as GDK or Cairo since Gecko will never touch the handler
after startup.

Differential Revision: https://phabricator.services.mozilla.com/D147247
2022-05-26 01:58:49 +00:00
stransky a903faa3e1 Bug 1770111 [Linux] Build GLContextProviderLinux on other unix systems r=jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D146816
2022-05-20 12:37:08 +00:00
Norisz Fay 840028742a Backed out changeset cde097a49a39 (bug 1770111) for causing build bustages on GLContextProvider.h CLOSED TREE 2022-05-20 10:25:35 +03:00
stransky 3da535a403 Bug 1770111 [Linux] Build GLContextProviderLinux on other unix systems r=jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D146816
2022-05-20 07:12:22 +00:00
sotaro 4f8549101c Bug 1766282 - Do not use SharedHandle of ID3D11Texture2D of hardware decoded video during no video copy r=jgilbert,jrmuizel,gfx-reviewers
With CI's NVIDIA GPU, SharedHandle of ID3D11Texture2D of hardware decoded video during no video copy caused rendering problem. When SharedHandle is not used, the rendering problem did not happen. But when video is rendered to WebGL texture, SharedHandle need to be used.
In this case, D3D11TextureIMFSampleImage copies original ID3D11Texture2D to a new ID3D11Texture2D and use a shared handled of the copied texture. And no video copy of future video frames are disabled.

NoCopyNV12Texture is renamed to ZeroCopyNV12Texture to clarify its meaning.

Differential Revision: https://phabricator.services.mozilla.com/D144598
2022-05-20 04:37:53 +00:00
Kelsey Gilbert 2bd9efd83a Bug 1770235 - DrawBlitProg::Draw non-vao path must restore vaa0's buffer. r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D146844
2022-05-19 23:00:33 +00:00
stransky 9f95c41a96 Bug 1769499 [Linux/EGL] Create GBM based surface for headless GL context r=jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D146555
2022-05-19 15:18:22 +00:00
criss dd9c3d30c8 Backed out changeset d13c0a1c7a19 (bug 1769499) for causing bustages on GLContextProviderEGL.cpp. CLOSED TREE 2022-05-19 10:27:48 +03:00
stransky 8979f28b18 Bug 1769499 [Linux/EGL] Create GBM based surface for headless GL context r=jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D146555
2022-05-19 06:34:20 +00:00
stransky 9f92539de5 Bug 1769710 [Linux] Use GLContextProviderLinux on Linux r=jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D146549
2022-05-18 12:01:50 +00:00
stransky a734b8d21d Bug 1769710 [Linux] Remove GLContextProviderX11 r=jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D146548
2022-05-18 12:01:50 +00:00
stransky 7ee135958e Bug 1769710 [Linux] Remove GLContextProviderWayland r=jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D146547
2022-05-18 12:01:49 +00:00
stransky 126f981f9a Bug 1769710 [Linux] Add GLContextProviderLinux for GLX/EGL r=jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D146546
2022-05-18 12:01:49 +00:00
Cristian Tuns e7e8403c3b Backed out 4 changesets (bug 1769710) for causing build bustages on Android CLOSED TREE
Backed out changeset 05fe9638ac05 (bug 1769710)
Backed out changeset 7ddd8fdfe957 (bug 1769710)
Backed out changeset b8191e074d6d (bug 1769710)
Backed out changeset 202d09293cf2 (bug 1769710)
2022-05-18 03:09:03 -04:00
stransky 8555fad567 Bug 1769710 [Linux] Use GLContextProviderLinux on Linux r=jgilbert
Depends on D146548

Differential Revision: https://phabricator.services.mozilla.com/D146549
2022-05-18 06:43:48 +00:00
stransky d1b8efc7b4 Bug 1769710 [Linux] Remove GLContextProviderX11 r=jgilbert
Depends on D146547

Differential Revision: https://phabricator.services.mozilla.com/D146548
2022-05-18 06:43:48 +00:00
stransky d880bc82cf Bug 1769710 [Linux] Remove GLContextProviderWayland r=jgilbert
Depends on D146546

Differential Revision: https://phabricator.services.mozilla.com/D146547
2022-05-18 06:43:47 +00:00
stransky 6891e2856b Bug 1769710 [Linux] Add GLContextProviderLinux for GLX/EGL r=jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D146546
2022-05-18 06:43:47 +00:00
Kelsey Gilbert e722cdd3ed Bug 1703654 - Prototype display-p3 for WebGL canvas. r=lsalzman,emilio,webidl,smaug
Enable (direct) external surface compositing for MacIOSurfaces.
Works on Mac.

Differential Revision: https://phabricator.services.mozilla.com/D144073
2022-05-02 23:54:09 +00:00
Csoregi Natalia 9a8af5a95a Backed out changeset 718ead395698 (bug 1703654) for causing bustage on IPCMessageUtils.h. CLOSED TREE 2022-04-29 00:38:28 +03:00
Kelsey Gilbert c3a7e39783 Bug 1703654 - Prototype display-p3 for WebGL canvas. r=lsalzman,emilio
Enable (direct) external surface compositing for MacIOSurfaces.
Works on Mac.

Differential Revision: https://phabricator.services.mozilla.com/D144073
2022-04-28 19:12:08 +00:00
Molnar Sandor 68045e3d85 Backed out changeset 071aa43a0419 (bug 1703654) for causing build bustages in SharedSurfaceDMABUF. CLOSED TREE 2022-04-26 20:14:48 +03:00