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

43490 Коммитов

Автор SHA1 Сообщение Дата
Kelsey Gilbert 24fcc06910 Bug 1771374 - Disable color management based on pref in DCLayerTree. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D150276
2022-06-29 23:38:23 +00:00
Kelsey Gilbert c4f86e2e33 Bug 1771374 - Support display-p3 output via DirectComposition on Windows. r=sotaro,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D150275
2022-06-29 23:38:22 +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
criss efb5f18b59 Backed out 3 changesets (bug 1771374) for causing build bustages on GLBlitHelper.cpp. CLOSED TREE
Backed out changeset 71d40a0a3c9c (bug 1771374)
Backed out changeset 6a42df6834fe (bug 1771374)
Backed out changeset be888d0fd0bf (bug 1771374)
2022-06-30 01:12:46 +03:00
Kelsey Gilbert 7cf061700c Bug 1771374 - Fix lint warnings. r=gfx-reviewers,aosmond
Differential Revision: https://phabricator.services.mozilla.com/D150620
2022-06-29 21:48:53 +00:00
Kelsey Gilbert 4fc89754ca Bug 1771374 - Disable color management based on pref in DCLayerTree. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D150276
2022-06-29 21:48:52 +00:00
Kelsey Gilbert bad5d9146c Bug 1771374 - Support display-p3 output via DirectComposition on Windows. r=sotaro,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D150275
2022-06-29 21:48:52 +00:00
Botond Ballo 8db826da52 Bug 1771836 - Split helper_bug1756529 out into its own test group. r=hiro
Differential Revision: https://phabricator.services.mozilla.com/D150616
2022-06-29 21:20:51 +00:00
Botond Ballo 1674044117 Bug 1777277 - Guard against infinite recursion in RemoteContentController::NotifyScaleGestureComplete(). r=mccr8
However, also add a MOZ_ASSERT because GetGeckoContentControllerForRoot()
returning a RemoteContentController here is unexpected and should be
investigated further.

Differential Revision: https://phabricator.services.mozilla.com/D150638
2022-06-29 20:53:59 +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
Botond Ballo eb70096a5f Bug 1777151 - Call assertion functions like ok() without qualifying them as SimpleTest.ok() in APZ subtests. r=dlrobertson
The unqualified versions are the ones hooked to print the subtest name.

Depends on D150609

Differential Revision: https://phabricator.services.mozilla.com/D150610
2022-06-29 17:40:17 +00:00
Botond Ballo 461cd53745 Bug 1777151 - Move helper_bug982141 into test_group_scrollframe_activation. r=dlrobertson
helper_bug982141 was the first APZ test to be run in its own window, a technique
which we've since formalized in runSubtestsSeriallyInFreshWindows().

Rather than having a dedicated test_bug982141 to open its window,
move the subtest into test_group_scrollframe_activation.

Differential Revision: https://phabricator.services.mozilla.com/D150609
2022-06-29 17:40:17 +00:00
stransky bea11a62d5 Bug 1773282 [Linux] Remove nsIGfxInfo::FEATURE_VAAPI and use nsIGfxInfo::FEATURE_HARDWARE_VIDEO_DECODING r=alwu
nsIGfxInfo::FEATURE_HARDWARE_VIDEO_DECODING is used on all platforms so let's use it on Linux too and don't add new feature for Linux only.

Differential Revision: https://phabricator.services.mozilla.com/D149765
2022-06-29 12:09:02 +00:00
stransky 59dfb5f41a Bug 1773282 [Linux] Don't print VP8_HW_DECODE/VP9_HW_DECODE on about:support on Linux as it's not used there r=alwu
Differential Revision: https://phabricator.services.mozilla.com/D149763
2022-06-29 12:09:02 +00:00
sotaro a807c798e9 Bug 1712486 - Add async front buffer posting for out-of-process WebGL r=jgilbert,lsalzman,gfx-reviewers
The async front buffer posting is going to be enabled by another bug.

Async IPC was added for async front buffer posting for out-of-process WebGL.
Client does not use TextureClient for storing SurfaceDescriptor.
It works basically same way as to in-process WebGL around nsDisplayCanvas, WebRenderCanvasData, WebRenderCommandBuilder and WebRenderBridgeParent.
SharedSurfaces of SurfaceDescriptorD3D10 are kept alive during their usage. It is for keeping a shread handle valid.
Copied data buffers of SharedShurface_Basics are kept alive during their usage. It is for keeping RenderBufferTextureHost valid.

Differential Revision: https://phabricator.services.mozilla.com/D150197
2022-06-29 09:32:29 +00:00
Norisz Fay f70f5a4b0f Backed out changeset af98fb4ff148 (bug 1712486) for causing build bustages on LayersSurfaces CLOSED TREE 2022-06-29 09:06:45 +03:00
sotaro 8a8d04cce2 Bug 1712486 - Add async front buffer posting for out-of-process WebGL r=jgilbert,lsalzman,gfx-reviewers
The async front buffer posting is going to be enabled by another bug.

Async IPC was added for async front buffer posting for out-of-process WebGL.
Client does not use TextureClient for storing SurfaceDescriptor.
It works basically same way as to in-process WebGL around nsDisplayCanvas, WebRenderCanvasData, WebRenderCommandBuilder and WebRenderBridgeParent.
SharedSurfaces of SurfaceDescriptorD3D10 are kept alive during their usage. It is for keeping a shread handle valid.
Copied data buffers of SharedShurface_Basics are kept alive during their usage. It is for keeping RenderBufferTextureHost valid.

Differential Revision: https://phabricator.services.mozilla.com/D150197
2022-06-29 05:05:47 +00:00
Glenn Watson f92ac501b1 Bug 1776075 - Remove use of clip-id parenting in gecko r=gfx-reviewers,jrmuizel
Removes the last usage of the old-style clip-id parenting in
gecko. These paths passed the clip parent, but shouldn't be
necessary (all tests pass without them). Landing as a small
patch that's easy to bisect and back out if it does cause any
regression.

Differential Revision: https://phabricator.services.mozilla.com/D150050
2022-06-29 00:21:45 +00:00
sotaro b15ea105d5 Bug 1776800 - Let zero copy hardware decoded video to release on intel GPU on Windows r=jrmuizel,gfx-reviewers
Reuse decoder device also to release on intel GPU on Windows, since it is also necessary for zero copy hardware decoded video.
Reuse decoder device handling is also updated as aligned to FEATURE_HW_DECODED_VIDEO_ZERO_COPY.

Differential Revision: https://phabricator.services.mozilla.com/D150448
2022-06-28 21:54:36 +00:00
Andrew Osmond c9e5ad2c49 Bug 1771493 - Part 2. Merge FontFaceSetImpl and gfxUserFontSet into a single class. r=emilio
This patch merges FontFaceSetImpl and gfxUserFontSet into the same
class. This reduces the level of indirection and in theory makes it
easier to manage future threading issues.

Differential Revision: https://phabricator.services.mozilla.com/D147817
2022-06-28 21:47:00 +00:00
Jim Blandy 484ca146df Bug 1776816: Update wgpu to b370b990 (2022-6-28). r=jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D150447
2022-06-28 20:53:15 +00:00
Brad Werth cdfeb597d3 Bug 1774939: Rebuild video layer if it fails to enqueue a surface. r=mstange
For unknown reasons, AVSampleBufferDisplayLayer may sometimes stop
enqueueing new buffers. In this case it will return false for the
readyForMoreMediaData property. When this happens, there's no guarantee
that the layer will ever accept new buffers again. We can work around
this by rebuilding the video layer when it locks up, which ensures that
the video sample is displayed in the next update, seemingly without
visual jitter.

