Commit Graph

2178 Commits

Author SHA1 Message Date
stransky
f49660886e Bug 1663003 [Linux/EGL] When we can't find EGLConfig with actual XVisual, use the first suitable one, r=jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D89720
2020-09-10 17:47:37 +00:00
stransky
3468f83483 Bug 1650583 [Linux/EGL] Implement GLContextEGL::FindVisual(), r=jgilbert
Implement GLContextEGL::FindVisual() as a EGL counterpart of GLContextGLX::FindVisual() used
by GLX.

We need to make sure that GdkWindow uses the same visual as GL framebuffer we use for it.
That was already implemented for GLX backend (Bug 1478454).

The visual match is implemented by visual parameter at CreateConfig()/CreateConfigScreen() routines and when it's non-zero,
try to find exact match based on visual ID.

Differential Revision: https://phabricator.services.mozilla.com/D87636
2020-09-03 09:02:44 +00:00
stransky
1b305cb7c0 Bug 1650583 [Linux/EGL] Log eglCreateWindowSurface failure, r=jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D87635
2020-09-03 09:02:37 +00:00
Noemi Erli
3403bbb58e Backed out 4 changesets (bug 1650583) for causing build bustages in rules.mk CLOSED TREE
Backed out changeset 033e491241b1 (bug 1650583)
Backed out changeset e6a03fea3aad (bug 1650583)
Backed out changeset b24be6b2d8cd (bug 1650583)
Backed out changeset bbb04547d367 (bug 1650583)
2020-09-03 02:33:34 +03:00
Martin Stransky
90c4b74c25 Bug 1650583 [Linux/EGL] Implement GLContextEGL::FindVisual(), r=jgilbert
Implement GLContextEGL::FindVisual() as a EGL counterpart of GLContextGLX::FindVisual() used
by GLX.

We need to make sure that GdkWindow uses the same visual as GL framebuffer we use for it.
That was already implemented for GLX backend (Bug 1478454).

The visual match is implemented by visual parameter at CreateConfig()/CreateConfigScreen() routines and when it's non-zero,
try to find exact match based on visual ID.

Differential Revision: https://phabricator.services.mozilla.com/D87636
2020-09-02 19:45:44 +00:00
Martin Stransky
fcbc4fc378 Bug 1650583 [Linux/EGL] Log eglCreateWindowSurface failure, r=jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D87635
2020-09-02 19:45:57 +00:00
James Willcox
8ce74e9eef Bug 1654459 - Don't use single-buffer SurfaceTexture on emulator r=sotaro
Differential Revision: https://phabricator.services.mozilla.com/D89041
2020-09-02 00:13:15 +00:00
Jeff Gilbert
79587135ae Bug 1661328 - Enable Mac webgl-ipc tests on Central. r=jmaher,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D89038
2020-09-01 23:29:01 +00:00
James Willcox
665c0bd32e Bug 1659681 - Avoid crash in ~SharedSurace_SurfaceTexture() when GLContext is lost r=sotaro,jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D88889
2020-09-01 13:00:39 +00:00
stransky
4256c8d7fc Bug 1656505 [Linux] Restore active texture when dmabuf texture is created and provide logging to dmabuf surfaces, r=jgilbert
- Restore active texture when dmabuf texture is created at DMABufSurfaceRGBA::CreateTexture()/DMABufSurfaceYUV::CreateTexture.
- Provide more logging for DMABufSurfaceRGBA surfaces.
- Implement DMABufSurfaceRGBA::DumpToFile() to save dmabuf surface content to png file.

Differential Revision: https://phabricator.services.mozilla.com/D88382
2020-09-01 07:24:46 +00:00
sotaro
b71cdb204a Bug 1658126 - Fix EGL_ANDROID_native_fence_sync check for android r=jgilbert
On recent android, EGL_ANDROID_native_fence_sync support is not reported even when eglDupNativeFenceFDANDROID() exists.

Differential Revision: https://phabricator.services.mozilla.com/D87995
2020-08-25 14:37:23 +00:00
Nicolas Silva
9f234a0d35 Bug 1660187 - Don't assert if the GL version string is empty. r=jgilbert
It can happen with Pernosco, getting in the way of reproducing problems elsewhere in the code base.

