mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-29 01:23:56 +01:00
[font] Acquire a scratch for v-origins
Still too slow.
This commit is contained in:
1 parent
76357479e3
commit
a40f85aff7
2 files changed
+4
-2
No files matched your search
+1
-1
@@ -403,6 +403,7 @@ struct glyf_accelerator_t
|
||||
float
|
||||
get_v_origin_with_var_unscaled (hb_codepoint_t gid,
|
||||
hb_font_t *font,
|
||||
hb_glyf_scratch_t &scratch,
|
||||
hb_scalar_cache_t *gvar_cache = nullptr) const
|
||||
{
|
||||
if (unlikely (gid >= num_glyphs)) return 0;
|
||||
@@ -410,7 +411,6 @@ struct glyf_accelerator_t
|
||||
bool success = false;
|
||||
|
||||
contour_point_t phantoms[glyf_impl::PHANTOM_COUNT];
|
||||
hb_glyf_scratch_t scratch;
|
||||
success = get_points (font, gid, points_aggregator_t (font, nullptr, phantoms, false),
|
||||
hb_array (font->coords,
|
||||
font->has_nonzero_coords ? font->num_coords : 0),
|
||||
|
||||
+3
-1
@@ -659,6 +659,7 @@ hb_ot_get_glyph_v_origins (hb_font_t *font,
|
||||
const auto &glyf = *ot_face->glyf;
|
||||
if (origin_cache && vmtx.has_data() && glyf.has_data ())
|
||||
{
|
||||
auto *scratch = glyf.acquire_scratch ();
|
||||
OT::hb_scalar_cache_t *gvar_cache = font->has_nonzero_coords ?
|
||||
ot_font->draw.acquire_gvar_cache (*ot_face->gvar) :
|
||||
nullptr;
|
||||
@@ -671,7 +672,7 @@ hb_ot_get_glyph_v_origins (hb_font_t *font,
|
||||
origin = cv;
|
||||
else
|
||||
{
|
||||
origin = font->em_scalef_y (glyf.get_v_origin_with_var_unscaled (*first_glyph, font, gvar_cache));
|
||||
origin = font->em_scalef_y (glyf.get_v_origin_with_var_unscaled (*first_glyph, font, *scratch, gvar_cache));
|
||||
origin_cache->set (*first_glyph, origin);
|
||||
}
|
||||
|
||||
@@ -683,6 +684,7 @@ hb_ot_get_glyph_v_origins (hb_font_t *font,
|
||||
|
||||
if (gvar_cache)
|
||||
ot_font->draw.release_gvar_cache (gvar_cache);
|
||||
glyf.release_scratch (scratch);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user