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

3586 Коммитов

Автор SHA1 Сообщение Дата
Cristian Tuns ce0b61513b Backed out changeset 06cfb7445c64 (bug 1799801) for causing build bustages CLOSED TREE 2022-11-09 11:57:02 -05:00
Jim Blandy 9d1f26b312 Bug 1799801: Update wgpu to 261069d0 (2022-10-5) r=nical,supply-chain-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D161662
2022-11-09 16:42:50 +00:00
Nicolas Silva 10546932e6 Bug 1768984 - Reuse plane splitters across scenes. r=gfx-reviewers,gw
Currently splane splitters are stored in the built scene and reallocated with every new scene.
This patch moves the responsibility of storing/recycling the plane splitters to the frame builder so that they can be reused in more cases. The scene builder only needs to track splitter indices, it doesn't use the splitter objects themselves.

Alone this patch does not make a large difference because the current version of the plane_split crate reallocates everything each frame. The next version of plane_split does a much better job of recycling allocations, and applying this patch on top of it makes a large difference.

Differential Revision: https://phabricator.services.mozilla.com/D160363
2022-11-09 11:22:34 +00:00
Nicolas Silva 5be0d3b13a Bug 1768984 - Vendor the plane-split update. r=gfx-reviewers,gw
Differential Revision: https://phabricator.services.mozilla.com/D161585
2022-11-09 11:22:34 +00:00
Nicolas Silva 9cc2763063 Bug 1768984 - Plane-split 0.18 update. r=gfx-reviewers,gw
New plane_split version with much faster BSP tree.
The main source of churn is plane_split not being generic over the unit tag anymore.

Differential Revision: https://phabricator.services.mozilla.com/D160362
2022-11-09 11:22:33 +00:00
Jan-Erik Rediger 68cd95c000 Bug 1799129 - Vendor Glean v51.8.0 and glean_parser 6.3.0 r=chutten,supply-chain-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D161276
2022-11-08 15:53:07 +00:00
Lee Salzman fe55c52512 Bug 1791495 - Check for zero sqrt on ARM. r=jrmuizel
For SWGL on ARM, we implement sqrt(N) as N * inversesqrt(N). This means we don't
properly handle zero unless we explicitly check for it. Otherwise, a NaN ends up
getting produced erroneously.

Differential Revision: https://phabricator.services.mozilla.com/D161107
2022-11-03 04:19:32 +00:00
ohall-m 3b204056d6 Bug 1771343 - GeckoView Android API 33 (Android 13) r=geckoview-reviewers,jgraham,jnicol,nalexander,jonalmeida
Updating GeckoView from Android API level 31 to API 33 for target and compile.

Differential Revision: https://phabricator.services.mozilla.com/D159764
2022-11-02 10:53:33 +00:00
Glenn Watson 480db43e21 Bug 1798244 - Port gradient stops to be stored in gpu-buffer r=gfx-reviewers,lsalzman
Port gradient stops to be stored in the gpu-buffer rather than
the gpu-cache. The intent is to land a small use case for the
gpu-buffer code, which will allow us to get an idea if there's any
unexpected performance or driver bugs from the new gpu-buffer code,
before making wider use of this to replace the gpu-cache.

Differential Revision: https://phabricator.services.mozilla.com/D160743
2022-11-01 01:30:47 +00:00
Jamie Nicol 24e878accb Bug 1794438 - Add test for computed reference frame transform with yflip and rotation. r=gfx-reviewers,bradwerth
This test ensures that a y-flip works correctly along with a 90/270
degree transform and a non-square content size.

Depends on D160817

Differential Revision: https://phabricator.services.mozilla.com/D160818
2022-10-31 20:51:43 +00:00
Jamie Nicol 11a9cd13b8 Bug 1794438 - Add ability to test push_computed_frame() to wrench. r=gfx-reviewers,bradwerth
Gecko uses the webrender API DisplayListBuilder.push_computed_frame()
to create a reference frame with a transform specified by a scale_from
size, an optional vertical_flip, and a rotation. This is used for
video.

This patch adds the ability to test this API from wrench yaml. An
example of a test using this capability can be found in the next patch
in this series.

Depends on D160816

Differential Revision: https://phabricator.services.mozilla.com/D160817
2022-10-31 20:51:43 +00:00
Jamie Nicol 6b208c7acb Bug 1794438 - Handle rotation with vertical flip transform correctly. r=gfx-reviewers,bradwerth
On Android, videos with a hard-coded rotation were being incorrectly
cropped when rendering. This is due to a buggy transform calculation
in SceneBuilder.build_reference_frame().

To apply the y-flip, we scale the height by -1, then translate the y
offset by content_size.height. However, as this video contains an 90
degree rotation, this means we actually end up translating by the
video's width rather than its height. Because the width and height are
different sizes in this video, this means the video is rendered at an
incorrect offset and is cropped. To fix this, ensure we translate by
content_size.width instead for 90 or 270 degree rotations.

Note that this only occured on Android because SurfaceTextureClient is
the only texture client type that sets the ORIGIN_BOTTOM_LEFT texture
flag, thereby causing a y-flip in this location.

Differential Revision: https://phabricator.services.mozilla.com/D160816
2022-10-31 20:51:42 +00:00
Lee Salzman 78300497a6 Bug 1797721 - Handle tile repeat in brush_linear_gradient SWGL span shader. r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D160608
2022-10-29 07:03:36 +00:00
Lee Salzman a2fa759a56 Bug 1795510 - Explicitly check for perspective in clip tile shaders for SWGL. r=aosmond
Clip tile shaders don't output the vertex W, so that SWGL can't detect if we're trying
to render something with perspective or not. swgl_drawSpan functions then get invoked
as if no perspective was used. In this case, we need to explicitly check to see if
there is perspective, or rather, that the W value varies along the span.

Differential Revision: https://phabricator.services.mozilla.com/D160464
2022-10-27 23:48:29 +00:00
Chris H-C de3c85f1cf Bug 1797363 - Vendor Glean SDK v51.7.0 r=TravisLong,supply-chain-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D160269
2022-10-26 13:02:54 +00:00
Bas Schouten be7600f0ff Bug 1768652: Make sure to always cancel the sceneswap timer when not recording. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D145968
2022-10-25 12:47:17 +00:00
Jan-Erik Rediger 2003f2a8b0 Bug 1796087 - Update to Glean v51.5.0 and UniFFI 0.21.0. r=chutten,supply-chain-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D159689
2022-10-20 12:42:47 +00:00
Nicolas Silva 6ff7822e10 Bug 1795711 - Show number of created/deleted textures in WR's profiler. r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D159589
2022-10-19 08:18:17 +00:00
Jamie Nicol 54c6c8806a Bug 1795614 - Avoid invalidating render targets on Mali-G710. r=gfx-reviewers,jgilbert
In bug 1787520 we discovered a driver bug affecting Mali-G78 devices,
and added a workaround for it - avoiding invalidating no-longer-needed
render targets at the end of each render pass. It now transpires this
bug also affects Mali-G710 GPUs, so this patch applies the same
workaround for those devices too.

Differential Revision: https://phabricator.services.mozilla.com/D159515
2022-10-17 18:52:01 +00:00
Glenn Watson 7b751b5e60 Bug 1794949 - Support deferred render task information in GPUBuffer r=gfx-reviewers,lsalzman
When building the GPUBuffer during the prepare pass, we want to be
able to refer to the UV rect (and other information) about images
and render tasks. However, we don't know this information until
after the resource cache block that occurs after prepare (waiting
for blob / glyph worker threads to complete).

Previously, we would defer these queries until batching and then
reference these via a GPU cache address in the instances, which
is complicated and inefficient (making instances larger than they
need to be).

With this change, GPUBuffer supports recording "patch" locations in
the buffer that UV rects should be added. After the render task
graph is built, the GPUBuffer can resolve and patch those locations,
meaning that batching is much simpler (and reducing the number of
indirect fetches required in vertex shaders).

Differential Revision: https://phabricator.services.mozilla.com/D159236
2022-10-13 04:25:18 +00:00
Ashly Hale a9a114bbfe Bug 1786634 - Remove ImageMask.repeat field because it is always false r=gw
Remove some dead code.