This is not useful if the video enqueueing is failing due to memory
pressure, but more serious failure points would likely be occurring at the
same time.

This patch also adds to the logging we will see when the pref
`gfx.core-animation.specialize-video.log` is set.

Differential Revision: https://phabricator.services.mozilla.com/D149920
2022-06-28 20:05:10 +00:00
Marian-Vasile Laza dfecbedace Backed out 5 changesets (bug 1771493) for causing bustages on FontFaceSetDocumentImpl.obj. CLOSED TREE
Backed out changeset 07513973391f (bug 1771493)
Backed out changeset 22f567c00af3 (bug 1771493)
Backed out changeset 609a5d93bf08 (bug 1771493)
Backed out changeset 1f5b0b087930 (bug 1771493)
Backed out changeset aa5527055ad1 (bug 1771493)
2022-06-28 22:21:00 +03:00
Michael Froman 318bb2d6ff Bug 1698699 - P7 - add missing include for hybrid builds. r=ng
Depends on D150312

Differential Revision: https://phabricator.services.mozilla.com/D150480
2022-06-28 16:29:41 +00:00
Nico Grunbaum fbc400fd93 Bug 1698699 - P0 - remove use of deprecated libyuv int types;r=mjf
Differential Revision: https://phabricator.services.mozilla.com/D150300
2022-06-28 16:29:37 +00:00
Andrew Osmond 4dfc867556 Bug 1771493 - Part 2. Merge FontFaceSetImpl and gfxUserFontSet into a single class. r=emilio
This patch merges FontFaceSetImpl and gfxUserFontSet into the same
class. This reduces the level of indirection and in theory makes it
easier to manage future threading issues.

Differential Revision: https://phabricator.services.mozilla.com/D147817
2022-06-28 15:58:10 +00:00
Bogdan Szekely c94fbd38ae Backed out 4 changesets (bug 1771493) for causing build bustages on FontFaceSet.cpp CLOSED TREE
Backed out changeset 3f2605087550 (bug 1771493)
Backed out changeset 5e6bf07c9c27 (bug 1771493)
Backed out changeset fbfb5b7dfb30 (bug 1771493)
Backed out changeset 93b7e171c74a (bug 1771493)
2022-06-28 17:57:11 +03:00
Andrew Osmond effce641e2 Bug 1771493 - Part 2. Merge FontFaceSetImpl and gfxUserFontSet into a single class. r=emilio
This patch merges FontFaceSetImpl and gfxUserFontSet into the same
class. This reduces the level of indirection and in theory makes it
easier to manage future threading issues.

Differential Revision: https://phabricator.services.mozilla.com/D147817
2022-06-28 14:27:21 +00:00
Bogdan Szekely 399c93b211 Backed out 4 changesets (bug 1773282) for causing xpcshell failures on test_gfxBlacklist_Version.js CLOSED TREE
Backed out changeset c9134683c1db (bug 1773282)
Backed out changeset a2d33cd0de61 (bug 1773282)
Backed out changeset 3024ad3df3db (bug 1773282)
Backed out changeset a1a1a1c7d622 (bug 1773282)
2022-06-28 16:06:39 +03:00
stransky a961fafee3 Bug 1773282 [Linux] Remove nsIGfxInfo::FEATURE_VAAPI and use nsIGfxInfo::FEATURE_HARDWARE_VIDEO_DECODING r=alwu
nsIGfxInfo::FEATURE_HARDWARE_VIDEO_DECODING is used on all platforms so let's use it on Linux too and don't add new feature for Linux only.

Differential Revision: https://phabricator.services.mozilla.com/D149765
2022-06-28 12:10:37 +00:00
stransky 56f1fe9fc0 Bug 1773282 [Linux] Don't print VP8_HW_DECODE/VP9_HW_DECODE on about:support on Linux as it's not used there r=alwu
Differential Revision: https://phabricator.services.mozilla.com/D149763
2022-06-28 12:10:36 +00:00
Michelle Goossens 7f247c8d44 Bug 1773830 - Migrate Linux mochitest-browser-chrome from AWS to GCP r=ahal,jmaher
Differential Revision: https://phabricator.services.mozilla.com/D150325
2022-06-28 11:11:42 +00:00
Botond Ballo 47d750a35a Bug 1776805 - Avoid including SimpleTest.js directly from APZ test helpers. r=dlrobertson
Note, this is only applicable to helpers used directly as subtests
in runSubtestsSeriallyInFreshWindows(). It does not apply to:

 * Fission test helpers (helper_fission_*.html), which use a separate
   subtest mechanism

 * Helpers for browser mochitests

 * Helpers which are files loaded in an iframe by another helper

Differential Revision: https://phabricator.services.mozilla.com/D150439
2022-06-28 04:43:26 +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
Iulian Moraru de7e722be8 Backed out 7 changesets (bug 1698699) for causing bp-hybrid bustages on scale_yuv_argb. CLOSED TREE
Backed out changeset b2606be8a0cf (bug 1698699)
Backed out changeset 97f5dde2d55e (bug 1698699)
Backed out changeset edf2a2cb7803 (bug 1698699)
Backed out changeset 0cc8a5a2d484 (bug 1698699)
Backed out changeset 95c49f3cfc03 (bug 1698699)
Backed out changeset 7016afe1f7f4 (bug 1698699)
Backed out changeset f0da7c35e088 (bug 1698699)
2022-06-28 01:47:56 +03:00
Kelsey Gilbert fe09859644 Bug 1776468 - With pref for d3d11 debug layer, also ask for debug IDXGIFactory. r=gfx-reviewers,bradwerth
Differential Revision: https://phabricator.services.mozilla.com/D150273
2022-06-27 21:40:53 +00:00
Nico Grunbaum 595ce349cf Bug 1698699 - P0 - remove use of deprecated libyuv int types;r=mjf
Differential Revision: https://phabricator.services.mozilla.com/D150300
2022-06-27 20:40:01 +00:00
Jonathan Kew 782d6c08e7 Bug 1772225 - Implement a CGLayer-backed version of cairo_quartz_surface, to improve print/PDF output quality for pdf.js documents. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D150128
2022-06-27 17:14:21 +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
Jonathan Kew 4d877eb687 Bug 1774631 - Fix typo in cairo-pdf-surface.c that causes us to get spuriously-rasterized PDF output. r=jrmuizel
There's a typo in the condition here, which results in returning CAIRO_INT_STATUS_UNSUPPORTED
in cases where that shouldn't be necessary. Fixing this gets me nice vector PDF output.

The bug is still present in upstream cairo trunk, so I'll report it there as well.

Differential Revision: https://phabricator.services.mozilla.com/D150381
2022-06-27 15:11:27 +00:00
Jamie Nicol 9b2022e57f Bug 1775480 - Log number of total and active renderers when EGL surface creation fails. r=gfx-reviewers,aosmond
The previous patch in this bug added crash annotations for the number
of total and currently active renderers. However, we are actually
interested in these values when the EGL surface creation fails, as
opposed to when we crash later on after failing to recover. This patch
adds the values to gfxCriticalNote at the time of the error.

