Commit Graph

2878 Commits

Author SHA1 Message Date
Ray Kraesig
873fc8dfcd Bug 1820066 [1/3] - Fix CreateSwapChainForHwnd call r=sotaro
Per Microsoft documentation, DXGI_SCALING_NONE is only supported by
swap chains using DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL; for any other swap
effect, including DXGI_SWAP_EFFECT_SEQUENTIAL, another value must be
supplied. Prior to Windows 10 the only such available entry was
DXGI_SCALING_STRETCH, so use that.

This causes the `CreateSwapChainForHwnd` call to succeed, rather than
causing us to fall back to `CreateSwapChain`. There is no known user-
facing effect here, as DXGI_SCALING_STRETCH is documented to be the
semantics applied by `CreateSwapChain` -- but it does eliminate an error
message from the D3D11 debug layer's output.

Differential Revision: https://phabricator.services.mozilla.com/D171521
2023-03-27 16:54:12 +00:00
serge-sans-paille
93b77462d2 Bug 1824071 - Make gfx/webrender_bindings buildable outside of a unified build environment r=andi
Differential Revision: https://phabricator.services.mozilla.com/D173398
2023-03-24 07:01:09 +00:00
sotaro
b0f638846b Bug 1823844 - Add error log to RenderThread::Start() r=gfx-reviewers,aosmond
Differential Revision: https://phabricator.services.mozilla.com/D173246
2023-03-23 00:34:52 +00:00
Sandor Molnar
39587cae6b Backed out 3 changesets (bug 1820066) for causing xpc failures in widget/headless/tests/test_headless.js CLOSED TREE
Backed out changeset 501d93d8c9eb (bug 1820066)
Backed out changeset ec623d25b138 (bug 1820066)
Backed out changeset c34dfd018abb (bug 1820066)
2023-03-22 22:54:53 +02:00
Ray Kraesig
0fe41b776a Bug 1820066 [1/3] - Fix CreateSwapChainForHwnd call r=sotaro
Per Microsoft documentation, DXGI_SCALING_NONE is only supported by
swap chains using DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL; for any other swap
effect, including DXGI_SWAP_EFFECT_SEQUENTIAL, another value must be
supplied. Prior to Windows 10 the only such available entry was
DXGI_SCALING_STRETCH, so use that.

This causes the `CreateSwapChainForHwnd` call to succeed, rather than
causing us to fall back to `CreateSwapChain`. There is no known user-
facing effect here, as DXGI_SCALING_STRETCH is documented to be the
semantics applied by `CreateSwapChain` -- but it does eliminate an error
message from the D3D11 debug layer's output.

Differential Revision: https://phabricator.services.mozilla.com/D171521
2023-03-22 15:09:24 +00:00
sotaro
9ca40310af Bug 1823352 - A little code cleanup in RenderThread r=gfx-reviewers,aosmond
Preparation for Bug 1804233

Differential Revision: https://phabricator.services.mozilla.com/D172981
2023-03-21 00:24:27 +00:00
sotaro
b2f1baf7c4 Bug 1812498 - Destroy RenderBufferTextureHosts that use VideoBridgeParent's Shmems in VideoBridgeParent::OnChannelError() r=lsalzman
Destroy RenderBufferTextureHosts that use VideoBridgeParent's Shmems before destroying all VideoBridgeParent's Shmems by PVideoBridgeParent::OnChannelError().

Differential Revision: https://phabricator.services.mozilla.com/D169796
2023-03-17 00:35:03 +00:00
Kelsey Gilbert
25f19106d7 Bug 1822519 - When qcms_profile_from_memory fails, default to sRGB for display space. r=gfx-reviewers,jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D172837
2023-03-16 20:54:52 +00:00
sotaro
5abd63997f Bug 1822459 - Use UniquePtr in mWindowInfos r=gfx-reviewers,ErichDonGubler
With UniquePtr, RenderThread::RemoveRenderer() becomes simpler.