Differential Revision: https://phabricator.services.mozilla.com/D159010
2022-10-11 23:54:28 +00:00
Lee Salzman cfb26bdf6f Bug 1792527 - Explicitly bind mip filter for external textures inside WebRender. r=gw
If an external image shows up multiple times while using a different image rendering
setting on each instance, we can erroneously call handler.lock() for each instance in
parallel, thus defaulting to the last image rendering setting supplied for all instances
in that batch.

To work around this, we get rid of the concept of having RenderTextureHosts maintain and
set the image rendering state, which results in a nice simplification. Then, when we go
to actually bind an external image inside WebRender, we set the image rendering state
at that point, so that regardless of how many instances of an external image are locked
simultaneously, we always use the correct image rendering setting for a batch.

Differential Revision: https://phabricator.services.mozilla.com/D158920
2022-10-10 19:23:51 +00:00
pmcmanis b3d8c6d5d8 Bug 1793786 - Update Glean version to 51.4.0 r=chutten,supply-chain-reviewers,webdriver-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D158759
2022-10-07 20:19:49 +00:00
Butkovits Atila 1bed1fd6e7 Backed out changeset a5df97f61fec (bug 1793786) for causing build bustages. CLOSED TREE 2022-10-07 16:35:21 +03:00
pmcmanis 5d43825505 Bug 1793786 - Update Glean version to 51.4.0 r=chutten,supply-chain-reviewers,webdriver-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D158759
2022-10-07 13:05:21 +00:00
Glenn Watson 23cf35087b Bug 1793714 - Update RON crate in WR to 0.7.1 r=gfx-reviewers,jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D158621
2022-10-05 02:51:51 +00:00
Glenn Watson fb47df18ef Bug 1791336 - Extend command buffer infrastructure for future primitive types r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D157611
2022-09-19 20:12:11 +00:00
Glenn Watson 97ba22d406 Bug 1790730 - Add basic infrastructure for gpu buffer texture. r=gfx-reviewers,nical
For some time, we've been wanting to move away from use of the GPU
cache, due to driver complexity and performance bugs when updating
the shared texture.

Instead, we can create one or more buffers that contain the relevant
information for the primitives that are currently dirty + visible,
and being batched for drawing.

By pooling these and only reusing them when the GPU has finished
referencing them, we hope to simplify the management of GPU buffers
compared to the GPU cache, and also remove driver stalls we see
in various cases related to the GPU cache (note: the buffer recycling
will be implemented in follow up commits).

For now, this basic infrastructure will allow us to do some experiments
and profiling with using this, while building some of the planned
performance optimizations for clip-mask rendering.

Differential Revision: https://phabricator.services.mozilla.com/D157284
2022-09-18 22:21:13 +00:00
Jan-Erik Rediger f6a6e37ef5 Bug 1788040 - Update to Glean v51.2.0. r=chutten,supply-chain-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D156937
2022-09-13 12:57:58 +00:00
Jamie Nicol 9da985b994 Bug 1787520 - Avoid invalidating render targets on Mali-G78 devices. r=gfx-reviewers,jrmuizel
On the Pixel 6 family devices we are seeing frequent image corruption
issues on some websites, which started following the Android 13
upgrade. This can be avoided by not invalidating the no-longer-needed
render targets at the end of each render pass. This is only an
optimization anyway, so is safe to skip.

The Android 13 update upgraded the Mali driver from version v1.r32p1
to v1.r36p0. As we did not encounter this bug prior to the Android 13
update, this patch only applies the workaround on driver versions
v1.r36p0 and above. It's possible other GPUs than the G78 are also
affected, but for now we limit the workaround to just this GPU. We can
re-evaluate if and when we receive bug reports from users on other
GPUs.

Differential Revision: https://phabricator.services.mozilla.com/D157116
2022-09-12 15:59:46 +00:00
Butkovits Atila cdc9808d7e Backed out changeset 28680960f741 (bug 1787520) for causing build bustages. CLOSED TREE 2022-09-12 18:46:13 +03:00
Jamie Nicol 3c581eecf5 Bug 1787520 - Avoid invalidating render targets on Mali-G78 devices. r=gfx-reviewers,jrmuizel
On the Pixel 6 family devices we are seeing frequent image corruption
issues on some websites, which started following the Android 13
upgrade. This can be avoided by not invalidating the no-longer-needed
render targets at the end of each render pass. This is only an
optimization anyway, so is safe to skip.

The Android 13 update upgraded the Mali driver from version v1.r32p1
to v1.r36p0. As we did not encounter this bug prior to the Android 13
update, this patch only applies the workaround on driver versions
v1.r36p0 and above. It's possible other GPUs than the G78 are also
affected, but for now we limit the workaround to just this GPU. We can
re-evaluate if and when we receive bug reports from users on other
GPUs.

Differential Revision: https://phabricator.services.mozilla.com/D157116
2022-09-12 14:19:01 +00:00
Jeff Muizelaar dacea3aa0f Bug 1790172 - Elaborate panic message. r=gfx-reviewers,lsalzman
This might help us make sense of bug 1769492.

Differential Revision: https://phabricator.services.mozilla.com/D157024
2022-09-10 04:06:05 +00:00
Mike Hommey 388bdd5c5b Bug 1789510 - Remove unnecessary parentheses. r=gfx-reviewers,bradwerth,gw
Rustc 1.64 warns about them (which --enable-warnings-as-errors turns
into an error).

Differential Revision: https://phabricator.services.mozilla.com/D156600
2022-09-07 00:26:25 +00:00
Glenn Watson 863a1d7867 Bug 1788774 - Remove unused slow subpixel rendering path r=gfx-reviewers,lsalzman
There is a slow rendering path for subpixel AA on hardware that
doesn't support dual-source blending. However, we never actually
enable that path (as `force_subpixel_aa` is never modified by
Gecko) now as almost all hardware supports it. If ever running
Firefox on a machine without dual-source blending, grayscale
text AA will be enabled by default, or SW-WR can be used if
subpixel AA is desired.

Differential Revision: https://phabricator.services.mozilla.com/D156234
2022-09-01 21:34:17 +00:00
Glenn Watson 4e87a61ffb Bug 1787089 - Fix interactions between root level mix-blend containers and backdrop-filter r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D155536
2022-08-29 00:30:24 +00:00
Andrew Osmond 734922ce3d Bug 1785673 - Improve DisplayListPayload buffer preallocations. r=nical
Instead of setting a ceiling on how much we are willing to allocate, we
should always try to reallocate a buffer the same size that we used
before. If we cannot, we should fail gracefully and just not preallocate
at all. This should help with profiles where we consistently need a
larger payload buffer than the previous maximum, while minimizing OOM
crashes on the other side, where our preallocations fail and/or are more
than the next display list update actually requires.

Differential Revision: https://phabricator.services.mozilla.com/D154951
2022-08-18 11:47:03 +00:00
Jamie Nicol a8f97c1373 Bug 1784051 - Delete SwCompositor's shared depth texture when final surface is destroyed. r=lsalzman
And lazily create it when first surface is created. This prevents us
unnecessarily holding on to that memory when a compositor has no
surfaces, ie when the tab is backgrounded on Android. While each depth
texture may only be a few megabytes, this quickly adds up on Android
where each tab has its own compositor.

Differential Revision: https://phabricator.services.mozilla.com/D154636
2022-08-17 09:58:51 +00:00
Bas Schouten 7847d11464 Bug 1784286: Add telemetry probe for measuring rendering time for frames without shader compilation. r=nical
Differential Revision: https://phabricator.services.mozilla.com/D154407
2022-08-16 21:25:09 +00:00
Csoregi Natalia 185b01f5c5 Backed out changeset 524ef2de255e (bug 1784286) for causing webrender bustages. CLOSED TREE 2022-08-16 23:17:37 +03:00
Bas Schouten 668b1c1db0 Bug 1784286: Add telemetry probe for measuring rendering time for frames without shader compilation. r=nical
Differential Revision: https://phabricator.services.mozilla.com/D154407
2022-08-16 19:51:38 +00:00
Jamie Nicol 41a2bac09c Bug 1784049 - Free native surfaces held by tile cache on memory pressure. r=gw
When the webrender render backend receives a memory pressure event,
call a new function TileCacheInstance.memory_pressure() for each tile
cache owned by the render backend. This destroys each compositor tile
and surface owned by the cache. By additionally setting the
NativeTileId for each tile to None, we will automatically allocate new
tiles if required during the next frame build.