Differential Revision: https://phabricator.services.mozilla.com/D150365
2022-06-27 14:13:26 +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
Martin Stransky 3a7a803654 Bug 1774271 [Linux] Use DMABUF_SURFACE_EXPORT feature to control dmabuf surface export from EGLImage and disable that on Mesa/Intel and Mesa/AMD r=jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D149984
2022-06-27 05:54:52 +00:00
Iulian Moraru de1c46fa2a Backed out 4 changesets (bug 1773282) for causing bp-hybrid bustages on FFmpegLibWrapper. CLOSED TREE
Backed out changeset 0ec631549071 (bug 1773282)
Backed out changeset c370d6fa2f1f (bug 1773282)
Backed out changeset a69d65742893 (bug 1773282)
Backed out changeset 6c9325e96448 (bug 1773282)
2022-06-25 12:07:40 +03:00
stransky 20d789184c Bug 1773282 [Linux] Remove nsIGfxInfo::FEATURE_VAAPI and use nsIGfxInfo::FEATURE_HARDWARE_VIDEO_DECODING r=alwu
nsIGfxInfo::FEATURE_HARDWARE_VIDEO_DECODING is used on all platforms so let's use it on Linux too and don't add new feature for Linux only.

Differential Revision: https://phabricator.services.mozilla.com/D149765
2022-06-25 05:24:47 +00:00
stransky dabbc69fa1 Bug 1773282 [Linux] Don't print VP8_HW_DECODE/VP9_HW_DECODE on about:support on Linux as it's not used there r=alwu
Differential Revision: https://phabricator.services.mozilla.com/D149763
2022-06-25 05:24:46 +00:00
Botond Ballo 4befa03baa Bug 1776530 - Assert that APZUpdater::RunOnUpdaterThread() is not called directly from the updater thread. r=tnikkel
With the exception of the egde case scenarios in which
IsConnectedToWebRender() returns false.

Also add a comment warning that if RunOnUpdaterThread() were to be called
directly from the updater thread when connected to WebRender, the
implementation would be incorrect.

Differential Revision: https://phabricator.services.mozilla.com/D150309
2022-06-25 04:33:51 +00:00
Botond Ballo 0fcaeddf43 Bug 1776530 - Rename APZUpdater::UsingWebRenderUpdaterThread() to IsConnectedToWebRender(). r=tnikkel
The earlier name dates back to a time when we could use WebRender
but not necessarily use a WebRender thread as the updater thread.

Also add a comment to list the remaining situatins in which this
function can return false.

Differential Revision: https://phabricator.services.mozilla.com/D150308
2022-06-25 04:33:51 +00:00
Kelsey Gilbert c6b76d3b9a Bug 1776465 - GLBlitHelper link failure should go down link failure branch. r=gfx-reviewers,lsalzman
Also, no reason not to complete iteration across uTex[012], as opposed
to breaking early once we hit the first one that isn't present.
A shader with e.g. uTex1 but not uTex0 is weird, but there's no reason
for it not to work.

Differential Revision: https://phabricator.services.mozilla.com/D150270
2022-06-24 18:29:58 +00:00
Lee Salzman cceb9a72ed Bug 1776348 - Only report TextureType::DMABUF for WebGL if actually supported. r=stransky
Differential Revision: https://phabricator.services.mozilla.com/D150218
2022-06-24 15:45:26 +00:00
criss 69db7542e5 Backed out changeset c71363131ad4 (bug 1776348) for causing build bustages on CanvasRenderer.cpp. CLOSED TREE 2022-06-24 18:34:25 +03:00
Lee Salzman f9d88396f2 Bug 1776348 - Only report TextureType::DMABUF for WebGL if actually supported. r=stransky
Differential Revision: https://phabricator.services.mozilla.com/D150218
2022-06-24 15:21:05 +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
David Shin aca7c3d4df Bug 1773493 - Use Rust's `ComputedTimingFunction` for IPDL. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D149663
2022-06-23 17:07:13 +00:00
Andrew Osmond f29955e688 Bug 1776215 - Make font related prefs threadsafe. r=gfx-reviewers,jrmuizel
This allows us to access these prefs off the main thread, e.g. for DOM
workers using OffscreenCanvasRenderingContext2D's text methods.

Differential Revision: https://phabricator.services.mozilla.com/D150124
2022-06-23 15:21:25 +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
Jeff Muizelaar c2582e4fc1 Bug 1776112 - Stop temporarily setting the building rect to the paint rect. r=mstange
This doesn't seem to serve any purpose anymore. MOZ_RELEASE_ASSERTing
if mBuildingRect is read during ::Paint doesn't show it happening
anywhere.

Differential Revision: https://phabricator.services.mozilla.com/D150066
2022-06-23 15:04:27 +00:00
Emilio Cobos Álvarez cbb5b58f4d Bug 1772555 - Use style interpolation code for gradients. r=nical
This ensures they're clamped on Animated -> sRGB conversion, and in the
future we'll have to implement different color spaces so we'll need to
use it anyways.

Differential Revision: https://phabricator.services.mozilla.com/D149792
2022-06-22 23:02:34 +00:00
Boris Chiou 6c723e6e0a Bug 1744850 - Drop ScrollTimeline:sTiming and introduce a normalized timing. r=birtles
`sTiming` is a hack and I believe animation-delay,
animation-iteration-count, animation-direction, and animation-fill-mode
should be meaningful for scroll-linked animations. (I will add the
tentative wpt in Bug 1775327.)

So we need to introduce a normalized timing when resolving the specified
timing.

Also, this patch makes the bug of printing scroll animations detectable.

No behavior is changed and I'd like to remove the magic values and do
normalization in Bug 1775327.

Note: Based on https://github.com/w3c/csswg-drafts/issues/4862 and
web-animations-2, we will introudce CSSNumberish for duration, current
time, and delay. That is, we will accept percentage for
animation-duration, animation-delay. However, Gecko doesn't support
CSSNumberish for those values, so we'd like to normalize these time values
in Bug 1775327. This patch is the 1st step: split the normalized
timing from the specified timing, and use it when resolving the
timing, for progress-based timeline.

Differential Revision: https://phabricator.services.mozilla.com/D149683
2022-06-22 21:19:30 +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
Mike Conley af9dec9a76 Bug 1773865 - Dispatch an event on the window document when a pinch zoom gesture ends. r=botond,smaug,NeilDeakin
Differential Revision: https://phabricator.services.mozilla.com/D149283
2022-06-22 19:40:17 +00:00
Iulian Moraru 0ebda972c1 Backed out changeset 003cad9bbcc6 (bug 1772555) for causing reftest failures on bugs/1315113-1.html. 2022-06-22 22:00:53 +03:00
Norisz Fay 10b3954a76 Backed out changeset 4230bdcf07ae (bug 1773865) for causing bc failures browser_zoom_commands.js CLOSED TREE 2022-06-22 20:13:23 +03:00
Emilio Cobos Álvarez 827fe3a33e Bug 1772555 - Use style interpolation code for gradients. r=nical
This ensures they're clamped on Animated -> sRGB conversion, and in the
future we'll have to implement different color spaces so we'll need to
use it anyways.

