Commit graph

16740 commits

Author SHA1 Message Date
Behdad Esfahbod
73ee9c346f Revert "[sanitize] Only check trailing edge of ranges"
This reverts commit e4856cf809.

This is wrong on at least 32-bit systems. Might add a condition
version later.
2023-07-07 22:47:20 -06:00
Behdad Esfahbod
0b879afb5a [sanitize] Inline Coverage::sanitize 2023-07-07 22:35:43 -06:00
Behdad Esfahbod
92448910a7 [sanitize] Minor inline a few more short functions 2023-07-07 22:18:18 -06:00
Behdad Esfahbod
d84504206c [sanitize] Optimize away an overflow check when not needed
When the length argument is 16bit...
2023-07-07 22:02:05 -06:00
Behdad Esfahbod
e4856cf809 [sanitize] Only check trailing edge of ranges
Assumptions...

Speeds up Gulzar load_face_and_shape benchmark by 7%.
2023-07-07 23:57:45 -04:00
Behdad Esfahbod
6a683ea6eb [sanitize] Enlighten check_range() some more
No need to check for len=0 arrays. They must still be in range.
2023-07-07 21:02:15 -06:00
Behdad Esfahbod
c24ea1036b [sanitize] Minor tweak to len=0 case which is handled otherwise anyway 2023-07-07 20:43:20 -06:00
Behdad Esfahbod
403bc7caa4 [sanitize] Simplify Rule::sanitize() 2023-07-07 20:17:32 -06:00
Behdad Esfahbod
385896ff66 [sanitize] Speed up ChainRule::sanitize()
10% speedup in sanitizing Gulzar-Regular.
2023-07-07 19:56:19 -06:00
Behdad Esfahbod
2006d3211f [sanitize] Add "fastpath" for ArrayOfOffset16To<> objects with max size
Unfortunately this doesn't speed up NotoNastaliq or Gulzar as I was
hoping for. Their GSUB tables are not large enough for this to kick
in...
2023-07-07 19:24:01 -06:00
Behdad Esfahbod
7a85663c2b Revert "[sanitize] Add "fastpath" for ArrayOfOffset16To<> objects with max size"
This reverts commit 10f8556c73.

