Commit Graph

13608 Commits

Author SHA1 Message Date
Behdad Esfahbod 76fc27713f [vector] Remove explicit std::move
Was confusing compilers. Let them figure it out themselves.

Makes NotoNastaliqu subsetting/1000 benchmark more than twice faster:

Benchmark                                                                       Time             CPU      Time Old      Time New       CPU Old       CPU New
------------------------------------------------------------------------------------------------------------------------------------------------------------
BM_subset/subset_glyphs/NotoNastaliqUrdu-Regular.ttf/1000                    -0.5064         -0.5065           111            55           110            55
BM_subset/subset_codepoints/NotoNastaliqUrdu-Regular.ttf/1000                -0.5494         -0.5493           132            59           131            59
2022-05-12 12:14:07 -06:00
Behdad Esfahbod c81198b5bc [set] Tweak move operators a bit
Should be equivalent.
2022-05-12 12:14:02 -06:00
Behdad Esfahbod 8dc072d20d
Merge pull request #3579 from harfbuzz/subset-retain-buffer
Subset retain buffer
2022-05-11 16:45:40 -06:00
Behdad Esfahbod 175319cd89 [gsubgpos] Clean up OT::ClassDefFormat2::intersected_class_glyphs 0 case 2022-05-11 13:47:17 -06:00
Behdad Esfahbod 137af3612b [gsubgpos] Simplify OT::ClassDefFormat2::intersected_class_glyphs() 2022-05-11 13:39:30 -06:00
Behdad Esfahbod 3261e05bdb [subset] Optimize ClassDef1::intersected_class_glyphs() for class0 2022-05-11 13:16:31 -06:00
Behdad Esfahbod c78d8ba60b [subset] Allocate same size as source table for GSUB/GPOS/name 2022-05-11 13:05:41 -06:00
Behdad Esfahbod 2e7f1ae48f [subset] Use vector.allocated size instead of tracking buf_size 2022-05-11 12:52:27 -06:00
Behdad Esfahbod f08537963b [cff-subset] Pre-alloc vector for operator decoding 2022-05-11 12:14:49 -06:00
Behdad Esfahbod 7edd54f3dd [perf/benchmark-subset] Minor cleanup 2022-05-11 12:14:49 -06:00
Behdad Esfahbod aeb50b8942 [subset] Retain buffer across table subset operations 2022-05-11 12:14:49 -06:00
Behdad Esfahbod bff78e6515 [cff] Convert interpretation environment to use constructor 2022-05-10 16:50:38 -06:00
Behdad Esfahbod de053e2efb [cff] Convert subr_subset_param_t to use constructor 2022-05-10 16:17:20 -06:00
Behdad Esfahbod 96140db485 [cff] Convert cff2_extents_param_t to use constructor 2022-05-10 16:17:20 -06:00
Behdad Esfahbod 54544f2a57 [cff] Convert cff1_extents_param_t to use constructor 2022-05-10 16:17:20 -06:00
Behdad Esfahbod 377befd0c7 [cff] Convert get_seac_param_t to use constructor 2022-05-10 16:17:20 -06:00
Behdad Esfahbod 8fd70362fa [cff] Use hb_ubytes_t() instead of Null(hb_ubytes_t) 2022-05-10 16:17:20 -06:00
Behdad Esfahbod 9033c7f99d [cff-common] Optimize INDEX::operator[]
Previous try showed slowdown in benchmarks, suprisingly.

Rewrite it keeping the function, hopefully allowing better optimization.
2022-05-10 14:58:53 -06:00
Behdad Esfahbod 3aace2431b Revert "[cff-common] Optimize INDEX::operator[]"
This reverts commit 9edb03ac7a.
2022-05-10 14:54:04 -06:00
Behdad Esfahbod b31ef081db Revert "[cff] Add an unlikely()"
This reverts commit 9ba9adb7ed.

This shows slowdown in benchmarks.
2022-05-10 14:52:40 -06:00
Behdad Esfahbod 9ba9adb7ed [cff] Add an unlikely() 2022-05-10 14:43:00 -06:00
Behdad Esfahbod 9edb03ac7a [cff-common] Optimize INDEX::operator[] 2022-05-10 14:43:00 -06:00
Garret Rieger 52d59bf150 [perf] Make subset benchmark data driven. 2022-05-10 14:30:08 -06:00
Behdad Esfahbod 0a42410dc8 [cff2] Change extents/shape stack to be just a number
Do the blending immediately.

Fixes https://github.com/harfbuzz/harfbuzz/issues/3559

Benchmark on AdobeVFPrototype shows 35% speedup. Now we're faster
than FreeType:

