[COLR] Pepper some hb_barrier()'s around

The version is a minor version (because uint16), as such
version > 1 should be considered as supporting version 1
data.
pull/4893/head
Behdad Esfahbod 4 months ago
parent cec95a2d26
commit 008505e1c4
  1. 24
      src/OT/Color/COLR/COLR.hh

@ -2080,7 +2080,7 @@ struct COLR
bool has_v0_data () const { return numBaseGlyphs; }
bool has_v1_data () const
{
if (version != 1)
if (version < 1)
return false;
hb_barrier ();
@ -2180,7 +2180,7 @@ struct COLR
hb_set_t *variation_indices,
hb_set_t *delta_set_indices) const
{
if (version != 1) return;
if (version < 1) return;
hb_barrier ();
hb_set_t visited_glyphs;
@ -2222,16 +2222,16 @@ struct COLR
{ return (this+baseGlyphList); }
bool has_var_store () const
{ return version >= 1 && varStore != 0; }
{ return version >= 1 && hb_barrier () && varStore != 0; }
bool has_delta_set_index_map () const
{ return version >= 1 && varIdxMap != 0; }
{ return version >= 1 && hb_barrier () && varIdxMap != 0; }
const DeltaSetIndexMap &get_delta_set_index_map () const
{ return (version == 0 || varIdxMap == 0) ? Null (DeltaSetIndexMap) : this+varIdxMap; }
{ return has_delta_set_index_map () && hb_barrier () ? this+varIdxMap : Null (DeltaSetIndexMap); }
const ItemVariationStore &get_var_store () const
{ return (version == 0 || varStore == 0) ? Null (ItemVariationStore) : this+varStore; }
{ return has_var_store () && hb_barrier () ? this+varStore : Null (ItemVariationStore); }
bool sanitize (hb_sanitize_context_t *c) const
{
@ -2242,7 +2242,6 @@ struct COLR
(this+layersZ).sanitize (c, numLayers) &&
(version == 0 ||
(hb_barrier () &&
version == 1 &&
baseGlyphList.sanitize (c, this) &&
layerList.sanitize (c, this) &&
clipList.sanitize (c, this) &&
@ -2465,7 +2464,9 @@ struct COLR
if (unlikely (!c->serializer->extend_min (colr_prime))) return_trace (false);
if (version == 0 || downgrade_to_V0 (glyphset))
return_trace (colr_prime->serialize_V0 (c->serializer, 0, base_it, layer_it));
return_trace (colr_prime->serialize_V0 (c->serializer, 0, base_it, layer_it));
hb_barrier ();
//start version 1
if (!c->serializer->allocate_size<void> (5 * HBUINT32::static_size)) return_trace (false);
@ -2505,8 +2506,9 @@ struct COLR
bool
get_extents (hb_font_t *font, hb_codepoint_t glyph, hb_glyph_extents_t *extents) const
{
if (version == 1)
if (version >= 1)
{
hb_barrier ();
ItemVarStoreInstancer instancer (&(this+varStore),
&(this+varIdxMap),
hb_array (font->coords, font->num_coords));
@ -2545,7 +2547,7 @@ struct COLR
bool
has_paint_for_glyph (hb_codepoint_t glyph) const
{
if (version == 1)
if (version >= 1)
{
hb_barrier ();
@ -2576,7 +2578,7 @@ struct COLR
hb_paint_context_t c (this, funcs, data, font, palette_index, foreground, instancer);
c.current_glyphs.add (glyph);
if (version == 1)
if (version >= 1)
{
hb_barrier ();

Loading…
Cancel
Save