Differential Revision: https://phabricator.services.mozilla.com/D87732
2020-08-25 07:41:12 +00:00
sotaro
520e0ba1c7 Bug 1660434 - Add EGL_KHR_wait_sync support r=jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D87994
2020-08-24 17:50:48 +00:00
Jeff Gilbert
62f6cc5d9c Bug 1659225 - Apply UNPACK_ params only after init. r=lsalzman
+ Add asserts that we are infact in the default state.

Differential Revision: https://phabricator.services.mozilla.com/D87964
2020-08-23 06:09:33 +00:00
Jeff Gilbert
e3e331e9ad Bug 1658433 - Implement WebGL draft extension EXT_texture_norm16. r=lsalzman,webidl,smaug
Differential Revision: https://phabricator.services.mozilla.com/D86630
2020-08-12 15:19:17 +00:00
Jeff Gilbert
a824ab4d81 Bug 1656034 - Support multiple EglDisplays per GLLibraryEGL. r=lsalzman,sotaro,stransky
Have webrender use its own EGLDisplay, letting WebGL use a different
one.

Differential Revision: https://phabricator.services.mozilla.com/D85496
2020-08-07 07:14:46 +00:00
Mihai Alexandru Michis
639b2bd075 Backed out changeset f1f10f791e99 (bug 1656034) for causing bustages in DMABufSurface.cpp
CLOSED TREE
2020-08-07 02:36:33 +03:00
Jeff Gilbert
b5d6906473 Bug 1656034 - Support multiple EglDisplays per GLLibraryEGL. r=lsalzman,sotaro,stransky
Have webrender use its own EGLDisplay, letting WebGL use a different
one.

Differential Revision: https://phabricator.services.mozilla.com/D85496
2020-08-06 22:53:53 +00:00
Mihai Alexandru Michis
4719cf3e7d Backed out changeset 06538f141210 (bug 1656034) for causing bustages in GLContextProviderEGL.cpp
CLOSED TREE
2020-08-07 00:19:32 +03:00
Jeff Gilbert
78c66237bb Bug 1656034 - Support multiple EglDisplays per GLLibraryEGL. r=lsalzman,sotaro,stransky
Have webrender use its own EGLDisplay, letting WebGL use a different
one.

Differential Revision: https://phabricator.services.mozilla.com/D85496
2020-08-06 19:56:43 +00:00
Dzmitry Malyshau
86b28cfe0b Bug 1656853 - Check for EGL context to be alive on destruction r=aosmond,jgilbert
This probably doesn't matter, as the changes will be rolled back by
https://phabricator.services.mozilla.com/D85496
But the change should fix the crash anyway, for now.

Differential Revision: https://phabricator.services.mozilla.com/D86069
2020-08-05 21:58:14 +00:00
Robert Mader
dd996a396b Bug 1656472 - [X11] Drop CopySubBufferMESA and add SwapBuffersWithDamage support, r=nical
This largely reverts D81868, only keeping what's needed to make SwapBuffersWithDamage
work, and also adds BufferAge support to RenderCompositorOGL.

Differential Revision: https://phabricator.services.mozilla.com/D85565
2020-07-31 16:13:54 +00:00
Dzmitry Malyshau
3d822b4eda Bug 1652972 - Mark EGL context as lost on Shutdown() r=aosmond
This is meant to save us in cases where the message loop in GPU process
receives commands related to resources that point to the old EGL context
that was just shut down. Since the symbols are erased, we'd end up with
trying to execute a nullptr on `MakeCurrent()`. With marking the context
as lost, however, no symbols will be accessed.

Differential Revision: https://phabricator.services.mozilla.com/D84868
2020-07-29 02:33:54 +00:00
Robert Mader
1e96614739 Bug 1654687 - Remove some more GTK3-version related checks, r=stransky
They are all present since 3.8. Also bumb a version check.