Differential Revision: https://phabricator.services.mozilla.com/D172644
2023-03-16 00:59:19 +00:00
Glenn Watson
6e6cfd149f Bug 1822436 - Remove offset from WR border-image implementation r=gfx-reviewers,lsalzman
It's not needed, as Gecko incorporates it in to the border-image rect.

Differential Revision: https://phabricator.services.mozilla.com/D172636
2023-03-15 20:51:37 +00:00
Marian-Vasile Laza
d9dcca62c0 Backed out changeset 82ff06193160 (bug 1822436) for wr wrench bustages. CLOSED TREE 2023-03-15 22:34:35 +02:00
Glenn Watson
30496845a0 Bug 1822436 - Remove offset from WR border-image implementation r=gfx-reviewers,lsalzman
It's not needed, as Gecko incorporates it in to the border-image rect.

Differential Revision: https://phabricator.services.mozilla.com/D172636
2023-03-15 20:01:20 +00:00
Chris Martin
b42c4425d0 Bug 1816559 - Remote compositor recording from GPU process r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D170514
2023-03-14 13:31:37 +00:00
Otto Länd
f63433d7a5 Bug 1799258: apply code formatting via Lando
# ignore-this-changeset
2023-03-13 21:10:21 +00:00
Kelsey Gilbert
754f4a89af Bug 1799258 - Share all-of-dcomp.h preamble, and deal with outdated mingw dcomp.h. r=gfx-reviewers,sotaro
Mingw's dcomp.h is not the official one, but rather a by-hand
reproduction. While this newly-updated version has e.g.
IDCompositionFilterEffect, it is still missing e.g.
IDCompositionColorMatrixEffect.

Differential Revision: https://phabricator.services.mozilla.com/D168839
2023-03-13 21:04:12 +00:00
Kelsey Gilbert
c1b083b181 Bug 1799258 - Ask dcomp.h to define IDCompositionFilterEffect. r=gfx-reviewers,bradwerth
Differential Revision: https://phabricator.services.mozilla.com/D168325
2023-03-13 21:04:12 +00:00
Kelsey Gilbert
2a633b2502 Bug 1799258 - Do color-management on Windows+DComp via IDCompositionFilterEffects. r=sotaro
+ Add gfx.color_management.rec709_gamma_as_srgb:true. :'(

In particular, rec709(16/255) -> srgb(31/255). Even though it's
technically correct, it's practically-speaking incorrect, since that's
not what Chrome does, nor what the web expected for years and years.

In practice, basically everyone expects gamma to just be completely
ignored.

What people expect:
* Pretend gamut is srgb(==rec709), but stretch this naively for the
  display. If you have a display-p3-gamut display, srgb:0.5 expects to
  be displayed as display:0.5, which will be display-p3:0.5 to the eyes.
* Pretend all content gammas (TFs) are srgb(!=rec790), and then bitcast this
  naively for the display. E.g. rec709(16/255) should
  display the same as srgb(16/255), not srgb(31/255). (Note: display-p3
  uses srgb gamma) But if your display has e.g. gamma=3.0, don't
  convert or compensate.

This is a formalization of what you get when you spend decades ignoring
color management, and people build things based on behavior-in-practice,
not behavior-in-theory.

Also:
+ gfx.color_management.native_srgb:true for Windows, so we don't use the
  display color profile, which no one else does.
+ Add rec2020_gamma_as_rec709, so we have a path towards maybe having
  rec2020 use its correct transfer function, rather than srgb (like
  rec709).

Differential Revision: https://phabricator.services.mozilla.com/D161857
2023-03-13 21:04:10 +00:00
sotaro
c28b3ba4ed Bug 1818685 - Disable video overlay if mVideoSwapChain->Present() is very slow on Windows r=gfx-reviewers,lsalzman
There were cases that mVideoSwapChain->Present() took long time. It caused low fps and stuttering and lots of dropped frames. When it happens, disabling video overlay could address the problem.

