Commit graph

120 commits

Author SHA1 Message Date
Jonathan Kew
5ce9bfb3a4 Bug 1866105 - Add the font file path to the font descriptor sent to webrender on macOS. r=gfx-reviewers,lsalzman
This allows us to skip additional font registration in content processes,
as it ensures consistent resolution of the font descriptor even when there
are multiple font resources with the same psname present.

Differential Revision: https://phabricator.services.mozilla.com/D195418
2023-12-05 10:59:06 +00:00
Emilio Cobos Álvarez
c25b3b246f Bug 1862061 - Remove -moz-font-smoothing-background-color. r=gfx-reviewers,desktop-theme-reviewers,devtools-reviewers,dao,gw
See comments in the bug for reasoning. macOS hasn't used subpixel AA for
quite a while.

Emulating this macOS AA on vibrant backgrounds was the only point of
this feature.

This allows to simplify the WebRender code quite a bit, too.

Differential Revision: https://phabricator.services.mozilla.com/D192311
2023-11-01 09:14:29 +00:00
Jonathan Kew
b521628b5f Bug 1803406 - Backout 2 changesets (6a82f1f120aa, 87d83c56fbe5) due to regression reported in bug 1858869.
Differential Revision: https://phabricator.services.mozilla.com/D190908
2023-10-13 08:32:56 +00:00
Jonathan Kew
5032f4321e Bug 1803406 - Ensure consistent font lists across macOS processes, and use the kCTFontOptionsPreferSystemFont option when instantiating Core Text fonts. r=gfx-reviewers,lsalzman
This aims to avoid conflicts with user-installed fonts that shadow system fonts,
where there is a risk that different processes end up using different, incompatible
versions of "the same" font (i.e. they resolve the same font descriptor to different
resources).

Differential Revision: https://phabricator.services.mozilla.com/D170286
2023-10-12 11:54:08 +00:00
Jonathan Kew
bef8902ad1 Bug 1856035 - Rework the management of font variation settings across CoreGraphics and CoreText font instances, on macOS 13 and later only. r=gfx-reviewers,lsalzman
The new approach works on Ventura and Sonoma, but appears to regress behavior on some
earlier releases, so put it behind a runtime version check.

Once we no longer support pre-macOS 13 versions, we can simplify this.

Depends on D190501

Differential Revision: https://phabricator.services.mozilla.com/D190502
2023-10-10 08:21:42 +00:00
Jonathan Kew
39f2d60247 Bug 1856035 - Merge implementations of CreateCTFontFromCGFontWithVariations from gfxMacFont.cpp and 2d/ScaledFontMac.cpp (no change in behavior). r=gfx-reviewers,lsalzman
This should not change behavior, it just merges the two versions of
CreateCTFontFromCGFontWithVariations to simplify maintenance.

Depends on D190500

Differential Revision: https://phabricator.services.mozilla.com/D190501
2023-10-10 08:21:42 +00:00
Jonathan Kew
21e094be9a Bug 1856035 - Backed out changeset 57fec34232bd for regression behavior on macOS 11 and 12.
Not sure why the new implementation doesn't work on older OS versions,
but these APIs are inadequately documented and liable to change behavior
between releases. So just go with what works, as shown by testing.

Differential Revision: https://phabricator.services.mozilla.com/D190500
2023-10-09 18:53:01 +00:00
Jonathan Kew
ff399246f1 Bug 1856035 - Rework the management of font variation settings across CoreGraphics and CoreText font instances. r=gfx-reviewers,lsalzman
It appears that when a Core Text font is instantiated from a CGFont or from a font descriptor,
its optical-size setting now always gets assigned according to the font size being created,
overriding any 'opsz' variation that was already specified on the CGFont or the CTFontDescriptor.
(This seems to be a behavior change compared to older macOS versions.)

To get the desired 'opsz' setting on the Core Text font, it seems to be necessary to use
CTFontCreateCopyWithAttributes to get a modified copy of an already-existing CTFont.

Differential Revision: https://phabricator.services.mozilla.com/D190389
2023-10-08 11:56:49 +00:00
Butkovits Atila
dc4f0dd2a4 Backed out 3 changesets (bug 1803406) for causing WR bustages. CLOSED TREE
Backed out changeset 91f12411aff1 (bug 1803406)
Backed out changeset edb458dfa8b8 (bug 1803406)
Backed out changeset 9c4a875ec67d (bug 1803406)
2023-09-29 21:33:03 +03:00
Jonathan Kew
d7baedb599 Bug 1803406 - Ensure consistent font lists across macOS processes, and use the kCTFontOptionsPreferSystemFont option when instantiating Core Text fonts. r=gfx-reviewers,lsalzman
This aims to avoid conflicts with user-installed fonts that shadow system fonts,
where there is a risk that different processes end up using different, incompatible
versions of "the same" font (i.e. they resolve the same font descriptor to different
resources).