This was, unfortunately, wrong :(.
2023-07-07 19:21:53 -06:00
Behdad Esfahbod
f2a3680fab Revert "[gsubgpos] Limit (Chain)ContextFormat3 for consistency"
This reverts commit 90b48917da.
2023-07-07 19:21:03 -06:00
Behdad Esfahbod
90b48917da [gsubgpos] Limit (Chain)ContextFormat3 for consistency 2023-07-07 18:52:28 -06:00
Behdad Esfahbod
3b02f694e8 [sanitize/GSUBGPOS] Limit max-size of a few offset arrays
This significantly speeds up Gulzar-Regular sanitize, by 40%.
2023-07-07 18:40:43 -06:00
Behdad Esfahbod
10f8556c73 [sanitize] Add "fastpath" for ArrayOfOffset16To<> objects with max size 2023-07-07 18:37:03 -06:00
Behdad Esfahbod
68b7891459 [sanitize] Add "fastpath" for ArrayOfOffset16To<> objects with max size
Unfortunately this doesn't speed up NotoNastaliq or Gulzar as I was
hoping for. Their GSUB tables are not large enough for this to kick
in...
2023-07-07 17:33:13 -06:00
Behdad Esfahbod
90752cd5b7 [type] Add HeadlessArray16Of 2023-07-07 15:47:28 -06:00
Behdad Esfahbod
59abcda269 [sanitize] Add an ALWAYS_INLINE
Looks like it was always inlined anyway.
2023-07-07 15:45:40 -06:00
Behdad Esfahbod
45a1721230 [ot-font] Prefer CFF2 over CFF1 2023-07-06 16:06:50 -06:00
أحمد المحمودي
43d0aff672
[introspection] Pass both libharfbuzz_gobject & libharfbuzz as positional parameters
Fixes #4304
2023-07-04 09:22:53 +03:00
Behdad Esfahbod
25297408de [COLR] Fix PaintComposite sanitize timeout
Was timing out after recent sanitize() change.

Fixes https://oss-fuzz.com/testcase-detail/5692635449524224
2023-07-03 10:35:27 -06:00
dependabot[bot]
a8c655e651 Bump actions/checkout from 3.5.1 to 3.5.3
Bumps [actions/checkout](https://github.com/actions/checkout) from 3.5.1 to 3.5.3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3.5.1...c85c95e3d7251135ab7dc9ce3241c5835cc595a9)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-03 11:44:38 -04:00
Behdad Esfahbod
de2c10732d [ot-map] Speed up for default shaper
Sort late, the reduced number of features.
2023-07-02 16:53:41 -06:00
Behdad Esfahbod
8156c5a685 [ot-map] Minor micro-optimize 2023-07-02 16:35:32 -06:00
Behdad Esfahbod
5ac9eaa035 [sanitize] Minor micro-optimize 2023-07-02 16:18:08 -06:00
Behdad Esfahbod
e8948d634e [set-digest] Micro-optimize more 2023-07-02 15:37:24 -06:00
Behdad Esfahbod
cb73ba7104 [set-digest] Fixup for previous commit 2023-07-02 15:28:39 -06:00
Behdad Esfahbod
918ad89294 [set-digest] Early terminate add_range() if we're full 2023-07-02 14:56:20 -06:00
Behdad Esfahbod
bb33675e60 [sanitize] Micro-optimize check_range() 2023-07-02 14:11:40 -06:00
Behdad Esfahbod
d1c82a1cc6 [sanitize] Speed up check_struct()
Don't account for length here. Should not be a problem.
Fingers crossed fuzzers.

18% speed up in load_face_and_shape Gulzar-Regular.
2023-07-02 13:43:44 -06:00
Behdad Esfahbod
ec94386622 [OffsetTo] Micro-optimize away a check 2023-07-02 13:29:53 -06:00
Behdad Esfahbod
eae8278896 [GPOS] Micro-optimize lazy_some_gpos check
Speeds up 11% in:
BM_Font/load_face_and_shape/Roboto-Regular.ttf/hb
2023-07-02 13:07:26 -06:00
Behdad Esfahbod
46e54a2390 [GPOS] Remove extra check 2023-07-02 13:03:16 -06:00
Behdad Esfahbod
13438da16e [benchmark-font] Minor move a variable 2023-07-02 12:56:13 -06:00
Behdad Esfahbod
7f5380fe94 [Composite] Don't apply transformation if phantom_only 2023-07-02 12:19:22 -06:00
Behdad Esfahbod
0cf759b0d4 [Glyph] Don't shift anchored Composite if phantom_only
Fixes https://oss-fuzz.com/testcase-detail/5114131137822720
2023-07-02 12:15:43 -06:00
Behdad Esfahbod
645bde4738 [Glyph] Pass phantom-only to gvar only for SIMPLE glyphs
For Composites we need to get the translation offset deltas.
2023-07-02 12:07:22 -06:00
Behdad Esfahbod
e92eefaabb [gvar] Cache two values in shared_tuple_active_idx
Speeds up varc-hangul.ttf draw_glyph by 10%.
2023-07-02 11:38:00 -06:00
Behdad Esfahbod
7d72fdd5bf [benchmark-font] Do some work in draw_glyph callbacks
For no good reason other than matching what I'm adding to
skrifa benchmark.  Doesn't seem to affect benchmarks whatsoever.
2023-07-02 09:56:09 -06:00
Behdad Esfahbod
47b5ee6789
Merge pull request #4306 from harfbuzz/gpos-lazy-device
GPOS lazy Device
2023-07-01 14:48:39 -04:00
Behdad Esfahbod
2d6091fc42 [GPOS] Make AnchorMatrix sanitize lazy again
Was reverted in the previous commit, because it was incomplete.
2023-06-30 11:49:19 -06:00
Behdad Esfahbod
0887382cdf [GPOS] Fix sanitize 2023-06-30 11:39:53 -06:00
Behdad Esfahbod
83eb744e09 [sanizie] Inline check_range if not OPTIMIZE_SIZE
BM_Font/load_face_and_shape/NotoNastaliqUrdu-Regular.ttf/hb                     -0.1046         -0.1051           194           173           193           172
BM_Font/load_face_and_shape/NotoSerifMyanmar-Regular.otf/hb                     -0.2401         -0.2412            36            27            36            27
2023-06-30 11:33:39 -06:00
Behdad Esfahbod
690af7aa69 [GPOS] Sanitize Device tables lazily
This speeds up face loading for variable fonts by 80%!

Comparing before to after
Benchmark                                                                          Time             CPU      Time Old      Time New       CPU Old       CPU New
---------------------------------------------------------------------------------------------------------------------------------------------------------------
BM_Font/load_face_and_shape/Roboto-Regular.ttf/hb                               -0.0368         -0.0366            20            20            20            19
BM_Font/load_face_and_shape/RobotoFlex-Variable.ttf/hb                          -0.7149         -0.7162            77            22            77            22
BM_Font/load_face_and_shape/RobotoFlex-Variable.ttf/var/hb                      -0.7241         -0.7255            80            22            79            22
BM_Font/load_face_and_shape/SourceSansPro-Regular.otf/hb                        -0.1441         -0.1445            28            24            28            24
BM_Font/load_face_and_shape/AdobeVFPrototype.otf/hb                             -0.7893         -0.7910            66            14            66            14
BM_Font/load_face_and_shape/AdobeVFPrototype.otf/var/hb                         -0.7865         -0.7882            67            14            66            14
BM_Font/load_face_and_shape/SourceSerifVariable-Roman.ttf/hb                    -0.8895         -0.8900           227            25           226            25
BM_Font/load_face_and_shape/SourceSerifVariable-Roman.ttf/var/hb                -0.8895         -0.8900           226            25           225            25
BM_Font/load_face_and_shape/Comfortaa-Regular-new.ttf/hb                        -0.5512         -0.5531            42            19            42            19
BM_Font/load_face_and_shape/NotoNastaliqUrdu-Regular.ttf/hb                     -0.1511         -0.1510           227           192           225           191
BM_Font/load_face_and_shape/NotoSerifMyanmar-Regular.otf/hb                     -0.1494         -0.1498            41            35            40            34
OVERALL_GEOMEAN                                                                 -0.6443         -0.6456             0             0             0             0
2023-06-30 11:05:54 -06:00
Behdad Esfahbod
7a35668258 Minor variable fix 2023-06-30 10:50:25 -06:00
Behdad Esfahbod
d338506ccf [GPOS] Reuse sanitize_values_stride_unsafe in another function 2023-06-30 10:13:05 -06:00
Behdad Esfahbod
0fceaef0f7 [benchmark-subset] Report in microseconds, not milli
We're in that range now. :)
2023-06-30 08:50:49 -06:00
Behdad Esfahbod
547dc1a40e [benchmark-font] Add load_face_and_shape benchmark
To measure face-loading performance
2023-06-30 08:48:43 -06:00
Behdad Esfahbod
fcf70af134 [perf] Fix break 2023-06-30 08:43:10 -06:00
Behdad Esfahbod
794fac327c [glyf] Minor another range for loop 2023-06-29 20:56:16 -06:00