Commit Graph

10278 Commits

Author SHA1 Message Date
Behdad Esfahbod efa2a5796e [map] Add hb_map_copy()
New API:
+ hb_map_copy()
2022-05-26 05:01:57 -06:00
Behdad Esfahbod 3b28cff9c0 [cff1] Fix null dereference on memory alloc failure 2022-05-26 04:42:17 -06:00
Behdad Esfahbod 8df9aba997 Actually try to fix null-size undefined behavior
Related to:
https://github.com/harfbuzz/harfbuzz/pull/2067
https://bugzilla.mozilla.org/show_bug.cgi?id=1577584
2022-05-26 03:59:21 -06:00
Behdad Esfahbod 6010feeeb5 [varStore] Rename variable as per review
https://github.com/harfbuzz/harfbuzz/pull/3605
2022-05-24 09:01:02 -06:00
Behdad Esfahbod 3eb7eff487 Remove varstore cache use if HB_NO_VAR 2022-05-21 15:25:53 -06:00
Behdad Esfahbod 099482a37a [ot-font] Cache v_advance varstore as well 2022-05-21 15:24:23 -06:00
Behdad Esfahbod d9acc045f1 [VarStore] Sprinkle cache_t type around
It's available so no need to use void*.
2022-05-21 15:12:14 -06:00
Behdad Esfahbod da38312e42 [VarStore] Pepper cache with likely() 2022-05-21 15:12:14 -06:00
Behdad Esfahbod cf8f00e354 [VarStore] Don't use NAN
Is faster.

With this, I'm seeing 25 to 28% speedup in glyph_h_advances benchmark
of benchmark-font for var/hb tests.
2022-05-21 15:12:14 -06:00
Behdad Esfahbod 5336ba70f6 [HVAR] Cache VarStore region scalars 2022-05-21 15:12:14 -06:00
Behdad Esfahbod 880f50f7e4 Refactor varstore cache 2022-05-21 15:12:14 -06:00
Behdad Esfahbod f2a2fb91a3 [GPOS] Cache VarStore region scalars 2022-05-21 15:12:14 -06:00
Behdad Esfahbod 5fbc70c59b [VarStore] Add cache API 2022-05-21 15:12:14 -06:00
Behdad Esfahbod 05e82aa12e [ft] Add missing lock to kerning function 2022-05-20 17:36:59 -06:00
Behdad Esfahbod 4ea2725704 [set/map] Expose hash API publicly
New API:
+ hb_set_hash()
+ hb_map_hash()
2022-05-20 13:19:48 -06:00
Behdad Esfahbod 2e186d9f24 [buffer] Improve hash function of segment_properties_t 2022-05-20 13:19:48 -06:00
Khaled Hosny aee123fc83 4.3.0 2022-05-20 21:07:25 +02:00
Behdad Esfahbod 975a5f9194 [array] Use hb_memcmp instead of memcmp
Fixes ubsan error.
2022-05-20 12:34:49 -06:00
Behdad Esfahbod 55804e8d68 [hb-ft] Minor rearrange of struct members
To make clear what members the lock protects.
2022-05-20 11:40:44 -06:00
Garret Rieger cbf8f44c9b [subset-perf] swap instead of copying vertice's when reordering during sort. 2022-05-20 09:41:18 -06:00
Garret Rieger b32ca2a292 [subset-perf] remove sort_kahn from repacker.
Without an optimized FIFO queue implementation it's nearly as slow as the now optimized sort_shortest_distance.
2022-05-20 09:41:18 -06:00
Behdad Esfahbod 4266cf3be2 [array] Specialize operator== for bytes_t and ubytes_t 2022-05-19 18:16:54 -06:00
Behdad Esfahbod 6eaa22e9d7 [serialize] Reduce link_t size from 16 to 12 2022-05-19 18:16:54 -06:00
Behdad Esfahbod 30ba9a39e2 [vector] Add emplacing push implementation 2022-05-19 18:16:48 -06:00
Garret Rieger 73b8360dcf [subset] fix fuzzer found underflow when heap push fails.
Fixes https://oss-fuzz.com/testcase-detail/5148625505746944.
2022-05-19 17:02:34 -06:00
Behdad Esfahbod f1bf14ea89 Revert "[set] Cache hash value"
This reverts commit 44952bcc25.

