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

44613 Коммитов

Автор SHA1 Сообщение Дата
Makoto Kato 9aca857df0 Bug 1813573 - Part 1. Clean up AndroidVsyncSource to get current refresh rate when enabling vsync. r=geckoview-reviewers,owlish
Newer Android supports multiple refresh rate that is dynamically changed.
Actually, GeckoView will always pass the refresh rate value to vsync when
getting it first time.

So this fix changes that GeckoView gets the refresh rate when vsync is started.

Differential Revision: https://phabricator.services.mozilla.com/D168665
2023-03-01 03:12:31 +00:00
Hiroyuki Ikezoe e458d4423f Bug 1817126 - Implement GetUnsnappedLayoutScrollRange and use it in WantAsyncScroll. r=tnikkel
Depends on D170465

Differential Revision: https://phabricator.services.mozilla.com/D170466
2023-03-01 03:11:37 +00:00
Marian-Vasile Laza 6c1f72e279 Backed out 2 changesets (bug 1817126) for wpt failures on scrollable-overflow-zero-one-axis.html. CLOSED TREE
Backed out changeset 1a1fa9a635b8 (bug 1817126)
Backed out changeset 0a1f7b5bed45 (bug 1817126)
2023-03-01 04:51:48 +02:00
Glenn Watson 3844186dc3 Bug 1819224 - Fix buffer size bug in gpu-buffer r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D171167
2023-03-01 00:13:08 +00:00
Brad Werth 75eeec6a99 Bug 1768495 Part 4: Disable window occlusion tracker pref on crashtests that rely on a running compositor. r=emilio
These crashtests rely upon either a requestAnimationFrame callback or a
MozAfterPaint event. Those currently won't happen when the compositor is
paused, and on Windows these crashtests are occluded, which will now pause
the compositor. To deal with this, we disable the occlusion tracking pref
on Windows. Other platforms seem not to treat the crashtests as occluded,
so their compositors keep running.

Differential Revision: https://phabricator.services.mozilla.com/D171137
2023-02-28 23:04:54 +00:00
Hiroyuki Ikezoe bf9d5b4f09 Bug 1817126 - Implement GetUnsnappedLayoutScrollRange and use it in WantAsyncScroll. r=tnikkel
Depends on D170465

Differential Revision: https://phabricator.services.mozilla.com/D170466
2023-02-28 22:19:24 +00:00
Daniel Holbert 25409964a2 Bug 1818157: Backout changeset 510d250fd545 (bug 1814398) and e44b3ab61ae4 (bug 1817212) for introducing a performance regression. CLOSED TREE 2023-02-28 11:23:00 -08:00
Glenn Watson db38a6636e Bug 1818400 - Optimize primitive dependency checks in picture caching. r=gfx-reviewers,ahale
The main goal of this is to fix an implementation detail where the
WR code had to read every primitive in the tile even when checking
if a small sub-tile was valid (as the advance amounts of the
primitive dependency array vectors was stored in each primitive).

However, this patch itself is quite a significant optimization, it
improves displaylist_mutate by ~16%.

Instead of maintaining separate arrays for each dependency, use
a single byte array and use peek-poke to store these dependencies.

This simplifies the code for comparing dependencies, and makes the
traversal of sparse index buffers of the primitive array much faster.

Differential Revision: https://phabricator.services.mozilla.com/D170710
2023-02-28 19:52:41 +00:00
Chris H-C 319a2387c2 Bug 1816454 - Update Glean SDK to v52.3.0 r=TravisLong,supply-chain-reviewers,emilio
Also update some FOG tests that are now incorrect (label limits have been
lifted).

The `default_features = false` on `env_logger` are to avoid a new, duplicate
dependency on hermit-abi.

Differential Revision: https://phabricator.services.mozilla.com/D170816
2023-02-28 16:44:02 +00:00
Sandor Molnar c7778b99c0 Backed out changeset 1c6351a80663 (bug 1819097) for causing macOS bc failures in security/sandbox/test/browser_bug1393259.js CLOSED TREE 2023-02-28 19:07:51 +02:00
Jonathan Kew 988a2a4cab Bug 1819097 - Avoid repeating InitFontList due to RegisteredFontsChanged notification during startup on macOS. r=gfx-reviewers,lsalzman
During font-list initialization, we call Core Text to "activate" the supplemental language fonts,
and potentially any bundled fonts shipped with the app. But this generates an OS notification,
which if we process it will cause a redundant rebuild of our list. So to avoid this, set a flag
when we activate the fonts, telling us that the upcoming notification can be ignored.

Differential Revision: https://phabricator.services.mozilla.com/D171205
2023-02-28 10:36:59 +00:00
Jed Davis 3219af97cc Bug 1763625 - Refactor how we access child process handles. r=nika,media-playback-reviewers,karlt
Differential Revision: https://phabricator.services.mozilla.com/D169777
2023-02-28 03:41:51 +00:00
Lee Salzman a3fb56e5ce Bug 1818929 - Don't disable THREADSAFE_GL for X11, but leave stack size fixes from bug 1777849. r=aosmond,gfx-reviewers
Running WebGL on the Renderer thread is causing inexplicable browsertime harness failures. Since there is
still contention with the main thread, moving WebGL work from the CanvasRenderer thread to the Renderer
thread probably has only a small impact on the incidence of bug 1777849.

However, there were other stack size issues fixed there, so we want to leave the stack size fixes in
place.

Differential Revision: https://phabricator.services.mozilla.com/D171147
2023-02-27 22:57:43 +00:00
Csoregi Natalia 43c5854833 Backed out changeset dc92467cea22 (bug 1763625) for causing memory-related crashes and failures. CLOSED TREE 2023-02-28 00:52:22 +02:00
Dan Robertson 73fa554e54 Bug 1743045 - Respect general.smoothScroll for programmatic scrolls. r=hiro
For programmatic scrolls, we should respect a users general.smoothScroll
preference. If smooth scrolls are disabled, programmatic scrolls with
behavior: "smooth" should be treated as instant programmatic scrolls.

Differential Revision: https://phabricator.services.mozilla.com/D170110
2023-02-27 21:09:06 +00:00
Jed Davis 1015aea40b Bug 1763625 - Refactor how we access child process handles. r=nika,media-playback-reviewers,karlt
Differential Revision: https://phabricator.services.mozilla.com/D169777
2023-02-27 20:32:51 +00:00
Stanca Serban 8917a2896e Backed out changeset aba2a1dc6802 (bug 1816454) for causing PNGEncoder related build bustages. CLOSED TREE 2023-02-27 16:42:40 +02:00
Chris H-C 68d8ce8104 Bug 1816454 - Update Glean SDK to v52.3.0 r=TravisLong,supply-chain-reviewers
Also update some FOG tests that are now incorrect (label limits have been
lifted).

Differential Revision: https://phabricator.services.mozilla.com/D170816
2023-02-27 14:04:03 +00:00
stransky 2bdae35320 Bug 1809026 [Linux] Move global DMABufSurface management from VideoFrameSurface to DMABUFSurfaceImage r=alwu
Right now we add global reference to DMABufSurface in VideoFrameSurface when it's allocated by decoder and release it when DMABUFSurfaceImage deleted by MediaSupervisor.
It's not very obvious so in this patch we move DMABufSurface references to DMABUFSurfaceImage only, we add global ref when DMABufSurface is put to DMABUFSurfaceImage
and unref when DMABUFSurfaceImage is deleted.

Differential Revision: https://phabricator.services.mozilla.com/D170625
2023-02-27 11:20:34 +00:00
stransky 626d67ee7b Bug 1809026 [Linux] Implement fast DMABuf WebGL textures upload r=jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D167240
2023-02-27 11:20:09 +00:00
sotaro c28b3ba4ed Bug 1818685 - Disable video overlay if mVideoSwapChain->Present() is very slow on Windows r=gfx-reviewers,lsalzman
There were cases that mVideoSwapChain->Present() took long time. It caused low fps and stuttering and lots of dropped frames. When it happens, disabling video overlay could address the problem.

