43538 Commits

Author SHA1 Message Date
Razvan Cojocaru
e31680bb58 Bug 1751510 - Zoom gesture can not be performed at the same time as a pan gesture. r=botond
And add mochitest for pinching and panning in the same gesture.

Differential Revision: https://phabricator.services.mozilla.com/D151689
2022-07-27 19:05:53 +00:00
Jan-Erik Rediger
8dcad8e62e Bug 1781085 - Update to Glean v50.1.3 r=chutten,supply-chain-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D152770
2022-07-27 10:24:48 +00:00
criss
e3d5438abb Backed out changeset 581d7209c242 (bug 1781085) for causing build bustages. CLOSED TREE 2022-07-27 12:19:52 +03:00
Jan-Erik Rediger
a3f580ed1f Bug 1781085 - Update to Glean v50.1.3 r=chutten,supply-chain-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D152770
2022-07-27 08:58:11 +00:00
Glenn Watson
a00b8ca709 Bug 1779952 - Refactor and optimize internal representation of clip state r=nical
This patch refactors how clip chains are internally represented and used
during scene and frame building. The intent is to make clip processing
during frame building more efficient and consistent. Additionally, this
work enables follow ups to cache the result of clip-chain builds between
frame and scene builds.

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

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

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

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

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

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

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

Differential Revision: https://phabricator.services.mozilla.com/D151987
2022-07-26 21:13:32 +00:00
Emilio Cobos Álvarez
d98aff87e0 Bug 1781140 - Remove nsTimingFunction and ComputedTimingFunction. r=dshin
They're simple wrappers of StyleComputedTimingFunction so we can remove
them.

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

Differential Revision: https://phabricator.services.mozilla.com/D152707
2022-07-26 09:35:07 +00:00
Hiroyuki Ikezoe
6cd2d7b509 Bug 1780701 - Skip returning the snap target if the snap position is same as the scroll destination. r=botond
Depends on D152617

Differential Revision: https://phabricator.services.mozilla.com/D152618
2022-07-26 06:59:14 +00:00
Razvan Cojocaru
fd92081aec Bug 1779812 - We are entering the pinch lock too easily. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D151972
2022-07-26 03:24:41 +00:00
Tooru Fujisawa
a032f53a63 Bug 1780543 - Part 5: Add mozilla/chrome-script environment. r=Standard8
Differential Revision: https://phabricator.services.mozilla.com/D152430
2022-07-26 02:46:30 +00:00
Lee Salzman
11df7a2ec5 Bug 1771007 - Avoid sending SourceSurfaceWebgl off-thread. r=jrmuizel,gfx-reviewers
BorrowSnapshot can be called by OffScreenCanvas in various places that may send
a SourceSurfaceWebgl to the main thread. If it did not originate from the main
thread, then this can cause multiple threads to use it. In general we want to
avoid this. For now, override BorrowSnapshot and make it always force a Skia
snapshot that can be safely shared between threads instead of SourceSurfaceWebgl.

Differential Revision: https://phabricator.services.mozilla.com/D152417
2022-07-26 01:28:48 +00:00
Glenn Watson
4066f3d6bc Bug 1768678 - Fix blur source size adjustment for downscaling r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D152243
2022-07-26 00:58:32 +00:00
Emilio Cobos Álvarez
42b7f1a58c Bug 1780788 - Use abstract strings as in-arguments for ipdl. r=nika,necko-reviewers,media-playback-reviewers,alwu,dragana
This prevents copies and avoids the hack we have to avoid this, which
right now is using nsDependent{C,}String.

Non-virtual actors can still use `nsString` if they need to on the
receiving end.

Differential Revision: https://phabricator.services.mozilla.com/D152519
2022-07-25 20:19:48 +00:00
Dan Robertson
b3308af056 Bug 1773378 - Add basic axis lock mode compatibility test. r=botond
Add a basic test to ensure the delta for the pan start gesture is evaluated for
all axis locking modes.

Differential Revision: https://phabricator.services.mozilla.com/D152482
2022-07-25 18:23:04 +00:00
Dan Robertson
8e5b76b18b Bug 1773378 - Implement stateless dominant axis scrolling. r=botond,mstange
Implement the new dominant axis locking mode for the apz.axis_lock.mode
preference. When using this mode, we do not use the traditional axis locks.
Instead we only consider the input pan displacement for the axis with
a larger value, zeroing out the displacement on the opposite axis.

