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

2195 Коммитов

Автор SHA1 Сообщение Дата
Jeff Gilbert a426e3880b Bug 1669381 - Replace GLLibraryEGL nsIGfxInfo use with gfxVars. r=mattwoodrow
+ Remove now-unused gfxUtils::ThreadSafeGetFeatureStatus.

Differential Revision: https://phabricator.services.mozilla.com/D92529
2020-10-06 05:43:33 +00:00
Jamie Nicol 7adec85b80 Bug 1575765 - Implement KHR_partial_update for webrender. r=sotaro,jgilbert
KHR_partial_update allows us to avoid rerendering the entire
backbuffer every frame, and instead only render what has changed on
the current frame, as well as the difference between the current
backbuffer and the current frontbuffer. It works similarily to
EXT_buffer_age, which we already support, with the additional
requirement that we must call eglSetDamageRegion each frame before
rendering to the backbuffer.

Modify GLContextEGL::GetBufferAge() so that it queries the age if
either EXT_buffer_age or KHR_partial_update are available. This will
now automatically be queried by webrender through the
PartialPresentCompositor trait. Add a new function to that trait,
set_buffer_damage_region(), whose RenderCompositorEGL implementation
calls eglSetDamageRegion(). Call this from composite_simple(), once
the damage rect has been calculated but before rendering to the
backbuffer.

Additionally, change both RenderCompositorEGL and
RenderCompositorOGL's implementations of
ShouldDrawPreviousPartialPresentRegions() to unconditionally return
true, rather than checking for the existence of EXT_buffer_age (or
adding a new check for KHR_partial_update). The lack of these
extensions does not mean that webrender is able to skip rendering
previous frames' damage. Rather the opposite, it means we cannot
render *only* the previous frames' damage, and must instead always
render the entire buffer.

Differential Revision: https://phabricator.services.mozilla.com/D91203
2020-10-02 10:23:56 +00:00
Razvan Maries 63b41aa30f Backed out 3 changesets (bug 1656533, bug 1575765) for WebRender bustages. CLOSED TREE
Backed out changeset 84c31fd9ff82 (bug 1575765)
Backed out changeset 48c1532d1d9d (bug 1575765)
Backed out changeset ed9075d9319b (bug 1656533)
2020-10-02 12:51:55 +03:00
Jamie Nicol 5b8c7d826e Bug 1575765 - Implement KHR_partial_update for webrender. r=sotaro,jgilbert
KHR_partial_update allows us to avoid rerendering the entire
backbuffer every frame, and instead only render what has changed on
the current frame, as well as the difference between the current
backbuffer and the current frontbuffer. It works similarily to
EXT_buffer_age, which we already support, with the additional
requirement that we must call eglSetDamageRegion each frame before
rendering to the backbuffer.

Modify GLContextEGL::GetBufferAge() so that it queries the age if
either EXT_buffer_age or KHR_partial_update are available. This will
now automatically be queried by webrender through the
PartialPresentCompositor trait. Add a new function to that trait,
set_buffer_damage_region(), whose RenderCompositorEGL implementation
calls eglSetDamageRegion(). Call this from composite_simple(), once
the damage rect has been calculated but before rendering to the
backbuffer.

Additionally, change both RenderCompositorEGL and
RenderCompositorOGL's implementations of
ShouldDrawPreviousPartialPresentRegions() to unconditionally return
true, rather than checking for the existence of EXT_buffer_age (or
adding a new check for KHR_partial_update). The lack of these
extensions does not mean that webrender is able to skip rendering
previous frames' damage. Rather the opposite, it means we cannot
render *only* the previous frames' damage, and must instead always
render the entire buffer.

Differential Revision: https://phabricator.services.mozilla.com/D91203
2020-10-02 08:38:29 +00:00
sotaro 0666f42a43 Bug 1667932 - Fix file descriptor handling in SharedSurface_AndroidHardwareBuffer::WaitForBufferOwnership() r=jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D91704
2020-09-29 22:44:33 +00:00
sotaro 33ae1c138c Bug 1665241 - Simplify SurfaceFactory::Create() at TextureType::AndroidNativeWindow case r=jgilbert
When TextureType::AndroidNativeWindow is chosen StaticPrefs::webgl_enable_surface_texture() should be true.