Differential Revision: https://phabricator.services.mozilla.com/D171039
2023-02-27 05:29:24 +00:00
Lee Salzman 646e8918c1 Bug 1777849 - Disable FEATURE_THREADSAFE_GL on X11 and GLX. r=gfx-reviewers,ahale,aosmond
LibX11 versions prior to 1.7 have a race condition that made it unsafe to use
in multiple threads. Since Firefox 104, we created a CanvasRender thread that
is used to service WebGL commands off the Renderer thread so that WebGL does
not block WebRender. If WebGL uses GLX, this can lead us to using GLX on the
two different threads. In combination with an unsafe version of libX11, this
can lead to severe instability.

Further evidence points to the fact that the fix in 1.7 may have caused further
crashes that were not resolved until 1.7.4. Yet other reports indicate other
drivers than Mesa may still have issues even after 1.7.4. Ultimately, there
may be no safe version of libX11 to use right now.

However, GLX, which uses libX11, is considered legacy at this point, with many
users transitioning to EGL instead. It seems reasonable to not allow GLX to be
used from multiple threads at all, unless overridden by a pref, to work around
this.

We already have a FEATURE_THREADSAFE_GL in place to denote this, which was
currently used mainly for Nouveau which is also unsafe to use on multiple
threads. If this feature fails, the CanvasRender thread is not used, and
all WebGL commands go back to being on the Renderer thread as normal, avoiding
the problem.

A further snag is that recent ANGLE updates required a larger CanvasRenderer
thread stack size to avoid exhausting the stack. This patch uncovers the fact
that the Renderer and Compositor threads did not similarly have their stack
sizes adjusted in case WebGL is running on those threads instead.

Differential Revision: https://phabricator.services.mozilla.com/D170992
2023-02-25 22:49:51 +00:00
Stanca Serban ebf9b1f7bd Backed out changeset 42afa6604694 (bug 1777849) for causing build bustages in RenderThread.cpp. CLOSED TREE 2023-02-26 00:42:52 +02:00
Lee Salzman ada52201da Bug 1777849 - Disable FEATURE_THREADSAFE_GL on X11 and GLX. r=gfx-reviewers,ahale,aosmond
LibX11 versions prior to 1.7 have a race condition that made it unsafe to use
in multiple threads. Since Firefox 104, we created a CanvasRender thread that
is used to service WebGL commands off the Renderer thread so that WebGL does
not block WebRender. If WebGL uses GLX, this can lead us to using GLX on the
two different threads. In combination with an unsafe version of libX11, this
can lead to severe instability.

Further evidence points to the fact that the fix in 1.7 may have caused further
crashes that were not resolved until 1.7.4. Yet other reports indicate other
drivers than Mesa may still have issues even after 1.7.4. Ultimately, there
may be no safe version of libX11 to use right now.

However, GLX, which uses libX11, is considered legacy at this point, with many
users transitioning to EGL instead. It seems reasonable to not allow GLX to be
used from multiple threads at all, unless overridden by a pref, to work around
this.

We already have a FEATURE_THREADSAFE_GL in place to denote this, which was
currently used mainly for Nouveau which is also unsafe to use on multiple
threads. If this feature fails, the CanvasRender thread is not used, and
all WebGL commands go back to being on the Renderer thread as normal, avoiding
the problem.

A further snag is that recent ANGLE updates required a larger CanvasRenderer
thread stack size to avoid exhausting the stack. This patch uncovers the fact
that the Renderer and Compositor threads did not similarly have their stack
sizes adjusted in case WebGL is running on those threads instead.

Differential Revision: https://phabricator.services.mozilla.com/D170992
2023-02-25 22:20:50 +00:00
Jonathan Kew 448dfffea4 Bug 1818412 - Flip the y-axis in GetFontExtents, to match gecko's coordinate space. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D170746
2023-02-25 20:59:45 +00:00
Jonathan Kew f1f7bf044d Bug 688193 - Remove call to CTFontManagerSetAutoActivationSetting from the startup path on macOS. r=gfx-reviewers,lsalzman
It shouldn't be necessary to do this at startup, only on first use of LookupLocalFont.
(We can also simplify things a bit: now that we don't support pre-10.6 systems where
the symbol wasn't present, we don't need to do a runtime dlsym() check.)

Differential Revision: https://phabricator.services.mozilla.com/D170998
2023-02-25 20:58:23 +00:00
Timothy Nikkel b9ea148a58 Bug 1818674. r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D170847
2023-02-24 23:41:33 +00:00
sotaro f0340b38bf Bug 1818637 - Backout Bug 1817709 r=gfx-reviewers,bradwerth
The problem of Bug 1817269 happens also on Win 11. Then we do not have enough reason to block video overlay on Win10.

Differential Revision: https://phabricator.services.mozilla.com/D170835
2023-02-24 01:41:42 +00:00
Jonathan Kew aeec9224a6 Bug 688085 - Remove IDL method nsIFontEnumerator::UpdateFontList; just call gfxPlatform directly from widget/windows code where needed. r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D170328
2023-02-23 21:45:12 +00:00
Jonathan Kew d1c5009e61 Bug 1818488 - Hoist access to gfxContext::GetTextDrawer() out of the glyph-rendering inner loop. r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D170749
2023-02-23 21:44:34 +00:00
Jonathan Kew bf67e143fd Bug 1817854 - Update harfbuzz to release 7.0.1. r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D170811
2023-02-23 21:43:47 +00:00
Erich Gubler 19553e0a37 Bug 1817271: fix ordering of WebGPU feature toggling when blocklisted r=webgpu-reviewers,jimb
In `gfx/config/gfxFeature.{h,cpp}`, it can be observed that a `mozilla::gfx::FeatureState` is
a state machine that collects different "levels" of enabled-ness. To summarize[^1], these are:

1. Default
2. User
3. Environment
4. Runtime

The rules for initializing each of these layers are basically that:

1. At least (1) must be initialized, otherwise, the feature is "unused".
2. Other levels may only be initialized (or re-initialized) if (a) all previous levels were
    initialized, and (b) no subsequent levels are initialized. Otherwise, throw an assertion
    error.

In the bug we're fixing here, we were attempting to configure the environment level before the user
level, which violates rule 2. Oops! Make sure we init the user level before initting the
environment level.

[^1]: You can find a better description of the intent of each layer at <https://searchfox.org/mozilla-central/rev/75da1dd5d4b9b991f919a41594194eab93cdef62/gfx/config/gfxFeature.h#147-155>.

Differential Revision: https://phabricator.services.mozilla.com/D170764
2023-02-23 17:41:14 +00:00
Brad Werth db56ec4f1f Bug 1817691: Make nsNativeLayerCA clean up rounding errors in update regions. r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D170767
2023-02-23 17:24:44 +00:00
stransky e42ac0d5d9 Bug 1813407 Get widget size only once in RenderCompositorSWGL r=lsalzman
- Get widget size in RenderCompositorSWGL::BeginFrame() and save it for further use. That prevents flickering/artifacts if compositor widget size is changed during rendering.
- Request full screen update when widget size changes on Wayland.

Differential Revision: https://phabricator.services.mozilla.com/D169905
2023-02-23 10:52:14 +00:00
Jamie Nicol f90dfc0c14 Bug 1795592 - Allow wrench to run on recent Android versions. r=gbrown
To run webrender's wrench tests the app needs to read a file to parse
the command line args from, and write a file with the test
output. These files also need to be written and read manually over adb
by the engineer running the tests (or more likely by the
android_wrench.py script).

Currently we use the external data dir for these files. However, on
recent android versions these are no longer accessible to the app
without jumping through some hoops. This patch makes us instead use
the internal data dir. It also makes the app "debuggable" so that
these files can be written to via adb using run-as.

Additionally, we must ensure that the android_wrench.py script uses
run-as instead of root to push and pull the files, as root does not
have permission to do so on recent android versions.

Differential Revision: https://phabricator.services.mozilla.com/D169829
2023-02-23 10:04:34 +00:00
Csoregi Natalia dd188e11f2 Backed out changeset 05981db2f726 (bug 1743045) for causing failures on test_group_scrollend.html. CLOSED TREE 2023-02-23 04:23:40 +02:00
Dan Robertson 8ac30ce878 Bug 1743045 - Respect general.smoothScroll for programmatic scrolls. r=hiro
For programmatic scrolls, we should respect a users general.smoothScroll
preference. If smooth scrolls are disabled, programmatic scrolls with
behavior: "smooth" should be treated as instant programmatic scrolls.