Differential Revision: https://phabricator.services.mozilla.com/D84899
2020-07-26 13:20:13 +00:00
Emilio Cobos Álvarez
ff61891772 Bug 1653011 - Simplify and make WeakPtr<Derived> usable and compact. r=froydnj,sg,geckoview-reviewers,jgilbert,kvark,snorp
Having two classes in the inheritance chain inherit from SupportsWeakPtr
now won't compile, but you can use WeakPtr<Derived> when any base class
inherits from SupportsWeakPtr.

Differential Revision: https://phabricator.services.mozilla.com/D83674
2020-07-23 14:51:46 +00:00
Andrew Osmond
6cfed64163 Bug 1650748 - Prevent DMABUF usage with GLX. r=nical
Differential Revision: https://phabricator.services.mozilla.com/D84256
2020-07-22 18:58:11 +00:00
Nicolas Silva
eb34985ecc Bug 1625070 - Use glxCopySubBufferMESA when available if partial present and WebRender are enabled on GLX. r=jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D81868
2020-07-16 14:44:41 +00:00
Narcis Beleuzu
2f4cbd537c Backed out changeset 74a508f9bac4 (bug 1625070) for wr failure on position-sticky-scroll-reposition.html . CLOSED TREE 2020-07-16 13:03:13 +03:00
Nicolas Silva
8f37bf747b Bug 1625070 - Use glxCopySubBufferMESA when available if partial present and WebRender are enabled on GLX. r=jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D81868
2020-07-15 18:20:48 +00:00
Imanol Fernandez
3956a11433 Bug 1642994 - Fix SurfaceTexture assertion failure in WebGLContext::GetFrontBuffer r=jgilbert
- WaitForBufferOwnership() must be called before locking the front buffer
- Use mDefaultFB->mFB instead of 0 to fix a freeze in the readPixels call
- SurfaceTexture.releaseTexImage must be called after each use

Differential Revision: https://phabricator.services.mozilla.com/D82944
2020-07-09 18:31:12 +00:00
Miko Mynttinen
0969459ef6 Bug 1536515 - Part 1: Use the correct OpenGL formats for SurfaceFormat::A8 and SurfaceFormat::A16 r=jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D80504
2020-07-07 17:56:46 +00:00
Imanol Fernandez
41f5efde8f Bug 1374571 - Ensure ANativeWindow is not null before calling eglCreateWindowSurface r=jgilbert
ANativeWindow_fromSurface can return null. This leads to a crash in the eglCreateWindowSurface call.

Differential Revision: https://phabricator.services.mozilla.com/D82369
2020-07-06 17:07:35 +00:00
aardgoose
63856c61b2 Bug 1536674 - Expose KHR_parallel_shader_compile in glx/gl r=jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D32056
2020-07-06 12:48:47 +00:00
Sylvestre Ledru
caf785c695 Bug 1519636 - Reformat recent changes to the Google coding style r=andi
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D82178
2020-07-04 09:38:43 +00:00
Imanol Fernandez
dcdc973db7 Bug 1374571 - Ensure EGL Library is initialized when calling CreateSurfaceFromNativeWindow. r=jgilbert
There are some code paths where CreateSurfaceFromNativeWindow can be called without the GLLibraryEGL::EnsureInitialized check

Differential Revision: https://phabricator.services.mozilla.com/D81990
2020-07-02 18:07:10 +00:00
sotaro
ce3a41744b Bug 1648411 - Add AHardwareBuffer layer buffer support on android r=jnicol
AHardwareBuffer is supported since Android O(APIVersion 26). Implementation of AndroidHardwareBufferTextureData referred AndroidNativeWindowTextureData. Implementation of AndroidHardwareBufferTextureHost referred obsoleted GrallocTextureHost.

android fence is not supported yet.

Differential Revision: https://phabricator.services.mozilla.com/D81808
2020-07-02 13:43:19 +00:00
Martin Stransky
2ba9319525 Bug 1640048 - [X11] Initial EGL runtime support, r=jgilbert,rmader
Patch by Robert Mader [:rmader]

This enables support for EGL on X11, toggled by setting the
MOZ_X11_EGL env variable. It allows running the Webrender
and OpenGL compositors basically like we do with GLX by default.

Note that that there are several things missing:

- no pixmap sharing support (not clear if we want/need it)
- it still uses GLX for several things like finding the X11 visual, VSync and glxtest.

