Commit Graph

6506 Commits

Author SHA1 Message Date
Behdad Esfahbod dfc86e4b35 [atomic] Fix cast to fallback ptr_get() 2018-08-01 00:22:18 -07:00
Behdad Esfahbod 7a4d576e81 [gobject] Fix copy/paste error 2018-08-01 00:19:25 -07:00
Behdad Esfahbod ad27562742 [atomic] On IBM, use light-weight sync for everything
lwsync() is a full read/write-barrier.  That's all we need, never
need sync().  I'm not sure why an isync() was used in fetch_and_add,
but since that's a read-modify-write, I just changed it to have
lwsync() on both sides.
2018-07-31 23:01:05 -07:00
Behdad Esfahbod fd638d215f [atomic] Add XXX items around Solaris ops
Since add_int and cas are both read-modify-write, I wonder if we
also need a barrier after them.
2018-07-31 23:00:15 -07:00
Behdad Esfahbod 896ff15ae6 [atomic] Fix get() impl
Originally, glib's atomic_get was implemented as "memory_barrier; load".
I copied this into cairo, fontconfig, and harfbuzz.  However, that's
wrong.  Correct way is "load; memory_barrier".  The details are long
and hard to fully grasp.  Best to read:

  https://www.kernel.org/doc/Documentation/memory-barriers.txt

Also see my report against GNOME:

  https://gitlab.gnome.org/GNOME/glib/issues/1449

Note that this is irrelevant if C++11-like atomic ops are available.
2018-07-31 22:51:38 -07:00
Behdad Esfahbod d7a15799d4 [gobject] Hook up hb_map_t 2018-07-31 22:28:28 -07:00
Behdad Esfahbod 63c74e8d1d [atomic] Fix fallback impl 2018-07-31 22:21:21 -07:00
Behdad Esfahbod 4bc16aca47 [atomic] Add get_relaxed / set_relaxed
To help TSan and be more "correct".
2018-07-31 21:29:18 -07:00
Behdad Esfahbod 3dd1b88765 [atomic] Use CONSUME, not ACQUIRE, memory-order for get()
Although, all implementations just elevate that to ACQUIRE.
But requirement for us is just CONSUME.
2018-07-31 20:28:36 -07:00
Behdad Esfahbod 06b91d935d Revert "[atomic] Make pointer get op relaxed instead of acquire"
This reverts commit b1e5650c67.

After lots of head-scratching and finally finding the only truly
readable source to be the good old:

  https://www.kernel.org/doc/Documentation/memory-barriers.txt

I've convinced myself that we need consume memory-ordering on get().
The location of memory-barrier in a load should be after, not before
the load.  That needs fixing.  I'll do that separately.
2018-07-31 20:28:36 -07:00
Garret Rieger 2bdd903c69 [subset] limit the max codepoint value to the unicode limit.
When collecting all codepoints in the cmap avoid using large amount of memory for fonts that declare coverage over all 32 bit integers.
2018-07-31 18:40:38 -07:00
Garret Rieger 7278d9df30 [subset] Add hb_ot_layout_collect_features to harfbuzz-sections.txt.
Add the fuzzer test case for feature collection timeout.
2018-07-31 18:26:09 -07:00
Garret Rieger 89733755a4 [subset] use add_array to populate feature_indexes.
This is much faster then calling a bunch of individual add()'s.
2018-07-31 18:26:09 -07:00
Garret Rieger 7d92bef9c5 [subset] collect features first, then use those to collect lookups. 2018-07-31 18:26:09 -07:00
Behdad Esfahbod af876cce30 [indic] Flip default logic for double-halants in old-school
Oriya went down from 9 to 2.

BENGALI: 353725 out of 354188 tests passed. 463 failed (0.130722%)
DEVANAGARI: 707311 out of 707394 tests passed. 83 failed (0.0117332%)
GUJARATI: 366355 out of 366457 tests passed. 102 failed (0.0278341%)
GURMUKHI: 60729 out of 60747 tests passed. 18 failed (0.0296311%)
KANNADA: 951300 out of 951913 tests passed. 613 failed (0.0643966%)
MALAYALAM: 1048136 out of 1048334 tests passed. 198 failed (0.0188871%)
MYANMAR: 1115830 out of 1123883 tests passed. 8053 failed (0.716534%)
ORIYA: 42327 out of 42329 tests passed. 2 failed (0.00472489%)
SINHALA: 271596 out of 271847 tests passed. 251 failed (0.0923313%)
TAMIL: 1091754 out of 1091754 tests passed. 0 failed (0%)
TELUGU: 970555 out of 970573 tests passed. 18 failed (0.00185457%)
2018-07-31 15:29:48 -07:00
Behdad Esfahbod 92ba9905ca [indic] Allow double-halant in old-spec Devanagari
Fixes https://github.com/harfbuzz/harfbuzz/issues/1071
2018-07-31 15:19:32 -07:00
Behdad Esfahbod fe099a844b [test] Add Khmer tests, with NotoSansKhmer-Regular.ttf
Note that there's minor positioning differences, and ONE reordering
difference between what we get for these and what Uniscribe gets.
Probably same as what's described in commit message for
1a96cc825d
2018-07-31 14:20:31 -07:00
Behdad Esfahbod 5772edc0ea [khmer] Typo 2018-07-31 14:10:31 -07:00
Behdad Esfahbod 2d6edc9008 [test] Add Khmer test texts from recent bugs 2018-07-31 13:56:55 -07:00
Behdad Esfahbod df26a32c8f [test] Move things around for shaper updates 2018-07-31 13:55:53 -07:00
Behdad Esfahbod 6ddd669e20 [khmer] Clear syllables before presentation features
Probably not what Uniscribe does, but good idea?
2018-07-31 13:40:22 -07:00
Behdad Esfahbod 8eef1964a7 [khmer] Revert previous change, and remove pauses
This makes test suite happy again (at 44) while fixing the sequences
we were fixing, which were the following with KhmerUI.ttf:

  U+1789,U+17BC
  U+1789,U+17D2,U+1789
  U+1789,U+17D2,U+1789,U+17BC