Differential Revision: https://phabricator.services.mozilla.com/D149792
2022-06-22 17:00:56 +00:00
Mike Conley acc5c41175 Bug 1773865 - Dispatch an event on the window document when a pinch zoom gesture ends. r=botond,smaug,NeilDeakin
Differential Revision: https://phabricator.services.mozilla.com/D149283
2022-06-22 16:15:57 +00:00
Jamie Nicol 00cdec76f5 Bug 1775480 - Add more crash annotations for bug 1772839. r=gfx-reviewers,aosmond
Add crash annotations for the total number of webrender renderers, as
well as the number that are currently not paused, as this error could
be caused by having multiple renderers in a resumed state
concurrently. Additionally, add some gfxCriticalNotes for potentially
relevant error cases.

Differential Revision: https://phabricator.services.mozilla.com/D150000
2022-06-22 15:31:56 +00:00
serge-sans-paille 5b0ab0f5a6 Bug 1775340 - Cleanup gfx/ includes r=sylvestre
This one is a bit messy so I was very conservative on the changes.

Differential Revision: https://phabricator.services.mozilla.com/D149922
2022-06-22 09:50:52 +00:00
Chris Peterson c1c9a048ec Bug 1775162 - Fix C++20 build error in BSPPolygon template class definition. r=gfx-reviewers,jrmuizel
gcc -std=c++20 (but not clang -std=c++20) complains about template class definitions that specify the template parameter on the class constructor.

In file included from /builds/worker/workspace/obj-build/dist/include/nsDisplayList.h:43,
from /builds/worker/workspace/obj-build/dist/include/mozilla/layout/RemoteLayerTreeOwner.h:17,
from /builds/worker/workspace/obj-build/dist/include/mozilla/dom/BrowserParent.h:23,
from /builds/worker/checkouts/gecko/accessible/ipc/other/RemoteAccessible.cpp:13:
/builds/worker/workspace/obj-build/dist/include/mozilla/layers/BSPTree.h:30:18: error: expected ')' before '*' token
|   BSPPolygon<T>(T* aData, gfx::Polygon&& aGeometry)
|                ~ ^

Differential Revision: https://phabricator.services.mozilla.com/D149813
2022-06-22 04:06:47 +00:00
Emilio Cobos Álvarez 7829e5aab5 Bug 1774378 - Make select code harder to mess up. r=Gijs
Right now we rely on the menulist to be injected by hand in all the
relevant windows. Instead create it lazily, making the select code more
standalone.

The DevTools window was missing it, for example.

Differential Revision: https://phabricator.services.mozilla.com/D149620
2022-06-21 21:42:58 +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
Glenn Watson d784bfaee9 Bug 1775188 - Remove direct use of ClipId on stacking contexts r=gfx-reviewers,lsalzman
In future, stacking contexts, hit-tests and prims will all use
clip-chains rather than the old-style ClipId references.

Differential Revision: https://phabricator.services.mozilla.com/D149844
2022-06-21 20:23:59 +00:00
criss 89867d6a26 Backed out changeset da8c34fec36e (bug 1773865) for causing mochitest failures on browser_zoom_commands.js. CLOSED TREE 2022-06-21 22:03:04 +03:00
Mike Conley 8ebd805e62 Bug 1773865 - Dispatch an event on the window document when a pinch zoom gesture ends. r=botond,smaug,NeilDeakin
Differential Revision: https://phabricator.services.mozilla.com/D149283
2022-06-21 14:02:19 +00:00
Robert Mader 324edb90ae Bug 1758473 - Move VA-API test into glxtest, r=stransky
Some VA-API drivers are so broken that trying to use them
crashes Firefox. This is nothing entirely new for GPU drivers
and which is why we have `glxtest`.

Thus move the test from `VAAPIUtils` there. This has the
additional benefit of only doing the test once.

Given the importance of GL-accelerated rendering these days,
we don't want failing VA-API drivers to disable hardware
Webrender and WebGL. Thus fork the VA-API test into its
own process.

Differential Revision: https://phabricator.services.mozilla.com/D148981
2022-06-21 08:45:27 +00:00
Botond Ballo f76d3a476c Bug 1772646 - Make GetStartupTime() non-static. r=hiro
If it's static, every translation unit gets its own copy of
the static local variable sStartupTime.

Since it's defined in a header, we make it inline instead.

Differential Revision: https://phabricator.services.mozilla.com/D149811
2022-06-20 21:30:38 +00:00
Jonathan Kew c3f962f2b2 Bug 1775125 - Avoid duplicate call to hypotf() in FlattenedPath::ComputePointAtLength. r=gfx-reviewers,jrmuizel,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D149788
2022-06-20 17:32:45 +00:00
stransky 1cdfeeec54 Bug 1774075 [Linux] Don't use EGL_MESA_image_dma_buf_export on mesa/radeonsi driver r=jgilbert
Don't use EGL_MESA_image_dma_buf_export on Mesa/radeonsi driver due to multi-thread crash there (https://gitlab.freedesktop.org/mesa/mesa/-/issues/6666)

Differential Revision: https://phabricator.services.mozilla.com/D149238
2022-06-20 10:14:41 +00:00
Botond Ballo 5d687c962b Bug 1771503 - Disable the 'two layers that scroll together' assertion for matrices with Inf or NaN elements. r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D149466
2022-06-17 23:50:49 +00:00
Chris Peterson 33e4a145c6 Bug 1774522 - Make Skia C++20 compatible by replacing deprecated std::result_of_t. r=lsalzman
The C++ std library functions `std::result_of` and `std::result_of_t` were deprecated in C++17 and removed in C++20.

Upstream Skia removed use of `std::result_of_t` in 2021, so we can just copy upstream's new replacement code:

https://skia.googlesource.com/skia/+/7d8cdd5b7f277f3b661e1eea067cf45a467572c6%5E%21/
https://skia.googlesource.com/skia/+/dc976a96ea388ae49fd0ce18d5a07d8fc15779cf%5E%21/

Because we're just extracting code from upstream, our local changes here can be safely overwritten whenever we next vendor a new Skia version.

Differential Revision: https://phabricator.services.mozilla.com/D149490
2022-06-17 02:13:46 +00:00
Lee Salzman 4963ce29fb Bug 1773936 - Apply Skia-equivalent subpixel rounding in DrawTargetWebgl. r=aosmond,gfx-reviewers
Depending on the current transform, Skia applies either subpixel rounding or integer
rounding to different coordinate axes of the transformed glyph position. If we don't
correctly predict which of these are applied, we may have aliased cache entries that
round to the same value in DrawTargetWebgl but for which Skia under the hood rounds
in entirely different directions. When this happens, glyphs can get hinted to the
wrong direction. To fix this, we need to ensure that we appropriately apply either
subpixel rounding or integer rounding in the same manner as Skia.

Differential Revision: https://phabricator.services.mozilla.com/D149350
2022-06-16 21:39:07 +00:00
Jonathan Kew d58446c275 Bug 1772189 - Avoid potential infinite recursion when initializing vertical metrics, if the font has a broken 'vmtx' table. r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D148928
2022-06-16 12:38:35 +00:00
Lee Salzman 5cf73489a8 Bug 1769082 - Avoid divide-by-zero in Skia's luminosity blend mode. r=jrmuizel,gfx-reviewers
This applies a fix that is present in Skia's HW luminosity blend mode to its
CPU pipeline so that the luminosity mode no longer divides by zero, thus avoiding
infs and nans.