Differential Revision: https://phabricator.services.mozilla.com/D90340
2020-09-29 04:28:48 +00:00
sotaro 36fb807eb2 Bug 1665300 - Disable glGetGraphicsResetStatus usage on android emulator r=jgilbert
glGetGraphicsResetStatus does not work on android emulator both with SwiftShader and with GPU.

Differential Revision: https://phabricator.services.mozilla.com/D90391
2020-09-29 04:37:22 +00:00
sotaro 67e6515719 Bug 1663381 - Reduce file descriptor usage at SharedSurface_AndroidHardwareBuffer r=nical
We needs to reduce file descriptor creation for AndroidHardwareBuffer to avoid out of file descriptor situation. SharedSurface_AndroidHardwareBuffer::ToSurfaceDescriptor() is called for every composition. It causes avoid out of file descriptor.

By the change, file descriptor is created only once for each AndroidHardwareBuffer of SharedSurface_AndroidHardwareBuffer.

Differential Revision: https://phabricator.services.mozilla.com/D90066
2020-09-28 20:29:50 +00:00
Steven Michaud 69821ba2af Bug 1666293 - Flush explicitly before deleting textures. r=jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D90893
2020-09-21 20:24:51 +00:00
Sylvestre Ledru ec8859e69e Bug 1519636 - Reformat recent changes to the Google coding style r=andi
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D90793
2020-09-20 10:14:09 +00:00
Matt Woodrow 77b568f7af Bug 1660709 - Use MacIOSurface code to determine texture formats when binding an IOSurface to a texture. r=jgilbert
The GLBlitHelper version was reimplementing the same logic, and didn't have support for all the pixel types needed.

Differential Revision: https://phabricator.services.mozilla.com/D88125
2020-09-10 23:38:30 +00:00
John Lin b3c72383ca Bug 1655915 - p3: make AndroidSharedBlitGL unique. r=jgilbert
AndroidSharedBlitGL is never shared with other objects and doesn't
have to be ref-counted.

Differential Revision: https://phabricator.services.mozilla.com/D89532
2020-09-09 00:05:20 +00:00
John Lin a79f02d04e Bug 1655915 - p1: properly release surface. r=snorp,geckoview-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D89530
2020-09-16 16:59:49 +00:00
stransky c14c6f5775 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-11 10:39:56 +00:00
sotaro 872ccfe115 Bug 1649088 - Add SharedSurface support with AHardwareBuffer support on android r=jgilbert
AHardwareBuffer could remove several limitations of android::SurfaceTexture.

File descriptor usage of current implementation is not efficient. It is going to be addressed by Bug 1663381.

Differential Revision: https://phabricator.services.mozilla.com/D89232
2020-09-11 03:11:45 +00:00
sotaro 5d9e5a2687 Bug 1654475 - SharedSurface_SurfaceTexture: Only ReleaseTexImage if IsSingleBuffer r=jgilbert
SharedSurface_SurfaceTexture::ProducerReadReleaseImpl() handles java::GeckoSurfaceTexture. But how it work is very confusing. The GeckoSurfaceTexture is not SurfaceTexture of this class's GeckoSurface when current process is content process. SurfaceTexture of this class's GeckoSurface does not exist in this process. It exists in compositor's process. Then GeckoSurfaceTexture in this process is a sync surface that copies back the SurfaceTextrure from compositor's process.

Call ReleaseTexImage() only when Surface is single buffer mode, since it needs to be called only when Surface is single buffer mode.

Differential Revision: https://phabricator.services.mozilla.com/D84477
2020-09-10 17:19:15 +00:00
Narcis Beleuzu 69a21ed2df Backed out 2 changesets (bug 1663003) for bustages on nsWindow.cpp . CLOSED TREE
Backed out changeset 50a87c4ddf15 (bug 1663003)
Backed out changeset c3035ba4d8fc (bug 1663003)
2020-09-10 23:40:09 +03:00
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