Differential Revision: https://phabricator.services.mozilla.com/D171039
2023-02-27 05:29:24 +00:00
Lee Salzman
646e8918c1 Bug 1777849 - Disable FEATURE_THREADSAFE_GL on X11 and GLX. r=gfx-reviewers,ahale,aosmond
LibX11 versions prior to 1.7 have a race condition that made it unsafe to use
in multiple threads. Since Firefox 104, we created a CanvasRender thread that
is used to service WebGL commands off the Renderer thread so that WebGL does
not block WebRender. If WebGL uses GLX, this can lead us to using GLX on the
two different threads. In combination with an unsafe version of libX11, this
can lead to severe instability.

Further evidence points to the fact that the fix in 1.7 may have caused further
crashes that were not resolved until 1.7.4. Yet other reports indicate other
drivers than Mesa may still have issues even after 1.7.4. Ultimately, there
may be no safe version of libX11 to use right now.

However, GLX, which uses libX11, is considered legacy at this point, with many
users transitioning to EGL instead. It seems reasonable to not allow GLX to be
used from multiple threads at all, unless overridden by a pref, to work around
this.

We already have a FEATURE_THREADSAFE_GL in place to denote this, which was
currently used mainly for Nouveau which is also unsafe to use on multiple
threads. If this feature fails, the CanvasRender thread is not used, and
all WebGL commands go back to being on the Renderer thread as normal, avoiding
the problem.

A further snag is that recent ANGLE updates required a larger CanvasRenderer
thread stack size to avoid exhausting the stack. This patch uncovers the fact
that the Renderer and Compositor threads did not similarly have their stack
sizes adjusted in case WebGL is running on those threads instead.

Differential Revision: https://phabricator.services.mozilla.com/D170992
2023-02-25 22:49:51 +00:00
Stanca Serban
ebf9b1f7bd Backed out changeset 42afa6604694 (bug 1777849) for causing build bustages in RenderThread.cpp. CLOSED TREE 2023-02-26 00:42:52 +02:00
Lee Salzman
ada52201da Bug 1777849 - Disable FEATURE_THREADSAFE_GL on X11 and GLX. r=gfx-reviewers,ahale,aosmond
LibX11 versions prior to 1.7 have a race condition that made it unsafe to use
in multiple threads. Since Firefox 104, we created a CanvasRender thread that
is used to service WebGL commands off the Renderer thread so that WebGL does
not block WebRender. If WebGL uses GLX, this can lead us to using GLX on the
two different threads. In combination with an unsafe version of libX11, this
can lead to severe instability.

Further evidence points to the fact that the fix in 1.7 may have caused further
crashes that were not resolved until 1.7.4. Yet other reports indicate other
drivers than Mesa may still have issues even after 1.7.4. Ultimately, there
may be no safe version of libX11 to use right now.

However, GLX, which uses libX11, is considered legacy at this point, with many
users transitioning to EGL instead. It seems reasonable to not allow GLX to be
used from multiple threads at all, unless overridden by a pref, to work around
this.

We already have a FEATURE_THREADSAFE_GL in place to denote this, which was
currently used mainly for Nouveau which is also unsafe to use on multiple
threads. If this feature fails, the CanvasRender thread is not used, and
all WebGL commands go back to being on the Renderer thread as normal, avoiding
the problem.

A further snag is that recent ANGLE updates required a larger CanvasRenderer
thread stack size to avoid exhausting the stack. This patch uncovers the fact
that the Renderer and Compositor threads did not similarly have their stack
sizes adjusted in case WebGL is running on those threads instead.

Differential Revision: https://phabricator.services.mozilla.com/D170992
2023-02-25 22:20:50 +00:00
stransky
e42ac0d5d9 Bug 1813407 Get widget size only once in RenderCompositorSWGL r=lsalzman
- Get widget size in RenderCompositorSWGL::BeginFrame() and save it for further use. That prevents flickering/artifacts if compositor widget size is changed during rendering.
- Request full screen update when widget size changes on Wayland.