On Android with SWGL enabled, this helps prevent ballooning memory
usage when opening several tabs, as memory pressure events are
triggered when a tab is backgrounded.

Differential Revision: https://phabricator.services.mozilla.com/D154635
2022-08-16 16:20:14 +00:00
Cristian Tuns 6659f90a94 Backed out 2 changesets (bug 1784049, bug 1784051) for causing mochitest failures with crash:core::panicking::panic_str CLOSED TREE
Backed out changeset 20e3e274cc27 (bug 1784051)
Backed out changeset 247891777d45 (bug 1784049)
2022-08-16 04:51:16 -04:00
Jamie Nicol f125453afd Bug 1784051 - Delete SwCompositor's shared depth texture when final surface is destroyed. r=lsalzman
And lazily create it when first surface is created. This prevents us
unnecessarily holding on to that memory when a compositor has no
surfaces, ie when the tab is backgrounded on Android. While each depth
texture may only be a few megabytes, this quickly adds up on Android
where each tab has its own compositor.

Depends on D154635

Differential Revision: https://phabricator.services.mozilla.com/D154636
2022-08-16 06:46:15 +00:00
Jamie Nicol 06164d4f71 Bug 1784049 - Free native surfaces held by tile cache on memory pressure. r=gw
When the webrender render backend receives a memory pressure event,
call a new function TileCacheInstance.memory_pressure() for each tile
cache owned by the render backend. This destroys each compositor tile
and surface owned by the cache. By additionally setting the
NativeTileId for each tile to None, we will automatically allocate new
tiles if required during the next frame build.

On Android with SWGL enabled, this helps prevent ballooning memory
usage when opening several tabs, as memory pressure events are
triggered when a tab is backgrounded.

Differential Revision: https://phabricator.services.mozilla.com/D154635
2022-08-16 06:46:15 +00:00
Nicolas Silva 35814d5a15 Bug 1690244 - Move WebRender initialization code out of renderer.rs. r=kvark
There is a lot going on in renderer.rs, the initialization code takes a non-negligible chunk of it and touches all aspects of WebRender including setting up all of the threads. This patch moves it into its own init module.
In addition, RendererOptions is renamed into WebRenderOptions to better reflect that it configures every aspect of the engine, and init::create_webrender_instance replaces Renderer::new.

This a rebased version of an pld patch approved by kvark a while back.

Differential Revision: https://phabricator.services.mozilla.com/D103767
2022-08-12 07:30:14 +00:00
Glenn Watson 9a091117e7 Bug 1757054 - Ensure line decoration cache tasks are at least 1x1 r=gfx-reviewers,nical
Differential Revision: https://phabricator.services.mozilla.com/D152829
2022-08-12 01:52:03 +00:00
Noemi Erli 01c7c4f180 Backed out changeset 6237668e5fca (bug 1690244) for causing webrender build bustages CLOSED TREE 2022-08-11 16:24:49 +03:00
Nicolas Silva f125931e67 Bug 1690244 - Move WebRender initialization code out of renderer.rs. r=kvark
There is a lot going on in renderer.rs, the initialization code takes a non-negligible chunk of it and touches all aspects of WebRender including setting up all of the threads. This patch moves it into its own init module.
In addition, RendererOptions is renamed into WebRenderOptions to better reflect that it configures every aspect of the engine, and init::create_webrender_instance replaces Renderer::new.

This a rebased version of an pld patch approved by kvark a while back.

Differential Revision: https://phabricator.services.mozilla.com/D103767
2022-08-11 12:39:56 +00:00
Jan-Erik Rediger 72b2c1829e Bug 1783754 - Update to Glean v51.1.0. r=TravisLong,supply-chain-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D154088
2022-08-09 15:58:51 +00:00
Lee Salzman 6b70286fc4 Bug 1783115 - Use only a single FT_Face for each font in WebRender. r=jnicol
This patch uses a single FT_Library for all font threads (even across separate windows)
within WebRender. It maintains a mapping from FontTemplate to a cached FT_Face that will
be traded to any font thread that requests it on a first-come-first-serve basis. This
FT_Face is guarded by a mutex to ensure that no other worker thread can use it while it
is in-use by the first requesting thread.

In general it is safe to use different FT_Faces on different threads so long as they are
distinct. However, the snag in this is that FT_LcdFilter state is stored globally in the
FT_Library, even while it is supplied per-FontInstance. To workaround this, we need to
keep track of how many threads are currently rasterizing glyphs with the FT_LcdFilter
state and wait for them to all finish before we can change the FT_LcdFilter to what
the next group of incoming jobs expects. FontContext::begin_rasterize/end_rasterize hooks
were added to support this. While there seems to be some support in newer FreeType
versions for per-FT_Face LcdFilter settings, it doesn't allow disabling the LcdFilter
or using legacy settings, so we are still suck using the global setting instead.

To further reduce memory usage, this patch also no longer allocates a separate FT_Face
for FontVariations. Instead, since the FT_Face must be locked to a single thread anyway,
it now just uses FT_Set_Var_Design_Coordinates on the single FT_Face for the font before
loading the batch of glyphs associated with the FontVariations. So regardless of how many
different variations are used for a font, it will only allocate a single FT_Face.

Normally, rayon's par_iter is used to scatter glyphs from a single font request onto
multiple threads which works against the one-font-per-thread model needed here. This
adds a FontContext::distribute_across_threads hook to control whether or not par_iter
should be used so that we can disable that behavior for this case, where instead we just
want to process each glyph serially within the scope of a single worker for a given
font request.

Differential Revision: https://phabricator.services.mozilla.com/D153715
2022-08-04 17:02:57 +00:00
Lee Salzman 5a8639ce8e Bug 1782795 - Remove shared context from GlyphRasterizer. r=jnicol
Differential Revision: https://phabricator.services.mozilla.com/D153503
2022-08-04 17:02:57 +00:00
Iulian Moraru c227f2e0d3 Backed out 2 changesets (bug 1782795, bug 1783115) for causing macos build bustages. CLOSED TREE
Backed out changeset 7c176468fe45 (bug 1783115)
Backed out changeset 01f50cfcc9b1 (bug 1782795)
2022-08-04 19:54:01 +03:00
Lee Salzman 1bd7909c3f Bug 1783115 - Use only a single FT_Face for each font in WebRender. r=jnicol
This patch uses a single FT_Library for all font threads (even across separate windows)
within WebRender. It maintains a mapping from FontTemplate to a cached FT_Face that will
be traded to any font thread that requests it on a first-come-first-serve basis. This
FT_Face is guarded by a mutex to ensure that no other worker thread can use it while it
is in-use by the first requesting thread.

In general it is safe to use different FT_Faces on different threads so long as they are
distinct. However, the snag in this is that FT_LcdFilter state is stored globally in the
FT_Library, even while it is supplied per-FontInstance. To workaround this, we need to
keep track of how many threads are currently rasterizing glyphs with the FT_LcdFilter
state and wait for them to all finish before we can change the FT_LcdFilter to what
the next group of incoming jobs expects. FontContext::begin_rasterize/end_rasterize hooks
were added to support this. While there seems to be some support in newer FreeType
versions for per-FT_Face LcdFilter settings, it doesn't allow disabling the LcdFilter
or using legacy settings, so we are still suck using the global setting instead.

To further reduce memory usage, this patch also no longer allocates a separate FT_Face
for FontVariations. Instead, since the FT_Face must be locked to a single thread anyway,
it now just uses FT_Set_Var_Design_Coordinates on the single FT_Face for the font before
loading the batch of glyphs associated with the FontVariations. So regardless of how many
different variations are used for a font, it will only allocate a single FT_Face.