Differential Revision: https://phabricator.services.mozilla.com/D152104
2022-07-25 18:23:04 +00:00
az
805f4822ab Bug 1766308 - Add gfxVars::CodecSupportInfo to store user-readable codec support string r=media-playback-reviewers,alwu
Differential Revision: https://phabricator.services.mozilla.com/D147386
2022-07-22 23:08:08 +00:00
az
534707da03 Bug 1766307 - Enable PDMFactory::Supports/SupportsMimeType to process+return HW/SW decode info r=media-playback-reviewers,alwu
Differential Revision: https://phabricator.services.mozilla.com/D147385
2022-07-22 23:08:08 +00:00
Cristian Tuns
dad30161bf Merge autoland to mozilla-central. a=merge 2022-07-22 04:57:12 -04:00
Bogdan Szekely
ae3891e91e Backed out changeset d2c2f810bf14 (bug 1780389) for causing Bug 1780679 a=backout 2022-07-22 11:30:25 +03:00
Glenn Watson
246371eb45 Bug 1780567 - Fix shared target allocation for tasks with Existing mode r=gfx-reviewers,jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D152474
2022-07-21 23:57:02 +00:00
Bas Schouten
548a858362 Bug 1780431: Fix Compositing PerfStat and do minor cleanup in the process. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D152291
2022-07-21 20:31:49 +00:00
Brad Werth
8b86012f73 Bug 1780586: Make IsCGColorOpaqueBlack handle clear color correctly. r=gfx-reviewers,jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D152439
2022-07-21 18:02:34 +00:00
Emilio Cobos Álvarez
a829fc3af6 Bug 1780540 - Don't forget charmap after setting in a font entry. r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D152379
2022-07-21 14:58:13 +00:00
Ryan VanderMeulen
7d4ba4cffd Bug 1780461 - Fix HarfBuzz Wcomma errors introduced in version 4.4.1. r=jfkthame
Cherry-pick of upstream commit:
https://github.com/harfbuzz/harfbuzz/pull/3719

Differential Revision: https://phabricator.services.mozilla.com/D152318
2022-07-21 14:33:08 +00:00
Norisz Fay
e99928ae0e Backed out changeset 3f75ba849f09 (bug 1780540) for causing build bustages on gfxFcPlatformFontList.cpp CLOSED TREE 2022-07-21 17:28:24 +03:00
Emilio Cobos Álvarez
54c02d1014 Bug 1780540 - Don't forget charmap after setting in a font entry. r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D152379
2022-07-21 13:52:28 +00:00
Owen Rafferty
d08627e1b0 Bug 1776724 - fix wayland-only build r=jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D150485
2022-07-21 09:10:59 +00:00
stransky
1ea3f7a202 Bug 1780389 [Wayland] Call moz_container_wayland_add_initial_draw_callback() on locked container, always lock MozContainer for access r=rmader
With this patch moz_container_wayland_surface_lock() always locks MozContainer and needs to be paired with moz_container_wayland_surface_unlock() even if it fails and returns nullptr.
Split moz_container_wayland_add_initial_draw_callback() to two new functions:

- moz_container_wayland_add_initial_draw_callback_locked() is called on locked container and only adds draw callback.
  It asserts when MozContainer is already to draw as we don't expect it.

- moz_container_wayland_add_or_fire_initial_draw_callback() is called on unlocked container as it has it's own lock.
  It behaves as original moz_container_wayland_add_initial_draw_callback(), i.e. stores draw callback when MosContainer is not visible
  and fires draw callback when we're ready to draw.

Differential Revision: https://phabricator.services.mozilla.com/D152276
2022-07-21 07:54:47 +00:00
Hiroyuki Ikezoe
7ecc3eddc9 Bug 1779909 - Skip re-snapping during pan/touch gestures or scrollbar dragging. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D152229
2022-07-21 00:02:10 +00:00
Glenn Watson
0080c38b17 Bug 1780320 - Support child scroll roots if in the root coordinate system r=gfx-reviewers,lsalzman
A requirement of calling `get_relative_transform` is that the child
node is an ancestor of the reference node. To ensure this invariant
is met, we exclude non-ancestor scroll roots from consideration when
picking a scroll root for an atomic picture cache slice. However, this
can mean we select a non-optimal scroll root in some cases. But the
`get_relative_transform` constraint only applies if the spatial nodes
are in a different coordinate system - if we know that the scroll roots
are in the same coordinate system, we can always calculate the correct
relative transform, regardless of ancestry of the nodes. We can rely on
this to relax the condition here, which means we select a more appropriate
scroll root, resulting in much less invalidation and rasterization work
in these cases.

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

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