Differential Revision: https://phabricator.services.mozilla.com/D149030
2022-06-16 03:39:41 +00:00
Butkovits Atila 297c111411 Backed out changeset f292760857f2 (bug 1769082) for causing build bustages at SkRasterPipeline_opts. CLOSED TREE 2022-06-16 06:18:27 +03:00
Lee Salzman 09080ca408 Bug 1769082 - Avoid divide-by-zero in Skia's luminosity blend mode. r=jrmuizel,gfx-reviewers
This applies a fix that is present in Skia's HW luminosity blend mode to its
CPU pipeline so that the luminosity mode no longer divides by zero, thus avoiding
infs and nans.

Differential Revision: https://phabricator.services.mozilla.com/D149030
2022-06-16 02:31: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
Emilio Cobos Álvarez 37f45fa980 Bug 1773924 - Simplify nsDeviceContext code dealing with DPI changes. r=jfkthame
This in-out parameter business used to be necessary (bug 1249279), but
we don't propagate the new widget scale to remote documents (which are
the common case now) and we seem to be doing just fine without that, so
I'm not sure why this would be needed anymore.

Also simplify some unit conversions while at it.

Differential Revision: https://phabricator.services.mozilla.com/D149032
2022-06-15 09:57:38 +00:00
Jonathan Kew 0f30176a40 Bug 1774192 - Build harfbuzz with MT support. r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D149241
2022-06-15 08:13:01 +00:00
Botond Ballo 2c303ddd7c Bug 1773256 - Use ProjectPoint when transforming coordinates from parent to child in BrowserParent. r=tnikkel
This patch also backs out the incorrect fix for bug 1745834
(see comment 12 on the bug for an explanation).

Differential Revision: https://phabricator.services.mozilla.com/D149321
2022-06-15 05:29:52 +00:00
Razvan Cojocaru 92f59ee7ac Bug 1773382 - Change the return type of GetPaintedLayerScaleForFrame() to MatrixScales. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D148764
2022-06-14 21:54:55 +00:00
Emilio Cobos Álvarez ee23efc9b5 Bug 1773813 - Incorporate OS zoom factor in window sizing calculations. r=tnikkel
In bug 1773342 I made OS text scale factor behave like a full zoom
factor which applies to all pages (including the browser chrome). That's
generally straight forward but it makes some callsites that use unzoomed
CSS coordinates misbehave (or behave correctly accidentally actually in
some other cases).

The main fix here is making
nsIBaseWindow::UnscaledDevicePixelsPerCSSPixel() and
nsIScreen::GetDefaultCSSScaleFactor() account for OS zoom as necessary.
However, I also went through the relevant code and cleaned it up to use
typed units and operations when possible.

The setup means:

 * nsIWidget::GetDefaultScale() doesn't account for OS full zoom.
 * nsIBaseWindow and nsIScreen does.

These are the places where this should matter and stuff can get
confused, but this works surprisingly well for all callers (except one
nsDeviceContext one which we use only for PuppetWidget and we can
remove by falling back to 1.0 like all other widgets until the update
comes).

Differential Revision: https://phabricator.services.mozilla.com/D149033
2022-06-14 15:01:52 +00:00
Norisz Fay 60ea7706bd Backed out changeset da5c71190673 (bug 1773813) for causing build bustages CLOSED TREE 2022-06-14 15:13:58 +03:00
Emilio Cobos Álvarez c64d0fcaa6 Bug 1773813 - Incorporate OS zoom factor in window sizing calculations. r=tnikkel
In bug 1773342 I made OS text scale factor behave like a full zoom
factor which applies to all pages (including the browser chrome). That's
generally straight forward but it makes some callsites that use unzoomed
CSS coordinates misbehave (or behave correctly accidentally actually in
some other cases).

The main fix here is making
nsIBaseWindow::UnscaledDevicePixelsPerCSSPixel() and
nsIScreen::GetDefaultCSSScaleFactor() account for OS zoom as necessary.
However, I also went through the relevant code and cleaned it up to use
typed units and operations when possible.

The setup means:

 * nsIWidget::GetDefaultScale() doesn't account for OS full zoom.
 * nsIBaseWindow and nsIScreen does.

These are the places where this should matter and stuff can get
confused, but this works surprisingly well for all callers (except one
nsDeviceContext one which we use only for PuppetWidget and we can
remove by falling back to 1.0 like all other widgets until the update
comes).

Differential Revision: https://phabricator.services.mozilla.com/D149033
2022-06-14 11:37:25 +00:00
Robert Mader d8d4d7a87a Bug 1773377 - Try EGL device platform for headless contexts, r=stransky,jgilbert
On multi-GPU setups, EGLs "surfaceless" platform may pick the wrong device.
There is a very recent extension which solves this issue,
`EGL_EXT_explicit_device`, however it states:
> Using EGL_EXT_explicit_device with EGL_MESA_platform_surfaceless is
> functionally identical to EGL_EXT_platform_device.

Thus, if we previously detected a render node device, use
`EGL_EXT_platform_device` to create the display in headless scenarios.

For all other cases, notably ARM SOCs where
`EGL_DRM_RENDER_NODE_FILE_EXT` is not yet availble, continue to
fall back to the surfaceless platform.

Note: this patch also does some cleanups. Most importantly,
`EGL_MESA_platform_surfaceless` is a client extension, not a
display extension. The check for it must thus always have failed.
Instead, check for it before trying to use it when creating the
display.
Also remove the rendundant redifinition in `GLDefs.h` - it's
already included in the upstream EGL headers.

Differential Revision: https://phabricator.services.mozilla.com/D148946
2022-06-13 23:15:37 +00:00
Dan Robertson 0880c42a83 Bug 1773381 - Axis lock should not be considered in CanScroll(). r=botond
The axis lock should not be considered when determining if an axis can
scroll in a given direction.

Differential Revision: https://phabricator.services.mozilla.com/D148970
2022-06-13 20:51:43 +00:00
Jamie Nicol 78a8e7cc0b Bug 1774026 - Make EGL Surface non-current before destroying. r=gfx-reviewers,aosmond
This is a purely speculative attempt to fix bug 1772839. The theory
being perhaps that due to the EGL Surface being current,
eglDestroySurface does not detach it from the Android Surface. This
would cause the subsequent eglCreateWindowSurface to fail as the
Android Surface is still attached.

Differential Revision: https://phabricator.services.mozilla.com/D149147
2022-06-13 15:14:30 +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
Nicolas Silva 35a0ac21ff Bug 1772639 - Avoid potentially overflowing cast from float to int64 in FitsInt32. r=gfx-reviewers,jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D148781
2022-06-13 08:37:30 +00:00
Emilio Cobos Álvarez 9fc2aa47fc Bug 1773558 - Move fixed-point font types to Rust. r=layout-reviewers,jfkthame
Now that cbindgen and rust support const generics, it seems more simple.

This centralizes all the relevant font constants etc in rust and avoids
conversions when going from rust to C++ and vice versa.

Differential Revision: https://phabricator.services.mozilla.com/D148847
2022-06-13 00:59:23 +00:00
Emilio Cobos Álvarez 37d1e1d868 Bug 1773811 - Fix APZ autoscroll coordinates. r=tnikkel
In bug 1773342, I made OS text zoom behave like layout full zoom on all
pages (including the main browser page).

