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

371 Коммитов

Автор SHA1 Сообщение Дата
Jonathan Kew 8c2fcaf9f8 Bug 1768237 - Clean up locking and checks for name/face duplication during CheckForLegacyFamilyNames. r=lsalzman
A number of the crash stacks here involve CheckForLegacyFamilyNames. I think what's happening in these
cases is that we've found a font family record via the mOtherFamilyNames table (which means it was the
result of a legacy-name or localized-name search already). That family is locked in CheckForLegacyFamilyNames,
but then if we find another version of the name in one of its faces, we may end up finding the same record
within AddWithLegacyFamilyName and trying to lock it recursively.

Cleaning up the locking in gfxFontFamily (we don't need to hold a write-lock in CheckForLegacyFamilyNames,
read-lock is sufficient) and suppressing the use of CheckForLegacyFamilyNames for family records that
were created via that codepath in the first place should prevent this happening.

Depends on D145970

Differential Revision: https://phabricator.services.mozilla.com/D145971
2022-05-11 08:47:32 +00:00
Jonathan Kew 5e5b3f791c Bug 1768554 - Fix thread-safety of gfxFontFamily::GetFontList callers. r=lsalzman
Callers that use the family's list of fonts need to hold a read lock for as
long as they're accessing the list.

Alternatively, the work can be moved into a gfxFontFamily method that locks
internally.

Differential Revision: https://phabricator.services.mozilla.com/D145924
2022-05-10 09:52:14 +00:00
Jonathan Kew 18ea0ed0c9 Bug 1766378 followup - Don't require the font-list lock to be held before calling gfxPlatformFontList::FindFontForFamily, just lock internally. r=lsalzman
It turns out the only caller of this method is one obscure edge-case in gfxDWriteFont,
so it should simply be an external API that makes no assumptions about locking.

Differential Revision: https://phabricator.services.mozilla.com/D144792
2022-04-27 18:40:12 +00:00
Jonathan Kew 0fd7a7ea1a Bug 1756474 - Add locking to gfxPlatformFontList and gfxFontFamily, to allow use from worker threads. r=lsalzman
We use a recursive-mutex in gfxPlatformFontList as some of its methods may be called from
classes like gfxFontEntry that are used both from layout code (which does not explictly
lock the font-list) and internally by font-list code that is already holding the lock.

Differential Revision: https://phabricator.services.mozilla.com/D143869
2022-04-19 14:20:21 +00:00
Jonathan Kew 406bc339fd Bug 1763414 - Make gfxFontEntry instances usable from multiple threads. r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D143216
2022-04-08 17:06:36 +00:00
Jonathan Kew 60b0b30676 Bug 1761965 - Accelerate InitializeCodepointsWithNoFonts() by only constructing the bitset incrementally once, then copying it to the other array entries. r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D142336
2022-03-29 17:59:57 +00:00
Jonathan Kew 40a7b7fbbd Bug 1759988 - Ensure InitializeCodepointsWithNoFonts() is always called during font-list initialization. r=gfx-reviewers,jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D141953
2022-03-24 14:23:34 +00:00
Jonathan Kew bc843f9f73 Bug 1758721 - Preload font prefs that may be needed at textrun-construction time, to avoid use of the (main-thread-only) preference service. r=lsalzman
This doesn't in itself make them thread-safe, but it provides a basis to do so by avoiding
dependence on the Preferences service at textrun-construction time.

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