Differential Revision: https://phabricator.services.mozilla.com/D152235
2022-07-20 23:37:39 +00:00
Brad Werth
b7bf5c8d2e Bug 1737682 Part 1: Log whether or not we are hitting the detached state. r=mstange
There are 10 enum cases that we track internally, one of which isn't
emitted as telemetry. These cases are 0-indexed to match the enum values.

0 / NotVideo: Not used for telemetry. No video is showing.

1 / LowPower: We are showing exactly one video and we believe we are
hitting the video low power mode. We don't use "Success" because of name
collision in the telemetry generation.

2 / FailMultipleVideo: There is more than one video visible.

3 / FailWindowed: The video is being viewed in windowed mode, not
fullscreen mode, so low power mode is not possible.

4 / FailOverlaid: The video has something on top of it (like captions).

5 / FailBacking: The layer directly underneath the video does not cover
the window or does not have a black background.

6 / FailMacOSVersion: The system is running a too-early version of macOS.

7 / FailPref: The user has disabled the
`gfx.core-animation.specialize-video` pref.

8 / FailSurface: The video is encoded in such a way we can't decode it to
a qualifying pixel format.

9 / FailEnqueue: The video didn't enqueue properly, and we fell back to a
non-video display path.

Differential Revision: https://phabricator.services.mozilla.com/D129453
2022-07-20 20:00:26 +00:00
Cosmin Sabou
ea3afb405e Backed out 2 changesets (bug 1737682) for causing build bustages on TelemetryHistogramEnums.h. CLOSED TREE
Backed out changeset 297b16133aa9 (bug 1737682)
Backed out changeset 362b1e430789 (bug 1737682)
2022-07-20 22:08:50 +03:00
Brad Werth
7b4233aaa1 Bug 1737682 Part 1: Log whether or not we are hitting the detached state. r=mstange
There are 10 enum cases that we track internally, one of which isn't
emitted as telemetry. These cases are 0-indexed to match the enum values.

0 / NotVideo: Not used for telemetry. No video is showing.

1 / Success: We are showing exactly one video and we believe we are
hitting the video low power mode.

2 / FailMultipleVideo: There is more than one video visible.

3 / FailWindowed: The video is being viewed in windowed mode, not
fullscreen mode, so low power mode is not possible.

4 / FailOverlaid: The video has something on top of it (like captions).

5 / FailBacking: The layer directly underneath the video does not cover
the window or does not have a black background.

6 / FailMacOSVersion: The system is running a too-early version of macOS.

7 / FailPref: The user has disabled the
`gfx.core-animation.specialize-video` pref.

8 / FailSurface: The video is encoded in such a way we can't decode it to
a qualifying pixel format.

9 / FailEnqueue: The video didn't enqueue properly, and we fell back to a
non-video display path.

Differential Revision: https://phabricator.services.mozilla.com/D129453
2022-07-20 18:48:28 +00:00
Lee Salzman
f1344407b0 Bug 1779953 - Ensure MaybeRecordFrame is called before EndFrame. r=tnikkel
If MaybeRecordFrame is called after EndFrame, this means we are reading from
the back buffer state immediately after a call to SwapBuffers. The state of
the back buffer is undefined in that scenario, and mostly was just returning
old frames. We actually want to call MaybeRecordFrame before EndFrame, so we
get the valid contents of the back buffer before it is swapped out.

Differential Revision: https://phabricator.services.mozilla.com/D151988
2022-07-20 16:55:20 +00:00
criss
dcedbd6b45 Backed out changeset 6aefdcf0d53b (bug 1773378) for causing mochitest failures on browser_test_background_tab_scroll.js. CLOSED TREE 2022-07-20 07:36:07 +03:00
sotaro
1af3966f37 Bug 1780138 - Let zero copy hardware decoded video to release on all GPUs on Windows r=jrmuizel,gfx-reviewers
A bug is not reported related to "zero copy hardware decoded video" on Windows. Zero video frame copy needs "reuse decoder device ". And it is already enabled on Nightly / Early Beta by Bug 1773714.

RadeonBlockNoVideoCopy is renamed to RadeonBlockZeroVideoCopy

