Update:
- UniFFI to 0.27.1
- Glean to 59.0.0
- App-services to a recent version
This removes the need for the goblin build hack, although we still have
duplicate versions of goblin since UniFFI is ahead of the moz-central
version. I think that should be easy to resolve as a follow-up.
Updating uniffi-bindget-gecko-js based on upstream changes:
- Clone objects before lowering them
(https://github.com/mozilla/uniffi-rs/pull/1880)
- Use u64 for the RustBuffer length and capacity field
(https://github.com/mozilla/uniffi-rs/pull/1978)
I didn't implement the new callback interface VTable code. Instead I
simply disabled the one fixture that tests it. I'd rather implement
https://bugzilla.mozilla.org/show_bug.cgi?id=1888668 first, since that
will simplify the process a bunch. The only real-world use-case for
callbacks that I know of is Mark's logging changes, but that will
require implementing trait interfaces anyways so I'd rather wait than
write a bunch of C++ code that we then throw away.
Differential Revision: https://phabricator.services.mozilla.com/D206130
This simplifies the common infrastructure, removes two varyings from the common set and will allow other patterns to handle sampling differently if they need it (for example an upcoming repeating pattern).
In addition:
- the color parameter is always passed to the fragment shader (it used to be only when no uv_rect was passed).
- v_flags was reorganized a bit so that w is used by the common infrastructure and xyz are available for patterns to use.
Differential Revision: https://phabricator.services.mozilla.com/D206098
position: sticky items scroll independently of their containing
content, resulting in large amounts of picture cache invalidation when
scrolling, causing poor performance. This patch attempts to give them
their own picture cache slice in order to avoid that invalidation.
Differential Revision: https://phabricator.services.mozilla.com/D206502
This patch looks at slow frames that affect scrolling or animations specifically, and count them and looks at what phase took the longest during the slow frame (frame build, uploads and render). This data is continuously collected including while the profiler is not shown, so towards the end of a long browsing session or just after having looked at a test case we can see an approxiation of what caused the most jank.
Differential Revision: https://phabricator.services.mozilla.com/D206516
position: sticky items scroll independently of their containing
content, resulting in large amounts of picture cache invalidation when
scrolling, causing poor performance. This patch attempts to give them
their own picture cache slice in order to avoid that invalidation.
Differential Revision: https://phabricator.services.mozilla.com/D206502
For now we skip the quad path if the gradient is tiled. The plan is to add a repeating quad pattern that can repeat the result of a render task and get all quad patterns to use that.
Differential Revision: https://phabricator.services.mozilla.com/D204774
The loop was submitting a single command in the command buffer, always using the textured quad shader which worked when the interior is a solid color but not for other patterns.
This patch goes over the nine-patch segments twice, first generating a segmented primitive for the interrior with the appropriate pattern shader, and then the corners with the textured shader.
The patch tries to stay in the spirit of the existing code. I'm not super fond of the result. If the pattern isn't opaque the nine-patch will batch poorly since the both the interrior and corner parts are batched using the same rect. Also I suspect we'll find that we need more flexibility if/when we implement borders using quads. By then we'll probably have a clearer idea of the best way to handle segments in general.
Differential Revision: https://phabricator.services.mozilla.com/D206036
For now we skip the quad path if the gradient is tiled. The plan is to add a repeating quad pattern that can repeat the result of a render task and get all quad patterns to use that.
Differential Revision: https://phabricator.services.mozilla.com/D204774
The loop was submitting a single command in the command buffer, always using the textured quad shader which worked when the interior is a solid color but not for other patterns.
This patch goes over the nine-patch segments twice, first generating a segmented primitive for the interrior with the appropriate pattern shader, and then the corners with the textured shader.
The patch tries to stay in the spirit of the existing code. I'm not super fond of the result. If the pattern isn't opaque the nine-patch will batch poorly since the both the interrior and corner parts are batched using the same rect. Also I suspect we'll find that we need more flexibility if/when we implement borders using quads. By then we'll probably have a clearer idea of the best way to handle segments in general.
Differential Revision: https://phabricator.services.mozilla.com/D206036
For now we skip the quad path if the gradient is tiled. The plan is to add a repeating quad pattern that can repeat the result of a render task and get all quad patterns to use that.
Differential Revision: https://phabricator.services.mozilla.com/D204774
It's convenient for shaders that need to fetch data from two different places and we have a spare slot in the quad header. It's not strictly necessary if we want the spare slot for something else, since we could use the integer gpu buffer as an indirection for when we need more than one address (although that's a tad convoluted and inefficient).
Differential Revision: https://phabricator.services.mozilla.com/D204386
Moving vLocalPos from ps_quad_textured to ps_quad pushed the number of varying slots in ps_quad_mask over the limit (16). vLocalPos is going to be used by some patterns in addition to the texture code so ifdef'ing it out is inconvenient. It is simpler to win back a varying slot by packing the clip planes.
Differential Revision: https://phabricator.services.mozilla.com/D204229
Webrender's glslopt-optimized shaders encounter a miscompilation on
some Adreno driver versions regarding fetching empty clip tasks. This
patch reshuffles the code in such a way as to avoid the
bug. Unfortunately the specific cause of the miscompilation remains
unknown, meaning we must take extra care not to regress it in the
future.
Differential Revision: https://phabricator.services.mozilla.com/D204864
While investigating why get_surface_rect sometimes returns an empty rect (causing bad render task sizes), I noticed that all users of get_surface_rect use it to size surfaces, rely on the returned rect to be snapped to integer coordinates, and some even round the coordinates a second time. The documentation of the function states that its purpose is to provide a rect suitable for surface allocation. This patch bakes the expectation into the type and removes some redundant operations.
Differential Revision: https://phabricator.services.mozilla.com/D203738
The vClipRadii varying being changed to mediump is causing borders to
be clipped incorrectly at certain zoom levels. This patch reverts it
to highp to avoid the issue.
As a precaution it conservatively reverts several other varyings in
this shader to be highp as well. Although the others are not
responsible for the issue reported in this bug, using mediump for
varyings related to positioning could cause similar problems.
Differential Revision: https://phabricator.services.mozilla.com/D204507
While investigating why get_surface_rect sometimes returns an empty rect (causing bad render task sizes), I noticed that all users of get_surface_rect use it to size surfaces, rely on the returned rect to be snapped to integer coordinates, and some even round the coordinates a second time. The documentation of the function states that its purpose is to provide a rect suitable for surface allocation. This patch bakes the expectation into the type and removes some redundant operations.
Differential Revision: https://phabricator.services.mozilla.com/D203738
When updating the SpatialTree we record whether each spatial node is
itself or any of its ancestors are actively async zooming. This allows
us to make certain optimizations, such as low-quality pinch zoom mode,
or rounding the raster scale for glyphs.
The current implementation of this, however, contains a bug which
means that a node's is_ancestor_or_self_zooming variable will only be
true when itself or its _direct_ ancestor are zooming, rather than
_any_ ancestor. On certain pages this means we are unable to make the
aforementioned optimizations, resulting in poor performance. This
patch rectifies this problem and adds a unit test.
Differential Revision: https://phabricator.services.mozilla.com/D203446
It is unexpected since adjust_mask_scale_for_max_size rounds the rectangle out but asserting it caused crash spikes (see bug 1882416). This patch will discard the primitive or segment instead of attempting to allocate an invalid mask. If this causes some popping, we'll get some context in the logs.
Differential Revision: https://phabricator.services.mozilla.com/D202944
When low-quality-pinch-zoom is enabled we avoid updating the raster
scale whilst a zoom is active, in order to avoid expensive
re-rasterizations. As a result, however, zooming out a very long
way (ie from fully zoomed in to fully zoomed out) causes a huge number
of picture cache tiles to be on screen at once. Allocating this number
of textures causes extremely bad jank and potentially even OOM
crashes.
Additionally, when zooming in a very long way content appears very
blurry.
To avoid this, this patch updates the raster scale during a
low-quality pinch zoom whenever the zoom has doubled or halved since
the raster scale was last updated. This avoids the blurriness as well
as limiting the number of tiles on screen at once. This comes at the
cost of the occasional expensive frame when everything is
re-rasterized, but is a worthwhile trade-off.
Differential Revision: https://phabricator.services.mozilla.com/D203287
Batched texture uploads are supposed to be hard-coded as enabled or
disabled on certain platforms, and on other platforms controllable via
a pref. However, a previous refactoring made it so that the hard-coded
value is always being overridden by the pref (by checking whether the
hard-coded value is set in the wrong place). As a consequence, batched
texture uploads have been disabled on Mali-G devices, resulting in
poor performance.
This patch moves the check to the correct place, meaning the
hard-coded value is respected once again.
Differential Revision: https://phabricator.services.mozilla.com/D203145
- Increase the border of the rectangles rendered for the APZ minimap.
- Alter the order in which the minimap rectangles are drawn, such that the
larger rects are drawn first.
Differential Revision: https://phabricator.services.mozilla.com/D198203
On some Mali GPUs glPushDebugGroup and other functions from the
extension GL_KHR_debug always raise a GL_OUT_OF_MEMORY error. In debug
builds we automatically enable debug markers, as well as panicking
when encountering a GL error. This causes the GPU process to crash
repeatedly at startup, eventually falling back to software
webrender. To avoid this, we block the extension on affected devices.
Differential Revision: https://phabricator.services.mozilla.com/D201579
The APZ minimap is a debugging tool for Firefox developers, which can
be enabled with the pref apz.minimap.enabled.
When enabled, it shows a minimap overlay for every scroll frame, with
rects indicating the layout and visual viewports and the displayport.
We previously had an implementation for Layers that was removed when
Layers was removed. This patch is restoring an equivalent feature,
implemented for WebRender.
Differential Revision: https://phabricator.services.mozilla.com/D190720
The first branch (where the node is in the root coordinate system)
was not handling the TransformScroll::Unscrolled case, which should
use the scale/offset from the viewport transform rather than the
content transform.
Differential Revision: https://phabricator.services.mozilla.com/D196692
An oversight when updating the allowed shaders list in bug 1866020
assumed that devices without GL_OES_EGL_image_external_essl3 would
also not have GL_EXT_YUV_target. This turns out not to always be the
case, and results in a crash when attempting to initialize the shaders
on such devices.
This patch checks explicitly for GL_EXT_YUV_target when generating the
allowed shaders list.
Differential Revision: https://phabricator.services.mozilla.com/D196716
Pixel 6, 7, and 8 devices running Android 14 are affected by a bug
where video frames with SMPTE 432 color primaries are rendered
incorrectly when sampled from an external texture in GLES. To work
around this, we force these frames to be converted to RGB using BT709
colorspace instead. While this won't look exactly right, it is much
better than the current situation.
When we detect that a frame is decoded with that color space on an
affected device, we set a "ForceBT709" flag which gets passed through
to webrender as a new ImageBufferKind. Rendering this ImageBufferKind
is handled via a new shader feature TEXTURE_EXTERNAL_BT709, which
works much like the existing TEXTURE_EXTERNAL feature, but
additionally uses the EXT_YUV_TARGET extension to override the
colorspace transformation.
This approach could be extended in the future to handle additional
colorspace transformations, but for now only handles the one required
to workaround this particular driver bug.
Differential Revision: https://phabricator.services.mozilla.com/D195800
Pixel 6, 7, and 8 devices running Android 14 are affected by a bug
where video frames with SMPTE 432 color primaries are rendered
incorrectly when sampled from an external texture in GLES. To work
around this, we force these frames to be converted to RGB using BT709
colorspace instead. While this won't look exactly right, it is much
better than the current situation.
When we detect that a frame is decoded with that color space on an
affected device, we set a "ForceBT709" flag which gets passed through
to webrender as a new ImageBufferKind. Rendering this ImageBufferKind
is handled via a new shader feature TEXTURE_EXTERNAL_BT709, which
works much like the existing TEXTURE_EXTERNAL feature, but
additionally uses the EXT_YUV_TARGET extension to override the
colorspace transformation.
This approach could be extended in the future to handle additional
colorspace transformations, but for now only handles the one required
to workaround this particular driver bug.
Differential Revision: https://phabricator.services.mozilla.com/D195800
Updated uniffi-bindgen-gecko-js to work with UniFFI 0.25.2:
- Use `config.toml` to list UniFFI sources. This makes it easier to
associate data with them, for example the `crate_name` field that's
now required to generate the sources.
- Enable the `extern-rustbuffer` feature on `uniffi_core`
- Updated the external types fixture to work around
https://github.com/mozilla/uniffi-rs/issues/1872
Ran mach vendor and mach cargo vet to update the Rust crates.
Differential Revision: https://phabricator.services.mozilla.com/D195163
Updated uniffi-bindgen-gecko-js to work with UniFFI 0.25.2:
- Use `config.toml` to list UniFFI sources. This makes it easier to
associate data with them, for example the `crate_name` field that's
now required to generate the sources.
- Enable the `extern-rustbuffer` feature on `uniffi_core`
- Updated the external types fixture to work around
https://github.com/mozilla/uniffi-rs/issues/1872
Ran mach vendor and mach cargo vet to update the Rust crates.
Differential Revision: https://phabricator.services.mozilla.com/D195163