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

260 Коммитов

Автор SHA1 Сообщение Дата
Jonathan Kew a9d1612b31 Bug 1721612 - (more followup) Try to make clang-tidy happier, and cache the tracking value for a given px size. r=gfx-reviewers,lsalzman
No change in behavior, but should be a minor (imperceptible?) perf win for fonts
with a 'trak' table.

Differential Revision: https://phabricator.services.mozilla.com/D193321
2023-11-11 10:36:18 +00:00
Noemi Erli 2638d323a7 Backed out 3 changesets (bug 1721612) for causing failures in transform-input-002.html CLOSED TREE
Backed out changeset a19116887ffa (bug 1721612)
Backed out changeset 665f815ddf6f (bug 1721612)
Backed out changeset d5826f3cfadf (bug 1721612)
2023-11-11 03:29:08 +02:00
Jonathan Kew 447f00168e Bug 1721612 - (more followup) Try to make clang-tidy happier, and cache the tracking value for a given px size. r=gfx-reviewers,lsalzman
No change in behavior, but should be a minor (imperceptible?) perf win for fonts
with a 'trak' table.

Differential Revision: https://phabricator.services.mozilla.com/D193321
2023-11-10 20:02:00 +00:00
Jonathan Kew 0ed0e1afe0 Bug 1842674 - Rework gfxCharacterMap management. r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D185187
2023-09-04 11:40:03 +00:00
Norisz Fay 393fbfe542 Backed out changeset 1960ff4738f6 (bug 1842674) for causing multiple failures CLOSED TREE 2023-09-02 13:02:08 +03:00
Jonathan Kew 877166a8af Bug 1842674 - Rework gfxCharacterMap management. r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D185187
2023-09-02 09:02:08 +00:00
Cristian Tuns 1c8e77350d Backed out changeset 2a64e5770504 (bug 1842674) for causing build bustages in gfxPlatformFontList.cpp 2023-09-01 05:22:30 -04:00
Jonathan Kew d1a983d8fb Bug 1842674 - Rework gfxCharacterMap management. r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D185187
2023-09-01 08:31:23 +00:00
Jonathan Kew 260aac0062 Bug 1847529 - Provide typed versions of Pointer::ToPtr. r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D185564
2023-08-11 10:47:49 +00:00
Butkovits Atila f6b7599a3d Backed out changeset ad43d22e453c (bug 1847529) for causing reftest failures. CLOSED TREE 2023-08-11 01:26:07 +03:00
Jonathan Kew 46b3bb2a07 Bug 1847529 - Provide typed versions of Pointer::ToPtr. r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D185564
2023-08-10 20:35:24 +00:00
Masatoshi Kimura 181d1d2914 Bug 1844257 - Remove ipc/glue/LibrarySandboxPreload.(cpp|h). r=glandium
They are leftovers from bug 1572618 and bug 1737733.

Differential Revision: https://phabricator.services.mozilla.com/D183973
2023-07-19 23:29:19 +00:00
Jonathan Kew 6465086399 Bug 1827950 - Don't attempt to use font extents if we didn't get a valid 'head' table, or if it's not an sfnt resource. r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D175391
2023-04-14 11:54:05 +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 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
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 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
Shravan Narayan c375efadca Bug 1751818 - Remove use tainted_opaque from callbacks of libGraphite r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D162363
2022-11-22 06:06:36 +00:00
Jonathan Kew 79c92e7e4f Bug 1786259 - Avoid potential deadlock via AddWithLegacyFamilyName when shared-fontlist is disabled (incl. safe mode). r=gfx-reviewers,aosmond
Differential Revision: https://phabricator.services.mozilla.com/D157311
2022-09-14 12:50:23 +00:00
Jonathan Kew 09ae492bb3 Bug 1786472 - Reduce the number of separate atomic accesses involved in using gfxFontEntry during text measurement/drawing. r=aosmond
Depends on D155340

