Commit Graph

42647 Commits

Author SHA1 Message Date
Glenn Watson
a27b52ce4b Bug 1759647 - Fix segments on snapped picture surface with clips + scale transform r=gfx-reviewers,nical
Differential Revision: https://phabricator.services.mozilla.com/D141182
2022-03-16 19:56:56 +00:00
Randell Jesup
fcaf70841e Bug 1207753 - Add MOZ_UNANNOTATED to all Mutexes/Monitors r=nika,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D140849
2022-03-16 18:47:08 +00:00
Noemi Erli
2390d257e6 Backed out changeset 12a59e5a50bf (bug 1207753) for causing build bustage CLOSED TREE 2022-03-16 18:32:51 +02:00
Randell Jesup
4b033a5256 Bug 1207753 - Add MOZ_UNANNOTATED to all Mutexes/Monitors r=nika,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D140849
2022-03-16 16:16:14 +00:00
Nicolas Silva
e65e56a1bc Bug 1757588 - Reorganize the primitive instance flag bits. r=gw
The goal is to allow the brush flags to use more bits in a followup changes.Currently it uses all of its available 8 bits, this patch allows it to use up to 12.

Differential Revision: https://phabricator.services.mozilla.com/D140967
2022-03-15 10:54:47 +00:00
Andrew McCreight
1b5cf10537 Bug 1759432 - Don't check for the WebVR pref in VRProcessChild::Init. r=jgilbert
This check seems to fail even if the VR pref is enabled. I think this is
because we are running this code while very early in process startup.
I think it will not introduce risk because the other process in this case
will be the parent process, so if that's been taken over then we've already
lost.

This also seems to fix the leak that I had to ignore before, probably
because the VR process wasn't even starting up properly before, so I've
removed the leak threshold I had to add.

Differential Revision: https://phabricator.services.mozilla.com/D141170
2022-03-16 14:36:39 +00:00
sotaro
024c07a719 Bug 1758607 - Adds more latency for waiting device reset handling completed r=gfx-reviewers,jrmuizel
test_device_reset.html checks if canvas works after device reset. Since Bug 1757879 fix, windowutils.triggerDeviceReset() does the device reset handling asynchronously in gecko. And the device reset happened during testing canvas since 1757879 fix. The canvas testing needs to happen after the gecko's device reset handling.

The change adds more latency for waiting device reset completed in gecko.

Differential Revision: https://phabricator.services.mozilla.com/D141178
2022-03-16 14:03:42 +00:00
Butkovits Atila
927ad62c6a Backed out changeset a68ee4b09f92 (bug 1207753) for causing Hazard bustages. CLOSED TREE 2022-03-16 14:38:14 +02:00
Randell Jesup
7d4b5fae04 Bug 1207753 - Add MOZ_UNANNOTATED to all Mutexes/Monitors r=nika,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D140849
2022-03-16 12:01:14 +00:00
criss
a1561aea0f Backed out 2 changesets (bug 1757588) "for shader related crashes".a=backout
Backed out changeset 89ae192e5434 (bug 1757588)
Backed out changeset f3dbc4e70fc7 (bug 1757588)
2022-03-16 11:51:44 +02:00
Botond Ballo
d3db8ed4cd Bug 1753779 - Avoid emitting the same deferred transform item onto an ancestor and descendant WebRenderLayerScrollData node. r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D141064
2022-03-16 04:35:07 +00:00
sotaro
32ba88374f Bug 1759323 - Disable NoCopyNV12Texture with SW-WR r=gfx-reviewers,nical
It is not expected to use NoCopyNV12Texture with SW-WR.

Differential Revision: https://phabricator.services.mozilla.com/D140942
2022-03-16 00:16:35 +00:00
Markus Stange
47c6beb1ee Bug 1759234 - Merge VsyncSource::Display into VsyncSource. r=smaug
Every `VsyncSource` currently only has a single `Display` associated with it.
This means that we're not making use of the `Display` abstraction at all.
This patch gets rid of `Display` by merging it into `VsyncSource`.