Differential Revision: https://phabricator.services.mozilla.com/D170286
2023-09-29 17:58:17 +00:00
Jonathan Kew
bee329b01d Bug 1845813 - Null-check the variation tag dictionary before trying to apply it to the font. r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D185268
2023-08-03 13:29:32 +00:00
Chris Peterson
29300d010e Bug 1846113 - Remove some always-true macOS version checks now that Firefox only supports macOS >= 10.15. r=gfx-reviewers,jgilbert
Also remove mNeedsFakeNoStencil_UserFBs code in WebGLContext.h/cpp that was only needed on Intel macOS <= 10.11.

Differential Revision: https://phabricator.services.mozilla.com/D184880
2023-08-01 05:05:48 +00:00
Lee Salzman
dc0ab2eed4 Bug 1821512 - Fix Skia usage for API changes. r=jrmuizel
This just tries to address fairly random changes in the Skia API and correct
our usage of it in Moz2D and some other places.

Differential Revision: https://phabricator.services.mozilla.com/D173324
2023-04-16 15:34:50 +00:00
Natalia Csoregi
53631b0cfb Backed out 6 changesets (bug 1821512) for failures on browser_screenshots_test_full_page.js. CLOSED TREE
Backed out changeset a31f2795710e (bug 1821512)
Backed out changeset 3985c29a6490 (bug 1821512)
Backed out changeset 0d9814a43a4d (bug 1821512)
Backed out changeset e5570884e8e4 (bug 1821512)
Backed out changeset efc92c86fafd (bug 1821512)
Backed out changeset 3222f6498a44 (bug 1821512)
2023-04-16 11:30:32 +03:00
Lee Salzman
14b145251e Bug 1821512 - Fix Skia usage for API changes. r=jrmuizel
This just tries to address fairly random changes in the Skia API and correct
our usage of it in Moz2D and some other places.

Differential Revision: https://phabricator.services.mozilla.com/D173324
2023-04-16 04:00:00 +00:00
Iulian Moraru
6e2eff1bc5 Backed out 6 changesets (bug 1821512) for causing multiple failures. CLOSED TREE
Backed out changeset 97295a57babe (bug 1821512)
Backed out changeset 698104c7a5d1 (bug 1821512)
Backed out changeset 09aa18e47bf6 (bug 1821512)
Backed out changeset 20b46afb225f (bug 1821512)
Backed out changeset b531f604ea4c (bug 1821512)
Backed out changeset 0a7c0b0773d4 (bug 1821512)
2023-04-11 10:10:41 +03:00
Lee Salzman
5a40892628 Bug 1821512 - Fix Skia usage for API changes. r=jrmuizel
This just tries to address fairly random changes in the Skia API and correct
our usage of it in Moz2D and some other places.

Differential Revision: https://phabricator.services.mozilla.com/D173324
2023-04-11 05:00:05 +00:00
Marian-Vasile Laza
ddac1da17c Backed out changeset 12f866a5b267 (bug 1587094) for wrench bustages on synthetic-bold.yaml . CLOSED TREE 2022-02-03 22:23:07 +02:00
Lee Salzman
36c0803568 Bug 1587094 - Support MULTISTRIKE_BOLD font instance flag for WebRender. r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D137725
2022-02-03 18:53:13 +00:00
Lee Salzman
9bd2203649 Bug 1738589 - Let Gecko decide if WR Mac font has color glyphs. r=jfkthame
WR tries to normalize Mac FontInstances so that regardless of the font color
we only need to generate one version of the glyph in the cache. This strategy
backfires for fonts with color glyphs that are nominally supposed to ignore
the font color, but may choose to opt-in to the font color per-glyph based
on table data.

This determination is problematic to do in WR itself, but Gecko knows whether
a font has color glyphs ahead of time. So we let Gecko pass this data into
ScaledFonts which can then transmit the knowledge of whether the font has
color glyphs to the WR Mac font backend, which will then take appropriate
action.

Differential Revision: https://phabricator.services.mozilla.com/D130819
2021-11-10 22:16:13 +00:00
Marian-Vasile Laza
a84123836e Backed out changeset fd38093162bc (bug 1738589) for causing reftest failures on svg-glyph-invalid.html. CLOSED TREE 2021-11-10 20:50:54 +02:00
Lee Salzman
233a9f9899 Bug 1738589 - Let Gecko decide if WR Mac font has color glyphs. r=jfkthame
WR tries to normalize Mac FontInstances so that regardless of the font color
we only need to generate one version of the glyph in the cache. This strategy
backfires for fonts with color glyphs that are nominally supposed to ignore
the font color, but may choose to opt-in to the font color per-glyph based
on table data.

