summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/harfbuzz-ng/src/hb-cff2-interp-cs.hh
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>2023-02-27 09:53:00 +0100
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>2023-03-01 06:37:29 +0100
commita6edf9cbe5bd1d1c6bc08733f97fc07812126bde (patch)
tree7013520fe3cf1828c75c3eee562c90c41465b567 /src/3rdparty/harfbuzz-ng/src/hb-cff2-interp-cs.hh
parent5f32c9edce208125f642c86a4bc9e73564386243 (diff)
Update Harfbuzz to 7.0.1
Note: 6.4.x update has to be done in a separate commit because it did not get the update to 6.0.0, so the cherry-pick will not apply. Pick-to: 6.2 6.5 Task-number: QTBUG-111535 Change-Id: I9d4aae98f8267827ec983ca89b1310006c6aee78 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/3rdparty/harfbuzz-ng/src/hb-cff2-interp-cs.hh')
-rw-r--r--src/3rdparty/harfbuzz-ng/src/hb-cff2-interp-cs.hh13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/3rdparty/harfbuzz-ng/src/hb-cff2-interp-cs.hh b/src/3rdparty/harfbuzz-ng/src/hb-cff2-interp-cs.hh
index 00c25800e6..915b10cf39 100644
--- a/src/3rdparty/harfbuzz-ng/src/hb-cff2-interp-cs.hh
+++ b/src/3rdparty/harfbuzz-ng/src/hb-cff2-interp-cs.hh
@@ -45,7 +45,7 @@ struct blend_arg_t : number_t
numValues = numValues_;
valueIndex = valueIndex_;
unsigned numBlends = blends_.length;
- if (unlikely (!deltas.resize (numBlends)))
+ if (unlikely (!deltas.resize_exact (numBlends)))
return;
for (unsigned int i = 0; i < numBlends; i++)
deltas.arrayZ[i] = blends_.arrayZ[i];
@@ -55,7 +55,7 @@ struct blend_arg_t : number_t
void reset_blends ()
{
numValues = valueIndex = 0;
- deltas.resize (0);
+ deltas.shrink (0);
}
unsigned int numValues;
@@ -118,7 +118,7 @@ struct cff2_cs_interp_env_t : cs_interp_env_t<ELEM, CFF2Subrs>
region_count = varStore->varStore.get_region_index_count (get_ivs ());
if (do_blend)
{
- if (unlikely (!scalars.resize (region_count)))
+ if (unlikely (!scalars.resize_exact (region_count)))
SUPER::set_error ();
else
varStore->varStore.get_region_scalars (get_ivs (), coords, num_coords,
@@ -163,6 +163,8 @@ struct cff2_cs_interp_env_t : cs_interp_env_t<ELEM, CFF2Subrs>
return v;
}
+ bool have_coords () const { return num_coords; }
+
protected:
const int *coords;
unsigned int num_coords;
@@ -222,7 +224,10 @@ struct cff2_cs_opset_t : cs_opset_t<ELEM, OPSET, cff2_cs_interp_env_t<ELEM>, PAR
const hb_array_t<const ELEM> blends,
unsigned n, unsigned i)
{
- arg.set_blends (n, i, blends);
+ if (env.have_coords ())
+ arg.set_int (round (arg.to_real () + env.blend_deltas (blends)));
+ else
+ arg.set_blends (n, i, blends);
}
template <typename T = ELEM,
hb_enable_if (!hb_is_same (T, blend_arg_t))>