Differential Revision: https://phabricator.services.mozilla.com/D170110
2023-02-22 23:26:18 +00:00
Jonathan Kew 754f254acb Bug 1818224 - Make most things in nsFontMetrics const. r=gfx-reviewers,bradwerth
Differential Revision: https://phabricator.services.mozilla.com/D170664
2023-02-22 18:11:34 +00:00
Iulian Moraru a6d122dc1c Backed out changeset 2ddeecc9100b (bug 1168182) for causing mochitest failures on test_wheel_scroll.html. CLOSED TREE 2023-02-22 21:32:15 +02:00
Dan Robertson e03ea6d72f Bug 1168182 - Bind wheel event targets to wheel transactions. r=masayuki,smaug
- Create wheel transactions for wheel events handled by APZ.
 - Group wheel events with the current wheel transaction, so that all
   wheel events in a wheel transaction are fired to the same element.
 - Store the current event target for the first event in a wheel
   transaction to be used for subsequent events.
 - Add the dom.event.wheel-event-groups.enabled preference as a feature
   flag for this behavior.

Differential Revision: https://phabricator.services.mozilla.com/D163484
2023-02-22 16:57:05 +00:00
Jonathan Kew c487d17dbb Bug 1818149 - Hoist access to textDrawer->GeckoClipRect() out of the inner DrawOneGlyph method. r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D170578
2023-02-22 08:40:18 +00:00
Glenn Watson 986d097472 Bug 1818115 - Make FrameId be explicit u64 rather than usize r=gfx-reviewers,bradwerth
Simplifies some upcoming work to change how we store these when
updating primitive dependencies during picture cache updates.

Differential Revision: https://phabricator.services.mozilla.com/D170546
2023-02-22 03:59:32 +00:00
sotaro 75da1dd5d4 Bug 1817709 - Block video overlay with non-intel GPUs on Windows 10 r=jrmuizel,gfx-reviewers
Video overlay does not work well with non-intel GPUs on Windows 10. See Bug 1817269, Bug 1817617.

Differential Revision: https://phabricator.services.mozilla.com/D170311
2023-02-22 01:54:27 +00:00
Butkovits Atila d434d2fc49 Backed out changeset c33204e69e49 (bug 1743045) for causing failures at scroll-behavior-3.html. CLOSED TREE 2023-02-22 01:15:14 +02:00
Nicolas Silva ead11be6ca Bug 1817829 - Update wgpu to revision 74303308cd6030071889e865c40aa638214ed938. r=webgpu-reviewers,teoxoy
Depends on D170492

Differential Revision: https://phabricator.services.mozilla.com/D170493
2023-02-21 22:36:51 +00:00
Nicolas Silva 1e1d5892c3 Bug 1817829 - Don't enable wgpu's renderdoc feature by default. r=webgpu-reviewers,supply-chain-reviewers,teoxoy
It is unclear that we want it enabled for all users and this way we don't have to audit the changes in renderdoc-sys.
We can and should revisit this in the future if we feel like it would be useful to ship with webgpu+renderdoc integration.

Differential Revision: https://phabricator.services.mozilla.com/D170492
2023-02-21 22:36:50 +00:00
Dan Robertson 69572ca871 Bug 1743045 - Respect general.smoothScroll for programmatic scrolls. r=hiro
For programmatic scrolls, we should respect a users general.smoothScroll
preference. If smooth scrolls are disabled, programmatic scrolls with
behavior: "smooth" should be treated as instant programmatic scrolls.

Differential Revision: https://phabricator.services.mozilla.com/D170110
2023-02-21 22:02:11 +00:00
Andrew Osmond e69fa7da55 Bug 1818047 - Add prefs to control WebRender scissored cache clears. r=gfx-reviewers,jrmuizel
This patch adds two new prefs, gfx.webrender.scissored-cache-clears
.enabled and .force-enabled to control its status beyond the blocklist.
The former is true by default and allows one to turn the feature off by
flipping it to false. The latter allows one to force the feature on even
if the blocklist disables it. It also adds the status to the decision
log in about:support.

Differential Revision: https://phabricator.services.mozilla.com/D170507
2023-02-21 20:50:58 +00:00
Brad Werth e452df9d3b Bug 1808155 Part 1: Make NativeLayerCA VIDEO_LOG more useful. r=mac-reviewers,mstange
This change makes the VIDEO_LOG only output the first surface sent to a
video layer (whether an AVSampleBufferDisplayLayer or a CALayer), and
notes whenever the video layer has been recreated. This will be helpful in
diagnosing cases degenerate cases where display of video content toggles
between a specialized video layer and a normal layer.

Differential Revision: https://phabricator.services.mozilla.com/D170154
2023-02-21 19:58:47 +00:00
Tom Schuster a809d9d021 Bug 1756175 - Implement roundRect for canvas2D. r=lsalzman,emilio
Differential Revision: https://phabricator.services.mozilla.com/D168732
2023-02-21 19:41:49 +00:00
Emilio Cobos Álvarez 627efca14c Bug 1817381 - Remove DOMWindowUtils.fullZoom. r=jfkthame,layout-reviewers,extension-reviewers,rpl,geckoview-reviewers,m_kato
Callers just want the actual full zoom, not the one including the OS
text-scale.

Android doesn't have OS zoom to begin with, so this can't change
behavior, but the desktop caller passes the usual full zoom here[1], so
we're making the behavior match.

[1]: https://searchfox.org/mozilla-central/rev/9de332d5c8faac58dc1232b8a6383ce6cb1400f4/browser/components/extensions/parent/ext-tabs.js#1011

Depends on D170196

Differential Revision: https://phabricator.services.mozilla.com/D170197
2023-02-21 17:24:00 +00:00
Stanca Serban 200dca5cfb Backed out 4 changesets (bug 1813407) for causing Linux bp-hybrid bustages in WindowSurfaceProvider.h. CLOSED TREE
Backed out changeset 897b95c7fdad (bug 1813407)
Backed out changeset aba3e370a587 (bug 1813407)
Backed out changeset 61c79624c2ab (bug 1813407)
Backed out changeset f99d85efb04c (bug 1813407)
2023-02-21 12:54:32 +02:00
stransky b429a675e0 Bug 1813407 Get widget size only once in RenderCompositorSWGL r=lsalzman
- Get widget size in RenderCompositorSWGL::BeginFrame() and save it for further use. That prevents flickering/artifacts if compositor widget size is changed during rendering.
- Request full screen update when widget size changes on Wayland.

Differential Revision: https://phabricator.services.mozilla.com/D169905
2023-02-21 09:30:10 +00:00
Marian-Vasile Laza 7ccec0b37b Backed out changeset 343daddee430 (bug 1817381) for mochitest failures on test_bug574663.html. CLOSED TREE 2023-02-21 10:41:53 +02:00
Jonathan Kew 4594ae314a Bug 1815404 - Replace most uses of gfxContext::CreateOrNull with stack-allocated contexts. r=gfx-reviewers,lsalzman
Depends on D170370

Differential Revision: https://phabricator.services.mozilla.com/D170371
2023-02-21 07:28:25 +00:00
Jonathan Kew 5b9588f1aa Bug 1815404 - Eliminate gfxContext::CreatePreservingTransformOrNull, and replace callers with stack-allocated gfxContext. r=gfx-reviewers,lsalzman
Depends on D170369

Differential Revision: https://phabricator.services.mozilla.com/D170370
2023-02-21 07:28:24 +00:00
Jonathan Kew 1b3e69f8aa Bug 1815404 - Remove refcounting from gfxContext. r=gfx-reviewers,lsalzman
Depends on D170367

Differential Revision: https://phabricator.services.mozilla.com/D170369
2023-02-21 07:28:24 +00:00
Jonathan Kew 64fac83d98 Bug 1815404 - The drawTarget wrapped by a gfxContext never changes, so doesn't need to be stored in AzureState. r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D170367
2023-02-21 07:28:23 +00:00
Emilio Cobos Álvarez 1f4a94702f Bug 1817381 - Remove DOMWindowUtils.fullZoom. r=jfkthame,layout-reviewers,extension-reviewers,rpl,geckoview-reviewers,m_kato
Callers just want the actual full zoom, not the one including the OS
text-scale.