Originally, the intention of the `Display` abstraction was to use it for
per-monitor vsync. There would be one software `VsyncSource` and one hardware
`VsyncSource`, and the hardware `VsyncSource` would have one `Display` per
screen. But in reality, things have played out differently: The only platform
with per-monitor vsync is currently Linux Wayland, which has per-**widget**
vsync. And it has chosen to have one `VsyncSource` per widget, with a single
`Display` each.

For the macOS implementation of per-monitor vsync, I think it also makes
sense to have one `VsyncSource` per screen.

We already need to handle switching between VsyncSources, for switching
between software and hardware vsync, if the pref `layout.frame_rate` is
changed. So we might as well reuse that same switching capability for
switching between screens, when a window moves between screens or when a
tab moves between windows on different screens.

Differential Revision: https://phabricator.services.mozilla.com/D140891
2022-03-15 18:13:56 +00:00
Nicolas Silva
0440b5685e Bug 1757588 - Add missing plumbing to force anti-aliasing of axis-aligned rectangles. r=gw
The brush shader didn't take the anti-aliased code path if the transform was axis-aligned, this patch adds an extra flag to force the code path in the shader.

Differential Revision: https://phabricator.services.mozilla.com/D139958
2022-03-15 10:54:47 +00:00
Nicolas Silva
afe4771e50 Bug 1757588 - Reorganize the primitive instance flag bits. r=gw
The goal is to allow the brush flags to use more bits in a followup changes.Currently it uses all of its available 8 bits, this patch allows it to use up to 12.

Differential Revision: https://phabricator.services.mozilla.com/D140967
2022-03-15 10:54:47 +00:00
Timothy Nikkel
4c457eaf07 Bug 1758670. Correctly record checkerboard telemetry in base telemetry, not extended. r=botond
This data should be collected in release/base telemetry see https://searchfox.org/mozilla-central/rev/131f3af9a49d2203adb7b7ef30dcc37c9f1aa10b/toolkit/components/telemetry/Histograms.json#240

The reason it is not is that originally we only collected it in extended telemetry until bug 1539309. Bug 1539309 only changed Histograms.json but didn't update the C++ code.

Depends on D140642

Differential Revision: https://phabricator.services.mozilla.com/D140643
2022-03-15 06:51:29 +00:00
Botond Ballo
e18d4a2814 Bug 1749190 - Try harder to avoid cyclic scroll metadata annotations when building WRScrollData. r=tnikkel
Depends on D137943

Differential Revision: https://phabricator.services.mozilla.com/D137944
2022-03-15 00:56:00 +00:00
Botond Ballo
cde428ad83 Bug 1749190 - Rename a variable to be more precise. r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D137943
2022-03-15 00:55:59 +00:00
Emilio Cobos Álvarez
cc96c01559 Bug 1759494 - Remove some dead code introduced for PDFium. r=dholbert
IsSyncPagePrinting() only had one implementation which unconditionally
returned true.

So, any code that was conditioned on !IsSyncPagePrinting() is necessarily
dead/unreachable.

These are also crashing due to a null deref in mPrintTarget which might
happen if print is aborted.

Differential Revision: https://phabricator.services.mozilla.com/D140988
2022-03-14 23:18:22 +00:00
Kelsey Gilbert
479ddb1902 Bug 1756174 - gfxCriticalNote with details, instead of hard assert. r=gfx-reviewers,aosmond
Differential Revision: https://phabricator.services.mozilla.com/D140697
2022-03-14 18:12:22 +00:00
Timothy Nikkel
e079333f01 Bug 1758667. Don't record CHECKERBOARD_POTENTIAL_DURATION if we are not recording checkerboarding telemetry in general. r=botond
There's a small bug in the code that causes this to happen.