Normally, rayon's par_iter is used to scatter glyphs from a single font request onto
multiple threads which works against the one-font-per-thread model needed here. This
adds a FontContext::distribute_across_threads hook to control whether or not par_iter
should be used so that we can disable that behavior for this case, where instead we just
want to process each glyph serially within the scope of a single worker for a given
font request.

Differential Revision: https://phabricator.services.mozilla.com/D153715
2022-08-04 16:38:34 +00:00
Lee Salzman 241447a89a Bug 1782795 - Remove shared context from GlyphRasterizer. r=jnicol
Differential Revision: https://phabricator.services.mozilla.com/D153503
2022-08-04 16:38:34 +00:00
Glenn Watson 6e214817ef Bug 1782317 - Fix segment building scrolled local clip bug. r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D153428
2022-08-02 05:28:09 +00:00
Glenn Watson 07bcbd6c5e Bug 1782405 - Fix UV sampling rect for blurs with downscale-adjusted sizes r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D153314
2022-08-01 20:02:12 +00:00
Jan-Erik Rediger 94b2463ce2 Bug 1781030 - Upgrade to Glean v51.0.1. r=perry.mcmanis,supply-chain-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D152626
2022-08-01 10:50:47 +00:00
Glenn Watson 91a3a71c40 Bug 1781786 - Optimize some of the clip-set building process r=gfx-reviewers,nical
Pre-cache the clip set -> node information as entries are pushed
on to the clip-tree builder stack.

This page is still not fast (it's a worst case for our current
code with box-shadow clips) but it's better than without this
patch (and we have plans to optimize the box-shadow case).

Differential Revision: https://phabricator.services.mozilla.com/D152956
2022-07-30 04:07:18 +00:00
Glenn Watson 7f864ea080 Bug 1781987 - Fix shared clip root detection when ancestor has complex clips r=gfx-reviewers,nical
We need to exclude shared clip roots if the hierarchy contains a
complex clip, as the shared clip applied by the tile cache during
compositing doesn't support complex clips.

Differential Revision: https://phabricator.services.mozilla.com/D152961
2022-07-28 21:07:37 +00:00
Iulian Moraru 04f48d5fb6 Backed out changeset 9ced13a92244 (bug 1757054) for causing crashtest failures on 1757054.html. CLOSED TREE 2022-07-28 04:38:39 +03:00
Glenn Watson bda035b7f5 Bug 1757054 - Ensure line decoration cache tasks are at least 1x1 r=gfx-reviewers,nical
Differential Revision: https://phabricator.services.mozilla.com/D152829
2022-07-27 20:13:44 +00:00
Jan-Erik Rediger 8dcad8e62e Bug 1781085 - Update to Glean v50.1.3 r=chutten,supply-chain-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D152770
2022-07-27 10:24:48 +00:00
criss e3d5438abb Backed out changeset 581d7209c242 (bug 1781085) for causing build bustages. CLOSED TREE 2022-07-27 12:19:52 +03:00
Jan-Erik Rediger a3f580ed1f Bug 1781085 - Update to Glean v50.1.3 r=chutten,supply-chain-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D152770
2022-07-27 08:58:11 +00:00
Glenn Watson a00b8ca709 Bug 1779952 - Refactor and optimize internal representation of clip state r=nical
This patch refactors how clip chains are internally represented and used
during scene and frame building. The intent is to make clip processing
during frame building more efficient and consistent. Additionally, this
work enables follow ups to cache the result of clip-chain builds between
frame and scene builds.

These changes will significantly reduce the cost of the visibility pass
for the common case when not much content has changed. In this patch,
the public API for clipping remains (mostly) the same, in order to allow
landing and stabilising this work without major changes to Gecko. However,
a longer term goal is to make the public WR clip API more closely match
the internal representation, to reduce work done during scene building.

Clips on a primitive can be categorized into two buckets. The first are
local clips that are specific to the primitive and move with it. These
could essentially be considered part of the definition of the primitive
itself. The second are a hierarchy of clips that apply to one or more
items, and may move independently of the primitive(s) they clip. These
clips are things like scroll regions, stacking context clips, iframe
clip regions etc. On (real world) pages, the clip hierarchy is typically
quite shallow, with a small number of clips that are shared by a large
number of primitives.

Finding clips that are shared between primitives is both required (for
things such as determining which picture cache slice a primitive can
be assigned to, while applying the shared clips during composition), and
also a potential optimization (processing shared clips only once and
caching this clip state similar primitives).

The public clip-chain API has two complexities that make the above
difficult and time consuming for WR to determine. It was possible to
express a clipping hierarchy both via the legacy clip parenting path
(via `ClipId` definitions) and also via clip-chains (the `parent`
field of a `ClipChain`). Second, clip-chains themselves can define
an arbitrary number and ordering of clips. Clips can also implicitly
apply to primitives via parent stacking contexts and iframes, but must
sometimes be removed (when an intermediate surface is created) for
performance reasons.

The new internal representation provided by this patch introduces a
`ClipTree` structure which is built during scene building by accumulating
the set of clips that apply to a primitive from all explicit and implicit
sources, and grafting this on to the existing clip-tree structure.
This provides WR a simple way to determine which clips are shared between
primitive (by checking ancestry) and reduces the size of the internal
representation (by sharing clips where possible rather than duplicating).
Interning is still used to identify parts of the clip-tree that define
the same clipping state.

Specific changes in this patch:
 * Remove legacy `ClipId` style parenting support (in conjunction with
   previous patches)
 * Remove the public API ability to specify the clip on a primitive via
   `ClipId` (it must now be a clip-chain)
 * Remove `combined_local_clip_rect` from `PrimitiveInstance`, reducing
   the size of the structure significantly
 * Introduce `ClipTree` used during frame building, which is created by
   `ClipTreeBuilder` during scene building
 * Separate out per-primitive clip concept (`ClipTreeLeaf`) from clipping
   hierarchy (`ClipTreeNode`). In future, more elements will be moved to
   the `ClipTreeLeaf` and the state of each `ClipTreeNode` will be cached)
 * Simplify the logic to disable / remove clips during frame building that
   are applied by parent surface(s)
 * Port hit-testing to be based on `ClipTree` which is simpler, faster and
   also resolves some edge case correctness bugs
 * Use a simpler and faster method to find shared clips during picture
   cache slice assignment of primitives
 * Update wrench to use the public clip-chain API definition changes

This patch already introduces some real-world optimizations (for example,
`displaylist_mutate` becomes 6% faster overall), but mostly sets things
up for follow up patches to be able to cache clip-state between frames,
which should result in much larger wins.

Differential Revision: https://phabricator.services.mozilla.com/D151987
2022-07-26 21:13:32 +00:00
Glenn Watson 136d751432 Bug 1780877 - Fix regression in shared surface allocs by render task graph r=gfx-reviewers,lsalzman
The patch from 1780321 relaxes shared surface allocation, by allowing
surfaces to be shared even if they exist for >1 pass. However, it has
a logic bug - _non shared_ surfaces that are created may then be
allocated from as a shared surface if the `free_after` matches. This
restores the `is_shared` logic that used to exist, which fixes this
edge case (and still allows the performance optimization on the cases
that were fixed by 1780321).

Differential Revision: https://phabricator.services.mozilla.com/D152707
2022-07-26 09:35:07 +00:00
Glenn Watson 4066f3d6bc Bug 1768678 - Fix blur source size adjustment for downscaling r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D152243
2022-07-26 00:58:32 +00:00
Glenn Watson 246371eb45 Bug 1780567 - Fix shared target allocation for tasks with Existing mode r=gfx-reviewers,jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D152474
2022-07-21 23:57:02 +00:00
Glenn Watson 0080c38b17 Bug 1780320 - Support child scroll roots if in the root coordinate system r=gfx-reviewers,lsalzman
A requirement of calling `get_relative_transform` is that the child
node is an ancestor of the reference node. To ensure this invariant
is met, we exclude non-ancestor scroll roots from consideration when
picking a scroll root for an atomic picture cache slice. However, this
can mean we select a non-optimal scroll root in some cases. But the
`get_relative_transform` constraint only applies if the spatial nodes
are in a different coordinate system - if we know that the scroll roots
are in the same coordinate system, we can always calculate the correct
relative transform, regardless of ancestry of the nodes. We can rely on
this to relax the condition here, which means we select a more appropriate
scroll root, resulting in much less invalidation and rasterization work
in these cases.