Differential Revision: https://phabricator.services.mozilla.com/D155341
2022-09-06 09:20:57 +00:00
Jonathan Kew 5839530325 Bug 1786281 - Use AutoHBBlob for temporary blobs in various places, to replace manual destruction. r=gfx-reviewers,lsalzman
Depends on D155208

Differential Revision: https://phabricator.services.mozilla.com/D155209
2022-08-22 13:36:16 +00:00
Jonathan Kew 5961354da8 Bug 1740530 - patch 2 - Simplify COLR-glyph rendering a bit, by calling COLRFonts methods directly from gfxFont instead of via gfxFontEntry wrappers. r=gfx-reviewers,lsalzman
Depends on D152036

Differential Revision: https://phabricator.services.mozilla.com/D152037
2022-08-17 10:59:33 +00:00
Jonathan Kew ffe11bba5a Bug 1740530 - patch 1 - Move COLR font support functions from gfxUtils into their own class. r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D152036
2022-08-17 10:59:33 +00:00
Iulian Moraru 04e55eb8e5 Backed out 10 changesets (bug 1740530) for causing reftest failures on colrv1.
Backed out changeset 6f6a55195489 (bug 1740530)
Backed out changeset adc2b1544c4c (bug 1740530)
Backed out changeset cf530e9fea50 (bug 1740530)
Backed out changeset 10b6bafbbd9a (bug 1740530)
Backed out changeset 1c9205a0193f (bug 1740530)
Backed out changeset 06f7b45d044a (bug 1740530)
Backed out changeset 02d6294b7a6d (bug 1740530)
Backed out changeset 673f9010ea75 (bug 1740530)
Backed out changeset 429601610f26 (bug 1740530)
Backed out changeset e6523049b675 (bug 1740530)
2022-08-16 21:28:46 +03:00
Jonathan Kew b55969e54c Bug 1740530 - patch 2 - Simplify COLR-glyph rendering a bit, by calling COLRFonts methods directly from gfxFont instead of via gfxFontEntry wrappers. r=gfx-reviewers,lsalzman
Depends on D152036

Differential Revision: https://phabricator.services.mozilla.com/D152037
2022-08-16 12:48:32 +00:00
Jonathan Kew 81c6e793b9 Bug 1740530 - patch 1 - Move COLR font support functions from gfxUtils into their own class. r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D152036
2022-08-16 12:48:31 +00:00
Noemi Erli dd80638572 Backed out 10 changesets (bug 1740530) for causing build bustage in COLRFonts.cpp CLOSED TREE
Backed out changeset afbcf312dbaf (bug 1740530)
Backed out changeset dfcb59684ed2 (bug 1740530)
Backed out changeset cc1a41e1bf44 (bug 1740530)
Backed out changeset 4c3cb20a5203 (bug 1740530)
Backed out changeset 275eb6c4900b (bug 1740530)
Backed out changeset 768df8b3c770 (bug 1740530)
Backed out changeset 4db61d87c172 (bug 1740530)
Backed out changeset a95e62dc9288 (bug 1740530)
Backed out changeset fdc71479fcd9 (bug 1740530)
Backed out changeset 8b26219a4294 (bug 1740530)
2022-08-16 14:31:39 +03:00
Jonathan Kew f80351990d Bug 1740530 - patch 2 - Simplify COLR-glyph rendering a bit, by calling COLRFonts methods directly from gfxFont instead of via gfxFontEntry wrappers. r=gfx-reviewers,lsalzman
Depends on D152036