Differential Revision: https://phabricator.services.mozilla.com/D140642
2022-03-14 12:34:48 +00:00
Jamie Nicol
8ac1a00788 Bug 1712969 - Perform full composite if external surfaces are moved or shrunk r=gw
When using webrender's draw compositor with partial present enabled,
we treat the entire area of all promoted compositor surfaces as
dirty. However, if a compositor surface is moved or reduced in size
this is buggy - the *new* area of the surface will be treated as
dirty, but the additional area it used to occupy will not be. This
means that area may not be updated properly when compositing, leaving
stale content behind.

To fix this, keep track of the combined area of all promoted
compositor surfaces. If the area on the new frame does not contain the
area from the previous frame, then request a full composite by setting
dirty_rects_are_valid to false.

Differential Revision: https://phabricator.services.mozilla.com/D140717
2022-03-14 08:39:57 +00:00
Glenn Watson
8f1835aa7a Bug 1758168 - Fix for fractional sizes when scaling surfaces > max size r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D140595
2022-03-13 20:11:08 +00:00
Glenn Watson
89f0e122a4 Bug 1757876 - Introduce command buffers between prepare <-> batch pass r=gfx-reviewers,nical
Previously, WR would recursively walk the entire picture
tree during each of the visibility, prepare and batching
passes. With this change, the prepare pass builds a tightly
packed command buffer of draw commands for each child surface
and/or picture cache tile. The batching pass now reads the
packed command buffers, meaning that no traversal of the
picture tree is required during batching.

This serves two purposes:

(1) It makes it possible to direct primitives within a
    single picture to different render tasks. This isn't
    yet used, but is a straightforward addition to how
    command buffers work. This functionality will be used
    to split primitives across render tasks where there
    are readback boundaries (e.g. backdrop-filter and also
    mix-blend-mode). The existing picture graph code ensures
    that we then optimally allocate, batch and draw pictures
    that contain these barrier style primitives.

(2) In the common case, where only a small portion of the
    scene has changed during a frame, it's a significant
    optimization to avoid another picture tree traversal.
    Instead, the batching code will only end up iterating
    small lists of the primitives that overlap the dirty
    region for the given tile / child surface.

Differential Revision: https://phabricator.services.mozilla.com/D140159
2022-03-13 20:03:06 +00:00
Jonathan Kew
bc843f9f73 Bug 1758721 - Preload font prefs that may be needed at textrun-construction time, to avoid use of the (main-thread-only) preference service. r=lsalzman
This doesn't in itself make them thread-safe, but it provides a basis to do so by avoiding
dependence on the Preferences service at textrun-construction time.

The FontPrefs record is inert once constructed, so one approach to worker-thread use would
be to make it refcounted, and have the worker hold a strong reference to the record it's using,
so that it won't be affected if the main thread handles a pref-change and replaces its
FontPrefs. Alternatively, maybe we can just protect access with the same lock as other uses
of the font list, once that is in place (bug 1756474).