Differential Revision: https://phabricator.services.mozilla.com/D152236
2022-07-20 23:37:40 +00:00
Glenn Watson e757de0919 Bug 1780321 - Support shared render targets that have a lifetime of more than one pass r=gfx-reviewers,lsalzman
In the presence of complex effects such as backdrop-filter, it's
possible that some picture cache tiles can be drawn in a different
pass to other picture cache tiles. If there are a large number of
child render tasks that are shared between tiles assigned to different
render passes, that may result in a large number of standalone render
target allocations, which can hurt performance and reduce batching
efficiency.

This patch allows shared surfaces to be used when they have a lifetime
that spans more than one pass. We track the `free_after` in the active
shared surface list, and only allocate tasks if they match the lifetime
of other tasks in that shared surface. Existing logic ensures that
surface is returned to the shared target pool only after the `free_after`
pass has occurred.

Differential Revision: https://phabricator.services.mozilla.com/D152235
2022-07-20 23:37:39 +00:00
Brad Werth 6736828278 Bug 1778187: Explicitly store tile cache background color and backdrop rect. r=gw
This patch solves a performance problem and a semantic problem introduced
in Bug 1773109. That Bug changed the term tile cache 'backdrop' to mean
two distinct things:

1) An opaque region spanning the entire tiling area (the sole original
meaning).
2) An opaque region spanning the visible area.

Presently the code tries and fails to maintain both of those meanings in the
BackdropInfo structure. The problem arises when the tiling backdrop is one
color and the visible backdrop is a different color. There's only one color in
the structure! The existing code attempts to circumvent this by setting the
tile cache background_color for the tiling color, and that's slow. Even if it
wasn't slow, the opaque_rect is set for the tiling area instead of the actual
backdrop area, which is semantically confusing, and could lead to incorrect
draw on platforms that support native color layers.

This patch addresses these issues by adding a spanning_opaque_color to the
BackdropInfo structure, which will only be set when there is a backdrop that
covers the tiling area. That color can be used as a clear color for the slice
tiles, when set. This patch also adds a backdrop_rect which indicates the area
of the actual backdrop, if set. This backdrop_rect is used to size the native
color layers, if supported by the compositor.

Differential Revision: https://phabricator.services.mozilla.com/D151942
2022-07-18 15:00:27 +00:00
Glenn Watson 891c6e9288 Bug 1779387 - Restore clip root parenting for now r=gfx-reviewers,aosmond
There are some hit-test use cases that still rely on clip-chains
and invalid clip-chain handles inheriting from the root clip-id
for a pipeline.

This will become irrelevant once the clip-tree patches land next
week, but for now we can restore these to fix a regression going
out in a release.

Differential Revision: https://phabricator.services.mozilla.com/D151880
2022-07-15 04:16:07 +00:00
Travis Long 2855beea72 Bug 1772132 - Update Glean and remove cargo metadata replacement. r=janerik,supply-chain-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D151499
2022-07-14 13:11:13 +00:00
Norisz Fay 31e76fd90f Backed out changeset ce93635100b6 (bug 1772132) for causing webrender build bustage CLOSED TREE 2022-07-13 22:08:19 +03:00
Travis Long a285a07c6e Bug 1772132 - Update Glean and remove cargo metadata replacement. r=janerik,supply-chain-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D151499
2022-07-13 18:00:35 +00:00
Bogdan Szekely 6030807e22 Backed out changeset 1ff9bb6e4a8c (bug 1772132) for causing build bustage. CLOSED TREE 2022-07-13 16:17:53 +03:00
Travis Long e826b78da5 Bug 1772132 - Update Glean and remove cargo metadata replacement. r=janerik,supply-chain-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D151499
2022-07-13 12:59:16 +00:00
smolnar 36788ca992 Backed out changeset ab4790cd94eb (bug 1772132) for causing wrench bustage CLOSED TREE 2022-07-13 12:04:13 +03:00
Travis Long 86debe7916 Bug 1772132 - Update Glean and remove cargo metadata replacement. r=janerik,supply-chain-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D151499
2022-07-13 08:43:41 +00:00
Bas Schouten 1444526cbe Bug 1778395 - Part 1: Record time between frame creation and the start of frame building. r=jrmuizel,chutten
Differential Revision: https://phabricator.services.mozilla.com/D151184
2022-07-12 14:59:09 +00:00
Jamie Nicol 75236a237a Bug 1778150 - Override UV rect for cs_scale when source is external texture. r=gfx-reviewers,nical
In webrender, external textures provide an override UV rect which is
not known until during rendering when the texture is actually
resolved. For brush shaders this value is automatically read from the
GPU cache, but for other shaders the UVs are passed as instance
attributes. Currently we use the overridden UV rect correctly for the
composite shader, but not the cs_scale shader.

On Android devices which do not support the
GL_OES_EGL_image_external_essl3 extension, the cs_scale shader is used
to render video in some cases. Because we were not handling the
texture's UV rect correctly, video was being rendered upside down on
some websites as a result.

This patch makes us manually override the scale shader's instance
data's source_rects when the source is an external
texture. Additionally, the cs_scale shader needs adapted to handle the
case where the UV rect is inverted.

Differential Revision: https://phabricator.services.mozilla.com/D151233
2022-07-07 16:38:21 +00:00
Glenn Watson 5bd787a0ba Bug 1778036 - Switch public primitive API to be clip-chain based r=gfx-reviewers,lsalzman
This is mostly just changing a small number of structs and function
params (most of the work has been done in previous patches).

Differential Revision: https://phabricator.services.mozilla.com/D150987
2022-07-05 20:52:31 +00:00
Glenn Watson 5c3d556f14 Bug 1778030 - Remove clip_id_stack from wrench r=gfx-reviewers,lsalzman
Also update reftests to only specify rect / rounded-rect / mask per clip.

Differential Revision: https://phabricator.services.mozilla.com/D150984
2022-07-05 20:52:31 +00:00
Glenn Watson bbcff3fc66 Bug 1778017 - Remove ClipId-style parenting from rect clip public API r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D150983
2022-07-05 11:22:05 +00:00
Glenn Watson 60220b9b80 Bug 1778015 - Remove ClipId-style parenting from rounded-rects clip public API r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D150982
2022-07-05 09:53:28 +00:00
Glenn Watson 829af78106 Bug 1778013 - Remove ClipId-style parenting from image clip masks public API r=gfx-reviewers,lsalzman
Also make the parent in ClipTemplate an Option, so that the
semantics are a bit clearer (follow up patches will remove this
parent field entirely).

Differential Revision: https://phabricator.services.mozilla.com/D150980
2022-07-05 08:20:49 +00:00
Dan Robertson affccc0acb Bug 1753019 - Use the animation id to identify hit testing metadata. r=botond,gw
## Summary

Pass the fixed position element animation id through webrender, returning the
the animation id in the hit-test result if the element is a fixed position
element. This animation id then can be used to lookup the relevant Hit-Testing
Tree Node, which can be used to find the fixed (or sticky) position side bits.

## Motivation

Sticky content can be currently stuck to the root content or not, based on the
scroll position. As a result, when hit testing sticky content, APZ needs both
the sticky position side bits and additional information to determine if the
element is currently stuck to the root content. This is needed to fix the
hit-testing of sticky position content when a APZ transform is being applied,
such as overscroll and hiding the dynamic toolbar.

## Implementation

The information needed to determine if a element is currently stuck to the root
content and the fixed/sticky position side bits is already stored in the
hit-testing tree node. Any hit test result should have a corresponding
hit-testing tree node entry. When a hit-test result contains a animation id and
a hit-testing tree node is found, we can store a pointer to this node and use
this to check the fixed/sticky position side bits. Something similar is already
done for hit test results when a scrollbar is hit.