This determination is problematic to do in WR itself, but Gecko knows whether
a font has color glyphs ahead of time. So we let Gecko pass this data into
ScaledFonts which can then transmit the knowledge of whether the font has
color glyphs to the WR Mac font backend, which will then take appropriate
action.

Differential Revision: https://phabricator.services.mozilla.com/D130819
2021-11-10 16:09:00 +00:00
Jonathan Kew
e29954ec04 Bug 1732629 - [gfx/2d] Get non-localized variation axis names from CoreGraphics in ScaledFontMac, so that we set up the CGFont correctly with variation values. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D129576
2021-10-27 14:15:12 +00:00
Butkovits Atila
1f01e97274 Backed out 2 changesets (bug 1732629) for causing build bustages. CLOSED TREE
Backed out changeset d67d7024d557 (bug 1732629)
Backed out changeset 59cc3481c534 (bug 1732629)
2021-10-27 16:55:53 +03:00
Jonathan Kew
e6fbe7eb13 Bug 1732629 - [gfx/2d] Get non-localized variation axis names from CoreGraphics in ScaledFontMac, so that we set up the CGFont correctly with variation values. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D129576
2021-10-27 13:35:04 +00:00
Jonathan Kew
1da61536b7 Bug 1735612 - Don't assert if CreateCGFontWithVariations is called with no variations; just return null and let the caller handle fallback. r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D128489
2021-10-15 07:27:05 +00:00
Mike Hommey
3282e2080d Bug 1722454 - Remove USE_SKIA. r=gfx-reviewers,jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D120935
2021-07-29 23:29:44 +00:00
Jeff Muizelaar
691f75ddb4 Bug 1690235. Fix creating variation CTFonts. r=lsalzman
This is an alternate approach to aadbc6deca05.

CTFontCreateWithGraphicsFont seems to give "LastResort" when used on a
system CGFont with variation applied on 10.12-10.14. We can avoid that
by using CTFontCreateWithGraphicsFont with a variation descriptor.

I'm only applying this approach to cairo for now to mimimize the risk
of this breaking something or causing the crashes that we were seeing
before.

See https://github.com/servo/core-foundation-rs/pull/439 for
a standalone test case.

Differential Revision: https://phabricator.services.mozilla.com/D104581
2021-02-09 22:27:33 +00:00
Jonathan Kew
248af00296 Bug 1690235 - Don't use a font descriptor for variation fonts on systems before macOS 10.15. r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D103916
2021-02-03 17:25:19 +00:00
Brad Werth
d1844db20a Bug 1675854 Part 2: Use AutoRelease in ScaledFontMac::GetFontDescriptor. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D96456
2020-11-09 20:38:11 +00:00
Brad Werth
5d00ad647a Bug 1675854: Make ScaledFontMac::GetFontDescriptor release the psname reference before returning. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D96260
2020-11-06 21:36:08 +00:00
tobar2018
d7a64d8211 Bug 1673051 - Remove OnYosemiteOrLater(), OnElCapitanOrLater(), and OnSierraOrLater(). r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D95304
2020-11-02 16:25:18 +00:00
Jeff Muizelaar
ab92c3225f Bug 1672088. Avoid creating CTFonts from CGFonts when using NativeFontResourceMac. r=lsalzman
This has the same motivation as bug 1672088.

Differential Revision: https://phabricator.services.mozilla.com/D94062
2020-10-20 15:48:26 +00:00
Jeff Muizelaar
2909b283eb Bug 1671967 - Rely on mCTFont being set. r=lsalzman
Now that we always use CTFontDrawGlyphs we can just
rely on having a CTFont.

Differential Revision: https://phabricator.services.mozilla.com/D94032
2020-10-19 16:29:47 +00:00
Jeff Muizelaar
0440c26f3d Bug 1671963 - Always use CTFontDrawGlyphs. r=lsalzman
CTFontDrawGlyphs has been around since 10.7

