Adenilson Cavalcanti
4a719a7f4c
Optimize harfbuzz big integer conversions
...
Profiling showed that type conversions were adding considerable cycles in time
spent doing text shaping.
The idea is to optimize it using native processor instructions to help Blink
layout performance.
Doing further investigation revelead that compilers may not use the
proper instruction on ARM 32bits builds (i.e. REV16).
One way to insure that the generated ASM was ideal for both gcc/clang
was using __builtin_bswap16.
Added bonus is that we no longer need to test for CPU architecture.
2018-11-27 13:43:05 -08:00
Behdad Esfahbod
cfb9771a3b
[coretext] Try to fix
2018-11-16 03:25:07 -05:00
Behdad Esfahbod
ce5da0f36a
[shaper] Rewrite shaper data code to be more template-driven than macro-driven
2018-11-16 02:52:20 -05:00
Behdad Esfahbod
dc4225ccd1
Don't retry creating again and again in lazy_loader if create failed
...
Still does that if get_null() returns nullptr. Our shaper data objects
are like that. Shrug.
2018-11-13 20:48:46 -05:00
Behdad Esfahbod
274f4c726f
Rename check_array2() to check_array()
2018-11-12 14:24:36 -05:00
Behdad Esfahbod
e014405a21
Rename check_array(array, a, b) to check_range()
2018-11-12 14:23:31 -05:00
Behdad Esfahbod
c8f4cc4927
[kerx] Fix integer overflow in multiply
...
Fixes https://oss-fuzz.com/v2/testcase-detail/5754863779053568
2018-11-12 14:11:29 -05:00
Behdad Esfahbod
1fd183ee1c
Finish off eecccc919c
2018-11-11 16:47:52 -05:00
Behdad Esfahbod
eecccc919c
Don't store to null object
...
Ouch :).
2018-11-11 15:48:47 -05:00
Behdad Esfahbod
903856ab50
Remove unused function
2018-11-11 15:45:58 -05:00
Behdad Esfahbod
a953b64750
Revert parts of previous commit that made clang unhappy
2018-11-10 20:10:03 -05:00
Behdad Esfahbod
1d66cdcf77
Better fix for MSVC 2008
...
Follow up on b4c6113032
Fixes https://github.com/harfbuzz/harfbuzz/issues/1374
2018-11-10 19:57:51 -05:00
Behdad Esfahbod
f6fc5574d3
Add pointer magic operators to hb_atomic_ptr_t
2018-11-05 13:23:54 -05:00
Behdad Esfahbod
138f9e0f25
Minor
2018-10-30 01:31:13 -07:00
Ebrahim Byagowi
f7a08cd41d
Fix extra semicolon issues and test that on CI ( #1330 )
2018-10-30 11:29:09 +03:30
Behdad Esfahbod
35d410f2ba
Remove ASSERT_POD
...
Newer compilers / language allows structs with constructor in union.
So, this was not actually testing anything. Indeed, the recent
change in DISALLOW_COPY *is* making some of our types non-POD.
That broke some bots.
Just remove this since it wasn't doing much, and I'd rather have
DISALLOW_COPY.
2018-10-29 14:45:44 -07:00
Behdad Esfahbod
6f0454e176
Fix extra-semicolon warnings
2018-10-29 13:51:15 -07:00
Behdad Esfahbod
39bd07aed5
Fix bunch of unused parameter warnings
...
Show up with gcc -O0.
There's a few more but those are functions that need to be filled in.
Maybe this is a lost battle...
2018-10-26 21:22:26 -07:00
Behdad Esfahbod
955aa56b11
[vector] Make it act more like pointer
...
Add pointer cast operator and plus operator.
2018-10-25 16:50:38 -07:00
Garret Rieger
aa5af8d041
Fix size calculation in DEFINE_SIZE_ARRAY_SIZED.
2018-10-23 16:04:21 -07:00
Behdad Esfahbod
f7c0b4319c
[aat] Implement LookupFormat10
2018-10-19 15:23:49 -07:00
Bruce Mitchener
257d0e5aa3
Fix typos.
2018-10-19 19:24:05 +03:30
Behdad Esfahbod
c406aca193
Fix warning
2018-10-17 22:58:43 -07:00
Behdad Esfahbod
83780308b4
[aat] Fix sanitize slowdown
...
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=11034
2018-10-17 22:34:16 -07:00
Behdad Esfahbod
e9f9c0d81c
[sanitize] Reorder condition to silence bogus gcc warning
...
Was givin a dozen of:
../../src/hb-machinery.hh: In member function ‘bool AAT::ankr::sanitize(hb_sanitize_context_t*) const’:
../../src/hb-machinery.hh:307:23: warning: missed loop optimization, the loop counter may overflow [-Wunsafe-loop-optimizations]
bool ok = --this->max_ops > 0 &&
~~~~~~~~~~~~~~~~~~~~~~
this->start <= p &&
~~~~~~~~~~~~~~~~~~~
p <= this->end &&
~~~~~~~~~~~~~~~^~
(unsigned int) (this->end - p) >= len;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I believe those are bogus, but this silences them and does not introduce
logic issues I believe.
2018-10-12 16:06:39 -04:00
Behdad Esfahbod
7fa69e92ca
Comment
2018-10-10 19:02:32 -04:00
Behdad Esfahbod
d35315cc02
[aat] Fixup recent commit
...
For 329f240108
max_ops is signed.
2018-10-09 23:17:32 -04:00
Behdad Esfahbod
948f59a13a
[kerx] Use subtable range for runtime checks
2018-10-09 23:07:47 -04:00
Behdad Esfahbod
329f240108
[aat] Set embedded sanitizer max ops really high
...
Since we consume it legitimately during shaping.
2018-10-09 23:03:20 -04:00
Behdad Esfahbod
341206eb60
[vector] Make hb_vector_t relocatable / nestable
...
Ugly, but...
Fixes https://github.com/harfbuzz/harfbuzz/issues/1227
2018-10-05 18:39:48 +02:00
Behdad Esfahbod
606bf57430
Revert forcing use of single-parameter static_assert()
...
Some clang versions define static_assert as a macro apparently, so we cannot
redefine it...
This reverts commit 94bfea0ce6
.
This reverts commit 4e62627831
.
2018-09-16 19:34:39 +02:00
Behdad Esfahbod
4e62627831
Enforce single-param static_assert() only
...
So we don't accidentally break it again.
2018-09-16 18:09:36 +02:00
Behdad Esfahbod
9507b05a7a
Simplify sanitize->check_array()
...
Fix a bug in CBDT sanitize, and redundant check in avar.
2018-09-10 23:18:23 +02:00
Behdad Esfahbod
fda994e1d4
Use enum instead of "static const" in class scope
...
Technically, static const needs an out-of-class definition. Eg:
CXXLD libharfbuzz-subset.la
Undefined symbols for architecture x86_64:
"OT::FeatureVariationRecord::min_size", referenced from:
bool OT::GSUBGPOS::subset<OT::PosLookup>(hb_subset_context_t*) constin libharfbuzz_subset_la-hb-subset.o
bool OT::GSUBGPOS::subset<OT::SubstLookup>(hb_subset_context_t*) constin libharfbuzz_subset_la-hb-subset.o
"OT::Record<OT::LangSys>::min_size", referenced from:
OT::Script::subset(hb_subset_context_t*) constin libharfbuzz_subset_la-hb-subset.o
"OT::IntType<unsigned short, 2u>::min_size", referenced from:
OT::Script::subset(hb_subset_context_t*) constin libharfbuzz_subset_la-hb-subset.o
OT::RecordListOf<OT::Feature>::subset(hb_subset_context_t*) const in libharfbuzz_subset_la-hb-subset.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
make[4]: *** [libharfbuzz-subset.la] Error 1
make[3]: *** [all-recursive] Error 1
make[2]: *** [all] Error 2
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
Exited with code 2
2018-09-07 15:02:57 -04:00
Behdad Esfahbod
0d160d5ff5
[subset] Implement subsetting of SingleSubst
2018-09-04 14:20:35 -07:00
Behdad Esfahbod
dc50493a8d
[subset] Towards subsetting SingleSubstFormat1
...
Why does subset plan not have a hb_set_t of glyphs?
2018-09-03 18:23:23 -07:00
Behdad Esfahbod
bfa72a9a72
[subset] Towards GSUB/GPOS subsetting
...
Add subset() call for GSUBGPOS struct and its dependencies.
Not hooked up anywhere.
2018-09-01 18:34:50 -07:00
Behdad Esfahbod
6803ed8674
[serialize] Add reset()
2018-08-31 17:11:08 -07:00
Behdad Esfahbod
e58b190292
[subset] De-templatize hb_subset_context_t
...
We're going to (finally) use virtual methods for hb_serialize_context_t
customization, so don't need to carry a Serializer template variable
around... Simplifies code.
2018-08-31 16:46:35 -07:00
Behdad Esfahbod
22acd424ca
[serialize] Add a couple small methods
2018-08-31 16:41:18 -07:00
Behdad Esfahbod
a23b892fe6
Shuffle
2018-08-29 18:28:39 -07:00
Behdad Esfahbod
e6cb938065
[ot-face] Unify accelerators and tables
2018-08-26 00:21:29 -07:00
Behdad Esfahbod
f36ae6f8a8
[ot-font] Make everything (cmap/metrics) lazy
2018-08-25 23:26:45 -07:00
Behdad Esfahbod
c77ae40852
Rename hb-*private.hh to hb-*.hh
...
Sorry for the noise, downstream custom builders. Please adjust.
2018-08-25 22:36:36 -07:00