This means that getting CSS pixels from the browser page and turning
them to LayoutDevice pixels by multiplying by GetDefaultScale() isn't
right.

However, the caller already has the right device pixel values, so just
use them.

Differential Revision: https://phabricator.services.mozilla.com/D149026
2022-06-13 00:54:33 +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
Noemi Erli 841e350bc4 Backed out changeset 7585591a9bad (bug 1773558) for causing failures in system-fonts.html 2022-06-12 19:02:33 +03:00
Emilio Cobos Álvarez e441089ca0 Bug 1773558 - Move fixed-point font types to Rust. r=layout-reviewers,jfkthame
Now that cbindgen and rust support const generics, it seems more simple.

This centralizes all the relevant font constants etc in rust and avoids
conversions when going from rust to C++ and vice versa.

Differential Revision: https://phabricator.services.mozilla.com/D148847
2022-06-12 10:48:58 +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
Marian-Vasile Laza e7fd6c547f Backed out changeset 8e8c5926cdde (bug 1772189) for causing web-platform reftest failures on ch-unit-002.html. CLOSED TREE 2022-06-11 18:45:48 +03:00
Jonathan Kew b9a6c88490 Bug 1772189 - Avoid potential infinite recursion when initializing vertical metrics, if the font has a broken 'vmtx' table. r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D148928
2022-06-11 14:32:50 +00:00
Stephen A Pohl 0886e3143b Bug 1773752: Remove workarounds for old macOS SDKs and update documentation. r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D148944
2022-06-11 02:21:30 +00:00
David Shin 562eecc50f Bug 1764126 - Part 5: Enable `linear(...)` timing function on C++ side, r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D148791
2022-06-11 00:36:25 +00:00
criss ed1236630c Backed out 2 changesets (bug 1773752, bug 1696513) for causing build bustages. CLOSED TREE
Backed out changeset 6628f146ad0b (bug 1773752)
Backed out changeset f636b7e35d0c (bug 1696513)
2022-06-11 02:35:43 +03:00
Stephen A Pohl 1faf32bda8 Bug 1773752: Remove workarounds for old macOS SDKs and update documentation. r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D148944
2022-06-10 23:08:35 +00:00
criss c6b2c5db61 Backed out 9 changesets (bug 1772006) causing build bustages on nsTString.cpp. CLOSED TREE
Backed out changeset f17c7565707b (bug 1772006)
Backed out changeset c725fe1f5882 (bug 1772006)
Backed out changeset d19663161261 (bug 1772006)
Backed out changeset b6611ab002d9 (bug 1772006)
Backed out changeset 790f42b64af9 (bug 1772006)
Backed out changeset 79a734b4e4d9 (bug 1772006)
Backed out changeset 42730aae16ea (bug 1772006)
Backed out changeset b2542aef3054 (bug 1772006)
Backed out changeset 962bfea4a309 (bug 1772006)
2022-06-11 01:13:42 +03:00
Nika Layzell b3c13bf114 Bug 1772006 - Part 6: Simplify and move the string searching APIs from ns[T]StringObsolete, r=xpcom-reviewers,necko-reviewers,eeejay,dragana,barret
The biggest set of APIs from ns[T]StringObsolete which are still heavily used
are the string searching APIs. It appears the intention was for these to be
replaced by the `FindInReadable` APIs, however that doesn't appear to have
happened.

In addition, the APIs have some quirks around their handling of mixed character
widths. These APIs generally supported both narrow strings and the native
string type, probably because char16_t string literals weren't available until
c++11. Finally they also used easy-to-confuse unlabeled boolean and integer
optional arguments to control behaviour.

These patches do the following major changes to the searching APIs:

1. The ASCII case-insensitive search method was split out as
   LowerCaseFindASCII, rather than using a boolean. This should be less
   error-prone and more explicit, and allows the method to continue to use
   narrow string literals for all string types (as only ASCII is supported).
2. The other [R]Find methods were restricted to only support arguments with
   matching character types. I considered adding a FindASCII method which would
   use narrow string literals for both wide and narrow strings but it would've
   been the same amount of work as changing all of the literals to unicode
   literals.
   This ends up being the bulk of the changes in the patch.
3. All find methods were re-implemented using std::basic_string_view's find
   algorithm or stl algorithms to reduce code complexity, and avoid the need to
   carry around the logic from nsStringObsolete.cpp.
4. The implementations were moved to nsTStringRepr.cpp.
5. An overload of Find was added to try to catch callers which previously
   called `Find(..., false)` or `Find(..., true)` to set case-sensitivity, due
   to booleans normally implicitly coercing to `index_type`. This should
   probably be removed at some point, but may be useful during the transition.

Differential Revision: https://phabricator.services.mozilla.com/D148300
2022-06-10 21:12:08 +00:00
criss f377db97ef Backed out changeset b2d7601357c9 (bug 1772189) for causing multiple reftest failures. CLOSED TREE 2022-06-10 21:28:18 +03:00
Jonathan Kew 0bd9ebfd30 Bug 1772189 - Avoid potential infinite recursion when initializing vertical metrics, if the font has a broken 'vmtx' table. r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D148928
2022-06-10 17:30:45 +00:00
Sylvestre Ledru b848a697dc Bug 1617369 - Reformat recent rust changes with rustfmt r=emilio,extension-reviewers,willdurand
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D148376
2022-06-10 09:21:45 +00:00
Nicolas Silva 37773c28ed Bug 1773217 - Fix bundled fonts build on mac. r=gfx-reviewers,jrmuizel,aosmond
Differential Revision: https://phabricator.services.mozilla.com/D148760
2022-06-10 09:02:52 +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
Emilio Cobos Álvarez df28d4be99 Bug 1773491 - Partially back out bug 1773359 since Solaris also defines this constant. DONTBUILD
MANUAL PUSH: Tier3 build fix / backout CLOSED TREE
2022-06-09 16:35:00 +02:00
stransky b887666c92 Bug 1735929 [Linux] Use EGL_MESA_image_dma_buf_export in SharedSurfaceDMABUF r=jgilbert,aosmond
- Update SharedSurfaceDMABUF for EGL_MESA_image_dma_buf_export DMABufSurface interface.
- Test surface export and import in SurfaceFactory_DMABUF::CanCreateSurface() to make sure it really works.

Depends on D147636

Differential Revision: https://phabricator.services.mozilla.com/D147637
2022-06-09 08:37:20 +00:00
stransky 08d59365a9 Bug 1735929 [Linux] Add support of EGL_MESA_image_dma_buf_export to GLLibraryEGL r=jgilbert,aosmond
Differential Revision: https://phabricator.services.mozilla.com/D147635
2022-06-09 08:37:19 +00:00
Lee Salzman 86c6c85788 Bug 1701975 - Add crashtest. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D110490
2022-06-09 03:15:32 +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
Emilio Cobos Álvarez 84a20431f4 Bug 1773359 - Remove TRANSPARENT workaround in webrender bindings. r=gfx-reviewers,jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D148679
2022-06-08 19:19:08 +00:00
Ryan VanderMeulen 84e0467a0f Bug 1762191 - Update HarfBuzz to 4.3.0. r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D146955
2022-06-08 14:29:29 +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
Bas Schouten eb25f54ea0 Bug 1772216: Add telemetry probe to measure time spent waiting for the GPU. r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D148075
2022-06-08 13:41:19 +00:00
Bogdan Szekely 8b28449887 Merge mozilla-central to autoland. CLOSED TREE 2022-06-08 12:36:05 +03:00
Bogdan Szekely 2af77731df Merge autoland to mozilla-central. a=merge 2022-06-08 12:29:23 +03:00
Olli Pettay f44787b8da Bug 1773152 - Don't call SendNotifyFrameStats(stats) if no one will use the stats, r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D148568
2022-06-08 08:22:43 +00:00
Nicolas Silva a45bacf0d2 Bug 1746356 - Null-check the result of CreateSimilarDrawTarget. r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D148512
2022-06-08 07:28:04 +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
Bas Schouten 71c8e37424 Bug 1772216: Add telemetry probe to measure time spent waiting for the GPU. r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D148075
2022-06-08 02:11:07 +00:00
Emilio Cobos Álvarez 255763ef57 Bug 1773070 - Unify Gecko and Servo EventState/ElementState bits. r=smaug
Add a dom/base/rust crate called just "dom" where we can share these.