Differential Revision: https://phabricator.services.mozilla.com/D140914
2022-03-13 09:58:40 +00:00
Jens Stutte 8dc1e5affa Bug 1750635: Substitute AppShutdown:IsShuttingDown with equivalent AppShutdown::IsInOrBeyond. r=florian,xpcom-reviewers,nika
Differential Revision: https://phabricator.services.mozilla.com/D139143
2022-02-18 19:35:13 +00:00
Nicklas Boman 6a8f34efee Bug 1725363 - Replace PL_strcasecmp with nsCRT::strcasecmp r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D129073
2022-01-26 09:08:24 +00:00
Jonathan Kew 10f57748b5 Bug 1746795 - Make gfxPlatformFontList::CommonFontFallback honor a preference for emoji presentation when searching its font list, rather than just returning the first match for the codepoint. r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D136730
2022-01-25 16:18:06 +00:00
Dan Minor 522eefbe31 Bug 1719554 - Unify unicode::Script as intl::Script; r=platform-i18n-reviewers,gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D132278
2021-12-06 18:15:50 +00:00
Butkovits Atila 56c46d06a1 Backed out 3 changesets (bug 1719554) for causing bustages complaining about gfxTextRun.cpp.
Backed out changeset 6181e40d4da1 (bug 1719554)
Backed out changeset c261ede6ae81 (bug 1719554)
Backed out changeset 221ec418475c (bug 1719554)
2021-12-04 00:58:15 +02:00
Dan Minor 30ad309163 Bug 1719554 - Unify unicode::Script as intl::Script; r=platform-i18n-reviewers,gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D132278
2021-12-03 20:49:32 +00:00
Dan Minor e12f42285c Bug 1733659 - Clean up naming style in Locale; r=platform-i18n-reviewers,gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D131511
2021-11-23 12:36:41 +00:00
Sandor Molnar 2594d2ac61 Backed out 2 changesets (bug 1733659) for causing build bustages. CLOSED TREE
Backed out changeset 9e23aa79fda9 (bug 1733659)
Backed out changeset e316768591c0 (bug 1733659)
2021-11-22 20:51:20 +02:00
Dan Minor bcbfdb6d73 Bug 1733659 - Clean up naming style in Locale; r=platform-i18n-reviewers,gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D131511
2021-11-22 18:32:41 +00:00
Nika Layzell d73755617d Bug 1732343 - Part 2: Migrate all uses of base::FileDescriptor to UniqueFileHandle, r=handyman
This is useful for the following parts, as UniqueFileHandle is a cross-platform
type which can also be used to support transferring HANDLEs between processes.

This change requires fairly sweeping changes to existing callsites, which
previously did not require owning access to the handle types when transferring.
For the most part these changes were straightforward, but manual.

Differential Revision: https://phabricator.services.mozilla.com/D126564
2021-11-09 14:17:32 +00:00
Cristian Tuns cbd178830f Backed out 10 changesets (bug 1732343) for causing coverage build bustages (Bug 1739590).
Backed out changeset bba94c79f3e1 (bug 1732343)
Backed out changeset d30fa1e1f605 (bug 1732343)
Backed out changeset ed0b4f757c4b (bug 1732343)
Backed out changeset a272da134c34 (bug 1732343)
Backed out changeset ccb259d73843 (bug 1732343)
Backed out changeset a292990b62de (bug 1732343)
Backed out changeset 7d1854782ca8 (bug 1732343)
Backed out changeset 29eaabd9ffb3 (bug 1732343)
Backed out changeset 1aa26657a7a6 (bug 1732343)
Backed out changeset 7a6708dc620a (bug 1732343)
2021-11-05 07:21:04 -04:00
Nika Layzell b8279164db Bug 1732343 - Part 2: Migrate all uses of base::FileDescriptor to UniqueFileHandle, r=handyman
This is useful for the following parts, as UniqueFileHandle is a cross-platform
type which can also be used to support transferring HANDLEs between processes.

This change requires fairly sweeping changes to existing callsites, which
previously did not require owning access to the handle types when transferring.
For the most part these changes were straightforward, but manual.

