Commit Graph

43574 Commits

Author SHA1 Message Date
Andrew Osmond
128c09ccdd Bug 1782710 - Avoid accessing network service or principals on worker threads with font pathways. r=jfkthame
We do some initialization of gfxFontSrcURI and gfxFontFaceSrc that is
main thread only on the DOM worker threads. These portions of the
initialization can easily be deferred to on demand access since they are
only ever used on the main thread itself.

Differential Revision: https://phabricator.services.mozilla.com/D153461
2022-08-03 11:39:34 +00:00
Mark Banner
7428be4a86 Bug 1782008 - Remove now unnecessary .eslintrc.js files. r=webcompat-reviewers,extension-reviewers,media-playback-reviewers,pip-reviewers,denschub,rpl,alwu,mossop
Differential Revision: https://phabricator.services.mozilla.com/D152736
2022-08-03 11:16:20 +00:00
Butkovits Atila
aeb018ca75 Backed out changeset 48381173c92c (bug 1780315) for causing bug 1782764. CLOSED TREE 2022-08-03 13:43:39 +03:00
Andrew Osmond
f39bf41b7f Bug 1782731 - Make gfx.font_rendering.fontconfig.max_generic_substitutions threadsafe. r=jfkthame
This pref could be accessed off the main thread with workers. Convert it
to a threadsafe StaticPref.

Differential Revision: https://phabricator.services.mozilla.com/D153470
2022-08-02 20:58:41 +00:00
Jamie Nicol
a17ddfc210 Bug 1780093 - Disable SurfaceControl compositing path when selection is active. r=geckoview-reviewers,calu
On Android we previously added a rendering path using the
SurfaceControl API, in order to work around an Android OS bug when
recovering from a GPU process crash. Unfortunately the Magnifier
widget (shown when moving a text selection caret) does not work when
rendering using SurfaceControl.

This patch makes it so that we temporarily disable the SurfaceControl
path when a text selection is active, allowing the Magnifier to work.
Unfortunately this means that if a GPU process crash occurs while
there is an active selection we will be unable to recover. Hopefully
this turns out to be a relatively rare occurence.

Differential Revision: https://phabricator.services.mozilla.com/D153454
2022-08-02 20:55:20 +00:00
criss
0d7af74214 Backed out changeset 32689459fc62 (bug 1782731) for causing reftest failures. CLOSED TREE 2022-08-02 21:34:06 +03:00
Andrew Osmond
94fc207dd3 Bug 1782731 - Make gfx.font_rendering.fontconfig.max_generic_substitutions threadsafe. r=jfkthame
This pref could be accessed off the main thread with workers. Convert it
to a threadsafe StaticPref.

Differential Revision: https://phabricator.services.mozilla.com/D153470
2022-08-02 15:07:34 +00:00
Sandor Molnar
b7bdd0938f Backed out changeset b7b04703f99d (bug 1782710) for causing wpt failure. 2022-08-02 18:16:28 +03:00
Andrew Osmond
37466029fb Bug 1782710 - Avoid accessing network service or principals on worker threads with font pathways. r=jfkthame
We do some initialization of gfxFontSrcURI and gfxFontFaceSrc that is
main thread only on the DOM worker threads. These portions of the
initialization can easily be deferred to on demand access since they are
only ever used on the main thread itself.

Differential Revision: https://phabricator.services.mozilla.com/D153461
2022-08-02 14:26:57 +00:00
Norisz Fay
6b6c07c221 Backed out changeset f0d33d068908 (bug 1779205) for causing gfx related crashes CLOSED TREE 2022-08-02 15:24:49 +03:00
Jonathan Kew
dfc7e85147 Bug 1779205 - Drop variation tables entirely during sanitization if we don't support variations on the current platform. r=gfx-reviewers,aosmond
Differential Revision: https://phabricator.services.mozilla.com/D153444
2022-08-02 11:47:11 +00:00
Timothy Nikkel
5f9393c35d Bug 1780315. Use a timer to make sure all profiler screenshots get submitted. r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D152232
2022-08-02 11:14:17 +00:00
Pier Angelo Vendrame
2f55a1a885 Bug 1774413: Bundled fonts are not picked up on macOS r=jfkthame
Bundled fonts were not picked up because also child processes need to
register them.
Also, they were assigned User visibility, instead of Base, which was
not coherent with other platforms.

