43187 Commits

Author SHA1 Message Date
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
Hiroyuki Ikezoe
898933043c Bug 1312165 - Add a mochitest to make sure our special handling for page down/up scrolls. r=botond
In our scroll snap implementation, there's a special handling on a page
scrolling that the closest snap point in the same page before scrolling is prior
to the closest snap point in the next page. There was no test case to test the
behavior.

Differential Revision: https://phabricator.services.mozilla.com/D145849
2022-05-31 00:45:10 +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
Emilio Cobos Álvarez
a756db562a Bug 1769559 - Remove invalid assertion. r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D147631
2022-05-30 09:32:02 +00:00