Benchmark                                                           Time             CPU      Time Old      Time New       CPU Old       CPU New
------------------------------------------------------------------------------------------------------------------------------------------------
BM_Font/glyph_extents/AdobeVFPrototype.otf/hb                    -0.3792         -0.3792          1584           983          1581           982
BM_Font/glyph_extents/AdobeVFPrototype.otf/ft                    +0.0228         +0.0224          1220          1248          1218          1245
BM_Font/glyph_extents/AdobeVFPrototype.otf/var/hb                -0.3513         -0.3518          1616          1048          1613          1046
BM_Font/glyph_extents/AdobeVFPrototype.otf/var/ft                +0.0172         +0.0169          1232          1254          1230          1251
2022-05-10 13:41:12 -06:00
Garret Rieger 5277a5772b [perf] Add benchmarks for CFF subsetting. 2022-05-10 12:16:44 -06:00
Garret Rieger 8f9f0c494b [subset] Enforce cmap12 group ordering constraints in collect_mapping.
Fixes fuzzer issue: https://oss-fuzz.com/testcase-detail/6365271012540416
2022-05-10 12:15:09 -06:00
Behdad Esfahbod c99ad0f015
Merge pull request #3572 from harfbuzz/cff-stack
Cff stack
2022-05-09 18:52:19 -06:00
Behdad Esfahbod 1b14d2ff13 [cff] Fix arg-stack peek() impl 2022-05-09 18:15:31 -06:00
Behdad Esfahbod 6106ef8c0f [cff] Tighten up arg-stack access 2022-05-09 18:15:11 -06:00
Behdad Esfahbod 8c616a6efe [cff] Allocate stack inline instead of using hb_vector_t
Speeds up glyph_extents and glyph_shape benchmarks for CFF by 10
to 16 percent!
2022-05-09 17:50:59 -06:00
Behdad Esfahbod c941ece60f [cff] Use using instead of typedef 2022-05-09 17:34:58 -06:00
Behdad Esfahbod 64d63cebe2 [cff-common] Use existing types for str_buff_vec_t 2022-05-09 17:34:58 -06:00
Behdad Esfahbod e1838ec1f8 [cff-common] Remove unused method 2022-05-09 17:34:58 -06:00
Behdad Esfahbod 8aa54aaca2 [cff] Replace byte_str_t with hb_bytes_t use 2022-05-09 17:34:58 -06:00
Behdad Esfahbod fe1d85a55a [cff] Remove custom byte_str_t impl 2022-05-09 17:34:58 -06:00
Behdad Esfahbod c8a5f1e3c0 [cff-common] Indent 2022-05-09 17:34:58 -06:00
Behdad Esfahbod be7b2905cb [cff-common] Remove unused INDEX::serialize() method 2022-05-09 17:34:58 -06:00
Behdad Esfahbod 60390169b6 [cff-common] Write str_buf_t::total_size() as dagger 2022-05-09 17:34:58 -06:00
Behdad Esfahbod 258afb45b7 [cff-common] Use range-based loop in str_buff_vec_t 2022-05-09 17:34:58 -06:00
Behdad Esfahbod 8bb1a3ce9a [cff-common] Write INDEX offset-size calc using hb_bit_storage() 2022-05-09 17:34:58 -06:00
Behdad Esfahbod 2ccfe84eff [cff-common] Add assert to INDEX::set_offset_at() 2022-05-09 17:34:58 -06:00
Behdad Esfahbod 4bcab9e99a [cff-common] Use byte_str_t() instead of Null(byte_str_t) 2022-05-09 17:34:58 -06:00
Behdad Esfahbod 94f7a26322 [cff-common] Fix get_size() for Null object
The special-casing didn't make sense.
2022-05-09 17:34:58 -06:00
Behdad Esfahbod c9cc7d5d21 [cff-common] Inline once-used method in INDEX 2022-05-09 17:34:58 -06:00
Behdad Esfahbod 11482a3a39 [cff-common] Remove unused method from INDEX 2022-05-09 17:34:58 -06:00
Behdad Esfahbod d1bb3b08f6 [cff-common] Hide more INDEX internals 2022-05-09 17:34:58 -06:00
Behdad Esfahbod d3b21387fd [cff-common] Remove redundant operator implementation 2022-05-09 17:34:58 -06:00
Behdad Esfahbod a96b408d80 [cff-common] Hide INDEX internals 2022-05-09 17:34:58 -06:00
Behdad Esfahbod 335b1d83cf [cff-common] No need to check max-offset in INDEX
The length_at() function makes sure out-of-range offsets
are discarded. We just need to check the last offset.
2022-05-09 17:34:58 -06:00
Garret Rieger b051f3fa83 [subset] Fix cpal subsetting when there are partial palette overlaps.
The existing code doesn't correctly handle the case where palettes partially overlap in the color record array. This changes the subsetting to only share entries in the color record array when palettes have the same first color index. Partially overlapping palettes will be converted to disjoint segments in the color record array.

Updates one of the color tests to use multiple palettes.

Also fixes fuzzer: https://oss-fuzz.com/testcase-detail/5568200165687296.
2022-05-09 12:25:05 -06:00