Differential Revision: https://phabricator.services.mozilla.com/D126564
2021-11-04 19:20:17 +00:00
Dan Minor bbe54a9742 Bug 1736017 - Replace MozLocale with Locale in gfxPlatformFontList.cpp; r=platform-i18n-reviewers,gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D129208
2021-11-04 16:36:03 +00:00
Jonathan Kew 07dd3d88ac Bug 1735588 - Only allow the OMT InitFontList thread to be used if the shared font list is enabled. r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D128393
2021-10-28 17:10:45 +00:00
Noemi Erli 25dd04d4c5 Backed out 9 changesets (bug 1736017) for causing bustages in nsLineBreaker.cpp
Backed out changeset d7b7427bb29e (bug 1736017)
Backed out changeset 7249dec70600 (bug 1736017)
Backed out changeset f16572806b0c (bug 1736017)
Backed out changeset a78125c71b3e (bug 1736017)
Backed out changeset 84ba2cbd596a (bug 1736017)
Backed out changeset f771265e0930 (bug 1736017)
Backed out changeset c0cef271022d (bug 1736017)
Backed out changeset 19be73147fcc (bug 1736017)
Backed out changeset 11721cc861b0 (bug 1736017)
2021-10-28 00:06:35 +03:00
Dan Minor d71a0ee840 Bug 1736017 - Replace MozLocale with Locale in gfxPlatformFontList.cpp; r=platform-i18n-reviewers,gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D129208
2021-10-27 20:35:56 +00:00
Jonathan Kew b910e0fd90 Bug 1730460 - Ensure cached ReplacementCharacter family records are cleared when the font-list is reinitialized. r=emilio
Prior to bug 1715501, we were relying on the UpdateFontVisibility() method
to take care of this, but since making this a per-visibility-setting array,
that no longer happens so we need to explicitly clear them here.

Differential Revision: https://phabricator.services.mozilla.com/D128780
2021-10-18 20:59:15 +00:00
Dan Minor a9e674d68d Bug 1719746 - Rename Locale to MozLocale; r=platform-i18n-reviewers,zbraniecki
There is also a mozilla::intl::Locale in intl/locale/MozLocale.h. This naming
collision was causing crashes in debug builds where the wrong destructor ended
up being called. This patch renames the intl/locale/MozLocale.h class to
MozLocale.

I've filed Bug 1736017 to move callers of the MozLocale version to the
unified intl/components/Locale version.

Differential Revision: https://phabricator.services.mozilla.com/D128593
2021-10-18 13:38:24 +00:00
Mike Hommey f97bfb08a7 Bug 1732208 - Silence the unused-but-set-variable warning in gfx. r=gfx-reviewers,nical
gfx/2d/SourceSurfaceD2D1.cpp(201,20): error: variable 'options' set but not used [-Werror,-Wunused-but-set-variable]
  D2D1_MAP_OPTIONS options;
                   ^
gfx/thebes/gfxDWriteFontList.h(269,13): error: variable 'hr' set but not used [-Werror,-Wunused-but-set-variable]
    HRESULT hr = S_OK;
            ^
gfx/thebes/gfxGDIFontList.cpp(1020,12): error: variable 'cmapLoaded' set but not used [-Werror,-Wunused-but-set-variable]
      bool cmapLoaded = false;
           ^
gfx/thebes/gfxMacPlatformFontList.mm:1771:10: error: variable 'isStandardFace' set but not used [-Werror,-Wunused-but-set-variable]
    bool isStandardFace = false;
         ^
gfx/thebes/gfxPlatformFontList.cpp(1064,18): error: variable 'rejectedFallbackVisibility' set but not used [-Werror,-Wunused-but-set-variable]
  FontVisibility rejectedFallbackVisibility = FontVisibility::Unknown;
                 ^
gfx/vr/service/OculusSession.cpp(1329,12): error: variable 'bNewController' set but not used [-Werror,-Wunused-but-set-variable]
      bool bNewController = false;
           ^

Differential Revision: https://phabricator.services.mozilla.com/D126454
2021-09-28 00:02:45 +00:00
Emilio Cobos Álvarez e37caecb95 Bug 1730456 - InitPlatformFontList should reframe. r=jfkthame
I don't know why it didn't broadcast the reflow request to child
processes... Perhaps it doesn't have to?