Differential Revision: https://phabricator.services.mozilla.com/D152139
2022-07-20 03:53:30 +00:00
Cristian Tuns
296431b106 Backed out 8 changesets (bug 1754239, bug 1766307, bug 1766308, bug 1766310) for causing build bustages on Logging.h CLOSED TREE
Backed out changeset 50918938a839 (bug 1766307)
Backed out changeset 19800bb8974e (bug 1766307)
Backed out changeset 40ec82794497 (bug 1766310)
Backed out changeset 4f860e20098c (bug 1754239)
Backed out changeset f54eac410bfd (bug 1754239)
Backed out changeset c8cc5e0c89dd (bug 1766307)
Backed out changeset d7aab4098f12 (bug 1766308)
Backed out changeset a7ffa6f44fe8 (bug 1766307)
2022-07-19 21:20:07 -04:00
Dan Robertson
9950071606 Bug 1773378 - Implement stateless dominant axis scrolling. r=botond,mstange
Implement the new dominant axis locking mode for the apz.axis_lock.mode
preference. When using this mode, we do not use the traditional axis locks.
Instead we only consider the input pan displacement for the axis with
a larger value, zeroing out the displacement on the opposite axis.

Differential Revision: https://phabricator.services.mozilla.com/D152104
2022-07-20 00:51:27 +00:00
az
86d8351f49 Bug 1766308 - Add gfxVars::CodecSupportInfo to store user-readable codec support string r=media-playback-reviewers,alwu
Differential Revision: https://phabricator.services.mozilla.com/D147386
2022-07-19 23:27:39 +00:00
az
5d97400d50 Bug 1766307 - Enable PDMFactory::Supports/SupportsMimeType to process+return HW/SW decode info r=media-playback-reviewers,alwu
Differential Revision: https://phabricator.services.mozilla.com/D147385
2022-07-19 23:27:38 +00:00
Hiroyuki Ikezoe
4907d4f03c Bug 1742797 - Add a new IPC call to clear animation resources on WebRender, r=sotaro.
Differential Revision: https://phabricator.services.mozilla.com/D151481
2022-07-19 19:56:21 +00:00
Butkovits Atila
398eded3f1 Backed out 4 changesets (bug 1742797, bug 1748808) for causing crashes at mozilla::layers::APZCTreeManagerParent::RecvUpdateZoomConstraints.
Backed out changeset 23f2a369a5a7 (bug 1748808)
Backed out changeset 5b0edd03f698 (bug 1742797)
Backed out changeset 8ed69c2c1d49 (bug 1742797)
Backed out changeset 18e11e7ea9d0 (bug 1742797)
2022-07-19 08:12:04 +03:00
Hiroyuki Ikezoe
0dde09cde6 Bug 1779729 - Guard simultaneous access to mLastSnapTargetIds. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D152133
2022-07-19 03:08:08 +00:00
Kelsey Gilbert
b5f2464c70 Bug 1779166 - Mark two GLContexts as not owned by single threads. r=gfx-reviewers,lsalzman
1. In AndroidSharedBlitGL.
2. In DMABufSurface.

Differential Revision: https://phabricator.services.mozilla.com/D152141
2022-07-19 02:53:56 +00:00
Botond Ballo
a4bfaaf34b Bug 1779144 - Factor out a helper shared by the touch event and tap event handling codepaths. r=dlrobertson
Depends on D151939

Differential Revision: https://phabricator.services.mozilla.com/D151940
2022-07-18 21:37:48 +00:00
Botond Ballo
d6e6ccf103 Bug 1779144 - Handle touchpad double-taps correctly in APZCTreeManager::ConvertToGecko(). r=dlrobertson
Differential Revision: https://phabricator.services.mozilla.com/D151939
2022-07-18 21:37:47 +00:00
Hiroyuki Ikezoe
30a66f3945 Bug 1742797 - Add a new IPC call to clear animation resources on WebRender, r=sotaro.
Differential Revision: https://phabricator.services.mozilla.com/D151481
2022-07-18 18:01:52 +00:00
Norisz Fay
12f6ce9a82 Backed out changeset ff417c667b5b (bug 1779355) for causing build bustages on GLLibraryEGL.h CLOSED TREE 2022-07-18 20:48:26 +03:00
Kelsey Gilbert
992f515c41 Bug 1779355 - Check for owning thead in GLContext::MakeCurrent and EGLLibrary::fMakeCurrent. r=gfx-reviewers,bradwerth
Differential Revision: https://phabricator.services.mozilla.com/D151700
2022-07-18 17:35:03 +00:00