While we investivate https://github.com/harfbuzz/harfbuzz/issues/3599
2022-05-19 16:49:27 -06:00
Behdad Esfahbod b4d1ec310c [algs] Declare coerce() as constexpr 2022-05-19 16:06:21 -06:00
Behdad Esfahbod 2fdb7616f5 [map Further adjust hash function 2022-05-19 16:00:43 -06:00
Behdad Esfahbod 01fc90b68c [map] Adjust hash function 2022-05-19 16:00:06 -06:00
Behdad Esfahbod a47b0aebf5 [vector] Fix remove() implementation
test-vector under valgrind happy now.
2022-05-19 15:52:16 -06:00
Behdad Esfahbod 3bd755c32d [test-vector] Test remove()
Currently buggy. Valgrind confirms.
2022-05-19 15:51:18 -06:00
Behdad Esfahbod 58f848daa8 [set/map] Adjust hash function return type 2022-05-19 15:43:19 -06:00
Behdad Esfahbod 6544fc284f [vector] Add further copy implementation 2022-05-19 15:43:15 -06:00
Behdad Esfahbod c19f116952 [meta] Remove non-existing gcc4 trait implementation 2022-05-19 15:43:15 -06:00
Behdad Esfahbod 679b900e9b [meta] Fix gcc4 trait implementation 2022-05-19 15:43:15 -06:00
Behdad Esfahbod fb77f48ffd [vector] Optimize vector copy 2022-05-19 15:43:15 -06:00
Behdad Esfahbod 28b44ac46a [set] Switch set copy to vector operator =
Slows it down currently.
2022-05-19 15:43:15 -06:00
Behdad Esfahbod 37d3275dec [test-vector] Enable disabled test
This seems to work already.
2022-05-19 15:43:15 -06:00
Behdad Esfahbod 544ffb913e [set] Adjust grow_vector condition 2022-05-19 15:43:15 -06:00
Behdad Esfahbod 0623aa598b [benchmark-set] Add benchmark for set copy 2022-05-19 15:43:15 -06:00
Behdad Esfahbod 44952bcc25 [set] Cache hash value 2022-05-19 14:02:48 -06:00
Behdad Esfahbod 844ac328e4 [set] Fix hb_set_t hash stability 2022-05-19 13:54:31 -06:00
Behdad Esfahbod 2d0b1248b2 [test-map] Test hb_set_t hash stability
Fails currently.
2022-05-19 13:53:53 -06:00
Behdad Esfahbod 561e02fefb [map] Make hb_map_t hashable 2022-05-19 13:41:53 -06:00
Behdad Esfahbod ad17699089 [map] Add is_equal() / towards making hb_map_t hashable
New API:
+ hb_map_is_equal()
2022-05-19 13:36:12 -06:00
Behdad Esfahbod 14a24d8e3f [vector] Make hb_vector_t hashable 2022-05-19 13:04:06 -06:00
Behdad Esfahbod 124f9aeb9b [set] Make hb_set_t hashable 2022-05-19 12:58:02 -06:00
Garret Rieger 3ab2c7935f [subset-perf] Signficiantly speed up ClassDef*::subset.
Eliminates the usage of a glyph -> klass hash map and replaces it with a vector storing the mapping. This allows us to use the vector directly as the iterator driving the serialize. Approximately 1% speedup for Noto Nastaliq.
2022-05-19 12:37:28 -06:00
David Corbett e3e685e5ee [ot-tags] Fix `min_subtag_len` calculations 2022-05-18 18:30:01 -06:00
Garret Rieger 0b1c2ff96a [subset-perf] Remove extra map lookup in ClassDef subset methods. 2022-05-18 18:25:36 -06:00