Differential Revision: https://phabricator.services.mozilla.com/D152037
2022-08-16 10:39:50 +00:00
Jonathan Kew a4f0d6c65c Bug 1740530 - patch 1 - Move COLR font support functions from gfxUtils into their own class. r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D152036
2022-08-16 10:39:50 +00:00
Jonathan Kew 103d8f60a3 Bug 1783421 - Don't cache an hb_face_t in gfxFontEntry to share between font instances, as it is not thread-safe. r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D153853
2022-08-06 11:54:00 +00:00
Butkovits Atila 84489c001f Backed out changeset 6f0f72915ef9 (bug 1783421) for causing assertion failures at hb-object.hh. CLOSED TREE 2022-08-05 22:48:05 +03:00
Jonathan Kew a1b8c2ecdc Bug 1783421 - Don't cache an hb_face_t in gfxFontEntry to share between font instances, as it is not thread-safe. r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D153853
2022-08-05 15:07:41 +00:00
Jonathan Kew 8886c37ac5 Bug 1779205 - part 1 - Make gfxPlatform::HasVariationFontSupport() a static method that does not require a gfxPlatform instance. r=gfx-reviewers,jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D153576
2022-08-04 21:24:11 +00:00
Iulian Moraru 3cba981e96 Backed out 2 changesets (bug 1779205) for causing windows 2012 build bustages on gfxWindowsPlatform. CLOSED TREE
Backed out changeset a3b604b751e8 (bug 1779205)
Backed out changeset 49f2cdcc1a6b (bug 1779205)
2022-08-04 17:47:07 +03:00
Jonathan Kew 8eb407358c Bug 1779205 - part 1 - Make gfxPlatform::HasVariationFontSupport() a static method that does not require a gfxPlatform instance. r=gfx-reviewers,jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D153576
2022-08-04 14:12:51 +00:00
Sandor Molnar 6fb54d7474 Backed out 2 changesets (bug 1779205) for causing browser-chrome failures in gfx/thebes/gfxPlatform.cpp CLOSED TREE
Backed out changeset ea288d88571f (bug 1779205)
Backed out changeset 186424c5f4ea (bug 1779205)
2022-08-03 20:16:43 +03:00
Fabrice Desré c50cb528fc Bug 1761040 - Prefix thread safety macros with MOZ_ r=geckoview-reviewers,media-playback-reviewers,alwu,jesup,m_kato
Differential Revision: https://phabricator.services.mozilla.com/D152575
2022-08-03 16:39:41 +00:00
Jonathan Kew 6367858ff1 Bug 1779205 - part 1 - Make gfxPlatform::HasVariationFontSupport() a static method that does not require a gfxPlatform instance. r=gfx-reviewers,jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D153576
2022-08-03 15:52:45 +00:00
Andreea Pavel 3ccd75af8d Backed out changeset b9d2965591b9 (bug 1761040) for landing with wrong author CLOSED TREE DONTBUILD 2022-08-03 18:55:00 +03:00
Andreea Pavel fdb7cb2ecd Bug 1761040 - Prefix thread safety macros with MOZ_ r=geckoview-reviewers,media-playback-reviewers,alwu,jesup,m_kato
Differential Revision: https://phabricator.services.mozilla.com/D152575
2022-08-03 15:27:43 +00:00
Andreea Pavel 89d63c91e6 Backed out changeset a907159a482f (bug 1761040) for causing build bustages on a CLOSED TREE 2022-08-02 04:59:08 +03:00
Fabrice Desré 0f4ac7ad97 Bug 1761040 - Prefix thread safety macros with MOZ_ r=geckoview-reviewers,media-playback-reviewers,alwu,jesup,m_kato
Differential Revision: https://phabricator.services.mozilla.com/D152575
2022-08-02 00:49:41 +00:00
Andrew Osmond 2ae0134b4c Bug 1780193 - Refactor gfxFontCache expiration behaviour to mitigate perf reductions. r=jfkthame
In this patch, we make gfxFont use normal AddRef/Release semantics, and
instead now hold a strong reference to it inside the cache. At all times
a font should be in the expiration tracker, and whenever a lookup is
performed, we mark it as used.

When the tracker attempts to expire an entry, we check to see if the
only strong reference is inside the cache itself. If so, it is deleted.
If not, we mark it as used again instead of expiring it.

This has the advantage of making gfxFont::Release cheaper when there is
only one outstanding reference left outside the cache. It used to
acquire the gfxFontCache mutex in order to reinsert the font into the
expiration tracker when the last strong reference was cleared. This is a
very common case since the typical use case is only the main thread is
interacting with the cache, one font reference at a time.