Differential Revision: https://phabricator.services.mozilla.com/D150400
2022-08-02 10:30:35 +00:00
Glenn Watson
6e214817ef Bug 1782317 - Fix segment building scrolled local clip bug. r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D153428
2022-08-02 05:28:09 +00:00
Andreea Pavel
89d63c91e6 Backed out changeset a907159a482f (bug 1761040) for causing build bustages on a CLOSED TREE 2022-08-02 04:59:08 +03:00
Fabrice Desré
0f4ac7ad97 Bug 1761040 - Prefix thread safety macros with MOZ_ r=geckoview-reviewers,media-playback-reviewers,alwu,jesup,m_kato
Differential Revision: https://phabricator.services.mozilla.com/D152575
2022-08-02 00:49:41 +00:00
Iulian Moraru
27d760c7c2 Backed out 9 changesets (bug 1771374) for causing mochitest-webgl failures. CLOSED TREE
Backed out changeset ded977dd1896 (bug 1771374)
Backed out changeset adeb8b7d48f9 (bug 1771374)
Backed out changeset 7767340872c5 (bug 1771374)
Backed out changeset 33282b4ffaae (bug 1771374)
Backed out changeset 75db498cd0e7 (bug 1771374)
Backed out changeset 70035903ea37 (bug 1771374)
Backed out changeset 7c7de0fb66e1 (bug 1771374)
Backed out changeset 615df05e016f (bug 1771374)
Backed out changeset ac3411d21928 (bug 1771374)
2022-08-02 03:38:09 +03:00
Glenn Watson
07bcbd6c5e Bug 1782405 - Fix UV sampling rect for blurs with downscale-adjusted sizes r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D153314
2022-08-01 20:02:12 +00:00
Kelsey Gilbert
0e8f2b213c Bug 1771374 - Respect wr::ImageRendering in DCSurfaceSwapChain. r=gfx-reviewers,nical
Differential Revision: https://phabricator.services.mozilla.com/D152798
2022-08-01 19:49:29 +00:00
Kelsey Gilbert
4b2a1851ac Bug 1771374 - Pad odd-sized surface swapchains to even numbers. r=gfx-reviewers,nical
We need to pad e.g. nv12 4:2:0 formats in order to have integer-sized
chroma planes.
But also to avoid needing laser-focused testing for this case, just
unconditionally pad odd-sizes to even numbers.

* Test handling of odd-number-sized surfaces.

Differential Revision: https://phabricator.services.mozilla.com/D152797
2022-08-01 19:49:29 +00:00
Kelsey Gilbert
5108ab70bf Bug 1771374 - Create swapchain with premult-alpha if hasAlpha. r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D152445
2022-08-01 19:49:28 +00:00
Kelsey Gilbert
0bd05e8c5c Bug 1771374 - Fix build and lint warnings. r=gfx-reviewers,aosmond
Differential Revision: https://phabricator.services.mozilla.com/D150620
2022-08-01 19:49:27 +00:00
Kelsey Gilbert
5ebff89891 Bug 1771374 - Disable color management based on pref in DCLayerTree. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D150276
2022-08-01 19:49:27 +00:00
Kelsey Gilbert
fa6e66aedd Bug 1771374 - Support display-p3 output via DirectComposition on Windows. r=sotaro,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D150275
2022-08-01 19:49:26 +00:00
sotaro
1bd586c8f2 Bug 1782464 - Remove PlanarYCbCrImage::SetDelayedConversion() r=gfx-reviewers,nical
The SetDelayedConversion() is not used any more.