Differential Revision: https://phabricator.services.mozilla.com/D140914
2022-03-13 09:58:40 +00:00
Andrew McCreight
3f169d905a Bug 1758549, part 2 - Guard a few more entry points into VRManager. r=jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D140785
2022-03-12 15:30:37 +00:00
Andrew McCreight
a9eb9ba571 Bug 1758549, part 1 - Check that WebVR is enabled before creating PVR, PVRGPU and PVRLayer actors. r=jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D140784
2022-03-12 15:30:37 +00:00
Norisz Fay
082c5e7d80 Backed out 2 changesets (bug 1758549) for causing wpt leakcheck failures CLOSED TREE
Backed out changeset bf1b56a58eff (bug 1758549)
Backed out changeset 13be61e5ccd3 (bug 1758549)
2022-03-11 22:41:56 +02:00
Lee Salzman
8003ac22fc Bug 1758736 - Fix debug assert in textureLinearUnpackedRG16. r=bradwerth
Differential Revision: https://phabricator.services.mozilla.com/D140824
2022-03-11 17:57:17 +00:00
Andrew McCreight
67974ecbc3 Bug 1758549, part 2 - Guard a few more entry points into VRManager. r=jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D140785
2022-03-11 16:43:31 +00:00
Andrew McCreight
d886e818fb Bug 1758549, part 1 - Check that WebVR is enabled before creating PVR, PVRGPU and PVRLayer actors. r=jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D140784
2022-03-11 16:43:31 +00:00
Mark Banner
8bb4667fae Bug 1758474 - Implement an ESLint rule to disallow passing {} as the target parameter for ChromeUtils.import. r=Gijs,mossop,perftest-reviewers,preferences-reviewers,sparky
Differential Revision: https://phabricator.services.mozilla.com/D140517
2022-03-11 16:41:29 +00:00
Florian Quèze
1340e35255 Bug 1759144 - Avoid crashing when adding the ClearAnimation profiler marker if the animation is not found, r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D140844
2022-03-11 16:00:50 +00:00
Lee Salzman
2cbc657add Bug 1758555 - Share font keys across multiple namespaces within a Renderer. r=nical,gfx-reviewers
This replaces the sharing of SharedFontInstanceMap with a new structure
SharedFontResources that can be used to trade a mechanism between threads
of a single Renderer instance for de-duplicating fonts and font instances.

SharedFontResources stores maps of FontTemplates and FontInstances as well
as a new FontKeyMap and FontInstanceKeyMap which handles the mapping of
namespace-local font keys to a shared key. The shared key then maps to
the real, de-duplicated resource (template or instance) which has a lifetime
beyond that of any individual namespace that may refer to it. Reference
counting is used to track the lifetime of the shared key so that when no key
map entries refer to the shared key any longer, it will then expire and
be cleaned up. This does cause some complications with clearing a namespace
in that rather than simply crawling through a table looking for resources
with a given IdNamespace, we have to check for shared keys that have expired
when clearing a namespace caused the last references to their mappings
to be removed.

Given that ApiResources handles the up-front addition of font templates
and instances, while ResourceCache within the RenderBackend handles deletion,
most of these mappings have to be shared between threads, which is why they
live within SharedFontResources. When resource updates are processed by
either ApiResources or ResourceCache, we create a shared key as necessary to
add the font resource, and then delete the shared font resource when a resource
update caused the last reference to the resource's shared key to expire.

This only tries to de-duplicate fonts within a single Renderer (window). Since
each Renderer has its own texture cache and dependent glyph cache, sharing
across multiple windows would require extra complication with storing font
bitmaps outside of the texture cache and outside the Renderer instance itself.
For the sake of simplicity and to better understand how de-duplication impacts
performance, this patch only tries to address sharing within a single window.

Differential Revision: https://phabricator.services.mozilla.com/D140561
2022-03-11 10:15:02 +00:00
Lee Salzman
a1ba0b4ade Bug 1758968 - Clip drawing in DrawTargetD2D1::DrawSurfaceWithShadow. r=gfx-reviewers,nical
DrawSurfaceWithShadow is supposed to ignore transforms but still support clipping.
It appears that DrawTargetD2D1 for some reason never actually implemented clipping.

The DrawImage calls on the DC just need to happen within the bounds of PrepareForDrawing
and FinalizeDrawing. Since PrepareForDrawing handles the overriding of the blend mode
via SetPrimitiveBlend, we need to use DrawImage with D2D1_COMPOSITE_MODE_SOURCE_OVER
so that it will blend appropriately.