Differential Revision: https://phabricator.services.mozilla.com/D94029
2020-10-19 15:59:02 +00:00
Lee Salzman
88e30d29c4 Bug 1669575 - experimental backout of macOS 11 CoreText crash workaround in bug 1657440. r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D92666
2020-10-06 20:37:27 +00:00
Lee Salzman
811a48a03b Bug 1657440 - avoid letting Skia query style information for Mac fonts. r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D86492
2020-08-17 06:48:00 +00:00
Jonathan Kew
b12c5b9ea0 Bug 1657892 - Cache variation axes in the UnscaledFontMac to accelerate font instantiations. r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D86475
2020-08-09 07:23:42 +00:00
Lee Salzman
e97b3d4035 Bug 1639563 - sanitize WR fonts. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D76360
2020-05-22 15:48:55 +00:00
Lee Salzman
e7163f076c Bug 1611467 - unify UnscaledFont::GetFontDescriptor and GetWRFontDescriptor implementations. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D68284

--HG--
extra : moz-landing-system : lando
2020-03-26 16:11:00 +00:00
Andrew Osmond
91b071ed14 Bug 1618345 - Enforce proper color management by splitting gfx::Color into sRGBColor and DeviceColor types. r=jrmuizel
gfx::Color is currently misused in many places. The DrawTargets expect
the color space to be in device space, e.g. what we are actually going
to draw using. Everything sitting above generally deals with sRGB, as
specified in CSS. Sometimes we missed the conversion from sRGB to device
space when issuing draw calls, and similarly sometimes we converted the
color to device space twice.

This patch splits the type in two. sRGBColor and DeviceColor now
represent sRGB and device color spaces respectively. DrawTarget only
accepts DeviceColor, and one can get a DeviceColor from an sRGBColor via
the ToDeviceColor helper API. The reftests now pass with color
management enabled for everything (e.g. CSS) instead of just tagged
raster images.

There will be a follow up patch to enable color management everywhere by
default on all supported platforms.

Differential Revision: https://phabricator.services.mozilla.com/D64771

--HG--
extra : moz-landing-system : lando
2020-03-09 14:16:17 +00:00
Jonathan Kew
e9e88c90ab Bug 1602391 - Handle possible failure to get font table data in UnscaledFontMac. r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D56359

--HG--
extra : moz-landing-system : lando
2019-12-09 19:03:17 +00:00
Emilio Cobos Álvarez
e94a6fe8af Bug 1602317 - Switch WR bindings to use associated-constants-in-body. r=jrmuizel
Now that we have C++17, and thus inline const, we can do this.

Depends on D56306

Differential Revision: https://phabricator.services.mozilla.com/D56307

--HG--
extra : moz-landing-system : lando
2019-12-08 21:09:37 +00:00
Lee Salzman
d7ccbd0261 Bug 1591996 - miscellaneous Gecko fixes for Skia m79 update. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D50825

--HG--
extra : moz-landing-system : lando
2019-10-28 21:42:48 +00:00
Lee Salzman
2b03a82ba0 Bug 1584268 - only instantiate Cairo fonts when drawing to Cairo target. r=jfkthame
This removes a lot of old cruft in thebes to instantiate Cairo scaled fonts.
Instead, we only instantiate the Cairo scaled font inside Moz2D when we actually
need it for DrawTargetCairo. This thus gets rid of the duplicated code we had
inside both Moz2D and thebes to deal with Cairo scaled fonts.

Differential Revision: https://phabricator.services.mozilla.com/D47297

--HG--
extra : moz-landing-system : lando
2019-10-01 21:56:30 +00:00
Lee Salzman
4f2be9076e Bug 1547063 - implement recording instance data for ScaledFontMac. r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D44495

--HG--
extra : moz-landing-system : lando
2019-09-16 16:45:26 +00:00
Lee Salzman
2d38529fad Bug 1547063 - add SharedFTFace abstraction of FT_Face. r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D44491

--HG--
extra : moz-landing-system : lando
2019-09-16 17:03:04 +00:00
Cosmin Sabou
8113720646 Backed out 8 changesets (bug 1547063) for causing bug 1581466. a=backout
Backed out changeset c969a93b0ca7 (bug 1547063)
Backed out changeset 003f5a79c6a7 (bug 1547063)
Backed out changeset 2c7032b4d022 (bug 1547063)
Backed out changeset 23892ecc6ef8 (bug 1547063)
Backed out changeset af6e6807ece7 (bug 1547063)
Backed out changeset ebc71e607938 (bug 1547063)
Backed out changeset 772c3427c791 (bug 1547063)
Backed out changeset e74a67e2afe3 (bug 1547063)
2019-09-16 10:44:20 +03:00
Lee Salzman
b8b94ba41a Bug 1547063 - implement recording instance data for ScaledFontMac. r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D44495

--HG--
extra : moz-landing-system : lando
2019-09-15 03:00:44 +00:00
Lee Salzman
d5010d11ca Bug 1547063 - add SharedFTFace abstraction of FT_Face. r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D44491

--HG--
extra : moz-landing-system : lando
2019-09-15 02:59:44 +00:00