Differential Revision: https://phabricator.services.mozilla.com/D169905
2023-02-23 10:52:14 +00:00
Stanca Serban
200dca5cfb Backed out 4 changesets (bug 1813407) for causing Linux bp-hybrid bustages in WindowSurfaceProvider.h. CLOSED TREE
Backed out changeset 897b95c7fdad (bug 1813407)
Backed out changeset aba3e370a587 (bug 1813407)
Backed out changeset 61c79624c2ab (bug 1813407)
Backed out changeset f99d85efb04c (bug 1813407)
2023-02-21 12:54:32 +02:00
stransky
b429a675e0 Bug 1813407 Get widget size only once in RenderCompositorSWGL r=lsalzman
- Get widget size in RenderCompositorSWGL::BeginFrame() and save it for further use. That prevents flickering/artifacts if compositor widget size is changed during rendering.
- Request full screen update when widget size changes on Wayland.

Differential Revision: https://phabricator.services.mozilla.com/D169905
2023-02-21 09:30:10 +00:00
Jonathan Kew
4594ae314a Bug 1815404 - Replace most uses of gfxContext::CreateOrNull with stack-allocated contexts. r=gfx-reviewers,lsalzman
Depends on D170370

Differential Revision: https://phabricator.services.mozilla.com/D170371
2023-02-21 07:28:25 +00:00
Jonathan Kew
1b3e69f8aa Bug 1815404 - Remove refcounting from gfxContext. r=gfx-reviewers,lsalzman
Depends on D170367

Differential Revision: https://phabricator.services.mozilla.com/D170369
2023-02-21 07:28:24 +00:00
Fabrice Desré
f21d0cd9b0 Bug 1817033 - Make MAX_SHARED_SURFACE_SIZE configurable with a preference r=gw
Differential Revision: https://phabricator.services.mozilla.com/D169975
2023-02-16 01:44:07 +00:00
Sandor Molnar
ebec3db2d6 Backed out changeset f6188fe027b9 (bug 1817033) for causing webrender build bustages. CLOSED TREE 2023-02-16 03:21:59 +02:00
Fabrice Desré
4f9ae48be3 Bug 1817033 - Make MAX_SHARED_SURFACE_SIZE configurable with a preference r=gw
Differential Revision: https://phabricator.services.mozilla.com/D169975
2023-02-16 00:59:03 +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
Otto Länd
387e7dda28 Bug 1799258: apply code formatting via Lando
# ignore-this-changeset
2023-02-15 08:35:44 +00:00
Kelsey Gilbert
8f95a23615 Bug 1799258 - Share all-of-dcomp.h preamble, and deal with outdated mingw dcomp.h. r=gfx-reviewers,sotaro
Mingw's dcomp.h is not the official one, but rather a by-hand
reproduction. While this newly-updated version has e.g.
IDCompositionFilterEffect, it is still missing e.g.
IDCompositionColorMatrixEffect.

Differential Revision: https://phabricator.services.mozilla.com/D168839
2023-02-15 08:29:43 +00:00
Kelsey Gilbert
b60232a5ea Bug 1799258 - Ask dcomp.h to define IDCompositionFilterEffect. r=gfx-reviewers,bradwerth
Differential Revision: https://phabricator.services.mozilla.com/D168325
2023-02-15 08:29:43 +00:00
Kelsey Gilbert
5ed1620078 Bug 1799258 - Do color-management on Windows+DComp via IDCompositionFilterEffects. r=sotaro
+ Add gfx.color_management.rec709_gamma_as_srgb:true. :'(

In particular, rec709(16/255) -> srgb(31/255). Even though it's
technically correct, it's practically-speaking incorrect, since that's
not what Chrome does, nor what the web expected for years and years.

In practice, basically everyone expects gamma to just be completely
ignored.

What people expect:
* Pretend gamut is srgb(==rec709), but stretch this naively for the
  display. If you have a display-p3-gamut display, srgb:0.5 expects to
  be displayed as display:0.5, which will be display-p3:0.5 to the eyes.
* Pretend all content gammas (TFs) are srgb(!=rec790), and then bitcast this
  naively for the display. E.g. rec709(16/255) should
  display the same as srgb(16/255), not srgb(31/255). (Note: display-p3
  uses srgb gamma) But if your display has e.g. gamma=3.0, don't
  convert or compensate.