Most of the changes are automatic:

  s/mozilla::EventStates/mozilla::dom::ElementState/
  s/EventStates/ElementState/
  s/NS_EVENT_STATE_/ElementState::/
  s/NS_DOCUMENT_STATE_/DocumentState::/

And so on. This requires a new cbindgen version to avoid ugly casts for
large shifts.

Differential Revision: https://phabricator.services.mozilla.com/D148537
2022-06-07 23:09:52 +00:00
Timothy Nikkel 08d3f3c2f4 Bug 1772665. Initialize WebRenderImageProviderData::mDrawResult. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D148334
2022-06-07 12:50:30 +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
Sylvestre Ledru 42f6811d95 Bug 1519636 - Reformat recent changes to the Google coding style r=andi,media-playback-reviewers,necko-reviewers,padenot,dragana
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D148375
2022-06-07 12:32:55 +00:00
Mike Hommey 7ce663eb08 Bug 1772048 - Update rustc_version and semver crates. r=emilio,webdriver-reviewers,kinetik,whimboo
semver 1.0 doesn't and won't support Clone on semver::Error[1], so we
convert the mozversion error type to store the string version of the
error, which is an incompatible change requiring a version bump on the
crate.

1. https://github.com/dtolnay/semver/pull/280

Differential Revision: https://phabricator.services.mozilla.com/D147825
2022-06-07 10:01:32 +00:00
Mike Hommey 9e959e791a Bug 1772967 - Update dirs crate to 4.0. r=webdriver-reviewers,gfx-reviewers,jrmuizel,whimboo
Differential Revision: https://phabricator.services.mozilla.com/D148466
2022-06-07 09:29:07 +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
Ashley Hale 2879b04886 Bug 1772947 - Remove dead code DecomposeIntoNoRepeatTriangles. r=gfx-reviewers,jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D148455
2022-06-07 00:07:28 +00:00
Razvan Cojocaru d4ff2f21bf Bug 1767122 - Change the type of gfxWindowsNativeDrawing::mScale to MatrixScalesDouble. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D148339
2022-06-06 22:01:56 +00:00
Jamie Nicol 68af928298 Bug 1772849 - Annotate crash reports with eglCreateWindowSurface error code on Android. r=gfx-reviewers,jgilbert,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D148410
2022-06-06 18:12:39 +00:00
stransky a832fc14b9 Bug 1770560 [Linux] Move GetAsSourceSurface() implementation from DMABUFSurfaceImage to DMABufSurface r=sotaro,jgilbert
Both DMABUFSurfaceImage and DMABufSurface use its own headless GL context to create GL texture from DMABufSurface.
Let's unity that in DMABufSurface and use only one shared GL context for it.

Depends on D146989

Differential Revision: https://phabricator.services.mozilla.com/D146990
2022-06-06 13:31:03 +00:00
stransky b292c031de Bug 1770560 [Linux] Implement GLBlitHelper::Blit(DMABufSurface* surface,...) to blit DMABufSurface directly r=sotaro,jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D146989
2022-06-06 13:31:03 +00:00
Jim Blandy cee3303a59 Bug 1752188: Move GPUBufferDescriptor validation to server. r=jgilbert
Depends on [`wgpu#2673`].

WebGPU requires `GPUBufferDescriptor` validation failure to:

1) generate an error on the Device timeline, and

2) mark the new buffer as invalid.

Satisfy 1) by moving most validation to the compositor process.

Requirement 2) is harder. `wgpu_core::Global::device_create_buffer`
already takes care of some validation for us, and marks the provided
buffer id invalid when there's a problem. However, there are certain
errors the spec requires us to detect which `device_create_buffer`
cannot even see, because they are caught by standard Rust validation
steps in the process of creating the `wgpu_types::BufferDescriptor`
that one would *pass to* that function. For example, if there are
bogus bits set in the `usage` property, we can't even construct a Rust
`BufferUsages` value from that to include in the `BufferDescriptor`
that we must pass to `device_create_buffer`.

This means that we need to do some validation ourselves, in the
process of constructing that `BufferDescriptor`, and use the
`Global::create_buffer_error` method added in [`wgpu#2673`] to mark
the new buffer as invalid.

[`wgpu#2673`]: https://github.com/gfx-rs/wgpu/pull/2673

Differential Revision: https://phabricator.services.mozilla.com/D146768
2022-06-06 06:33:13 +00:00
Jim Blandy b3f36731c3 Bug 1752188: Error-handling cleanups. r=jgilbert
Document various things. Spell out that the error messages are UTF-8.

Let `server.rs`'s `ErrorBuffer` take a `&str` instead of a `String`.

Differential Revision: https://phabricator.services.mozilla.com/D146767
2022-06-06 06:33:13 +00:00
Emilio Cobos Álvarez 94ea7b0820 Bug 1772692 - AnimationInfo::EnumerateGenerationOnFrame shouldn't need to create a window renderer. r=hiro
There's no need to lazily create a renderer here. We already avoided
this in content processes, but there's no need to do so in the parent
process either.

This shouldn't change behavior, but might help with bug 1772691, and
generally seems cleaner.

Differential Revision: https://phabricator.services.mozilla.com/D148337
2022-06-05 23:20:45 +00:00
Jim Blandy 6c9ae4cd83 Bug 1772004: Update `wgpu` to 32af4f56 (2022-5-31) r=jgilbert
Minor changes are needed to the `mapAsync` implementation due to:
https://github.com/gfx-rs/wgpu/pull/2698

Differential Revision: https://phabricator.services.mozilla.com/D147805
2022-06-05 20:30:13 +00:00
Razvan Cojocaru f0ceea18e4 Bug 1767127 - Change the types of FilterInstance::m[UserSpaceToFilter|FilterSpaceToUser]SpaceScale to MatrixScalesDouble. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D148138
2022-06-03 19:55:30 +00:00
Dan Robertson f25a982b1d Bug 1760368 - A fixed element hit in the gutter should not be absorbed. r=botond
When a hit test result hits a fixed element that extends over the gutter, do not
absorb the event.

Depends on D147564

Differential Revision: https://phabricator.services.mozilla.com/D148077
2022-06-03 18:12:26 +00:00
Dan Robertson 49c7adc0d3 Bug 1760368 - Fix hit testing of fixed elements. r=botond
When transforming the hit test to what gecko expects, ensure that we
handle fixed elements correctly.