Differential Revision: https://phabricator.services.mozilla.com/D148648
2022-07-04 18:14:58 +00:00
Glenn Watson 775d9ac992 Bug 1777901 - Pt 2 - Port more wrench tests to specify clips via clip-chains r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D150927
2022-07-04 10:14:57 +00:00
Glenn Watson c048d4ef0e Bug 1777901 - Port more wrench tests to specify clips via clip-chains r=gfx-reviewers,lsalzman
The intent is to deprecate specifying clips via ClipId::Clip(..)
as this will simplify the ongoing clip-interning work.

Differential Revision: https://phabricator.services.mozilla.com/D150925
2022-07-04 10:14:56 +00:00
Glenn Watson 70b436796a Bug 1777395 - Remove legacy clip-parenting in wrench r=gfx-reviewers,lsalzman
This removes the last piece of code in wrench and gecko (there is
one more callsite in WR itself) that relies on the legacy clip
parenting code.

Differential Revision: https://phabricator.services.mozilla.com/D150694
2022-06-30 20:38:14 +00:00
Glenn Watson 65bb3e9aee Bug 1777388 - Remove legacy clip-parenting from `clip-to-frame` in wrench r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D150683
2022-06-30 02:41:02 +00:00
Glenn Watson 46928eda22 Bug 1777363 - Add clip-chain definition shortcut to wrench r=gfx-reviewers,lsalzman
Add a way to define an item-local clip-chain from a series of
clips. Port a couple of tests to use this instead of relying on
legacy clip-parenting (which we plan to remove soon).

Differential Revision: https://phabricator.services.mozilla.com/D150662
2022-06-29 22:41:01 +00:00
Glenn Watson 6672bf7be5 Bug 1777141 - Support `spatial-id` in wrench yaml files r=gfx-reviewers,lsalzman
Some more work towards removing the use of legacy clipid parenting
in wrench test files. Add support for specifying the spatial id
without also setting the clip parent. Port some more wrench tests
to use spatial-id and/or clip-chain.

Differential Revision: https://phabricator.services.mozilla.com/D150528
2022-06-29 19:34:18 +00:00
Brad Werth c1f79b8beb Bug 1773109: Change tile cache backdrops to only guarantee visible coverage. r=gw
Previously, a tile cache backdrop was an opaque color that was guaranteed
to cover the entire tile cache rect. This change makes it so that the
backdrop must only cover the visible area. For compositors that support
native color layers, this allows native color layers to be used more
often.

To make this work, the tile cache background color is updated whenever a
spanning backdrop is found. This ensures that tiles still clear to a
spanning color. The tile cache background is reset on each new scene, so
it won't carry a "stale" backdrop color.

Differential Revision: https://phabricator.services.mozilla.com/D150036
2022-06-28 01:11:31 +00:00
Brad Werth b6d72eca9b Bug 1776474: Make UploadTexturePool check minimum size of temporary buffer vec. r=nical
This patch ensures that the calculation for unused temporary buffers can
never overflow via subtraction. Instead of counting buffers as they are
taken from the vec, it just keeps track of how many are left. If a
previous frame has generated a lot of temporary buffers, this will detect
that the current frame didn't use them all.

Differential Revision: https://phabricator.services.mozilla.com/D150271
2022-06-27 17:12:59 +00:00
Glenn Watson 0c7933b0a3 Bug 1776621 - Remove per-item complex clips in wrench in favor of explicit clip-chains r=gfx-reviewers,lsalzman
A step towards removing specification of clips via old ClipId style in wrench.

Differential Revision: https://phabricator.services.mozilla.com/D150344
2022-06-27 05:56:46 +00:00
Glenn Watson 26ac926331 Bug 1776618 - Remove clip-node references from wrench r=gfx-reviewers,lsalzman
In future, it won't be possible to specify clip hierarchy by the
old ClipId identifier, so convert these ones to clip-chains now.

Differential Revision: https://phabricator.services.mozilla.com/D150342
2022-06-27 05:56:46 +00:00
Bobby Holley 28696910b9 Bug 1776096 - Bump WebRender crate versions. r=jrmuizel
We formerly published webrender to crates.io, but haven't done so in
several years. However, the in-tree version number still matches the
version published on crates.io, causing cargo-vet to flag that this is
something that should potentially be audited. We could silence that on
the cargo-vet side, but then if we ever starting publishing it again
we'd miss the nudge to certify the audit (which would be useful to
anyone consuming it). So bumping the versions to a not-yet-published
number is a good way to correctly articulate the situation.

Differential Revision: https://phabricator.services.mozilla.com/D150055
2022-06-24 04:11:26 +00:00
Marian-Vasile Laza ca94966846 Backed out 3 changesets (bug 1776096) for causing cargo bustages.
Backed out changeset d7bdddbc2edf (bug 1776096)
Backed out changeset f45836578ddd (bug 1776096)
Backed out changeset 2fcab932329e (bug 1776096)
2022-06-24 01:54:07 +03:00
Bobby Holley 18e520a71c Bug 1776096 - Bump WebRender crate versions. r=jrmuizel
We formerly published webrender to crates.io, but haven't done so in
several years. However, the in-tree version number still matches the
version published on crates.io, causing cargo-vet to flag that this is
something that should potentially be audited. We could silence that on
the cargo-vet side, but then if we ever starting publishing it again
we'd miss the nudge to certify the audit (which would be useful to
anyone consuming it). So bumping the versions to a not-yet-published
number is a good way to correctly articulate the situation.

Differential Revision: https://phabricator.services.mozilla.com/D150055
2022-06-23 22:15:26 +00:00
Marian-Vasile Laza a8c4de1417 Backed out changeset 859b4b866b60 (bug 1773109) for causing remote failures. CLOSED TREE 2022-06-24 01:24:34 +03:00
Narcis Beleuzu 9a4bc45bba Backed out 3 changesets (bug 1776096) for build bustages on Cargo.lock . CLOSED TREE
Backed out changeset 8d2b8b3af2ac (bug 1776096)
Backed out changeset 8e0ed786341b (bug 1776096)
Backed out changeset fe93a0ac4a3f (bug 1776096)
2022-06-23 23:29:50 +03:00
Bobby Holley 6239d0c6f8 Bug 1776096 - Bump WebRender crate versions. r=jrmuizel
We formerly published webrender to crates.io, but haven't done so in
several years. However, the in-tree version number still matches the
version published on crates.io, causing cargo-vet to flag that this is
something that should potentially be audited. We could silence that on
the cargo-vet side, but then if we ever starting publishing it again
we'd miss the nudge to certify the audit (which would be useful to
anyone consuming it). So bumping the versions to a not-yet-published
number is a good way to correctly articulate the situation.

Differential Revision: https://phabricator.services.mozilla.com/D150055
2022-06-23 20:16:14 +00:00
Brad Werth 2a2fb3dc86 Bug 1773109: Change tile cache backdrops to only guarantee visible coverage. r=gw
Previously, a tile cache backdrop was an opaque color that was guaranteed
to cover the entire tile cache rect. This change makes it so that the
backdrop must only cover the visible area. For compositors that support
native color layers, this allows native color layers to be used more
often.

To make this work, the tile cache background color is updated whenever a
spanning backdrop is found. This ensures that tiles still clear to a
spanning color. The tile cache background is reset on each new scene, so
it won't carry a "stale" backdrop color.

Differential Revision: https://phabricator.services.mozilla.com/D150036
2022-06-23 19:05:00 +00:00
Lee Salzman 6c3fae5e86 Bug 1774304 - Support simple format conversions when blitting. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D150071
2022-06-23 15:20:14 +00:00
Glenn Watson fb6ca66ec6 Bug 1775369 - Make hit-test API use clip-chains rather than ClipId r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D149938
2022-06-22 19:55:26 +00:00
Glenn Watson a523865d98 Bug 1775189 - Switch `push_stacking_context` API to be clip-chain based r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D149845
2022-06-21 21:09:24 +00:00
Jan-Erik Rediger 51f960bd09 Bug 1773255 - Update to Glean v50.1.0 r=chutten,supply-chain-reviewers
Including glean_parser 6.1.1