Differential Revision: https://phabricator.services.mozilla.com/D153328
2022-08-01 14:52:30 +00:00
Razvan Cojocaru
29bfe418e8 Bug 1681955 - Assertion failure: mIsRootContent, in FrameMetrics::GetCompositionSizeWithoutDynamicToolbar(). r=dlrobertson
Differential Revision: https://phabricator.services.mozilla.com/D153059
2022-08-01 13:32:15 +00:00
Jan-Erik Rediger
94b2463ce2 Bug 1781030 - Upgrade to Glean v51.0.1. r=perry.mcmanis,supply-chain-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D152626
2022-08-01 10:50:47 +00:00
Glenn Watson
91a3a71c40 Bug 1781786 - Optimize some of the clip-set building process r=gfx-reviewers,nical
Pre-cache the clip set -> node information as entries are pushed
on to the clip-tree builder stack.

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

Differential Revision: https://phabricator.services.mozilla.com/D152956
2022-07-30 04:07:18 +00:00
Nika Layzell
c15823d075 Bug 1772006 - Part 5: 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-07-30 00:12:48 +00:00
Nika Layzell
997047e2a4 Bug 1772006 - Part 4: Simplify and move the string comparison APIs from ns[T]StringObsolete, r=xpcom-reviewers,necko-reviewers,dragana,barret
This patch moves EqualsIgnoreCase to ns[T]StringObsolete, and removes
the aCount argument, instead migrating callers to use `StringBeginsWith`
with a case-insensitive comparator.

In addition, nsTStringRepr::Compare was removed and replaced with either
calls to methods like `StringBeginsWith` or the global `Compare` method.

These changes required some modifications at call-sites but should make
the behaviour less surprising and more consistent.

Differential Revision: https://phabricator.services.mozilla.com/D148299
2022-07-30 00:12:48 +00:00
Andrew Osmond
2ae0134b4c Bug 1780193 - Refactor gfxFontCache expiration behaviour to mitigate perf reductions. r=jfkthame
In this patch, we make gfxFont use normal AddRef/Release semantics, and
instead now hold a strong reference to it inside the cache. At all times
a font should be in the expiration tracker, and whenever a lookup is
performed, we mark it as used.

When the tracker attempts to expire an entry, we check to see if the
only strong reference is inside the cache itself. If so, it is deleted.
If not, we mark it as used again instead of expiring it.

This has the advantage of making gfxFont::Release cheaper when there is
only one outstanding reference left outside the cache. It used to
acquire the gfxFontCache mutex in order to reinsert the font into the
expiration tracker when the last strong reference was cleared. This is a
very common case since the typical use case is only the main thread is
interacting with the cache, one font reference at a time.

This does not completely restore us to the previous performance
observed, but it does reclaim half of the original design benefit while
remaining threadsafe.

Differential Revision: https://phabricator.services.mozilla.com/D153110
2022-07-29 14:48:38 +00:00
Emilio Cobos Álvarez
d23c50ffee Bug 1782082 - Avoid rounding error accumulation in nsDOMWindowUtils::ToScreenRectInCSSUnits. r=dholbert
Make sure to use the same scale the browser-chrome would actually use by
rounding to full app units.

This is especially visible with 1.5 text scale factor.

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

Differential Revision: https://phabricator.services.mozilla.com/D152961
2022-07-28 21:07:37 +00:00
Nicolas Silva
73a5fa066e Bug 1780803 - Avoid uninitialized enum in error path. r=gfx-reviewers,jgilbert
Addresses a coverity warning. The problem looks very benign but the work around is simple and it's good to keep the volume static analysis warnings in check.

Differential Revision: https://phabricator.services.mozilla.com/D152525
2022-07-28 13:45:14 +00:00
Iulian Moraru
04f48d5fb6 Backed out changeset 9ced13a92244 (bug 1757054) for causing crashtest failures on 1757054.html. CLOSED TREE 2022-07-28 04:38:39 +03:00
Glenn Watson
bda035b7f5 Bug 1757054 - Ensure line decoration cache tasks are at least 1x1 r=gfx-reviewers,nical
Differential Revision: https://phabricator.services.mozilla.com/D152829
2022-07-27 20:13:44 +00:00
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