Differential Revision: https://phabricator.services.mozilla.com/D126128
2021-09-23 16:35:32 +00:00
Jonathan Kew 1cf6b1131c Bug 1715537 - Log a warning to the web console when a font request is blocked due to font-visibility restrictions. r=emilio
Depends on D124196

Differential Revision: https://phabricator.services.mozilla.com/D124345
2021-09-23 13:36:18 +00:00
Jonathan Kew bfa1d70def Bug 1715501 - patch 2 - Pass the presContext to platform font lookup methods so they can query it for font visibility. r=emilio
This does not in itself change user-visible behavior, but is a foundation for bug
1715507 where we will make the behavior per-context instead of global. This is basically
just plumbing, passing a pointer to the presContext that's asking for fonts to be
resolved all the way down to the gfx code that handles the font list and looks up
fonts.

For the immediate goal of making font visibility work per-context, it would be
sufficient to pass the desired visibility level in to the font-selection methods.
However, passing the actual presContext down (and not just its visibility level)
will enable us to report back via the dev console when a font is blocked (see bug
1715537), so the approach here provides the basis for that upcoming enhancement.

Depends on D124194

Differential Revision: https://phabricator.services.mozilla.com/D124195
2021-09-08 12:18:17 +00:00
Jonathan Kew 99dbfb0c56 Bug 1715501 - patch 1 - Track codepoints with no available fonts and replacement-char family separately for each font-visibility level. r=emilio
This does not change existing behavior, but will be required once font visibility
is no longer simply a global setting. The data cached in these members depends on
the font visibility level, so currently we just flush it if the visibility pref is
modified. But in future we may be using multiple levels at the same time (in
separate contexts), so we want to maintain separate per-level caches here.

Differential Revision: https://phabricator.services.mozilla.com/D124194
2021-09-08 12:18:17 +00:00
Cristian Tuns 9e1718d5a5 Backed out 4 changesets (bug 1715537, bug 1715507, bug 1715501) for causing mochitest failures on test_bug418986-2.html. CLOSED TREE
Backed out changeset fff777ea5637 (bug 1715537)
Backed out changeset 240308eb514d (bug 1715507)
Backed out changeset e3f8526e0e2a (bug 1715501)
Backed out changeset cfdd1c5d8d3f (bug 1715501)
2021-09-08 07:48:51 -04:00
Jonathan Kew 34bb52269d Bug 1715537 - Log a warning to the web console when a font request is blocked due to font-visibility restrictions. r=emilio
Depends on D124196

Differential Revision: https://phabricator.services.mozilla.com/D124345
2021-09-08 09:35:18 +00:00
Jonathan Kew 20585f15c0 Bug 1715501 - patch 2 - Pass the presContext to platform font lookup methods so they can query it for font visibility. r=emilio
This does not in itself change user-visible behavior, but is a foundation for bug
1715507 where we will make the behavior per-context instead of global. This is basically
just plumbing, passing a pointer to the presContext that's asking for fonts to be
resolved all the way down to the gfx code that handles the font list and looks up
fonts.

For the immediate goal of making font visibility work per-context, it would be
sufficient to pass the desired visibility level in to the font-selection methods.
However, passing the actual presContext down (and not just its visibility level)
will enable us to report back via the dev console when a font is blocked (see bug
1715537), so the approach here provides the basis for that upcoming enhancement.

Depends on D124194

Differential Revision: https://phabricator.services.mozilla.com/D124195
2021-09-08 09:35:17 +00:00
Jonathan Kew ffc9bc9fe0 Bug 1715501 - patch 1 - Track codepoints with no available fonts and replacement-char family separately for each font-visibility level. r=emilio
This does not change existing behavior, but will be required once font visibility
is no longer simply a global setting. The data cached in these members depends on
the font visibility level, so currently we just flush it if the visibility pref is
modified. But in future we may be using multiple levels at the same time (in
separate contexts), so we want to maintain separate per-level caches here.