Android doesn't have OS zoom to begin with, so this can't change
behavior, but the desktop caller passes the usual full zoom here[1], so
we're making the behavior match.

[1]: https://searchfox.org/mozilla-central/rev/9de332d5c8faac58dc1232b8a6383ce6cb1400f4/browser/components/extensions/parent/ext-tabs.js#1011

Depends on D170196

Differential Revision: https://phabricator.services.mozilla.com/D170197
2023-02-21 05:37:35 +00:00
Glenn Watson f14e041e65 Bug 1817505 - Revert enable of tiled rendering path, for now r=gfx-reviewers,lsalzman
This patch exposes an unrelated issue that causes a performance regression.

For now, we'll revert this to get back to a normal baseline. Then, separately
fix the underlying code which regresses perf, then re-land this patch.

Revert "Bug 1811978 - Enable the new tiled rendering path, update test expectations r=gfx-reviewers,nical"

This reverts commit 7f3a2568aabf9fa2358fe0f7421042ba85a23442.

Differential Revision: https://phabricator.services.mozilla.com/D170399
2023-02-21 03:38:26 +00:00
sotaro 959d11a58a Bug 1817712 - Disable Feature::WEBRENDER_DCOMP_PRESENT when GPU process is disabled r=gfx-reviewers,nical
DirectComposition Device is not created when GPU process does not exist.

Differential Revision: https://phabricator.services.mozilla.com/D170315
2023-02-21 00:05:20 +00:00
Joel Maher 2e7f0978bf Bug 1817582 - Adjust 3 apz reftest fuzzy-if for windows11. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D170273
2023-02-20 18:46:08 +00:00
Iulian Moraru 1768901d9e Backed out 3 changesets (bug 1803406) for causing wd failures.
Backed out changeset d4cfac1ac9c6 (bug 1803406)
Backed out changeset 30d9711bf362 (bug 1803406)
Backed out changeset 3e5d60c6826a (bug 1803406)
2023-02-20 19:29:55 +02:00
Jonathan Kew 8ea62ea5d1 Bug 1803406 - Use CTFontManagerRegisterFontURLs if available to register fonts. r=gfx-reviewers,lsalzman
This replaces CTFontManagerRegisterFontsForURLs, which is deprecated since macOS 10.15.

(No user-visible behavior change.)

Depends on D170287

Differential Revision: https://phabricator.services.mozilla.com/D170288
2023-02-20 12:52:44 +00:00
Jonathan Kew 343a000aca Bug 1803406 - To try and mitigate the startup impact of font initialization, move more work to the RegisterFonts thread. r=gfx-reviewers,lsalzman
No user-visible behavior change; just trying to move a bit more work onto a secondary thread,
in the hope of improving startup perf (althogh if there's too much contention for disk i/o,
or not enough CPU cores available, it may not help much).

Depends on D170286

Differential Revision: https://phabricator.services.mozilla.com/D170287
2023-02-20 12:52:44 +00:00
Jonathan Kew c87bceea83 Bug 1803406 - Register supplemental macOS fonts in content processes, to maintain font-list consistency with parent. r=gfx-reviewers,lsalzman
Local testing indicates that if we don't do this, there's a risk that Core Text will resolve font names
differently in the content vs parent processes when duplicate fonts are installed (e.g. old versions of
Arial, Helvetica, etc that some users have "inherited" from ancient systems). The mismatched fonts used
for layout (in the content process) vs painting (by the parent) lead to the "garbled text" issue.

Unfortunately, this will impact content-process startup on macOS, so expect a perf regression report.

In my local testing, this appears to prevent the "garbled text" problem when an old version of Arial is
installed, or other similar font mismatch situations. There should be no user-visible behavior change
for systems with a "clean" font installation.

Differential Revision: https://phabricator.services.mozilla.com/D170286
2023-02-20 12:52:44 +00:00
Marian-Vasile Laza cdda30073f Backed out changeset 6eb460a4025d (bug 1817582) for reftest failures on overscroll-scrollbar.html. CLOSED TREE 2023-02-18 23:20:35 +02:00
Joel Maher 8ae682b338 Bug 1817582 - Adjust 3 apz reftest fuzzy-if for windows11. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D170273
2023-02-18 17:56:21 +00:00
Brad Werth 79eee79462 Bug 1658986: Make NativeLayerCA::HandlePartialUpdate sanity-check the update area. r=mstange
This change computes the new invalid region of the in progress surface
during the partial update, and asserts that the update region is
sufficient to cover it. This will assert earlier than the asserts in
NotifySurfaceReady, under similar conditions. Hopefully this will help us
identify if we are using an incorrectly calculated update area.

Additionally, it reorganizes the region boolean logic in
NativeLayerCA::HandlePartialUpdate to avoid adding in the update region
just to subtract it away again.

It also confirms that callers to the layer are always either using the
drawn surface call (NotifySurfaceReady) or the external surface call
(AttachExternalImage).

Differential Revision: https://phabricator.services.mozilla.com/D169019
2023-02-17 17:47:03 +00:00
Brad Werth 3529711d39 Bug 1747585: Stop forcing specialized video layers due to DRM, when the OS doesn't respect DRM. r=mac-reviewers,mstange
Forcing specialized video in this case was overriding the user's ability
to opt-out by setting the pref, while providing no benefit. Adding the
macOS version check around this makes our logic here consistent with our
setting of preventsCapture in ApplyChanges.

Differential Revision: https://phabricator.services.mozilla.com/D169849
2023-02-17 16:54:00 +00:00
sotaro 0561f430e2 Bug 1817269 - Backout Bug 1798245 r=jrmuizel,gfx-reviewers
Bug 1798245 causes Bug 1817269 on Fx 110.

Differential Revision: https://phabricator.services.mozilla.com/D170151
2023-02-17 01:47:02 +00:00
Christian Holler f554b74885 Bug 1817281 - Handle wrong deallocator type in TextureHost. r=gfx-reviewers,bradwerth
Differential Revision: https://phabricator.services.mozilla.com/D170111
2023-02-16 20:08:13 +00:00
Jonathan Kew 7d98300d55 Bug 1817184 - Don't send glyphs to webrender if they're going to be entirely outside the clip rect. r=gfx-reviewers,lsalzman
This reverts the per-glyph-run optimization landed in bug 1816299, and replaces it with a per-glyph version
that will work within a long run of glyphs in a single font, as well as across the glyph runs in a mixed-font textrun.
To minimize the cost of the check, rather than retrieving individual glyph bounds, we use the overall font extents.

(Note that this uses the bounding box min/max coordinates from the 'head' table, which may exceed the typographic
ascent/descent of the font, and the advances of the glyphs; we care about the ink extents, not typographic size.)

