Normally, if IsNull() is false, we'd expect ToPtr() to return a valid pointer,
but for code that may run on a stylo thread in the child process this is not
necessarily true: if resolving the pointer requires accessing a new shared-mem
block, we can't make that IPC call from the stylo thread. So in this case, we
let ToPtr() return null, and the caller needs to handle this safely.
Differential Revision: https://phabricator.services.mozilla.com/D81242
The logic was apparently initially copied from the compositor thread which too got migrated to nsThread in bug 1634253, so we re-use that same logic again.
This allows to remove all use of the Google's MessageLoop.
Differential Revision: https://phabricator.services.mozilla.com/D81974
In all those cases, the current nsISerialEventTarget is either the main thread or the MessageChannel's nsISerialEventTarget (since bug 1634846)
Differential Revision: https://phabricator.services.mozilla.com/D81966
This changes DrawTargetWrapAndRecord::CreateClippedDrawTarget to
properly set the transform on the newly created DrawTarget
to match DrawTargetRecording::CreateClippedDrawTarget.
More interestingly, it adds a print reftest that
ensures that this code is actually excerised.
Differential Revision: https://phabricator.services.mozilla.com/D82114
There are some code paths where CreateSurfaceFromNativeWindow can be called without the GLLibraryEGL::EnsureInitialized check
Differential Revision: https://phabricator.services.mozilla.com/D81990
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
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
If an image is promoted to a compositor surface, but subsequently
clipped (by invalid clip rect) then we skip requesting the image
but still try to resolve the surface when building batches.
This patch reorders the primitive pass so that any decisions about
dropping a primitive from the visible list are made before the
prim dependencies (and compositor surfaces) are updated.
Differential Revision: https://phabricator.services.mozilla.com/D81928
This should be a relatively straightforward patch. Essentially, we implement
a wrapper class (and friends) around nsZipArchive (and friends), which transparently
caches entries from the underlying zip archive in the StartupCache. This will break
without changes to the StartupCache, made in the patch after this, which allow it
to be used off of the main thread, and outside the main process.
Depends on D77635
Differential Revision: https://phabricator.services.mozilla.com/D77634
Allows to remove the dance around the compositor thread just to perform the assertion.
The use of an in-line lambda avoid all ambiguity on which thread this is called.
Differential Revision: https://phabricator.services.mozilla.com/D80635
There's a small race that can happen when the remote decoder gets shutdown during xpcom shutdown; that would cause GetCurrentSerialEventTarget to return null. Leading to an assertion failure in ActorLifecycleProxy thread-safety check when PRemoteDecoderManagerParent gets destroyed.
So we use a background taskqueue instead and cleanup a bit the threading code in there allowed thanks to the TaskQueue ability to not require an explicit shutdown.
Differential Revision: https://phabricator.services.mozilla.com/D81287
The `clear_caches_with_quads` flags is meant to work around a bug in some
drivers' scissored clears, but its implementation uses the `GL_ALWAYS` depth
comparison function, which SWGL doesn't support.
SWGL does scissored clears very well, so simply turning this workaround off on
SWGL avoids the problem and gets good results.
Of course we could just make SWGL support `GL_ALWAYS`, but that would be kind of
annoying, since it basically disables depth checks altogether, and we want to
use entirely different paths when depth checks aren't needed.
Differential Revision: https://phabricator.services.mozilla.com/D81918
swgl::Context::init_default_framebuffer takes two new arguments, for providing a
frame buffer owned by something else. swgl::Context::get_color_buffer returns an
extra value, describing the stride of the buffer in addition to the width.
Differential Revision: https://phabricator.services.mozilla.com/D81896
This should be a relatively straightforward patch. Essentially, we implement
a wrapper class (and friends) around nsZipArchive (and friends), which transparently
caches entries from the underlying zip archive in the StartupCache. This will break
without changes to the StartupCache, made in the patch after this, which allow it
to be used off of the main thread, and outside the main process.
Depends on D77635
Differential Revision: https://phabricator.services.mozilla.com/D77634
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
This greatly reduces the number of vector reallocations happening while building primitive lists. On the difficult cases like youtube front page the reduction is a bit more than 50%, and more in other pages I tested. More importantly it dramatically reduces the amount of the most expensive of these reallocations which are when the vector is starting to get large.
Differential Revision: https://phabricator.services.mozilla.com/D81725
Fix ODR violation: type of GLboolean must match gleam, else the unsafe{}
glue code will corrupt the parameters (and go out of bounds in
GetBooleanv). "Composite" was getting a garbage value for "flip".
Differential Revision: https://phabricator.services.mozilla.com/D81618
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
Allows to remove the dance around the compositor thread just to perform the assertion.
The use of an in-line lambda avoid all ambiguity on which thread this is called.
Differential Revision: https://phabricator.services.mozilla.com/D80635
There's a small race that can happen when the remote decoder gets shutdown during xpcom shutdown; that would cause GetCurrentSerialEventTarget to return null. Leading to an assertion failure in ActorLifecycleProxy thread-safety check when PRemoteDecoderManagerParent gets destroyed.
So we use a background taskqueue instead and cleanup a bit the threading code in there allowed thanks to the TaskQueue ability to not require an explicit shutdown.
Differential Revision: https://phabricator.services.mozilla.com/D81287
Previously, tile cache instances were destroyed and recreated
each time a new scene was created, as they were embedded inside
the picture primitives. An elaborate but complicated system was
used to retain important state (such as native surfaces, primitive
dependencies) across new scenes.
This patch moves the tile cache instances to be stored inside the
render backend. It removes the previous code for retaining state
for each tile cache. Instead, tile caches are created / reused /
destroyed during `new_async_scene_ready`.
This removes quite a bit of complexity. More importantly, it is
another step towards being able to cache and retain state such
as primitive tile assignments and visibility state across both
new frames and scenes.
Differential Revision: https://phabricator.services.mozilla.com/D81487
Guard against nullptr access of missing p.impl.
Also change LinkStatus so is_initialized is no longer true and calling
code can early out if bind_program fails.
Differential Revision: https://phabricator.services.mozilla.com/D81421