Merge pull request #5689 from harfbuzz/draw-varc-opts

[VARC] draw() optimizations
This commit is contained in:
Behdad Esfahbod authored and GitHub committed 2025-12-21 21:41:20 -07:00
commit 1cff2c31f0
2 files changed
+23 -4

No files matched your search

+12 -3
View File
@@ -1802,7 +1802,7 @@ struct TupleValues
{
iter_t (const unsigned char *p_, unsigned len_)
: p (p_), endp (p_ + len_)
{ if (ensure_run ()) read_value (); }
{ if (likely (ensure_run ())) read_value (); }
private:
const unsigned char *p;
@@ -1811,10 +1811,14 @@ struct TupleValues
signed run_count = 0;
unsigned width = 0;
HB_ALWAYS_INLINE
bool ensure_run ()
{
if (likely (run_count > 0)) return true;
return _ensure_run ();
}
bool _ensure_run ()
{
if (unlikely (p >= endp))
{
run_count = 0;
@@ -1904,10 +1908,15 @@ struct TupleValues
signed run_count = 0;
unsigned width = 0;
HB_ALWAYS_INLINE
bool ensure_run ()
{
if (run_count > 0) return true;
if (likely (run_count > 0)) return true;
return _ensure_run ();
}
bool _ensure_run ()
{
if (unlikely (p >= end))
{
run_count = 0;
+11 -1
View File
@@ -2586,7 +2586,17 @@ struct hb_scalar_cache_t
void clear ()
{
auto *values = &static_values[0];
for (unsigned i = 0; i < length; i++)
unsigned i = 0;
#ifndef HB_OPTIMIZE_SIZE
for (; i + 3 < length; i += 4)
{
values[i + 0] = INVALID;
values[i + 1] = INVALID;
values[i + 2] = INVALID;
values[i + 3] = INVALID;
}
#endif
for (; i < length; i++)
values[i] = INVALID;
}