Differential Revision: https://phabricator.services.mozilla.com/D140798
2022-03-11 10:02:07 +00:00
Lee Salzman
eb9953e3f6 Bug 1758127 - Don't use tight bounding rect if glyph transform fails. r=jnicol
Differential Revision: https://phabricator.services.mozilla.com/D140746
2022-03-11 08:06:39 +00:00
Florian Quèze
9fbf6f9b14 Bug 1757202 - Add the browser window inner id to the SetDisplayList, CompositeToTarget and SkippedComposite profiler markers, r=mstange.
Depends on D139733

Differential Revision: https://phabricator.services.mozilla.com/D140748
2022-03-11 07:49:06 +00:00
Florian Quèze
43b1fb6ca1 Bug 1757202 - Add SetAnimation, SampleAnimation and ClearAnimation markers on the compositor thread, r=mstange.
Differential Revision: https://phabricator.services.mozilla.com/D139733
2022-03-11 07:49:05 +00:00
Florian Quèze
e199a5a9b2 Bug 1757202 - Expose CompositorThreadHolder::GetThreadId to make it easy to add profiler markers on the compositor thread from any thread, r=mstange.
Differential Revision: https://phabricator.services.mozilla.com/D139732
2022-03-11 07:49:05 +00:00
Florian Quèze
9c9aca9d89 Bug 1757202 - Include the inner window id in the existing Composite markers, r=mstange.
Differential Revision: https://phabricator.services.mozilla.com/D139731
2022-03-11 07:49:05 +00:00
Florian Quèze
253d6198c8 Bug 1757202 - Make the inner window id of the browser window available in the compositor bridge, r=mstange.
Differential Revision: https://phabricator.services.mozilla.com/D139730
2022-03-11 07:49:04 +00:00
sotaro
c7c684492c Bug 1758865 - Add Feature::VIDEO_OVERLAY r=gfx-reviewers,lsalzman
With Feature::VIDEO_OVERLAY, we could know if video overlay is enabled from about:support.

Differential Revision: https://phabricator.services.mozilla.com/D140706
2022-03-10 23:58:18 +00:00
Andrew McCreight
ee28cac74e Bug 1758776 - Replace the unused mVRDisplayID with a bool. r=jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D140699
2022-03-10 17:40:43 +00:00
Lee Salzman
f3b77352e6 Bug 1758736 - Support RG16 textures in SWGL. r=bradwerth
Differential Revision: https://phabricator.services.mozilla.com/D140716
2022-03-10 16:36:05 +00:00
Nicolas Silva
903c8589d6 Bug 1758156 - Check that the webgpu pref is enabled when creating PWebGPUParent. r=aosmond
A better solution would check against the same value as reported by gfxConfig, which takes the pref as well as whether webgpu was blocked (for example due to buggy drivers) into account, but this still is good sanity check and easy to uplift.

Differential Revision: https://phabricator.services.mozilla.com/D140535
2022-03-10 10:32:34 +00:00
smolnar
e89faa903f Backed out changeset 5018856d8fee (bug 1758474) for causing node eslint failure. CLOSED TREE 2022-03-10 11:58:45 +02:00
Mark Banner
fe937b78bd Bug 1758474 - Implement an ESLint rule to disallow passing {} as the target parameter for ChromeUtils.import. r=Gijs,mossop,perftest-reviewers,preferences-reviewers,sparky
Differential Revision: https://phabricator.services.mozilla.com/D140517
2022-03-10 09:25:28 +00:00
Lee Salzman
6f0be8c19f Bug 1757067 - Explicitly specify chroma subsampling scheme for YCbCr data. r=jgilbert,jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D139656
2022-03-10 09:24:15 +00:00
smolnar
97f77f8381 Backed out changeset 36c6350bc7d1 (bug 1757067) for causing build bustages in gfx/gl/GLBlitHelperD3D.cpp CLOSED TREE 2022-03-10 10:10:10 +02:00
Lee Salzman
a664a6d305 Bug 1757067 - Explicitly specify chroma subsampling scheme for YCbCr data. r=jgilbert,jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D139656
2022-03-10 07:48:53 +00:00