Two important things in there:
* glean_parser: [data-review] Include extra keys' names and descriptions in data review template
* Glean: Derive `serde::{Deserialize, Serialize}` on `Lifetime` and `CommonMetricData`

Differential Revision: https://phabricator.services.mozilla.com/D149381
2022-06-15 15:39:33 +00:00
Lee Salzman e96936a4ec Bug 1768578 - Use nearest filter on short rows. r=gfx-reviewers,nical
Differential Revision: https://phabricator.services.mozilla.com/D148990
2022-06-13 14:34:04 +00:00
Glenn Watson f35bad6668 Bug 1773905 - Remove prepared_frame_id and chase id r=gfx-reviewers,lsalzman
As part of the frame building work being done, the PrimitiveInstance
struct will change significantly (most of the state will be moved
to the primitive template, instance will be closer to an index +
some visibility state).

`prepared_frame_id` is no longer relevant (it can't be incorrect
now due to the way prims are reset). The chase is is not used or
maintained, and would need to be quite different after the changes
mentioned above anyway.

Differential Revision: https://phabricator.services.mozilla.com/D149025
2022-06-12 23:12:23 +00:00
Glenn Watson 19447c5d19 Bug 1773899 - Remove antialiased flag from primitive instance r=gfx-reviewers,jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D149024
2022-06-12 23:12:23 +00:00
Mike Hommey c143e86971 Bug 1773399 - Update derive_more to 0.99.17. r=emilio,gfx-reviewers,nical
Limit its features to those we actually use, which turns out is none for
webrender_api.

Differential Revision: https://phabricator.services.mozilla.com/D148734
2022-06-11 20:34:18 +00:00
Nicolas Silva d69bd8c230 Bug 1772655 - Fix ReportMemory in gl.cc to match the malloc_size_of signature. r=gfx-reviewers,jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D148784
2022-06-10 09:02:52 +00:00
Brad Werth d0a86ec792 Bug 1773156 Part 3: Remove old tile cache backdrops from new scenes without a backdrop. r=gw
Since backdrop_surface is not cleared on prepare_for_new_scene, it's possible
that the tile cache might be carrying "old" backdrop info. Existing code
correctly handles this case *as long as* the new scene also has a backdrop.
This change is necessary to make sure that old backdrop info is cleared
even when the new scene does not contain a backdrop.

Differential Revision: https://phabricator.services.mozilla.com/D148848
2022-06-10 00:35:16 +00:00
Brad Werth 9000a5c7ea Bug 1773156 Part 2: Don't destroy tile cache backdrop surfaces during prepare_for_new_scene. r=gw
It's not necessary to clear the tile cache backdrop surface when a new
scene arrives. Doing so has unintended consequences because clearing the
backdrop surface forces the destruction of the associated native surface.
That native surface will very likely just have to be recreated. If the new
scene doesn't have a backdrop, or has a different backdrop, the logic in
take_context is sufficient to destroy the old one.

Depends on D148704

Differential Revision: https://phabricator.services.mozilla.com/D148705
2022-06-10 00:35:16 +00:00
Brad Werth 461675e683 Bug 1773156 Part 1: Deallocate native color backdrop surfaces upon tile cache destroy. r=gw
This ensures that the native surfaces for color backdrops are destroyed
when the tile cache itself is destroyed.

Depends on D148678

Differential Revision: https://phabricator.services.mozilla.com/D148704
2022-06-10 00:35:16 +00:00
Molnar Sandor 8c504b904a Backed out 2 changesets (bug 1773156) for causing reftest failures. CLOSED TREE
Backed out changeset bceb7f6acfd6 (bug 1773156)
Backed out changeset 7f26513a5bb6 (bug 1773156)
2022-06-09 23:15:23 +03:00
Brad Werth 267b206414 Bug 1773156 Part 2: Don't destroy tile cache backdrop surfaces during prepare_for_new_scene. r=gw
It's not necessary to clear the tile cache backdrop surface when a new
scene arrives. Doing so has unintended consequences because clearing the
backdrop surface forces the destruction of the associated native surface.
That native surface will very likely just have to be recreated. If the new
scene doesn't have a backdrop, or has a different backdrop, the logic in
take_context is sufficient to destroy the old one.

Depends on D148704

Differential Revision: https://phabricator.services.mozilla.com/D148705
2022-06-09 17:31:22 +00:00
Brad Werth 96cc289338 Bug 1773156 Part 1: Deallocate native color backdrop surfaces upon tile cache destroy. r=gw
This ensures that the native surfaces for color backdrops are destroyed
when the tile cache itself is destroyed.

Depends on D148678

Differential Revision: https://phabricator.services.mozilla.com/D148704
2022-06-09 17:31:21 +00:00
Lee Salzman fc5db6d514 Bug 1772643 - Clamp no-repeat steps to valid range. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D148805
2022-06-09 15:57:57 +00:00
Lee Salzman 8fcc63190b Bug 1746913 - Clamp clip distances to valid range. r=gfx-reviewers,jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D148743
2022-06-09 15:32:15 +00:00
Brad Werth 4f7cc97aba Bug 1772867: Require native color layers to fill the entire scrollable area. r=gw
This patch is rolling back changeset 06c57c0af21d which is Phabricator
revision D147566, plus adding some comments indicating the desire to
restore some of the intent of that code. The effect of this rollback is to
activate native color layers only if they cover the entire scrollable
area, not just the visible area. This is necessary to ensure correct
visuals as tiles are scrolled into view, when those tiles show something
other than the backdrop color.

Differential Revision: https://phabricator.services.mozilla.com/D148541
2022-06-08 19:42:14 +00:00
Molnar Sandor 26daa2dde6 Bug 1772223 - Fix wrench bustages in wr/webrender/src/telemetry.rs CLOSED TREE 2022-06-08 17:48:04 +03:00
Bas Schouten 063fc57c6b Bug 1772223: Add some additional probes for measuring important WebRender internals. r=jrmuizel,chutten
Differential Revision: https://phabricator.services.mozilla.com/D148078
2022-06-08 13:41:19 +00:00
Norisz Fay fd3fe8a239 Backed out 2 changesets (bug 1772216, bug 1772223) for causing webrender build bustages CLOSED TREE
Backed out changeset ec001981dfae (bug 1772223)
Backed out changeset 94fa038eea8e (bug 1772216)
2022-06-08 05:25:42 +03:00
Bas Schouten 5e39d47b08 Bug 1772223: Add some additional probes for measuring important WebRender internals. r=jrmuizel,chutten
Differential Revision: https://phabricator.services.mozilla.com/D148078
2022-06-08 02:11:07 +00:00
Jan-Erik Rediger 9f36df3eb8 Bug 1765326 - Update clap and other dependencies to avoid duplication. r=jnicol
The duplications arise from a Glean update, which has some of those as
transitive dependencies.
Upgrading Clap and others here reduces the duplication.

Differential Revision: https://phabricator.services.mozilla.com/D147659
2022-06-07 12:37:21 +00:00
Jan-Erik Rediger 8182bee632 Bug 1768834 - Switch to Glean with UniFFI integration r=glandium,chutten
Upgrades to Glean v50.0.1, which comes with a rewritten core and
UniFFI-powered bindings.
Glean has some API changes, so we swap it over to that. Mostly mechanical changes.
Also upgrades to inherent v1.0 in fog.
This matches what Glean uses internally and gets rid of one duplicated crate.

Also upgrades to glean-parser==6.0.1

One crate duplication now (change in `python/mozbuild/mozbuild/vendor/vendor_rust.py` required).
Some new crates now vendored.
These are transitive dependencies of Glean dependencies, all with valid
licenses and already used in other products (mobile).

Differential Revision: https://phabricator.services.mozilla.com/D146062
2022-06-07 12:37:20 +00:00
Mike Hommey 89e0a977d1 Bug 1684384 - Update glsl to 6.0. r=gfx-reviewers,lsalzman
Derived from patch by Dimitri Sabadie.