It includes some cleanups, mostly in order to decouple the X11
and Wayland implementations a bit more.

Differential Revision: https://phabricator.services.mozilla.com/D76417
2020-07-02 13:50:41 +00:00
Jeff Gilbert
335a0af676 Bug 1647491 - Hold ref to previous webgl frontbuffer while in-flight. r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D81921
2020-07-02 01:45:36 +00:00
Martin Stransky
1a8c767e6f Bug 1649120 [Linux] Rename Wayland/DMABuf in gfx code, r=sotaro
We change DMABuf config keys from Wayland specific to universal ones as they can be used in both X11 and Wayland backends.

Depends on D81515

Differential Revision: https://phabricator.services.mozilla.com/D81516
2020-07-01 11:22:42 +00:00
Simon Giesecke
e3c223da3e Bug 1648010 - Fix uses of NS_LITERAL_STRING with C string literals. r=geckoview-reviewers,agi,froydnj
Differential Revision: https://phabricator.services.mozilla.com/D80861
2020-07-01 08:34:12 +00:00
Simon Giesecke
cd8b8939b9 Bug 1648010 - Replace uses of NS_LITERAL_STRING/NS_LITERAL_CSTRING macros by _ns literals. r=geckoview-reviewers,jgilbert,agi,hsivonen,froydnj
Differential Revision: https://phabricator.services.mozilla.com/D80860
2020-07-01 08:29:29 +00:00
Gabriele Svelto
e8bade7e47 Bug 1647172 - Do not attempt to create a non-ES OpenGL context on Android r=jgilbert
This works around Android implementations that allow for non-ES contexts
to be created even though they don't work properly.

Differential Revision: https://phabricator.services.mozilla.com/D81666
2020-06-30 10:46:40 +00:00
sotaro
fa7166e309 Bug 1649119 - Add ANDROID_get_native_client_buffer support r=jgilbert
It is necessary for AHardwareBuffer usage.

Differential Revision: https://phabricator.services.mozilla.com/D81504
2020-06-30 00:31:12 +00:00
Martin Stransky
4a8f96bbdc Bug 1646007 [Wayland] Check Wayland dmabuf backend and fallback to a default one, r=jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D79979
2020-06-25 05:57:40 +00:00
sotaro
9437779a52 Bug 1648076 - Use AndroidSurfaceTexture related files only on Android r=jgilbert
No functional change. AndroidSurfaceTexture related files are used on all platforms. They are needed only on Android.

Differential Revision: https://phabricator.services.mozilla.com/D80869
2020-06-24 18:59:14 +00:00
Martin Stransky
2b91832e28 Bug 1645704 [Wayland] Rename WaylandDMABufSurface to DMABufSurface at gxf, r=sotaro
Differential Revision: https://phabricator.services.mozilla.com/D79637
2020-06-21 13:59:17 +00:00
Imanol Fernandez
cc77358c6f Bug 1646073 - Enable WebGL SwapChain pooling on Android. Use a separate SwapChain for WebVR. r=jgilbert
- Enable WebGL SwapChain pooling on Android. Creating and releasing Android Surfaces every frame causes a big performance hit due to AndroidSurface slow destructors bug.
- Add a separate SwapChain for WebVR. We are already using separate SwapChains for WebXR (WebGLFramebuffer::mOpaqueSwapChain) but not for WebVR (it uses the canvas backbuffer).

Differential Revision: https://phabricator.services.mozilla.com/D79840
2020-06-17 18:56:16 +00:00
Sylvestre Ledru
85c05f3a47 Bug 1519636 - Reformat recent changes to the Google coding style r=andi
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D79795
2020-06-16 14:37:23 +00:00
Jeff Gilbert
82ef5d6cc1 Bug 1632249 - Check weakptr value before deref in gl::Texture/Renderbuffer. r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D79626
2020-06-15 18:26:17 +00:00
Jeff Gilbert
4232c2c466 Bug 1632249 - Replace GLContextProvider::CreateOffscreen with GLContext::CreateOffscreenDefaultFb. r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D79390
2020-06-15 18:26:12 +00:00