This is a formalization of what you get when you spend decades ignoring
color management, and people build things based on behavior-in-practice,
not behavior-in-theory.

Also:
+ gfx.color_management.native_srgb:true for Windows, so we don't use the
  display color profile, which no one else does.
+ Add rec2020_gamma_as_rec709, so we have a path towards maybe having
  rec2020 use its correct transfer function, rather than srgb (like
  rec709).

Differential Revision: https://phabricator.services.mozilla.com/D161857
2023-02-15 08:29:41 +00:00
Andi-Bogdan Postelnicu
6a4cfe596b Bug 1617369 - Reformat recent rust changes with rustfmt r=emilio,webdriver-reviewers,whimboo
Updated with rustfmt 1.5.1-stable (fc594f1 2023-01-24)
# ignore-this-changeset

Depends on D168658

Differential Revision: https://phabricator.services.mozilla.com/D168659
2023-02-13 15:02:07 +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
Otto Länd
38ce5da877 Bug 1799258: apply code formatting via Lando
# ignore-this-changeset
2023-02-06 20:02:15 +00:00
Kelsey Gilbert
987b128720 Bug 1799258 - Share all-of-dcomp.h preamble, and deal with outdated mingw dcomp.h. r=gfx-reviewers,sotaro
Differential Revision: https://phabricator.services.mozilla.com/D168839
2023-02-06 19:58:56 +00:00
Kelsey Gilbert
9bf188ddc2 Bug 1799258 - Ask dcomp.h to define IDCompositionFilterEffect. r=gfx-reviewers,bradwerth
Differential Revision: https://phabricator.services.mozilla.com/D168325
2023-02-06 19:58:55 +00:00
Kelsey Gilbert
25d74c811d Bug 1799258 - Do color-management on Windows+DComp via IDCompositionFilterEffects. r=sotaro
+ Add gfx.color_management.rec709_gamma_as_srgb:true. :'(

In particular, rec709(16/255) -> srgb(31/255). Even though it's
technically correct, it's practically-speaking incorrect, since that's
not what Chrome does, nor what the web expected for years and years.

In practice, basically everyone expects gamma to just be completely
ignored.

What people expect:
* Pretend gamut is srgb(==rec709), but stretch this naively for the
  display. If you have a display-p3-gamut display, srgb:0.5 expects to
  be displayed as display:0.5, which will be display-p3:0.5 to the eyes.
* Pretend all content gammas (TFs) are srgb(!=rec790), and then bitcast this
  naively for the display. E.g. rec709(16/255) should
  display the same as srgb(16/255), not srgb(31/255). (Note: display-p3
  uses srgb gamma) But if your display has e.g. gamma=3.0, don't
  convert or compensate.

This is a formalization of what you get when you spend decades ignoring
color management, and people build things based on behavior-in-practice,
not behavior-in-theory.

Also:
+ gfx.color_management.native_srgb:true for Windows, so we don't use the
  display color profile, which no one else does.
+ Add rec2020_gamma_as_rec709, so we have a path towards maybe having
  rec2020 use its correct transfer function, rather than srgb (like
  rec709).

Differential Revision: https://phabricator.services.mozilla.com/D161857
2023-02-06 19:58:54 +00:00
sotaro
425786bd75 Bug 1813267 - Add WebRender (Software OpenGL) handling for AndroidHardwareBufferTextureHost r=gfx-reviewers,jnicol
Implementation is borrowed from RenderAndroidSurfaceTextureHost. Since Android SurfaceTexture and AndroidHardwareBuffer use same android GraphicBuffer.

Differential Revision: https://phabricator.services.mozilla.com/D168764
2023-02-06 11:27:05 +00:00
sotaro
6f5040909c Bug 1814811 - Fix out-of-process WebGL rendering by RenderAndroidSurfaceTextureHost and WebRender (Software OpenGL) r=lsalzman,gfx-reviewers
2 problems existed.