Differential Revision: https://phabricator.services.mozilla.com/D170058
2023-02-16 17:43:21 +00:00
Jonathan Kew 3eab87d4f9 Bug 1815700 - Render COLRv1 PaintComposite operations without using PushLayerWithBlend, as it seems to be unreliable in some cases. r=gfx-reviewers,lsalzman
This seems tricky to test in CI as it doesn't reproduce consistently
(originally reported on Windows, but I haven't been able to reproduce it
there at all; but successfully repro'd and tested locally on Linux).

Differential Revision: https://phabricator.services.mozilla.com/D169935
2023-02-16 10:35:57 +00:00
Robert Longson a8753e80e6 Bug 1814398 - SVGImageElement should not derive from SVGGeometryElement r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D168674
2023-02-16 08:56:46 +00:00
Robert Longson 88d6e6fbaa Bug 1817075 - Use nsIFrame::HasAnyStateBits() whenever possible instead of GetStateBits() r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D170006
2023-02-16 08:10:28 +00:00
Fabrice Desré f21d0cd9b0 Bug 1817033 - Make MAX_SHARED_SURFACE_SIZE configurable with a preference r=gw
Differential Revision: https://phabricator.services.mozilla.com/D169975
2023-02-16 01:44:07 +00:00
Sandor Molnar ebec3db2d6 Backed out changeset f6188fe027b9 (bug 1817033) for causing webrender build bustages. CLOSED TREE 2023-02-16 03:21:59 +02:00
Fabrice Desré 4f9ae48be3 Bug 1817033 - Make MAX_SHARED_SURFACE_SIZE configurable with a preference r=gw
Differential Revision: https://phabricator.services.mozilla.com/D169975
2023-02-16 00:59:03 +00:00
Nicolas Silva b6b40b0adb Bug 1815272 - Add a pref to restric blob image size to 2048x2048. r=gfx-reviewers,gw
This is an unsavoury workaround to let the fuzzing team make progress while we are sorting through our blob layerization and sizing issues.
This adds a hidden pref "gfx.webrender.debug.restrict-blob-size", which, when set to true, clamps the size of blob images to 2048x2048.
This means that bigger blobs will render incorrectly but will be less likely to cause OOMs.

Differential Revision: https://phabricator.services.mozilla.com/D169944
2023-02-15 22:05:56 +00:00
Emilio Cobos Álvarez 27dd98b647 Bug 1816915 - Clean up EffectSet APIs. r=firefox-animation-reviewers,boris
EffectSet::GetEffectSet seems rather redundant, use just EffectSet::Get
and tweak naming of similar APIs.

Differential Revision: https://phabricator.services.mozilla.com/D169931
2023-02-15 20:39:16 +00:00
Jonathan Kew 32309ca166 Bug 1816902 - Cache resolved color-font palettes in TextRunDrawParams, to avoid re-creating them per glyphrun. r=gfx-reviewers,nical
This substantially improves performance when there are lots of
individual emoji glyphs scattered through a textrun, each resulting
in a separate glyphrun using the emoji font.

Differential Revision: https://phabricator.services.mozilla.com/D169926
2023-02-15 17:10:58 +00:00
Nicolas Silva af2b8ac379 Bug 1816781 - Update wgpu to revision b33731c44c9dd3bfb79d889e7a699c26c3929cd3. r=webgpu-reviewers,nical
Differential Revision: https://phabricator.services.mozilla.com/D169866
2023-02-15 16:45:32 +00:00
Jamie Nicol 8def89f29c Bug 1816872 - Use unscissored clear if preferrable when dirty_rect equals valid_rect. r=gfx-reviewers,nical
A consequence of the previous patch in this series, which allows
partial picture cache tile invalidation on recent Mali GPUs, is that
we will start using a scissored clear to clear the tile if the dirty
region is smaller than the entire tile. We saw in bug 1809738 that a
scissored clear can be less efficient.

If it allows us to re-render less of the tile that is probably a
worthwhile trade off. However, we frequently encounter a case where
the entire valid_rect of a tile is dirty, but that is smaller than the
entire texture. This is because our tiles are 1024x512 pixels, so for
example on a 1080 pixel wide screen, the 2nd column of tiles will only
have a valid_rect that is 56 pixels wide. In such cases, using a
scissored clear does not reduce the amount of rendering required.

This patch therefore makes it so that we use an unscissored clear (on
devices where that is preferrable) if the dirty_rect is equal to the
valid_rect.

Depends on D169890

Differential Revision: https://phabricator.services.mozilla.com/D169891
2023-02-15 15:23:57 +00:00
Jamie Nicol 2d7f1d9edc Bug 1816872 - Allow partial picture cache tile invalidation on recent Mali devices. r=gfx-reviewers,nical
We previously blocked partial picture cache tile invalidation on
Mali-T and Mali-G devices due to several bugs. These issues no longer
appear to reproduce on recent Mali GPUs: eg G77, G78, G710 which are
all "Valhall" architecture. This patch therefore keeps the workaround
for all Midgard and Bifrost GPUs, but removes it for others.

Differential Revision: https://phabricator.services.mozilla.com/D169890
2023-02-15 15:23:56 +00:00
Stanca Serban aaea911dc4 Backed out 9 changesets (bug 1799258) for causing multiple failures. CLOSED TREE
Backed out changeset 40351b5987a5 (bug 1799258)
Backed out changeset 87f3532bfbcd (bug 1799258)
Backed out changeset 9c1d9405e8bf (bug 1799258)
Backed out changeset 60a0351d9092 (bug 1799258)
Backed out changeset 5f911de66ec0 (bug 1799258)
Backed out changeset 294a00d1c7b7 (bug 1799258)
Backed out changeset 228200dcaf93 (bug 1799258)
Backed out changeset b25110652394 (bug 1799258)
Backed out changeset 3c3c7366cc40 (bug 1799258)
2023-02-15 12:18:44 +02:00
Otto Länd 387e7dda28 Bug 1799258: apply code formatting via Lando
# ignore-this-changeset
2023-02-15 08:35:44 +00:00
Kelsey Gilbert 8f95a23615 Bug 1799258 - Share all-of-dcomp.h preamble, and deal with outdated mingw dcomp.h. r=gfx-reviewers,sotaro
Mingw's dcomp.h is not the official one, but rather a by-hand
reproduction. While this newly-updated version has e.g.
IDCompositionFilterEffect, it is still missing e.g.
IDCompositionColorMatrixEffect.

Differential Revision: https://phabricator.services.mozilla.com/D168839
2023-02-15 08:29:43 +00:00
Kelsey Gilbert b60232a5ea Bug 1799258 - Ask dcomp.h to define IDCompositionFilterEffect. r=gfx-reviewers,bradwerth
Differential Revision: https://phabricator.services.mozilla.com/D168325
2023-02-15 08:29:43 +00:00
Kelsey Gilbert 5de0b6d195 Bug 1799258 - Support outByIn.size()<2 in SampleOutByIn. r=bradwerth
This makes it easier to apply transform functions, even when they are
not defined/present.

Differential Revision: https://phabricator.services.mozilla.com/D167472
2023-02-15 08:29:42 +00:00
Kelsey Gilbert f598978814 Bug 1799258 - No-op equal tfs rather than inverting. r=bradwerth
Differential Revision: https://phabricator.services.mozilla.com/D167471
2023-02-15 08:29:42 +00:00
Kelsey Gilbert 5ed1620078 Bug 1799258 - Do color-management on Windows+DComp via IDCompositionFilterEffects. r=sotaro
+ Add gfx.color_management.rec709_gamma_as_srgb:true. :'(

In particular, rec709(16/255) -> srgb(31/255). Even though it's
technically correct, it's practically-speaking incorrect, since that's
not what Chrome does, nor what the web expected for years and years.

In practice, basically everyone expects gamma to just be completely
ignored.

What people expect:
* Pretend gamut is srgb(==rec709), but stretch this naively for the
  display. If you have a display-p3-gamut display, srgb:0.5 expects to
  be displayed as display:0.5, which will be display-p3:0.5 to the eyes.
* Pretend all content gammas (TFs) are srgb(!=rec790), and then bitcast this
  naively for the display. E.g. rec709(16/255) should
  display the same as srgb(16/255), not srgb(31/255). (Note: display-p3
  uses srgb gamma) But if your display has e.g. gamma=3.0, don't
  convert or compensate.

This is a formalization of what you get when you spend decades ignoring
color management, and people build things based on behavior-in-practice,
not behavior-in-theory.

Also:
+ gfx.color_management.native_srgb:true for Windows, so we don't use the
  display color profile, which no one else does.
+ Add rec2020_gamma_as_rec709, so we have a path towards maybe having
  rec2020 use its correct transfer function, rather than srgb (like
  rec709).

Differential Revision: https://phabricator.services.mozilla.com/D161857
2023-02-15 08:29:41 +00:00
Kelsey Gilbert c68b5dd286 Bug 1799258 - Add prereq Colorspaces stuff, including generic gamma->linear LUT inversion approximation. r=gfx-reviewers,bradwerth
Differential Revision: https://phabricator.services.mozilla.com/D163664
2023-02-15 08:29:41 +00:00
Kelsey Gilbert 8a7e329c9a Bug 1799258 - [qcms] Add query for profile data and lut tables. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D163663
2023-02-15 08:29:41 +00:00
Nicolas Silva 65e3f711d5 Bug 1816480 - Update wgpu to revision 581b22e6a026ac92589be2f36a30357600f9d02c. r=webgpu-reviewers,jimb
Differential Revision: https://phabricator.services.mozilla.com/D169826
2023-02-14 20:55:39 +00:00
Jonathan Kew cbfad50a4f Bug 1816299 - Try to avoid sending entirely-clipped glyph runs to a TextDrawTarget. r=gfx-reviewers,lsalzman
Now passes reftests on try:
https://treeherder.mozilla.org/jobs?repo=try&revision=7070b443cce9740358f12b4343c438a28c5808ac

Differential Revision: https://phabricator.services.mozilla.com/D169729
2023-02-14 08:10:14 +00:00
Makoto Kato 2898d64832 Bug 1816033 - screen.orientation.type and screen.orientation.angle should return current screen's value. r=smaug
Now Windows and Linux/wayland can return screen orientation type/angle,
so we should get it from current screen instead of primary screen.

Differential Revision: https://phabricator.services.mozilla.com/D169414
2023-02-14 06:16:33 +00:00
sotaro 0458f65c76 Bug 1816055 - Remove TextureFlags::BORROWED_EXTERNAL_ID check in TextureHost::Finalize() r=gfx-reviewers,lsalzman
TextureFlags::BORROWED_EXTERNAL_ID is no longer used.

Differential Revision: https://phabricator.services.mozilla.com/D169419
2023-02-14 03:06:16 +00:00
Gijs Kruitbosch 387cf24ca0 Bug 1810141 - fix tests to deal with changes to loadURI, r=mossop,perftest-reviewers,geckoview-reviewers,extension-reviewers,sparky,owlish
Depends on D168396

Differential Revision: https://phabricator.services.mozilla.com/D168397
2023-02-13 23:50:41 +00:00
Glenn Watson 6014228391 Bug 1811978 - Enable the new tiled rendering path, update test expectations r=gfx-reviewers,nical
Differential Revision: https://phabricator.services.mozilla.com/D167630
2023-02-13 23:28:44 +00:00
Kelsey Gilbert 5098fc5842 Bug 1814745 - Don't require a browser restart to update dom.webgpu.enabled. r=jimb
about:support's feature table still shows blocklisting, just not whether
the pref is set.
If different from default, dom.webgpu.enabled still shows up in about:support under
"Important Modified Prefs" like normal.

Also renames "gfx.webgpu.force-enabled" to "gfx.webgpu.ignore-blocklist"
to reflect its functionality.

Differential Revision: https://phabricator.services.mozilla.com/D169007
2023-02-13 23:11:42 +00:00
sotaro 44e635d2e6 Bug 1816053 - Add log to VideoBridgeParent::ActorDestroy() r=gfx-reviewers,lsalzman
It would be helpful if VideoBridgeParent::ActorDestroy() has a log of AbnormalShutdown.

Differential Revision: https://phabricator.services.mozilla.com/D169418
2023-02-13 21:46:54 +00:00
sotaro efa263deb1 Bug 1816057 - Add GPUVideoTextureHost::NeedsDeferredDeletion() r=gfx-reviewers,lsalzman
NeedsDeferredDeletion() is not overridden in GPUVideoTextureHost.

Differential Revision: https://phabricator.services.mozilla.com/D169425
2023-02-13 21:23:11 +00:00
stransky 041cc19726 Bug 1816429 Check aFontSet in addFontSetFamilies() r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D169626
2023-02-13 18:45:24 +00:00
Jamie Nicol f03cafb885 Bug 1816405 - Only print source of single shader when glslopt pass fails. r=gfx-reviewers,lsalzman
If the glslopt pass fails to optimize a shader, we helpfully print the
shader source so that it is easy to find what the problem is. However,
we print this from within the build_parallel call, meaning if multiple
shaders fail to optimize we print all of their sources and they get
interleaved with each other, making it very difficult to find the
problematic line.

This patch makes us delay printing the source until the same place
where we print the error log, after we have stopped processing in
parallel. This means we will only print the source of a single
shader (the first one which fails to optimize), along with the error
log for that shader, which is much easier to debug.

This also includes a small tidy-up to handle both vertex and fragment
shaders in a loop to remove code duplication, and runs rustfmt.

Differential Revision: https://phabricator.services.mozilla.com/D169618
2023-02-13 16:30:26 +00:00
Alex Jakobi 232617570d Bug 1805851 - Add unit test for APZC::ArePointerEventsConsumable. r=dlrobertson
Differential Revision: https://phabricator.services.mozilla.com/D167375
2023-02-13 16:26:09 +00:00
Andi-Bogdan Postelnicu 6a4cfe596b Bug 1617369 - Reformat recent rust changes with rustfmt r=emilio,webdriver-reviewers,whimboo
Updated with rustfmt 1.5.1-stable (fc594f1 2023-01-24)
# ignore-this-changeset

Depends on D168658

Differential Revision: https://phabricator.services.mozilla.com/D168659
2023-02-13 15:02:07 +00:00
Andi-Bogdan Postelnicu d7e8a09c21 Bug 1519636 - Reformat recent changes to the Google coding style. r=glandium
Updated with clang-format version 15.0.5 (taskcluster-MKK8dHUpQkGfPLA793lizg)
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D168658
2023-02-13 15:02:07 +00:00
Cristina Horotan 5f4356e527 Backed out 9 changesets (bug 1810141) for several test failures on a CLOSED TREE
Backed out changeset 8781a0d1254d (bug 1810141)
Backed out changeset 131037295784 (bug 1810141)
Backed out changeset 3852fbe290f4 (bug 1810141)
Backed out changeset 118f131a524a (bug 1810141)
Backed out changeset ab5d76846e10 (bug 1810141)
Backed out changeset dce3aa683445 (bug 1810141)
Backed out changeset 4dc41d90dbb3 (bug 1810141)
Backed out changeset 50b57ba1a061 (bug 1810141)
Backed out changeset 569de94781e4 (bug 1810141)
2023-02-13 16:05:30 +02:00
Gijs Kruitbosch ff1cc20bd7 Bug 1810141 - fix tests to deal with changes to loadURI, r=mossop,perftest-reviewers,geckoview-reviewers,extension-reviewers,sparky,owlish
Depends on D168396

Differential Revision: https://phabricator.services.mozilla.com/D168397
2023-02-13 12:55:26 +00:00
Ray Kraesig fdc007af70 Bug 1816001 - allow users to disable mitigation for bug 1638709 r=gfx-reviewers,bradwerth,ahale
Bug 1638709 describes artifacts when the webrender compositor is enabled
on certain Windows systems with NVIDIA cards and mixed monitor refresh
rates. As of bug 1704954, we currently disable DirectComposition on such
systems in Beta and Release as a mitigation.

Unfortunately, on a significant (albeit not yet fully characterized)
fraction of Windows 11 machines, the fallback compositor also has
issues, resulting in bug 1763981 (clipping of web content on first
entering fullscreen). Users experiencing this latter issue have hitherto
_not_ reported the former when testing on Nightly, suggesting that the
mitigation may be getting applied overbroadly.

Add a pref to allow disabling the mitigation in question, so that users
experiencing bug 1763981, but who are not subject to 1638709, have a
less intrusive workaround than remembering to hit F11 twice every time
they start Firefox.

Differential Revision: https://phabricator.services.mozilla.com/D169389
2023-02-11 00:31:49 +00:00
Ashley Hale dfafa061c4 Bug 1816031 - Fix up example-compositor so it can be used for additional testing r=gw
Differential Revision: https://phabricator.services.mozilla.com/D169404
2023-02-11 00:27:00 +00:00
Jonathan Kew 07fba46d11 Bug 1815679 - Fix errors in mapping font-style:oblique values to the 'slnt' axis in variable fonts. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D169335
2023-02-10 09:11:01 +00:00
Jonathan Kew 6c2cb4ec55 Bug 1815679 - Account for mRangeFlags in the userfont cache key. r=emilio
This is actually a bug that pre-dates the regression here, but I haven't seen a report
of it or a specific test failure that results. However, the new WPT reftests I'm
intending to land for the slant issue do exhibit a failure until this is fixed,
so let's go ahead and do it here.

Differential Revision: https://phabricator.services.mozilla.com/D169334
2023-02-10 09:11:01 +00:00
Cristian Tuns 8335f7645c Backed out changeset fe2339f60bf1 (bug 1816001) for causing build bustages on gfxConfigManager.cpp CLOSED TREE 2023-02-09 17:48:08 -05:00
Ray Kraesig 8d967b07d5 Bug 1816001 - allow users to disable mitigation for bug 1638709 r=gfx-reviewers,bradwerth
Bug 1638709 describes artifacts when the webrender compositor is enabled
on certain Windows systems with NVIDIA cards and mixed monitor refresh
rates. As of bug 1704954, we currently disable DirectComposition on such
systems in Beta and Release as a mitigation.

Unfortunately, on a significant (albeit not yet fully characterized)
fraction of Windows 11 machines, the fallback compositor also has
issues, resulting in bug 1763981 (clipping of web content on first
entering fullscreen). Users experiencing this latter issue have hitherto
_not_ reported the former when testing on Nightly, suggesting that the
mitigation may be getting applied overbroadly.

Add a pref to allow disabling the mitigation in question, so that users
experiencing bug 1763981, but who are not subject to 1638709, have a
less intrusive workaround than remembering to hit F11 twice every time
they start Firefox.

Differential Revision: https://phabricator.services.mozilla.com/D169389
2023-02-09 22:32:06 +00:00
Razvan Cojocaru c698be2359 Bug 1815442 - Increase fuzzing on failing perma OS X tests. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D169180
2023-02-08 18:01:20 +00:00
Nicolas Silva 452651d391 Bug 1814848 - Update wgpu to revision 41de797c745d317e93b9cf50e7446faff7f65954. r=webgpu-reviewers,jimb a=reland CLOSED TREE
Differential Revision: https://phabricator.services.mozilla.com/D168928
2023-02-07 18:08:29 +00:00
Csoregi Natalia 435547cbe3 Backed out 3 changesets (bug 1814848) for causing address sanitizer fails in MOZ_Crash. CLOSED TREE
Backed out changeset 38ecc5076ab3 (bug 1814848)
Backed out changeset 7dd5ce12c5f3 (bug 1814848)
Backed out changeset 5c42f3352b26 (bug 1814848)
2023-02-07 23:10:17 +02:00
Nicolas Silva e45015e278 Bug 1814848 - Update wgpu to revision 41de797c745d317e93b9cf50e7446faff7f65954. r=webgpu-reviewers,jimb
Differential Revision: https://phabricator.services.mozilla.com/D168928
2023-02-07 18:08:29 +00:00
Jamie Nicol 428ac6de51 Bug 1814344 - Disable scissored clear optimization on all Android except SWGL. r=gfx-reviewers,jrmuizel
In bug 1809738 we found that our scissored render target clear
optimization actively hurt performance on some Mali GPUs. From testing
on a variety of Android devices, we have found that it mostly makes no
difference either way, but hurts performance on some other GPUs
too. On software webrender, however, it is still a performance win.

This patch therefore disables the optimization on all Android, apart
from when using software webrender.

Differential Revision: https://phabricator.services.mozilla.com/D169062
2023-02-07 15:21:48 +00:00
Arsen Arsenović 55b688775f Bug 1811714 - Add a few missing <cstdint> includes r=gfx-reviewers,nical
GCC 13s libstdc++ reduced its dependency on some headers like <cstdint>,
so it's no longer transitively included through various headers.
Include it explicitly.

See also: https://gcc.gnu.org/gcc-13/porting_to.html#header-dep-changes

  11:16.32 .../components/telemetry/pingsender/pingsender.cpp:30:7:
                    error: unknown type name 'uint32_t'
  11:16.33 const uint32_t kConnectionTimeoutMs = 30 * 1000;
  11:16.33       ^
  11:16.33 ... /components/telemetry/pingsender/pingsender.cpp:76:9:
                    error: unknown type name 'uint32_t'
  11:16.33   const uint32_t kBufferSize = 4 * 1024 - 1;
  11:16.34         ^
  11:16.44 2 errors generated.
  (et al)

Differential Revision: https://phabricator.services.mozilla.com/D167491
2023-02-07 07:13:32 +00:00
Razvan Cojocaru 015878d5a9 Bug 1554795 - Support desktop scrollbar thumb sizing logic in APZ. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D161561
2023-02-06 23:16:59 +00:00
Botond Ballo 3783cb10b6 Bug 1554795 - Expose the currently effective visual viewport rect. r=hiro
Similar to the other GetCurrentAsync*() functions,
GetCurrentAsyncVisualViewport() takes into account the async test
attributes as well as the frame delay.

It supersedes GetCurrentAsyncScrollOffsetInCSSPixels() which can
be obtained as the the TopLeft() of the visual viewport rect.

Differential Revision: https://phabricator.services.mozilla.com/D163148
2023-02-06 23:16:58 +00:00
Norisz Fay ed1015daf1 Backed out 9 changesets (bug 1799258) for causing build bustages CLOSED TREE
Backed out changeset a48db1421c6d (bug 1799258)
Backed out changeset 7707637480e7 (bug 1799258)
Backed out changeset 0141b29bf5df (bug 1799258)
Backed out changeset cd9af26bb314 (bug 1799258)
Backed out changeset 4e68a54c6410 (bug 1799258)
Backed out changeset 52afd24d2338 (bug 1799258)
Backed out changeset b4b4977857c7 (bug 1799258)
Backed out changeset 2c23929f52f2 (bug 1799258)
Backed out changeset 83744e1e372b (bug 1799258)
2023-02-07 00:36:41 +02:00
Otto Länd 38ce5da877 Bug 1799258: apply code formatting via Lando
# ignore-this-changeset
2023-02-06 20:02:15 +00:00
Kelsey Gilbert 987b128720 Bug 1799258 - Share all-of-dcomp.h preamble, and deal with outdated mingw dcomp.h. r=gfx-reviewers,sotaro
Differential Revision: https://phabricator.services.mozilla.com/D168839
2023-02-06 19:58:56 +00:00
Kelsey Gilbert 9bf188ddc2 Bug 1799258 - Ask dcomp.h to define IDCompositionFilterEffect. r=gfx-reviewers,bradwerth
Differential Revision: https://phabricator.services.mozilla.com/D168325
2023-02-06 19:58:55 +00:00
Kelsey Gilbert 10e1d1a8d0 Bug 1799258 - Support outByIn.size()<2 in SampleOutByIn. r=bradwerth
This makes it easier to apply transform functions, even when they are
not defined/present.

Differential Revision: https://phabricator.services.mozilla.com/D167472
2023-02-06 19:58:55 +00:00
Kelsey Gilbert 1c58e179b5 Bug 1799258 - No-op equal tfs rather than inverting. r=bradwerth
Differential Revision: https://phabricator.services.mozilla.com/D167471
2023-02-06 19:58:54 +00:00
Kelsey Gilbert 25d74c811d Bug 1799258 - Do color-management on Windows+DComp via IDCompositionFilterEffects. r=sotaro
+ Add gfx.color_management.rec709_gamma_as_srgb:true. :'(

In particular, rec709(16/255) -> srgb(31/255). Even though it's
technically correct, it's practically-speaking incorrect, since that's
not what Chrome does, nor what the web expected for years and years.

In practice, basically everyone expects gamma to just be completely
ignored.

What people expect:
* Pretend gamut is srgb(==rec709), but stretch this naively for the
  display. If you have a display-p3-gamut display, srgb:0.5 expects to
  be displayed as display:0.5, which will be display-p3:0.5 to the eyes.
* Pretend all content gammas (TFs) are srgb(!=rec790), and then bitcast this
  naively for the display. E.g. rec709(16/255) should
  display the same as srgb(16/255), not srgb(31/255). (Note: display-p3
  uses srgb gamma) But if your display has e.g. gamma=3.0, don't
  convert or compensate.

This is a formalization of what you get when you spend decades ignoring
color management, and people build things based on behavior-in-practice,
not behavior-in-theory.

Also:
+ gfx.color_management.native_srgb:true for Windows, so we don't use the
  display color profile, which no one else does.
+ Add rec2020_gamma_as_rec709, so we have a path towards maybe having
  rec2020 use its correct transfer function, rather than srgb (like
  rec709).

Differential Revision: https://phabricator.services.mozilla.com/D161857
2023-02-06 19:58:54 +00:00
Kelsey Gilbert a1c5ea24c5 Bug 1799258 - Add prereq Colorspaces stuff, including generic gamma->linear LUT inversion approximation. r=gfx-reviewers,bradwerth
Differential Revision: https://phabricator.services.mozilla.com/D163664
2023-02-06 19:58:53 +00:00
Kelsey Gilbert c5cc9f1f33 Bug 1799258 - [qcms] Add query for profile data and lut tables. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D163663
2023-02-06 19:58:53 +00:00
Jonathan Kew 0569fbd9be Bug 1801463 - Use a cursor in FlattenedPath to accelerate successive calls to ComputePointAtLength for SVG text-on-a-path layout. r=gfx-reviewers,nical
This enables my local build to achieve 60fps on the js1k demo linked from the bug,
whereas without the patch I get barely 10fps.

Note: it's still possible for ComputePointAtLength would perform poorly if
the caller is iterating backwards or doing random access to a long path.
A potential mitigation for that would be to add an mLength field to FlatPathOp,
storing the length-so-far of the path, so that ComputePointAtLength could do
a binary search instead of linear accumulation. But this would add significant
memory overhead, and may not be worth doing; the low-overhead cursor here
appears to be enough to make text-on-a-path perform much better.

Differential Revision: https://phabricator.services.mozilla.com/D168937
2023-02-06 15:01:20 +00:00
Emilio Cobos Álvarez 87568139b1 Bug 1814239 - Expose Point/Size rounded-to-multiple helpers, and use them from MaybeRoundToDisplayPixels. r=tnikkel,gfx-reviewers,nical
Turns out we already had code for this in NumericTools.h, so reuse it.

I thought I was going to need this code somewhere else though I didn't
end up needing it.

While at it clean up unnecessary template params I noticed.

Differential Revision: https://phabricator.services.mozilla.com/D168460
2023-02-06 12:28:47 +00:00
sotaro 425786bd75 Bug 1813267 - Add WebRender (Software OpenGL) handling for AndroidHardwareBufferTextureHost r=gfx-reviewers,jnicol
Implementation is borrowed from RenderAndroidSurfaceTextureHost. Since Android SurfaceTexture and AndroidHardwareBuffer use same android GraphicBuffer.

Differential Revision: https://phabricator.services.mozilla.com/D168764
2023-02-06 11:27:05 +00:00
sotaro 2f26b6d07c Bug 1811456 - Fix srcOrigin of Android SurfaceTexture Blit r=gfx-reviewers,jnicol
It is short term fix. Using SurfaceTexture.getTransform() is long term fix.

Differential Revision: https://phabricator.services.mozilla.com/D168933
2023-02-06 11:23:38 +00:00
Makoto Kato 3e6ba61292 Bug 1812938 - Part 2. FindScreen returns Screen instead of nsIScreen. r=emilio
`nsDeviceContext` isn't scriptable, it is unnecessary to return `nsIScreen`
for `FindScreen`.

Differential Revision: https://phabricator.services.mozilla.com/D168030
2023-02-06 04:51:27 +00:00
Makoto Kato a81830ccdb Bug 1812938 - Part 1. GetWidgetScreen returns Screen instead of nsIScreen. r=emilio,geckoview-reviewers,owlish
`nsIWidget` isn't scriptable, so it is unnecessary to return `nsIScreen` for
`GetWidgetScreen`.

Differential Revision: https://phabricator.services.mozilla.com/D168029
2023-02-06 04:51:26 +00:00
Emilio Cobos Álvarez 3d092ba60e Bug 1775062 - Implement ipdl reads without needing default ctors. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D149743
2023-02-04 11:12:36 +00:00
Nika Layzell 1cbf30fe37 Bug 1812156 - Part 1: Fix some IPDL statements to use fully qualified names, r=necko-reviewers,valentin
These types were used in IPDL but were not fully qualified.

Differential Revision: https://phabricator.services.mozilla.com/D168877
2023-02-04 10:44:24 +00:00
Lee Salzman 4d84b490bc Bug 1814628 - Use half-spaces to select the corner of a rounded rect. r=jrmuizel,gfx-reviewers,ahale
Currently, the rounded rect shader uses the linear distance from the corner's origin
(the ellipse origin) to select which corner to evaluate ellipse distance within. However,
this metric may fail when it believes we are currently inside multiple corners, and may
select the wrong minimal distance and thus the wrong corner. Ideally, we need to actually
compute the ellipse distance for each corner and select the minimal one, but this is
prohibitively expensive.

Instead, we use the same strategy as the SWGL span shader which is to define a half-space
plane that spans the diagonal of each corner, by which we decide if we are inside a given
corner by seeing which side of the coner diagonal's half-space plane we're on. This yields
code that is about as fast as the currently broken linear distance comparison and more
closely matches the results of the SWGL span shader as a bonus.

This also cleans up the half-space varyings to be specified in a more common plane form
of normal and offset which takes up less space while being a bit cheaper to evaluate.

Differential Revision: https://phabricator.services.mozilla.com/D168769
2023-02-04 05:48:46 +00:00
sotaro 4e27043c64 Bug 1813200 - Replace EffectNV12 creation by EffectRGB in CompositorOGL::Initialize() r=gfx-reviewers,lsalzman
EffectNV12 is not used by RenderCompositorOGLSWGL/RenderCompositorLayersSWGL. EffectRGB  is used by RenderCompositorLayersSWGL.

Differential Revision: https://phabricator.services.mozilla.com/D168771
2023-02-03 23:14:12 +00:00
Andrew Osmond e63bfec092 Bug 1789693 - Refactor gfxFont and gfxFontCache expiration tracking. r=jfkthame
This patch reverts our behaviour closer to how we worked prior to bug
1780193. Parts of bug 1780193 remain because they are necessary to
ensure there are no race conditions when interacting with the cache from
multiple threads.

Now we remove fonts from the expiration tracker when there are strong
references remaining to the object. When the last strong reference is
cleared, we readd the font to the expiration tracker. A lookup will
remove it from the tracker (and creates a strong reference). If it
expires from the tracker, it is then destroy. There are several race
conditions we need to manage because the refcount can be updated without
holding the gfxFontCache mutex.

Differential Revision: https://phabricator.services.mozilla.com/D156716
2023-02-03 19:31:46 +00:00
Jonathan Kew 55ad8c60ec Bug 1322437 - Ensure that gfxFontGroup::GetDefaultFont tries the platform list's GetDefaultFontEntry() as a last resort in all cases. r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D168782
2023-02-03 17:19:33 +00:00
sotaro 6f5040909c Bug 1814811 - Fix out-of-process WebGL rendering by RenderAndroidSurfaceTextureHost and WebRender (Software OpenGL) r=lsalzman,gfx-reviewers
2 problems existed.

- [1] RenderAndroidSurfaceTextureHost::GetUvCoords() was not called when RenderAndroidSurfaceTextureHost is wrapped by RenderTextureHostWrapper.
- [2] NeedsYFlip() of SurfaceTextureHost::CreateRenderTexture() uses TextureHost::mFlags. But TextureHost::mFlags was updated by RemoteTextureHostWrapper::ApplyTextureFlagsToRemoteTexture() after SurfaceTextureHost::CreateRenderTexture() call. Then RenderAndroidSurfaceTextureHost::mOriginPos became wrong.

[1] is addressed by adding RenderTextureHostWrapper::GetUvCoords()

[2] is addressed by removing RenderAndroidSurfaceTextureHost::mOriginPos. It is not necessary since Bug 1731980.

Differential Revision: https://phabricator.services.mozilla.com/D168763
2023-02-03 08:39:56 +00:00
sotaro 010e474c0f Bug 1813189 - Limit external compositing only to ImageRendering::Auto r=gw,gfx-reviewers
Disable external compositing if ImageRendering is not ImageRendering::Auto for now. It seems that we could not handle ImageRendering::Pixelated for video overlay on Windows.

Differential Revision: https://phabricator.services.mozilla.com/D168514
2023-02-03 01:32:03 +00:00
Jonathan Kew 4b98682338 Bug 1814651 - Cherry-pick commit 85be877 from upstream harfbuzz. r=gfx-reviewers,jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D168686
2023-02-02 18:43:54 +00:00
stransky 9e2f7a799d Bug 1799747 [Linux] Don't check VA-API feature status when it's force enabled r=emilio
Depends on D168003

Differential Revision: https://phabricator.services.mozilla.com/D168004
2023-02-02 12:28:54 +00:00
stransky 9730ae163c Bug 1799747 [Linux] Switch media_ffmpeg_vaapi_enabled() to media_ffmpeg_vaapi_enabled_AtStartup() as we don't change the setup runtime r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D168003
2023-02-02 12:28:53 +00:00