This does not completely restore us to the previous performance
observed, but it does reclaim half of the original design benefit while
remaining threadsafe.

Differential Revision: https://phabricator.services.mozilla.com/D153110
2022-07-29 14:48:38 +00:00
Andrew Osmond a9049b5248 Bug 1779519 - gfxFontCache expiration tracker operations should be more atomic. r=jfkthame
gfxFontCache acquires and releases its mutex during various operations.
In order to keep the state internally consistent, we should only release
the lock after the full operation is complete. This involves moving the
deletion of gfxFont to outside the lock via a temporary discard array.

The expiration state should not be protected by the gfxFont's mutex
since we don't hold it during most operations. Instead we should hold
gfxFontCache's mutex because then we can guarantee the operation is
atomic, particularly when a worker wants a font, and the main thread is
aging the generations.

When a font is returned from gfxFontCache, we now return it already
removed from the tracker, and with its refcount updated. This avoids any
potential races between the expiration timer and a worker accessing the
font, as well as simplying the callers so they don't need to be aware of
addref-ing manually in case the result is to be discarded (so that it
gets readded to the tracker).

Differential Revision: https://phabricator.services.mozilla.com/D151821
2022-07-14 19:53:09 +00:00
criss ba063e13c6 Backed out changeset e4cd98b5984d (bug 1779519) for causing build bustages. CLOSED TREE 2022-07-14 22:06:53 +03:00
Andrew Osmond 9f767ee84a Bug 1779519 - gfxFontCache expiration tracker operations should be more atomic. r=jfkthame
gfxFontCache acquires and releases its mutex during various operations.
In order to keep the state internally consistent, we should only release
the lock after the full operation is complete. This involves moving the
deletion of gfxFont to outside the lock via a temporary discard array.

The expiration state should not be protected by the gfxFont's mutex
since we don't hold it during most operations. Instead we should hold
gfxFontCache's mutex because then we can guarantee the operation is
atomic, particularly when a worker wants a font, and the main thread is
aging the generations.

When a font is returned from gfxFontCache, we now return it already
removed from the tracker, and with its refcount updated. This avoids any
potential races between the expiration timer and a worker accessing the
font, as well as simplying the callers so they don't need to be aware of
addref-ing manually in case the result is to be discarded (so that it
gets readded to the tracker).

Differential Revision: https://phabricator.services.mozilla.com/D151821
2022-07-14 18:35:49 +00:00
Andrew Osmond 325d34f8d7 Bug 1778711 - gfxCharacterMap should use threadsafe refcounting. r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D151372
2022-07-08 17:34:47 +00:00
Andrew Osmond ccb3289c49 Bug 1778608 - Fix FontFaceSetWorkerImpl destruction off main thread. r=emilio
The loaders need to be destroyed on the main thread. Assertions for
gfxUserFontSet and gfxFontFamily need to be updated for workers.

Depends on D151342

Differential Revision: https://phabricator.services.mozilla.com/D151343
2022-07-08 17:34:46 +00:00
smolnar 5141a24432 Backed out 5 changesets (bug 1777287, bug 1778610, bug 1778681, bug 1778608, bug 1778694) for causing assertion failures in mozilla/ServoUtils.h CLOSED TREE
Backed out changeset 0aef1644a90e (bug 1777287)
Backed out changeset 53145a539af3 (bug 1778694)
Backed out changeset d2ec7b6792ec (bug 1778681)
Backed out changeset 921a5cd15b42 (bug 1778608)
Backed out changeset d1b85405ea07 (bug 1778610)
2022-07-08 17:17:00 +03:00
Andrew Osmond 5865d04029 Bug 1778608 - Fix FontFaceSetWorkerImpl destruction off main thread. r=emilio
The loaders need to be destroyed on the main thread. Assertions for
gfxUserFontSet and gfxFontFamily need to be updated for workers.

Depends on D151342

Differential Revision: https://phabricator.services.mozilla.com/D151343
2022-07-08 13:24:35 +00:00