Differential Revision: https://phabricator.services.mozilla.com/D100511
2022-06-07 06:17:35 +00:00
Lee Salzman d2ba7ad41e Bug 1758219 - Avoid stepping interpolants when edges are extremely close. r=gfx-reviewers,gw
Division by zero (and also close to zero values) can cause the interpolant step to
become infinite which can feed bogus values into the shader. Since the left and
right edges in this case are essentially at the same position, we can freely just
choose interpolants from either the left or right edge. Just set the step scale
to zero in this case so we default to the interpolant values from the left edge
and don't step them at all in this case.

Differential Revision: https://phabricator.services.mozilla.com/D148232
2022-06-03 05:29:15 +00:00
Lee Salzman 91acfa8f3f Bug 1771932 - Use more initializer lists in glsl.h. r=gfx-reviewers,gw
Avoid assigning to fields in the constructor body when it is constexpr.

Differential Revision: https://phabricator.services.mozilla.com/D148093
2022-06-02 03:19:07 +00:00
Glenn Watson 9abf4c300d Bug 1772049 - Use a surface for stacking contexts with backface-visible: false r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D147828
2022-06-01 21:52:08 +00:00
Brad Werth 199e48dfac Bug 1731136 Part 4: Limit backdrops to the visible area. r=gw
This calculates the visible area of the TileCache, and compares against that area
for four purposes:

1) Backdrops must cover only the visible area, not the tile coverage area.
2) Primitives only obstruct the backdrop if they appear in the visible area.
3) Backdrop candidates opaque rects are clipped to the visible area.
4) Subpixel AA is allowed as long as the backdrop rect covers the visible
tiling area, not necessarily the entire tiling area.

All these changes ensure that if a tile coverage area is larger than the window,
backdrops are only considered and created for the visible area.

Note that this has no effect on the contents of tiles that intersect the
backdrop area, wholly or partly. Those tiles, per earlier parts of this
patch, are only set with is_visible=false, which means that they are not
sent to the compositor this frame. The tile surfaces still exist, etc.
This is all in alignment with the idea that we want the entire slice area
(covered by the tiles) to be ready to be scrolled in.

Differential Revision: https://phabricator.services.mozilla.com/D147566
2022-06-01 19:40:03 +00:00
Glenn Watson a48bfe124b Bug 1731136 Part 3: Make the tile_cache track compositor backdrop surfaces. r=gw
In addition to creating the backdrop surface when it is detected, this also
turns off the rendering of tiles in that same slice. Virtual tiles
associated with compositor surfaces (external or not) will still be
rendered.

This adds a clip check to avoid pushing tiles that are fully clipped out. It
also adds a similar check for compositor surfaces.

Depends on D127175

Differential Revision: https://phabricator.services.mozilla.com/D128131
2022-06-01 19:40:03 +00:00
Brad Werth c979bb1fd6 Bug 1731136 Part 2: Allow native compositors to handle surface backdrops. r=gw
This only allows native compositors to claim this capability, without changing
any compositors to do so. In Part 4, the macOS native compositor claims this
capability in conjunction with adding the code that handles the color layers.

Differential Revision: https://phabricator.services.mozilla.com/D127175
2022-06-01 19:40:02 +00:00
Brad Werth 6c7a45e39b Bug 1731136 Part 1: Extend compositor to manage backdrop surfaces. r=gw
This is all scaffolding that will be used by later parts of this patch
series.

Differential Revision: https://phabricator.services.mozilla.com/D128130
2022-06-01 19:40:02 +00:00
Molnar Sandor 307fd4a744 Backed out 5 changesets (bug 1731136) for causing reftest failures in layout/reftests/bugs/299136-1.html CLOSED TREE
Backed out changeset d2a56d51c65b (bug 1731136)
Backed out changeset a24467137e9b (bug 1731136)
Backed out changeset e127e41e12da (bug 1731136)
Backed out changeset 7dfdcb74d1c1 (bug 1731136)
Backed out changeset 6b5626a7b82d (bug 1731136)
2022-06-01 04:12:55 +03:00
Glenn Watson 64e35e6e1a Bug 1771561 - Fix incorrectly invalidating tiles with zero-sized backdrop filters r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D147710
2022-05-31 22:55:32 +00:00
Glenn Watson fffb5f1ec1 Bug 1771556 - Handle backdrop capture failing clip check when sub-graph is visible r=gfx-reviewers,lsalzman
This can happen when there is a long nested chain of backdrop-filters
and float inaccuracies cause the final capture primitive to be culled.

Differential Revision: https://phabricator.services.mozilla.com/D147704
2022-05-31 22:55:32 +00:00
Brad Werth 3e0472c2f5 Bug 1731136 Part 4: Limit backdrops to the visible area. r=gw
This calculates the visible area of the TileCache, and compares against that area
for three purposes:

1) Backdrops must cover only the visible area, not the tile coverage area.
2) Primitives only obstruct the backdrop if they appear in the visible area.
3) Backdrop candidates opaque rects are clipped to the visible area.

All these changes ensure that if a tile coverage area is larger than the window,
backdrops are only considered and created for the visible area.

Note that this has no effect on the contents of tiles that intersect the
backdrop area, wholly or partly. Those tiles, per earlier parts of this
patch, are only set with is_visible=false, which means that they are not
sent to the compositor this frame. The tile surfaces still exist, etc.
This is all in alignment with the idea that we want the entire slice area
(covered by the tiles) to be ready to be scrolled in.

Differential Revision: https://phabricator.services.mozilla.com/D147566
2022-05-31 22:21:15 +00:00
Glenn Watson ac39164f78 Bug 1731136 Part 3: Make the tile_cache track compositor backdrop surfaces. r=gw
In addition to creating the backdrop surface when it is detected, this also
turns off the rendering of tiles in that same slice. Virtual tiles
associated with compositor surfaces (external or not) will still be
rendered.

This adds a clip check to avoid pushing tiles that are fully clipped out. It
also adds a similar check for compositor surfaces.

Depends on D127175

Differential Revision: https://phabricator.services.mozilla.com/D128131
2022-05-31 22:21:15 +00:00
Brad Werth 4b0f3f3d0f Bug 1731136 Part 2: Allow native compositors to handle surface backdrops. r=gw
This only allows native compositors to claim this capability, without changing
any compositors to do so. In Part 4, the macOS native compositor claims this
capability in conjunction with adding the code that handles the color layers.

Differential Revision: https://phabricator.services.mozilla.com/D127175
2022-05-31 22:21:14 +00:00
Brad Werth 5455eef7f6 Bug 1731136 Part 1: Extend compositor to manage backdrop surfaces. r=gw
This is all scaffolding that will be used by later parts of this patch
series.

Differential Revision: https://phabricator.services.mozilla.com/D128130
2022-05-31 22:21:14 +00:00
Bas Schouten c1f8082a55 Bug 1770974: Collect telemetry on blob rasterization times. r=nical
Depends on D147224

Differential Revision: https://phabricator.services.mozilla.com/D147226
2022-05-30 14:49:18 +00:00
Glenn Watson 76e7c0ef08 Bug 1771547 - Fix task graph dependencies with nested / sibling backdrop-filters r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D147614
2022-05-30 06:17:30 +00:00
Glenn Watson 5f9af8e2cc Bug 1771573 - Fix popping incorrect number of clip roots r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D147601
2022-05-29 23:52:29 +00:00
criss 59b9e1210a Backed out 4 changesets (bug 1731136) for causing Bug 1771465 . CLOSED TREE
Backed out changeset c333a19d8712 (bug 1731136)
Backed out changeset 6b5b4b5eb1e9 (bug 1731136)
Backed out changeset 7afa3f4b5a85 (bug 1731136)
Backed out changeset b408a3230170 (bug 1731136)
2022-05-27 17:39:43 +03:00
Glenn Watson 9c01ef38cd Bug 1771388 - Ensure backdrop capture has same clip as backdrop render r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D147482
2022-05-27 05:38:29 +00:00
Glenn Watson af07735825 Bug 1771293 - Handle backdrop-filter chains that are culled due to being invisible r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D147460
2022-05-26 23:43:27 +00:00