Fixes rest of https://github.com/harfbuzz/harfbuzz/issues/974
2018-07-31 13:40:17 -07:00
Behdad Esfahbod 7c658ea2f2 [khmer] Apply ccmp after basic features
Part of https://github.com/harfbuzz/harfbuzz/issues/974
2018-07-31 12:49:02 -07:00
Behdad Esfahbod 1a96cc825d [khmer] Rewrite most of shaper to better follow spec
Khmer spec has only one reordering phase, and only simple prebase
matra and Coeng-Ro reordering.  Implement that.  Specifically,
this was done to address recognizing different orders of the matra
and Coeng-Ro sequence.  That said, some combinations are now
reordered differently from Uniscribe.  Not clear if that's intended
or a bug in Uniscribe.  The following two sequences render the same
in Uniscribe whereas we reorder them differently:

  U+17A0,U+17D2,U+179A,U+17C2
  U+17A0,U+17C2,U+17D2,U+179A

For that reason, our test suite numbers regressed slightly.  Used
to be at 34 for fails, now at:

KHMER: 299080 out of 299124 tests passed. 44 failed (0.0147096%)

But generally a good change, and removed lots of code.

Fixes https://github.com/harfbuzz/harfbuzz/issues/1026
2018-07-31 11:45:32 -07:00
Behdad Esfahbod f5152cea42 [shaper] Move code around 2018-07-31 01:27:04 -07:00
Behdad Esfahbod 36d0fbbc52 [shaper] Remove a macro 2018-07-31 01:15:04 -07:00
Behdad Esfahbod b1e5650c67 [atomic] Make pointer get op relaxed instead of acquire
We only use it before cmpexch, so relaxed is fine and faster for
common case.
2018-07-31 01:02:31 -07:00
Behdad Esfahbod 66ccd8ac40 [serialize] Increase stage count from 8 to 32
Indic shaper uses many stages.  Now we are provably not limiting
functionality whereas the previous limit of 8 was assuming real-world
practices.
2018-07-30 17:03:06 -07:00
Behdad Esfahbod ee8cf91965 [serialize] Remove unused truncate() method 2018-07-30 16:59:41 -07:00
Michiharu Ariza 8782f80cce fixed FDSelect0::sanitize 2018-07-30 15:27:20 -07:00
Michiharu Ariza 9c4cadaef0 Added sanitize functions & calls
Added sanitize functions to FDSelect
Added satnitize calls for FDSelect, VariationStore, FDArray, TopDict
2018-07-30 14:28:40 -07:00
Michiharu Ariza 161b642ec5 Merge branch 'master' into cff-subset 2018-07-30 12:22:09 -07:00
Garret Rieger 5edf454aa6 [subset] During lookup collection remember the features we've already processed. 2018-07-27 17:29:00 -07:00
Behdad Esfahbod 42c183f803 Minor 2018-07-27 14:55:29 -07:00
Behdad Esfahbod ecab6604e5 [serialize] Allocate for markFilteringSet 2018-07-27 14:54:15 -07:00
Behdad Esfahbod 7f08818c44 Minor 2018-07-27 14:54:15 -07:00
prrace 2e25d8f491 Fix unlikely leaks 2018-07-27 14:54:08 -07:00
Behdad Esfahbod 3c2842cbcf Add hb-iter-private.hh
Unused so far.
2018-07-25 17:07:17 -07:00
Behdad Esfahbod 92b1e025c6 Move some code from hb-open-type-private.hh to hb-machinery-private.hh 2018-07-25 16:58:47 -07:00
Behdad Esfahbod 6b11fea997 [closure] Allocate out set on the stack 2018-07-25 16:01:37 -07:00
Behdad Esfahbod 74467b7901 Fix compile 2018-07-25 14:30:07 -07:00
Behdad Esfahbod bf90f35302 [coretext] Add note 2018-07-25 13:57:24 -07:00
Garret Rieger fb58cb4b5c [subset] Only used reachable lookups for gsub closure. 2018-07-25 13:56:58 -07:00
Behdad Esfahbod c38bd4025f [closure] Separate in and out glyphs
Fixes https://github.com/harfbuzz/harfbuzz/issues/1107
2018-07-24 13:47:32 -07:00
Garret Rieger 85646fdadb [subset] Limit the iterations of the closure algorithm.
Prevents O(n^2) run times.
2018-07-23 16:01:57 -07:00
Behdad Esfahbod 94759d4cf8 Fix visibility on mingw32
Should fix bots again.
2018-07-23 15:08:32 -07:00
Behdad Esfahbod 61eddbd8ef Fix infinite loop in loading num_glyphs within sanitizer 2018-07-23 14:44:10 -07:00
Behdad Esfahbod e22a48ac95 One more visibility trick
Should fix Windows build again.
2018-07-23 13:24:26 -07:00
Behdad Esfahbod e57a638bde One more 2018-07-23 12:00:02 -07:00
Behdad Esfahbod 36ed163fdd Remove unnecessary OT:: namespace specifiers 2018-07-23 11:57:45 -07:00