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

9745 Коммитов

Автор SHA1 Сообщение Дата
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 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
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
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
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
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
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
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
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
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
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
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
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 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
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
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
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
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
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 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
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
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
Jonathan Kew e0c4a32c6e Bug 1794298 - Improve font-selection heuristics so that Twemoji-Mozilla keycaps (in emoji style) work as expected. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D168401
2023-02-01 13:25:39 +00:00
Jonathan Kew 7585dcd59a Bug 1813987 - Remove direct ICU usage from gfxFontGroup; rely on intl::String API instead. r=platform-i18n-reviewers,gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D168359
2023-01-31 18:56:53 +00:00
Tom Schuster e1d65f08eb Bug 1811863 - Replace the remaining users of privacy_resistFingerprinting(). r=tjr
Differential Revision: https://phabricator.services.mozilla.com/D168081
2023-01-30 21:37:04 +00:00
Jonathan Kew b927eaab86 Bug 1724892 - Implement the font-synthesis-{weight,style,small-caps} longhand properties, and make font-synthesis into a shorthand. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D167480
2023-01-29 13:25:31 +00:00
sotaro d55f5ec846 Bug 1810097 - Support AHardwareBuffer of out-of-process WebGL on Android r=lsalzman,gfx-reviewers
Modify AHardwareBuffer implementation as to support gl::SharedSurface of out-of-process WebGL. And remove unused AHardwareBuffer implementation.

By limiting AHardwareBuffer only in GPU process, AHardwareBuffer implementation becomes simpler. We do not need to handle cross process AHardwareBuffer delivery and cross process android Fence delivery.

Differential Revision: https://phabricator.services.mozilla.com/D167911
2023-01-27 21:35:26 +00:00
Jonathan Kew 2d4285c3c9 Bug 1363454 - Create a pref to list icon font families that should be used even when use_document_fonts=0, overriding the browser's font prefs. r=emilio,dholbert
Some widely-used icon fonts use ligature rules to replace icon names such as "volume_up"
or "down_arrow" with icon glyphs. If the site is designed to use such a font, but the user
disables document fonts and we use our default Latin font instead, the underlying text will
be rendered instead of the intended icon.

To enable such fonts to continue to work, we provide a list of known ligature-icon fonts
and allow them to be used even when the document-fonts setting is disabled.

Differential Revision: https://phabricator.services.mozilla.com/D167923
2023-01-27 17:32:54 +00:00
Jonathan Kew e9adaa9c22 Bug 1812676 - Improve font-style:oblique mapping to 'slnt' variation. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D167989
2023-01-27 13:32:19 +00:00
Jamie Nicol 33a176e4f3 Bug 1810693 - Disable robust buffer access on Adreno 620 devices. r=gfx-reviewers,nical
A long time ago we blocked this on Adreno 630 due to causing strange
shader linking errors. We have recently discovered that this can also
affect Adreno 620 devices too.

Differential Revision: https://phabricator.services.mozilla.com/D167941
2023-01-26 14:31:11 +00:00
Jonathan Kew b9dbd7a04b Bug 1803154 - Back out changeset c1b0ce76a51b (bug 1801512) because it seems to have made things worse for a number of users. r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D167615
2023-01-24 10:03:49 +00:00
sotaro 53393b26d4 Bug 1811160 - Disable out-of-process WebGL and accelerated canvas when GPU process does not exists on android r=gfx-reviewers,lsalzman
On Android, GPU process exists by default. When GPU process does not exist, an error should disable GPU process.

On Android, WebGL handling process could easily crash. The crash could trigger disable GPU process. Current out-of-process WebGL implementation creates WebGLParent in parent process. Then a crash in parent process could be triggered by WebGL. Then it seems better to disable out-of-process WebGL when GPU process does not exist.

And it seems also better to disable accelerated canvas, since it uses WebGL for acceleration.

Differential Revision: https://phabricator.services.mozilla.com/D167512
2023-01-24 06:05:13 +00:00
Csoregi Natalia f822f99642 Backed out 6 changesets (bug 1799258) for failures on gfx.color_management.display_profile. CLOSED TREE
Backed out changeset 22351f36b74b (bug 1799258)
Backed out changeset 9bbbe3ed2794 (bug 1799258)
Backed out changeset e05c809f58d0 (bug 1799258)
Backed out changeset 791eeb52f034 (bug 1799258)
Backed out changeset 353ef4721bba (bug 1799258)
Backed out changeset b5157d950aa7 (bug 1799258)
2023-01-24 02:08:51 +02:00
Kelsey Gilbert 9e2d016bd4 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-01-23 22:13:17 +00:00
Emilio Cobos Álvarez 90e1d8d837 Bug 1809126 - Remove moz-fonttable protocol. r=jfkthame,necko-reviewers
We only use it to generate a dummy URI for SVG-in-Opentype documents. We
don't really need the URIs to be unique or anything in practice.

I noticed this code while looking at the load flags set up for
bug 1809006.

Differential Revision: https://phabricator.services.mozilla.com/D166291
2023-01-20 18:41:16 +00:00
Jonathan Kew f17f8c8ec4 Bug 1811471 - Merge Hiragana and Katakana scripts for text-shaping purposes, to allow kerning across both alphabets. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D167402
2023-01-20 18:26:29 +00:00