Depends on D146825

Differential Revision: https://phabricator.services.mozilla.com/D148076
2022-06-03 18:12:26 +00:00
Dan Robertson 9a05a09fb2 Bug 1760368 - Overscroll transform should not apply to fixed content. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D146825
2022-06-03 18:12:25 +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
Botond Ballo 84fc68c001 Bug 1771822 - Do not explicitly set dom.visualviewport.enabled in tests. r=tnikkel
This pref is now enabled by default on all platforms.

Depends on D147810

Differential Revision: https://phabricator.services.mozilla.com/D147811
2022-06-02 22:57:56 +00:00
Botond Ballo 18351c43de Bug 1771822 - Remove the browser.chrome.dynamictoolbar pref. r=tnikkel,perftest-reviewers,AlexandruIonescu
This pref is left over from a previous dynamic toolbar implementation,
and no one was reading its value.

Differential Revision: https://phabricator.services.mozilla.com/D147810
2022-06-02 22:57:56 +00:00
Emilio Cobos Álvarez f55315efb0 Bug 1772423 - Add a Region.Contains(point) and use it to simplify a couple callers. r=gfx-reviewers,bradwerth
This also ensures that the callers are well-typed too.

Differential Revision: https://phabricator.services.mozilla.com/D148206
2022-06-02 22:56:55 +00:00
Tom Ritter 76a5c5703e Bug 1692609 - Force 60hz for RFP and use that as the time-atom r=jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D148122
2022-06-02 18:27:48 +00:00
Brad Werth 1652c99df3 Bug 1731821: Remove NativeLayerCA video layer isolation and support scaffolding. r=mstange
The mouse moved tracking was only present to support the video layer isolation, so
this patch also removes that.

Differential Revision: https://phabricator.services.mozilla.com/D147468
2022-06-02 15:37:24 +00:00
Miko Mynttinen fa6c5c7b89 Bug 1758983 - Do not generate WR fallback data if translation overflows int32_t r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D141135
2022-06-02 14:16:58 +00:00
Sergio Villar Senin 4e4273a599 Bug 1771515 - [webxr] Support Oculus Quest2 controllers. r=jgilbert
Add support for the oculus-touch-v3 (Quest2) input profile. As specified
in the XR input profile we're setting oculus-touch-v2, oculus-touch, and
generic-trigger-squeeze-thumbstick as fallback profiles.

Update the externalVR VRControllerType enum as well.

Co-authored-by: Imanol Fernandez <ifernandez@igalia.com>

Differential Revision: https://phabricator.services.mozilla.com/D147519
2022-06-02 05:10:17 +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
Razvan Cojocaru dab093953c Bug 1770289 - Change the return type of nsLayoutUtils::ComputeSuitableScaleForAnimation() to MatrixScales. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D147835
2022-06-01 23:19:11 +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 6af8eda593 Bug 1731136 Part 5: Make macOS native compositor and NativeLayerCA handle backdrop r=mstange
layers.


This makes the macOS native compositor claim the ability to handle color
layers and makes NativeLayerCA actually do it. Color layers have a different
structure than other layers. Color layers apply the color to the
wrappingCALayer, and have no contentCALayer at all. That means that the
color layers are always sized to the layer's clip rect.

This also contains a drive-by fix to handle the case where an mOpaquenessTintLayer
exists when mMutatedSpecializeVideo is set to true. Before this change, in such a
case, the opaqueness layer will not be associated with the recreated wrapping layer.

Depends on D128131

Differential Revision: https://phabricator.services.mozilla.com/D128545
2022-06-01 19:40:04 +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
stransky 67f9cb618c Bug 1752494 [Linux] Enable VA-API on Nightly and Mesa >= 21.0 r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D147874
2022-06-01 17:52:34 +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
Brad Werth 8626787faa Bug 1768824 Part 2: Set macOS transfer functions independently of colorSpace. r=media-playback-reviewers,alwu
This creates a helper function in a new class gfxMacUtils that makes the
software and hardware decoders use the same logic. The new class was
necessary because gfxUtils is included in many files that don't include
CoreFoundation headers and would hit namespace collision if it was included
there.

Differential Revision: https://phabricator.services.mozilla.com/D146735
2022-05-31 23:06:16 +00:00
Brad Werth a020cf9407 Bug 1768824 Part 1: Track transfer characteristics for BT709. r=media-playback-reviewers,alwu
BT709 transfer characteristics may be specified in videos even if they don't
use the BT709 colorSpace. This change also makes BT709 the default, since it
is the safest option for unspecified cases.

Differential Revision: https://phabricator.services.mozilla.com/D146734
2022-05-31 23:06:15 +00: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 47917e0be8 Bug 1731136 Part 5: Make macOS native compositor and NativeLayerCA handle backdrop r=mstange
layers.


This makes the macOS native compositor claim the ability to handle color
layers and makes NativeLayerCA actually do it. Color layers have a different
structure than other layers. Color layers apply the color to the
wrappingCALayer, and have no contentCALayer at all. That means that the
color layers are always sized to the layer's clip rect.

This also contains a drive-by fix to handle the case where an mOpaquenessTintLayer
exists when mMutatedSpecializeVideo is set to true. Before this change, in such a
case, the opaqueness layer will not be associated with the recreated wrapping layer.

Depends on D128131

Differential Revision: https://phabricator.services.mozilla.com/D128545
2022-05-31 22:21:15 +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
Jamie Nicol 2cf59fe695 Bug 1767128 - Rework and re-enable SurfaceControl rendering path on Android. r=agi,gfx-reviewers,aosmond
In bug 1762424 we introduced a rendering path on Android using the
SurfaceControl API, in order to work around a bug preventing recovery
from a GPU process crash. However, the initial implementation caused
this bug: repeatedly sending the same SurfaceControl objects over AIDL
to the GPU process resulted in them being leaked, eventually causing
severe display issues. Not only were we duplicating the SurfaceControl
for each widget, but each time a widget was resized too.

This patch reworks our usage of the SurfaceControl API to avoid ever
having to send them cross-process. Instead, we create a single child
SurfaceControl object for each SurfaceControl that is attached to a
widget. (Typically there will be a single one shared between all
widgets, changing only when the app is paused and resumed, which is
much fewer than one per widget per resize.)

In the parent process we obtain the Surfaces that will be rendered in
to from the child SurfaceControls, and only send those Surfaces to the
GPU process. Thankfully unlike SurfaceControls, sending Surfaces
cross-process does not cause leaks. When the GPU process dies we
simply destroy all of the child SurfaceControls, and recreate them
again on-demand.

Differential Revision: https://phabricator.services.mozilla.com/D147437
2022-05-31 18:41:07 +00:00
Mike Hommey 7b58e2b833 Bug 1771827 - Don't enable the aarch64_target_feature feature on rustc 1.61.0. r=gfx-reviewers,jrmuizel
because it's stable as of that version.

Differential Revision: https://phabricator.services.mozilla.com/D147706
2022-05-31 00:50:09 +00:00
Hiroyuki Ikezoe 43bb9dc340 Bug 1312165 - Parse scroll-snap-stop style and propagate it to APZ side. r=emilio,botond
Depends on D146147

Differential Revision: https://phabricator.services.mozilla.com/D145850
2022-05-31 00:45:11 +00:00