- [1] RenderAndroidSurfaceTextureHost::GetUvCoords() was not called when RenderAndroidSurfaceTextureHost is wrapped by RenderTextureHostWrapper.
- [2] NeedsYFlip() of SurfaceTextureHost::CreateRenderTexture() uses TextureHost::mFlags. But TextureHost::mFlags was updated by RemoteTextureHostWrapper::ApplyTextureFlagsToRemoteTexture() after SurfaceTextureHost::CreateRenderTexture() call. Then RenderAndroidSurfaceTextureHost::mOriginPos became wrong.

[1] is addressed by adding RenderTextureHostWrapper::GetUvCoords()

[2] is addressed by removing RenderAndroidSurfaceTextureHost::mOriginPos. It is not necessary since Bug 1731980.

Differential Revision: https://phabricator.services.mozilla.com/D168763
2023-02-03 08:39:56 +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
9e2d016bd4 Bug 1799258 - Do color-management on Windows+DComp via IDCompositionFilterEffects. r=sotaro
+ Add gfx.color_management.rec709_gamma_as_srgb:true. :'(

In particular, rec709(16/255) -> srgb(31/255). Even though it's
technically correct, it's practically-speaking incorrect, since that's
not what Chrome does, nor what the web expected for years and years.

In practice, basically everyone expects gamma to just be completely
ignored.

What people expect:
* Pretend gamut is srgb(==rec709), but stretch this naively for the
  display. If you have a display-p3-gamut display, srgb:0.5 expects to
  be displayed as display:0.5, which will be display-p3:0.5 to the eyes.
* Pretend all content gammas (TFs) are srgb(!=rec790), and then bitcast this
  naively for the display. E.g. rec709(16/255) should
  display the same as srgb(16/255), not srgb(31/255). (Note: display-p3
  uses srgb gamma) But if your display has e.g. gamma=3.0, don't
  convert or compensate.

This is a formalization of what you get when you spend decades ignoring
color management, and people build things based on behavior-in-practice,
not behavior-in-theory.

Also:
+ gfx.color_management.native_srgb:true for Windows, so we don't use the
  display color profile, which no one else does.
+ Add rec2020_gamma_as_rec709, so we have a path towards maybe having
  rec2020 use its correct transfer function, rather than srgb (like
  rec709).

Differential Revision: https://phabricator.services.mozilla.com/D161857
2023-01-23 22:13:17 +00:00
Nicolas Silva
6c395ff797 Bug 1808549 - Pass the WR device to Compositor methods. r=gfx-reviewers,lsalzman
This will be needed by the draw compositor which can't own the device renderer's device but needs to use it. Other implementations can just ignore the parameter.

Differential Revision: https://phabricator.services.mozilla.com/D165958
2023-01-19 15:40:50 +00:00
Nicolas Silva
255a5b7c14 Bug 1804914 - Represent compositor transforms using scale-offsets instead of 4x4 matrices. r=gw
The draw compositor's occlusion culling optimization relies on the transforms preserving axis alignment.

Differential Revision: https://phabricator.services.mozilla.com/D165141
2023-01-19 15:40:49 +00:00
sotaro
0bb743f94a Bug 1811170 - Make GpuProcessTextureId strongly-typed r=gfx-reviewers,lsalzman
uint64_t is used for GpuProcessTextureId. It should be strongly-typed.

Differential Revision: https://phabricator.services.mozilla.com/D167224
2023-01-19 08:19:28 +00:00
Erich Gubler
0b017316a8 Bug 1753349 (7/9): refactor(gfx): stop using LOCAL_EGL_FLEXIBLE_SURFACE_COMPATIBILITY_SUPPORTED_ANGLE r=jgilbert,gfx-reviewers
Now that we're using `EGL_KHR_no_config_context`, this attribute request is no longer necessary.
Even worse, support for it already been removed by upstream ANGLE. So, let's remove it before we try
to upgrade ANGLE.

Differential Revision: https://phabricator.services.mozilla.com/D167038
2023-01-19 04:47:53 +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