Differential Revision: https://phabricator.services.mozilla.com/D124194
2021-09-08 09:35:16 +00:00
Jonathan Kew c7fdc790cc Bug 1725297 - Remove expiring font telemetry probes. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D124051
2021-08-31 13:48:51 +00:00
Emilio Cobos Álvarez cfca657d9c Bug 1722487 - Avoid some work for font list updates. r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D123363
2021-08-26 23:17:54 +00:00
Jonathan Kew da11a216cc Bug 1724421 - Use template argument deduction to simplify callsites when checking the standard font-family visibility lists. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D122003
2021-08-06 14:06:53 +00:00
Emilio Cobos Álvarez e5fc71cc00 Bug 1722009 - Map system-ui to the `menu` font family. r=jfkthame
This seems to be what Chrome does on Windows, and should do the right
thing in other OSes.

On macOS we can do something better and look up the language-dependent
font. That requires further work, but shouldn't probably block this (as
long as system-ui is turned off by default at least).

Differential Revision: https://phabricator.services.mozilla.com/D120714
2021-07-27 11:11:51 +00:00
Emilio Cobos Álvarez f501d497d2 Bug 1720710 - Add system-ui boilerplate. r=jfkthame
Alias -apple-system to it, and put it behind a pref for now. This is
pretty boring (read: uncontroversial hopefully) code. The follow-up work
is modifying StaticPresData to look up the fonts using system APIs,
probably. Maybe a bit more work if on macOS they can't be named.

Differential Revision: https://phabricator.services.mozilla.com/D119984
2021-07-27 11:11:51 +00:00
Jonathan Kew 04da370178 Bug 1714762 - patch 1 - Don't use asynchronous font fallback in the parent process, to avoid glitches in UI rendering. r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D117666
2021-06-14 17:09:21 +00:00
Jonathan Kew 489fe85732 Bug 1689379 - Try to reduce the chance of an apparent shutdown hang by bailing out of potentially-expensive font-list calls if the app is shutting down. r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D116740
2021-06-06 21:24:44 +00:00
Jonathan Kew c840efe013 Bug 1712165 - Reorder conditions to avoid a possible race between the InitFontList thread and main thread accessing gfxPlatformFontList. r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D115690
2021-05-21 16:39:17 +00:00
Jonathan Kew cf297d803f Bug 1708768 - Make InitFontList safe to call off-main-thread on macOS, and run font-list initialization on a separate thread during startup. r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D115295
2021-05-18 11:10:43 +00:00
Jonathan Kew 18310539bf Bug 1708768 - Preliminary cleanup of gfxPlatformFontList creation/initialization code; no functional change. r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D114863
2021-05-18 11:10:42 +00:00
Iulian Moraru b6ba6af634 Backed out 3 changesets (bug 1708768) for causing font related crashes (bug 1711332). a=backout DONTBUILD
Backed out changeset fa037550d6e8 (bug 1708768)
Backed out changeset 10b30c8d4b86 (bug 1708768)
Backed out changeset c03c7df7cd61 (bug 1708768)
2021-05-16 11:46:34 +03:00
Jonathan Kew 11b9b22a55 Bug 1708768 - Preliminary cleanup of gfxPlatformFontList creation/initialization code; no functional change. r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D114863
2021-05-14 18:05:44 +00:00
Jonathan Kew 83fcb74e81 Bug 1704812 - Broadcast newly-added FontList shm blocks to Content Processes instead of waiting and doing sync IPC. r=emilio,jld
Differential Revision: https://phabricator.services.mozilla.com/D112666
2021-05-13 14:30:09 +00:00
Csoregi Natalia 1697facf08 Backed out changeset 221d5494188c (bug 1704812) for thread sanitizer issues in SharedFontList. DONTBUILD CLOSED TREE 2021-05-13 15:16:00 +03:00
Jonathan Kew 0ba5a52a62 Bug 1704812 - Broadcast newly-added FontList shm blocks to Content Processes instead of waiting and doing sync IPC. r=emilio,jld
Differential Revision: https://phabricator.services.mozilla.com/D112666
2021-05-13 11:45:48 +00:00