Add hb_barrier() to switches of unions

https://github.com/harfbuzz/harfbuzz/pull/4864#issuecomment-2366923736
This commit is contained in:
Behdad Esfahbod committed 2024-09-23 08:02:25 -06:00
1 parent 7aace3d3fc
commit 7a890c2eb7
13 files changed
+260 -260

No files matched your search

+23 -23
View File
@@ -468,11 +468,11 @@ struct Lookup
const T* get_value (hb_codepoint_t glyph_id, unsigned int num_glyphs) const
{
switch (u.format) {
case 0: return u.format0.get_value (glyph_id, num_glyphs);
case 2: return u.format2.get_value (glyph_id);
case 4: return u.format4.get_value (glyph_id);
case 6: return u.format6.get_value (glyph_id);
case 8: return u.format8.get_value (glyph_id);
case 0: hb_barrier (); return u.format0.get_value (glyph_id, num_glyphs);
case 2: hb_barrier (); return u.format2.get_value (glyph_id);
case 4: hb_barrier (); return u.format4.get_value (glyph_id);
case 6: hb_barrier (); return u.format6.get_value (glyph_id);
case 8: hb_barrier (); return u.format8.get_value (glyph_id);
default:return nullptr;
}
}
@@ -481,7 +481,7 @@ struct Lookup
{
switch (u.format) {
/* Format 10 cannot return a pointer. */
case 10: return u.format10.get_value_or_null (glyph_id);
case 10: hb_barrier (); return u.format10.get_value_or_null (glyph_id);
default:
const T *v = get_value (glyph_id, num_glyphs);
return v ? *v : Null (T);
@@ -492,12 +492,12 @@ struct Lookup
void collect_glyphs (set_t &glyphs, unsigned int num_glyphs) const
{
switch (u.format) {
case 0: u.format0.collect_glyphs (glyphs, num_glyphs); return;
case 2: u.format2.collect_glyphs (glyphs); return;
case 4: u.format4.collect_glyphs (glyphs); return;
case 6: u.format6.collect_glyphs (glyphs); return;
case 8: u.format8.collect_glyphs (glyphs); return;
case 10: u.format10.collect_glyphs (glyphs); return;
case 0: hb_barrier (); u.format0.collect_glyphs (glyphs, num_glyphs); return;
case 2: hb_barrier (); u.format2.collect_glyphs (glyphs); return;
case 4: hb_barrier (); u.format4.collect_glyphs (glyphs); return;
case 6: hb_barrier (); u.format6.collect_glyphs (glyphs); return;
case 8: hb_barrier (); u.format8.collect_glyphs (glyphs); return;
case 10: hb_barrier (); u.format10.collect_glyphs (glyphs); return;
default:return;
}
}
@@ -516,12 +516,12 @@ struct Lookup
if (!u.format.sanitize (c)) return_trace (false);
hb_barrier ();
switch (u.format) {
case 0: return_trace (u.format0.sanitize (c));
case 2: return_trace (u.format2.sanitize (c));
case 4: return_trace (u.format4.sanitize (c));
case 6: return_trace (u.format6.sanitize (c));
case 8: return_trace (u.format8.sanitize (c));
case 10: return_trace (u.format10.sanitize (c));
case 0: hb_barrier (); return_trace (u.format0.sanitize (c));
case 2: hb_barrier (); return_trace (u.format2.sanitize (c));
case 4: hb_barrier (); return_trace (u.format4.sanitize (c));
case 6: hb_barrier (); return_trace (u.format6.sanitize (c));
case 8: hb_barrier (); return_trace (u.format8.sanitize (c));
case 10: hb_barrier (); return_trace (u.format10.sanitize (c));
default:return_trace (true);
}
}
@@ -531,11 +531,11 @@ struct Lookup
if (!u.format.sanitize (c)) return_trace (false);
hb_barrier ();
switch (u.format) {
case 0: return_trace (u.format0.sanitize (c, base));
case 2: return_trace (u.format2.sanitize (c, base));
case 4: return_trace (u.format4.sanitize (c, base));
case 6: return_trace (u.format6.sanitize (c, base));
case 8: return_trace (u.format8.sanitize (c, base));
case 0: hb_barrier (); return_trace (u.format0.sanitize (c, base));
case 2: hb_barrier (); return_trace (u.format2.sanitize (c, base));
case 4: hb_barrier (); return_trace (u.format4.sanitize (c, base));
case 6: hb_barrier (); return_trace (u.format6.sanitize (c, base));
case 8: hb_barrier (); return_trace (u.format8.sanitize (c, base));
case 10: return_trace (false); /* We don't support format10 here currently. */
default:return_trace (true);
}
+6 -6
View File
@@ -189,12 +189,12 @@ struct ActionSubrecord
switch (u.header.actionType)
{
case 0: return_trace (u.decompositionAction.sanitize (c));
case 1: return_trace (u.unconditionalAddGlyphAction.sanitize (c));
case 2: return_trace (u.conditionalAddGlyphAction.sanitize (c));
// case 3: return_trace (u.stretchGlyphAction.sanitize (c));
case 4: return_trace (u.decompositionAction.sanitize (c));
case 5: return_trace (u.decompositionAction.sanitize (c));
case 0: hb_barrier (); return_trace (u.decompositionAction.sanitize (c));
case 1: hb_barrier (); return_trace (u.unconditionalAddGlyphAction.sanitize (c));
case 2: hb_barrier (); return_trace (u.conditionalAddGlyphAction.sanitize (c));
// case 3: hb_barrier (); return_trace (u.stretchGlyphAction.sanitize (c));
case 4: hb_barrier (); return_trace (u.decompositionAction.sanitize (c));
case 5: hb_barrier (); return_trace (u.decompositionAction.sanitize (c));
default: return_trace (true);
}
}
+4 -4
View File
@@ -133,8 +133,8 @@ struct opbd
{
switch (format)
{
case 0: return u.format0.get_bounds (font, glyph_id, extents, this);
case 1: return u.format1.get_bounds (font, glyph_id, extents, this);
case 0: hb_barrier (); return u.format0.get_bounds (font, glyph_id, extents, this);
case 1: hb_barrier (); return u.format1.get_bounds (font, glyph_id, extents, this);
default:return false;
}
}
@@ -148,8 +148,8 @@ struct opbd
switch (format)
{
case 0: return_trace (u.format0.sanitize (c, this));
case 1: return_trace (u.format1.sanitize (c, this));
case 0: hb_barrier (); return_trace (u.format0.sanitize (c, this));
case 1: hb_barrier (); return_trace (u.format1.sanitize (c, this));
default:return_trace (true);
}
}
+3 -3
View File
@@ -250,7 +250,7 @@ struct TTCHeader
{
switch (u.header.version.major) {
case 2: /* version 2 is compatible with version 1 */
case 1: return u.version1.get_face_count ();
case 1: hb_barrier (); return u.version1.get_face_count ();
default:return 0;
}
}
@@ -258,7 +258,7 @@ struct TTCHeader
{
switch (u.header.version.major) {
case 2: /* version 2 is compatible with version 1 */
case 1: return u.version1.get_face (i);
case 1: hb_barrier (); return u.version1.get_face (i);
default:return Null (OpenTypeFontFace);
}
}
@@ -270,7 +270,7 @@ struct TTCHeader
hb_barrier ();
switch (u.header.version.major) {
case 2: /* version 2 is compatible with version 1 */
case 1: return_trace (u.version1.sanitize (c));
case 1: hb_barrier (); return_trace (u.version1.sanitize (c));
default:return_trace (true);
}
}
+8 -8
View File
@@ -308,8 +308,8 @@ struct FDSelect
{
switch (format)
{
case 0: return format.static_size + u.format0.get_size (num_glyphs);
case 3: return format.static_size + u.format3.get_size ();
case 0: hb_barrier (); return format.static_size + u.format0.get_size (num_glyphs);
case 3: hb_barrier (); return format.static_size + u.format3.get_size ();
default:return 0;
}
}
@@ -320,8 +320,8 @@ struct FDSelect
switch (format)
{
case 0: return u.format0.get_fd (glyph);
case 3: return u.format3.get_fd (glyph);
case 0: hb_barrier (); return u.format0.get_fd (glyph);
case 3: hb_barrier (); return u.format3.get_fd (glyph);
default:return 0;
}
}
@@ -332,8 +332,8 @@ struct FDSelect
switch (format)
{
case 0: return u.format0.get_fd_range (glyph);
case 3: return u.format3.get_fd_range (glyph);
case 0: hb_barrier (); return u.format0.get_fd_range (glyph);
case 3: hb_barrier (); return u.format3.get_fd_range (glyph);
default:return {0, 1};
}
}
@@ -347,8 +347,8 @@ struct FDSelect
switch (format)
{
case 0: return_trace (u.format0.sanitize (c, fdcount));
case 3: return_trace (u.format3.sanitize (c, fdcount));
case 0: hb_barrier (); return_trace (u.format0.sanitize (c, fdcount));
case 3: hb_barrier (); return_trace (u.format3.sanitize (c, fdcount));
default:return_trace (false);
}
}
+23 -23
View File
@@ -239,8 +239,8 @@ struct Encoding
unsigned int size = min_size;
switch (table_format ())
{
case 0: size += u.format0.get_size (); break;
case 1: size += u.format1.get_size (); break;
case 0: hb_barrier (); size += u.format0.get_size (); break;
case 1: hb_barrier (); size += u.format1.get_size (); break;
}
if (has_supplement ())
size += suppEncData ().get_size ();
@@ -251,8 +251,8 @@ struct Encoding
{
switch (table_format ())
{
case 0: return u.format0.get_code (glyph);
case 1: return u.format1.get_code (glyph);
case 0: hb_barrier (); return u.format0.get_code (glyph);
case 1: hb_barrier (); return u.format1.get_code (glyph);
default:return 0;
}
}
@@ -276,8 +276,8 @@ struct Encoding
switch (table_format ())
{
case 0: if (unlikely (!u.format0.sanitize (c))) { return_trace (false); } break;
case 1: if (unlikely (!u.format1.sanitize (c))) { return_trace (false); } break;
case 0: hb_barrier (); if (unlikely (!u.format0.sanitize (c))) { return_trace (false); } break;
case 1: hb_barrier (); if (unlikely (!u.format1.sanitize (c))) { return_trace (false); } break;
default:return_trace (false);
}
return_trace (likely (!has_supplement () || suppEncData ().sanitize (c)));
@@ -288,8 +288,8 @@ struct Encoding
{
switch (table_format ())
{
case 0: return StructAfter<CFF1SuppEncData> (u.format0.codes[u.format0.nCodes ()-1]);
case 1: return StructAfter<CFF1SuppEncData> (u.format1.ranges[u.format1.nRanges ()-1]);
case 0: hb_barrier (); return StructAfter<CFF1SuppEncData> (u.format0.codes[u.format0.nCodes ()-1]);
case 1: hb_barrier (); return StructAfter<CFF1SuppEncData> (u.format1.ranges[u.format1.nRanges ()-1]);
default:return Null (CFF1SuppEncData);
}
}
@@ -567,9 +567,9 @@ struct Charset
{
switch (format)
{
case 0: return min_size + u.format0.get_size (num_glyphs);
case 1: return min_size + u.format1.get_size (num_glyphs);
case 2: return min_size + u.format2.get_size (num_glyphs);
case 0: hb_barrier (); return min_size + u.format0.get_size (num_glyphs);
case 1: hb_barrier (); return min_size + u.format1.get_size (num_glyphs);
case 2: hb_barrier (); return min_size + u.format2.get_size (num_glyphs);
default:return 0;
}
}
@@ -579,9 +579,9 @@ struct Charset
{
switch (format)
{
case 0: return u.format0.get_sid (glyph, num_glyphs);
case 1: return u.format1.get_sid (glyph, num_glyphs, cache);
case 2: return u.format2.get_sid (glyph, num_glyphs, cache);
case 0: hb_barrier (); return u.format0.get_sid (glyph, num_glyphs);
case 1: hb_barrier (); return u.format1.get_sid (glyph, num_glyphs, cache);
case 2: hb_barrier (); return u.format2.get_sid (glyph, num_glyphs, cache);
default:return 0;
}
}
@@ -590,9 +590,9 @@ struct Charset
{
switch (format)
{
case 0: u.format0.collect_glyph_to_sid_map (mapping, num_glyphs); return;
case 1: u.format1.collect_glyph_to_sid_map (mapping, num_glyphs); return;
case 2: u.format2.collect_glyph_to_sid_map (mapping, num_glyphs); return;
case 0: hb_barrier (); u.format0.collect_glyph_to_sid_map (mapping, num_glyphs); return;
case 1: hb_barrier (); u.format1.collect_glyph_to_sid_map (mapping, num_glyphs); return;
case 2: hb_barrier (); u.format2.collect_glyph_to_sid_map (mapping, num_glyphs); return;
default:return;
}
}
@@ -601,9 +601,9 @@ struct Charset
{
switch (format)
{
case 0: return u.format0.get_glyph (sid, num_glyphs);
case 1: return u.format1.get_glyph (sid, num_glyphs);
case 2: return u.format2.get_glyph (sid, num_glyphs);
case 0: hb_barrier (); return u.format0.get_glyph (sid, num_glyphs);
case 1: hb_barrier (); return u.format1.get_glyph (sid, num_glyphs);
case 2: hb_barrier (); return u.format2.get_glyph (sid, num_glyphs);
default:return 0;
}
}
@@ -617,9 +617,9 @@ struct Charset
switch (format)
{
case 0: return_trace (u.format0.sanitize (c, c->get_num_glyphs (), num_charset_entries));
case 1: return_trace (u.format1.sanitize (c, c->get_num_glyphs (), num_charset_entries));
case 2: return_trace (u.format2.sanitize (c, c->get_num_glyphs (), num_charset_entries));
case 0: hb_barrier (); return_trace (u.format0.sanitize (c, c->get_num_glyphs (), num_charset_entries));
case 1: hb_barrier (); return_trace (u.format1.sanitize (c, c->get_num_glyphs (), num_charset_entries));
case 2: hb_barrier (); return_trace (u.format2.sanitize (c, c->get_num_glyphs (), num_charset_entries));
default:return_trace (false);
}
}
+9 -9
View File
@@ -62,9 +62,9 @@ struct CFF2FDSelect
{
switch (format)
{
case 0: return format.static_size + u.format0.get_size (num_glyphs);
case 3: return format.static_size + u.format3.get_size ();
case 4: return format.static_size + u.format4.get_size ();
case 0: hb_barrier (); return format.static_size + u.format0.get_size (num_glyphs);
case 3: hb_barrier (); return format.static_size + u.format3.get_size ();
case 4: hb_barrier (); return format.static_size + u.format4.get_size ();
default:return 0;
}
}
@@ -76,9 +76,9 @@ struct CFF2FDSelect
switch (format)
{
case 0: return u.format0.get_fd (glyph);
case 3: return u.format3.get_fd (glyph);
case 4: return u.format4.get_fd (glyph);
case 0: hb_barrier (); return u.format0.get_fd (glyph);
case 3: hb_barrier (); return u.format3.get_fd (glyph);
case 4: hb_barrier (); return u.format4.get_fd (glyph);
default:return 0;
}
}
@@ -92,9 +92,9 @@ struct CFF2FDSelect
switch (format)
{
case 0: return_trace (u.format0.sanitize (c, fdcount));
case 3: return_trace (u.format3.sanitize (c, fdcount));
case 4: return_trace (u.format4.sanitize (c, fdcount));
case 0: hb_barrier (); return_trace (u.format0.sanitize (c, fdcount));
case 3: hb_barrier (); return_trace (u.format3.sanitize (c, fdcount));
case 4: hb_barrier (); return_trace (u.format4.sanitize (c, fdcount));
default:return_trace (false);
}
}
+34 -34
View File
@@ -1497,12 +1497,12 @@ struct CmapSubtable
hb_codepoint_t *glyph) const
{
switch (u.format) {
case 0: return u.format0 .get_glyph (codepoint, glyph);
case 4: return u.format4 .get_glyph (codepoint, glyph);
case 6: return u.format6 .get_glyph (codepoint, glyph);
case 10: return u.format10.get_glyph (codepoint, glyph);
case 12: return u.format12.get_glyph (codepoint, glyph);
case 13: return u.format13.get_glyph (codepoint, glyph);
case 0: hb_barrier (); return u.format0 .get_glyph (codepoint, glyph);
case 4: hb_barrier (); return u.format4 .get_glyph (codepoint, glyph);
case 6: hb_barrier (); return u.format6 .get_glyph (codepoint, glyph);
case 10: hb_barrier (); return u.format10.get_glyph (codepoint, glyph);
case 12: hb_barrier (); return u.format12.get_glyph (codepoint, glyph);
case 13: hb_barrier (); return u.format13.get_glyph (codepoint, glyph);
case 14:
default: return false;
}
@@ -1510,12 +1510,12 @@ struct CmapSubtable
void collect_unicodes (hb_set_t *out, unsigned int num_glyphs = UINT_MAX) const
{
switch (u.format) {
case 0: u.format0 .collect_unicodes (out); return;
case 4: u.format4 .collect_unicodes (out); return;
case 6: u.format6 .collect_unicodes (out); return;
case 10: u.format10.collect_unicodes (out); return;
case 12: u.format12.collect_unicodes (out, num_glyphs); return;
case 13: u.format13.collect_unicodes (out, num_glyphs); return;
case 0: hb_barrier (); u.format0 .collect_unicodes (out); return;
case 4: hb_barrier (); u.format4 .collect_unicodes (out); return;
case 6: hb_barrier (); u.format6 .collect_unicodes (out); return;
case 10: hb_barrier (); u.format10.collect_unicodes (out); return;
case 12: hb_barrier (); u.format12.collect_unicodes (out, num_glyphs); return;
case 13: hb_barrier (); u.format13.collect_unicodes (out, num_glyphs); return;
case 14:
default: return;
}
@@ -1526,12 +1526,12 @@ struct CmapSubtable
unsigned num_glyphs = UINT_MAX) const
{
switch (u.format) {
case 0: u.format0 .collect_mapping (unicodes, mapping); return;
case 4: u.format4 .collect_mapping (unicodes, mapping); return;
case 6: u.format6 .collect_mapping (unicodes, mapping); return;
case 10: u.format10.collect_mapping (unicodes, mapping); return;
case 12: u.format12.collect_mapping (unicodes, mapping, num_glyphs); return;
case 13: u.format13.collect_mapping (unicodes, mapping, num_glyphs); return;
case 0: hb_barrier (); u.format0 .collect_mapping (unicodes, mapping); return;
case 4: hb_barrier (); u.format4 .collect_mapping (unicodes, mapping); return;
case 6: hb_barrier (); u.format6 .collect_mapping (unicodes, mapping); return;
case 10: hb_barrier (); u.format10.collect_mapping (unicodes, mapping); return;
case 12: hb_barrier (); u.format12.collect_mapping (unicodes, mapping, num_glyphs); return;
case 13: hb_barrier (); u.format13.collect_mapping (unicodes, mapping, num_glyphs); return;
case 14:
default: return;
}
@@ -1540,12 +1540,12 @@ struct CmapSubtable
unsigned get_language () const
{
switch (u.format) {
case 0: return u.format0 .get_language ();
case 4: return u.format4 .get_language ();
case 6: return u.format6 .get_language ();
case 10: return u.format10.get_language ();
case 12: return u.format12.get_language ();
case 13: return u.format13.get_language ();
case 0: hb_barrier (); return u.format0 .get_language ();
case 4: hb_barrier (); return u.format4 .get_language ();
case 6: hb_barrier (); return u.format6 .get_language ();
case 10: hb_barrier (); return u.format10.get_language ();
case 12: hb_barrier (); return u.format12.get_language ();
case 13: hb_barrier (); return u.format13.get_language ();
case 14:
default: return 0;
}
@@ -1560,9 +1560,9 @@ struct CmapSubtable
const void *base)
{
switch (format) {
case 4: return u.format4.serialize (c, it);
case 12: return u.format12.serialize (c, it);
case 14: return u.format14.serialize (c, &plan->unicodes, &plan->glyphs_requested, plan->glyph_map, base);
case 4: hb_barrier (); return u.format4.serialize (c, it);
case 12: hb_barrier (); return u.format12.serialize (c, it);
case 14: hb_barrier (); return u.format14.serialize (c, &plan->unicodes, &plan->glyphs_requested, plan->glyph_map, base);
default: return;
}
}
@@ -1573,13 +1573,13 @@ struct CmapSubtable
if (!u.format.sanitize (c)) return_trace (false);
hb_barrier ();
switch (u.format) {
case 0: return_trace (u.format0 .sanitize (c));
case 4: return_trace (u.format4 .sanitize (c));
case 6: return_trace (u.format6 .sanitize (c));
case 10: return_trace (u.format10.sanitize (c));
case 12: return_trace (u.format12.sanitize (c));
case 13: return_trace (u.format13.sanitize (c));
case 14: return_trace (u.format14.sanitize (c));
case 0: hb_barrier (); return_trace (u.format0 .sanitize (c));
case 4: hb_barrier (); return_trace (u.format4 .sanitize (c));
case 6: hb_barrier (); return_trace (u.format6 .sanitize (c));
case 10: hb_barrier (); return_trace (u.format10.sanitize (c));
case 12: hb_barrier (); return_trace (u.format12.sanitize (c));
case 13: hb_barrier (); return_trace (u.format13.sanitize (c));
case 14: hb_barrier (); return_trace (u.format14.sanitize (c));
default:return_trace (true);
}
}
+9 -9
View File
@@ -132,7 +132,7 @@ struct KernSubTable
{
switch (get_type ()) {
/* This method hooks up to hb_font_t's get_h_kerning. Only support Format0. */
case 0: return u.format0.get_kerning (left, right);
case 0: hb_barrier (); return u.format0.get_kerning (left, right);
default:return 0;
}
}
@@ -311,9 +311,9 @@ struct kern
bool has_state_machine () const
{
switch (get_type ()) {
case 0: return u.ot.has_state_machine ();
case 0: hb_barrier (); return u.ot.has_state_machine ();
#ifndef HB_NO_AAT_SHAPE
case 1: return u.aat.has_state_machine ();
case 1: hb_barrier (); return u.aat.has_state_machine ();
#endif
default:return false;
}
@@ -322,9 +322,9 @@ struct kern
bool has_cross_stream () const
{
switch (get_type ()) {
case 0: return u.ot.has_cross_stream ();
case 0: hb_barrier (); return u.ot.has_cross_stream ();
#ifndef HB_NO_AAT_SHAPE
case 1: return u.aat.has_cross_stream ();
case 1: hb_barrier (); return u.aat.has_cross_stream ();
#endif
default:return false;
}
@@ -333,9 +333,9 @@ struct kern
int get_h_kerning (hb_codepoint_t left, hb_codepoint_t right) const
{
switch (get_type ()) {
case 0: return u.ot.get_h_kerning (left, right);
case 0: hb_barrier (); return u.ot.get_h_kerning (left, right);
#ifndef HB_NO_AAT_SHAPE
case 1: return u.aat.get_h_kerning (left, right);
case 1: hb_barrier (); return u.aat.get_h_kerning (left, right);
#endif
default:return 0;
}
@@ -370,9 +370,9 @@ struct kern
AAT::kern_accelerator_data_t create_accelerator_data (unsigned num_glyphs) const
{
switch (get_type ()) {
case 0: return u.ot.create_accelerator_data (num_glyphs);
case 0: hb_barrier (); return u.ot.create_accelerator_data (num_glyphs);
#ifndef HB_NO_AAT_SHAPE
case 1: return u.aat.create_accelerator_data (num_glyphs);
case 1: hb_barrier (); return u.aat.create_accelerator_data (num_glyphs);
#endif
default:return AAT::kern_accelerator_data_t ();
}
+10 -10
View File
@@ -172,9 +172,9 @@ struct BaseCoord
hb_direction_t direction) const
{
switch (u.format) {
case 1: return u.format1.get_coord (font, direction);
case 2: return u.format2.get_coord (font, direction);
case 3: return u.format3.get_coord (font, var_store, direction);
case 1: hb_barrier (); return u.format1.get_coord (font, direction);
case 2: hb_barrier (); return u.format2.get_coord (font, direction);
case 3: hb_barrier (); return u.format3.get_coord (font, var_store, direction);
default:return 0;
}
}
@@ -182,7 +182,7 @@ struct BaseCoord
void collect_variation_indices (hb_set_t& varidx_set /* OUT */) const
{
switch (u.format) {
case 3: u.format3.collect_variation_indices (varidx_set);
case 3: hb_barrier (); u.format3.collect_variation_indices (varidx_set);
default:return;
}
}
@@ -193,9 +193,9 @@ struct BaseCoord
if (unlikely (!c->may_dispatch (this, &u.format))) return c->no_dispatch_return_value ();
TRACE_DISPATCH (this, u.format);
switch (u.format) {
case 1: return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...));
case 2: return_trace (c->dispatch (u.format2, std::forward<Ts> (ds)...));
case 3: return_trace (c->dispatch (u.format3, std::forward<Ts> (ds)...));
case 1: hb_barrier (); return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...));
case 2: hb_barrier (); return_trace (c->dispatch (u.format2, std::forward<Ts> (ds)...));
case 3: hb_barrier (); return_trace (c->dispatch (u.format3, std::forward<Ts> (ds)...));
default:return_trace (c->default_return_value ());
}
}
@@ -206,9 +206,9 @@ struct BaseCoord
if (unlikely (!u.format.sanitize (c))) return_trace (false);
hb_barrier ();
switch (u.format) {
case 1: return_trace (u.format1.sanitize (c));
case 2: return_trace (u.format2.sanitize (c));
case 3: return_trace (u.format3.sanitize (c));
case 1: hb_barrier (); return_trace (u.format1.sanitize (c));
case 2: hb_barrier (); return_trace (u.format2.sanitize (c));
case 3: hb_barrier (); return_trace (u.format3.sanitize (c));
default:return_trace (false);
}
}
+78 -78
View File
@@ -2067,11 +2067,11 @@ struct ClassDef
unsigned int get_class (hb_codepoint_t glyph_id) const
{
switch (u.format) {
case 1: return u.format1.get_class (glyph_id);
case 2: return u.format2.get_class (glyph_id);
case 1: hb_barrier (); return u.format1.get_class (glyph_id);
case 2: hb_barrier (); return u.format2.get_class (glyph_id);
#ifndef HB_NO_BEYOND_64K
case 3: return u.format3.get_class (glyph_id);
case 4: return u.format4.get_class (glyph_id);
case 3: hb_barrier (); return u.format3.get_class (glyph_id);
case 4: hb_barrier (); return u.format4.get_class (glyph_id);
#endif
default:return 0;
}
@@ -2080,11 +2080,11 @@ struct ClassDef
unsigned get_population () const
{
switch (u.format) {
case 1: return u.format1.get_population ();
case 2: return u.format2.get_population ();
case 1: hb_barrier (); return u.format1.get_population ();
case 2: hb_barrier (); return u.format2.get_population ();
#ifndef HB_NO_BEYOND_64K
case 3: return u.format3.get_population ();
case 4: return u.format4.get_population ();
case 3: hb_barrier (); return u.format3.get_population ();
case 4: hb_barrier (); return u.format4.get_population ();
#endif
default:return NOT_COVERED;
}
@@ -2146,11 +2146,11 @@ struct ClassDef
switch (u.format)
{
case 1: return_trace (u.format1.serialize (c, it));
case 2: return_trace (u.format2.serialize (c, it));
case 1: hb_barrier (); return_trace (u.format1.serialize (c, it));
case 2: hb_barrier (); return_trace (u.format2.serialize (c, it));
#ifndef HB_NO_BEYOND_64K
case 3: return_trace (u.format3.serialize (c, it));
case 4: return_trace (u.format4.serialize (c, it));
case 3: hb_barrier (); return_trace (u.format3.serialize (c, it));
case 4: hb_barrier (); return_trace (u.format4.serialize (c, it));
#endif
default:return_trace (false);
}
@@ -2164,11 +2164,11 @@ struct ClassDef
{
TRACE_SUBSET (this);
switch (u.format) {
case 1: return_trace (u.format1.subset (c, klass_map, keep_empty_table, use_class_zero, glyph_filter));
case 2: return_trace (u.format2.subset (c, klass_map, keep_empty_table, use_class_zero, glyph_filter));
case 1: hb_barrier (); return_trace (u.format1.subset (c, klass_map, keep_empty_table, use_class_zero, glyph_filter));
case 2: hb_barrier (); return_trace (u.format2.subset (c, klass_map, keep_empty_table, use_class_zero, glyph_filter));
#ifndef HB_NO_BEYOND_64K
case 3: return_trace (u.format3.subset (c, klass_map, keep_empty_table, use_class_zero, glyph_filter));
case 4: return_trace (u.format4.subset (c, klass_map, keep_empty_table, use_class_zero, glyph_filter));
case 3: hb_barrier (); return_trace (u.format3.subset (c, klass_map, keep_empty_table, use_class_zero, glyph_filter));
case 4: hb_barrier (); return_trace (u.format4.subset (c, klass_map, keep_empty_table, use_class_zero, glyph_filter));
#endif
default:return_trace (false);
}
@@ -2180,11 +2180,11 @@ struct ClassDef
if (!u.format.sanitize (c)) return_trace (false);
hb_barrier ();
switch (u.format) {
case 1: return_trace (u.format1.sanitize (c));
case 2: return_trace (u.format2.sanitize (c));
case 1: hb_barrier (); return_trace (u.format1.sanitize (c));
case 2: hb_barrier (); return_trace (u.format2.sanitize (c));
#ifndef HB_NO_BEYOND_64K
case 3: return_trace (u.format3.sanitize (c));
case 4: return_trace (u.format4.sanitize (c));
case 3: hb_barrier (); return_trace (u.format3.sanitize (c));
case 4: hb_barrier (); return_trace (u.format4.sanitize (c));
#endif
default:return_trace (true);
}
@@ -2193,11 +2193,11 @@ struct ClassDef
unsigned cost () const
{
switch (u.format) {
case 1: return u.format1.cost ();
case 2: return u.format2.cost ();
case 1: hb_barrier (); return u.format1.cost ();
case 2: hb_barrier (); return u.format2.cost ();
#ifndef HB_NO_BEYOND_64K
case 3: return u.format3.cost ();
case 4: return u.format4.cost ();
case 3: hb_barrier (); return u.format3.cost ();
case 4: hb_barrier (); return u.format4.cost ();
#endif
default:return 0u;
}
@@ -2209,11 +2209,11 @@ struct ClassDef
bool collect_coverage (set_t *glyphs) const
{
switch (u.format) {
case 1: return u.format1.collect_coverage (glyphs);
case 2: return u.format2.collect_coverage (glyphs);
case 1: hb_barrier (); return u.format1.collect_coverage (glyphs);
case 2: hb_barrier (); return u.format2.collect_coverage (glyphs);
#ifndef HB_NO_BEYOND_64K
case 3: return u.format3.collect_coverage (glyphs);
case 4: return u.format4.collect_coverage (glyphs);
case 3: hb_barrier (); return u.format3.collect_coverage (glyphs);
case 4: hb_barrier (); return u.format4.collect_coverage (glyphs);
#endif
default:return false;
}
@@ -2225,11 +2225,11 @@ struct ClassDef
bool collect_class (set_t *glyphs, unsigned int klass) const
{
switch (u.format) {
case 1: return u.format1.collect_class (glyphs, klass);
case 2: return u.format2.collect_class (glyphs, klass);
case 1: hb_barrier (); return u.format1.collect_class (glyphs, klass);
case 2: hb_barrier (); return u.format2.collect_class (glyphs, klass);
#ifndef HB_NO_BEYOND_64K
case 3: return u.format3.collect_class (glyphs, klass);
case 4: return u.format4.collect_class (glyphs, klass);
case 3: hb_barrier (); return u.format3.collect_class (glyphs, klass);
case 4: hb_barrier (); return u.format4.collect_class (glyphs, klass);
#endif
default:return false;
}
@@ -2238,11 +2238,11 @@ struct ClassDef
bool intersects (const hb_set_t *glyphs) const
{
switch (u.format) {
case 1: return u.format1.intersects (glyphs);
case 2: return u.format2.intersects (glyphs);
case 1: hb_barrier (); return u.format1.intersects (glyphs);
case 2: hb_barrier (); return u.format2.intersects (glyphs);
#ifndef HB_NO_BEYOND_64K
case 3: return u.format3.intersects (glyphs);
case 4: return u.format4.intersects (glyphs);
case 3: hb_barrier (); return u.format3.intersects (glyphs);
case 4: hb_barrier (); return u.format4.intersects (glyphs);
#endif
default:return false;
}
@@ -2250,11 +2250,11 @@ struct ClassDef
bool intersects_class (const hb_set_t *glyphs, unsigned int klass) const
{
switch (u.format) {
case 1: return u.format1.intersects_class (glyphs, klass);
case 2: return u.format2.intersects_class (glyphs, klass);
case 1: hb_barrier (); return u.format1.intersects_class (glyphs, klass);
case 2: hb_barrier (); return u.format2.intersects_class (glyphs, klass);
#ifndef HB_NO_BEYOND_64K
case 3: return u.format3.intersects_class (glyphs, klass);
case 4: return u.format4.intersects_class (glyphs, klass);
case 3: hb_barrier (); return u.format3.intersects_class (glyphs, klass);
case 4: hb_barrier (); return u.format4.intersects_class (glyphs, klass);
#endif
default:return false;
}
@@ -2263,11 +2263,11 @@ struct ClassDef
void intersected_class_glyphs (const hb_set_t *glyphs, unsigned klass, hb_set_t *intersect_glyphs) const
{
switch (u.format) {
case 1: return u.format1.intersected_class_glyphs (glyphs, klass, intersect_glyphs);
case 2: return u.format2.intersected_class_glyphs (glyphs, klass, intersect_glyphs);
case 1: hb_barrier (); return u.format1.intersected_class_glyphs (glyphs, klass, intersect_glyphs);
case 2: hb_barrier (); return u.format2.intersected_class_glyphs (glyphs, klass, intersect_glyphs);
#ifndef HB_NO_BEYOND_64K
case 3: return u.format3.intersected_class_glyphs (glyphs, klass, intersect_glyphs);
case 4: return u.format4.intersected_class_glyphs (glyphs, klass, intersect_glyphs);
case 3: hb_barrier (); return u.format3.intersected_class_glyphs (glyphs, klass, intersect_glyphs);
case 4: hb_barrier (); return u.format4.intersected_class_glyphs (glyphs, klass, intersect_glyphs);
#endif
default:return;
}
@@ -2276,11 +2276,11 @@ struct ClassDef
void intersected_classes (const hb_set_t *glyphs, hb_set_t *intersect_classes) const
{
switch (u.format) {
case 1: return u.format1.intersected_classes (glyphs, intersect_classes);
case 2: return u.format2.intersected_classes (glyphs, intersect_classes);
case 1: hb_barrier (); return u.format1.intersected_classes (glyphs, intersect_classes);
case 2: hb_barrier (); return u.format2.intersected_classes (glyphs, intersect_classes);
#ifndef HB_NO_BEYOND_64K
case 3: return u.format3.intersected_classes (glyphs, intersect_classes);
case 4: return u.format4.intersected_classes (glyphs, intersect_classes);
case 3: hb_barrier (); return u.format3.intersected_classes (glyphs, intersect_classes);
case 4: hb_barrier (); return u.format4.intersected_classes (glyphs, intersect_classes);
#endif
default:return;
}
@@ -3637,8 +3637,8 @@ struct DeltaSetIndexMap
unsigned length = plan.get_output_map ().length;
u.format = length <= 0xFFFF ? 0 : 1;
switch (u.format) {
case 0: return_trace (u.format0.serialize (c, plan));
case 1: return_trace (u.format1.serialize (c, plan));
case 0: hb_barrier (); return_trace (u.format0.serialize (c, plan));
case 1: hb_barrier (); return_trace (u.format1.serialize (c, plan));
default:return_trace (false);
}
}
@@ -3646,8 +3646,8 @@ struct DeltaSetIndexMap
uint32_t map (unsigned v) const
{
switch (u.format) {
case 0: return (u.format0.map (v));
case 1: return (u.format1.map (v));
case 0: hb_barrier (); return (u.format0.map (v));
case 1: hb_barrier (); return (u.format1.map (v));
default:return v;
}
}
@@ -3655,8 +3655,8 @@ struct DeltaSetIndexMap
unsigned get_map_count () const
{
switch (u.format) {
case 0: return u.format0.get_map_count ();
case 1: return u.format1.get_map_count ();
case 0: hb_barrier (); return u.format0.get_map_count ();
case 1: hb_barrier (); return u.format1.get_map_count ();
default:return 0;
}
}
@@ -3664,8 +3664,8 @@ struct DeltaSetIndexMap
unsigned get_width () const
{
switch (u.format) {
case 0: return u.format0.get_width ();
case 1: return u.format1.get_width ();
case 0: hb_barrier (); return u.format0.get_width ();
case 1: hb_barrier (); return u.format1.get_width ();
default:return 0;
}
}
@@ -3673,8 +3673,8 @@ struct DeltaSetIndexMap
unsigned get_inner_bit_count () const
{
switch (u.format) {
case 0: return u.format0.get_inner_bit_count ();
case 1: return u.format1.get_inner_bit_count ();
case 0: hb_barrier (); return u.format0.get_inner_bit_count ();
case 1: hb_barrier (); return u.format1.get_inner_bit_count ();
default:return 0;
}
}
@@ -3685,8 +3685,8 @@ struct DeltaSetIndexMap
if (!u.format.sanitize (c)) return_trace (false);
hb_barrier ();
switch (u.format) {
case 0: return_trace (u.format0.sanitize (c));
case 1: return_trace (u.format1.sanitize (c));
case 0: hb_barrier (); return_trace (u.format0.sanitize (c));
case 1: hb_barrier (); return_trace (u.format1.sanitize (c));
default:return_trace (true);
}
}
@@ -3695,8 +3695,8 @@ struct DeltaSetIndexMap
{
TRACE_SERIALIZE (this);
switch (u.format) {
case 0: return_trace (reinterpret_cast<DeltaSetIndexMap *> (u.format0.copy (c)));
case 1: return_trace (reinterpret_cast<DeltaSetIndexMap *> (u.format1.copy (c)));
case 0: hb_barrier (); return_trace (reinterpret_cast<DeltaSetIndexMap *> (u.format0.copy (c)));
case 1: hb_barrier (); return_trace (reinterpret_cast<DeltaSetIndexMap *> (u.format1.copy (c)));
default:return_trace (nullptr);
}
}
@@ -4111,11 +4111,11 @@ struct Condition
Instancer *instancer) const
{
switch (u.format) {
case 1: return u.format1.evaluate (coords, coord_len, instancer);
case 2: return u.format2.evaluate (coords, coord_len, instancer);
case 3: return u.format3.evaluate (coords, coord_len, instancer);
case 4: return u.format4.evaluate (coords, coord_len, instancer);
case 5: return u.format5.evaluate (coords, coord_len, instancer);
case 1: hb_barrier (); return u.format1.evaluate (coords, coord_len, instancer);
case 2: hb_barrier (); return u.format2.evaluate (coords, coord_len, instancer);
case 3: hb_barrier (); return u.format3.evaluate (coords, coord_len, instancer);
case 4: hb_barrier (); return u.format4.evaluate (coords, coord_len, instancer);
case 5: hb_barrier (); return u.format5.evaluate (coords, coord_len, instancer);
default:return false;
}
}
@@ -4124,7 +4124,7 @@ struct Condition
hb_map_t *condition_map /* OUT */) const
{
switch (u.format) {
case 1: return u.format1.keep_with_variations (c, condition_map);
case 1: hb_barrier (); return u.format1.keep_with_variations (c, condition_map);
// TODO(subset)
default: c->apply = false; return KEEP_COND_WITH_VAR;
}
@@ -4136,11 +4136,11 @@ struct Condition
if (unlikely (!c->may_dispatch (this, &u.format))) return c->no_dispatch_return_value ();
TRACE_DISPATCH (this, u.format);
switch (u.format) {
case 1: return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...));
case 2: return_trace (c->dispatch (u.format2, std::forward<Ts> (ds)...));
case 3: return_trace (c->dispatch (u.format3, std::forward<Ts> (ds)...));
case 4: return_trace (c->dispatch (u.format4, std::forward<Ts> (ds)...));
case 5: return_trace (c->dispatch (u.format5, std::forward<Ts> (ds)...));
case 1: hb_barrier (); return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...));
case 2: hb_barrier (); return_trace (c->dispatch (u.format2, std::forward<Ts> (ds)...));
case 3: hb_barrier (); return_trace (c->dispatch (u.format3, std::forward<Ts> (ds)...));
case 4: hb_barrier (); return_trace (c->dispatch (u.format4, std::forward<Ts> (ds)...));
case 5: hb_barrier (); return_trace (c->dispatch (u.format5, std::forward<Ts> (ds)...));
default:return_trace (c->default_return_value ());
}
}
@@ -4151,11 +4151,11 @@ struct Condition
if (!u.format.sanitize (c)) return_trace (false);
hb_barrier ();
switch (u.format) {
case 1: return_trace (u.format1.sanitize (c));
case 2: return_trace (u.format2.sanitize (c));
case 3: return_trace (u.format3.sanitize (c));
case 4: return_trace (u.format4.sanitize (c));
case 5: return_trace (u.format5.sanitize (c));
case 1: hb_barrier (); return_trace (u.format1.sanitize (c));
case 2: hb_barrier (); return_trace (u.format2.sanitize (c));
case 3: hb_barrier (); return_trace (u.format3.sanitize (c));
case 4: hb_barrier (); return_trace (u.format4.sanitize (c));
case 5: hb_barrier (); return_trace (u.format5.sanitize (c));
default:return_trace (true);
}
}
+30 -30
View File
@@ -2906,12 +2906,12 @@ struct Context
if (unlikely (!c->may_dispatch (this, &u.format))) return c->no_dispatch_return_value ();
TRACE_DISPATCH (this, u.format);
switch (u.format) {
case 1: return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...));
case 2: return_trace (c->dispatch (u.format2, std::forward<Ts> (ds)...));
case 3: return_trace (c->dispatch (u.format3, std::forward<Ts> (ds)...));
case 1: hb_barrier (); return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...));
case 2: hb_barrier (); return_trace (c->dispatch (u.format2, std::forward<Ts> (ds)...));
case 3: hb_barrier (); return_trace (c->dispatch (u.format3, std::forward<Ts> (ds)...));
#ifndef HB_NO_BEYOND_64K
case 4: return_trace (c->dispatch (u.format4, std::forward<Ts> (ds)...));
case 5: return_trace (c->dispatch (u.format5, std::forward<Ts> (ds)...));
case 4: hb_barrier (); return_trace (c->dispatch (u.format4, std::forward<Ts> (ds)...));
case 5: hb_barrier (); return_trace (c->dispatch (u.format5, std::forward<Ts> (ds)...));
#endif
default:return_trace (c->default_return_value ());
}
@@ -4239,12 +4239,12 @@ struct ChainContext
if (unlikely (!c->may_dispatch (this, &u.format))) return c->no_dispatch_return_value ();
TRACE_DISPATCH (this, u.format);
switch (u.format) {
case 1: return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...));
case 2: return_trace (c->dispatch (u.format2, std::forward<Ts> (ds)...));
case 3: return_trace (c->dispatch (u.format3, std::forward<Ts> (ds)...));
case 1: hb_barrier (); return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...));
case 2: hb_barrier (); return_trace (c->dispatch (u.format2, std::forward<Ts> (ds)...));
case 3: hb_barrier (); return_trace (c->dispatch (u.format3, std::forward<Ts> (ds)...));
#ifndef HB_NO_BEYOND_64K
case 4: return_trace (c->dispatch (u.format4, std::forward<Ts> (ds)...));
case 5: return_trace (c->dispatch (u.format5, std::forward<Ts> (ds)...));
case 4: hb_barrier (); return_trace (c->dispatch (u.format4, std::forward<Ts> (ds)...));
case 5: hb_barrier (); return_trace (c->dispatch (u.format5, std::forward<Ts> (ds)...));
#endif
default:return_trace (c->default_return_value ());
}
@@ -4328,7 +4328,7 @@ struct Extension
unsigned int get_type () const
{
switch (u.format) {
case 1: return u.format1.get_type ();
case 1: hb_barrier (); return u.format1.get_type ();
default:return 0;
}
}
@@ -4336,7 +4336,7 @@ struct Extension
const X& get_subtable () const
{
switch (u.format) {
case 1: return u.format1.template get_subtable<typename T::SubTable> ();
case 1: hb_barrier (); return u.format1.template get_subtable<typename T::SubTable> ();
default:return Null (typename T::SubTable);
}
}
@@ -4348,7 +4348,7 @@ struct Extension
typename hb_subset_context_t::return_t dispatch (hb_subset_context_t *c, Ts&&... ds) const
{
switch (u.format) {
case 1: return u.format1.subset (c);
case 1: hb_barrier (); return u.format1.subset (c);
default: return c->default_return_value ();
}
}
@@ -4359,7 +4359,7 @@ struct Extension
if (unlikely (!c->may_dispatch (this, &u.format))) return c->no_dispatch_return_value ();
TRACE_DISPATCH (this, u.format);
switch (u.format) {
case 1: return_trace (u.format1.dispatch (c, std::forward<Ts> (ds)...));
case 1: hb_barrier (); return_trace (u.format1.dispatch (c, std::forward<Ts> (ds)...));
default:return_trace (c->default_return_value ());
}
}
@@ -4574,9 +4574,9 @@ struct GSUBGPOS
unsigned int get_size () const
{
switch (u.version.major) {
case 1: return u.version1.get_size ();
case 1: hb_barrier (); return u.version1.get_size ();
#ifndef HB_NO_BEYOND_64K
case 2: return u.version2.get_size ();
case 2: hb_barrier (); return u.version2.get_size ();
#endif
default: return u.version.static_size;
}
@@ -4589,9 +4589,9 @@ struct GSUBGPOS
if (unlikely (!u.version.sanitize (c))) return_trace (false);
hb_barrier ();
switch (u.version.major) {
case 1: return_trace (u.version1.sanitize<TLookup> (c));
case 1: hb_barrier (); return_trace (u.version1.sanitize<TLookup> (c));
#ifndef HB_NO_BEYOND_64K
case 2: return_trace (u.version2.sanitize<TLookup> (c));
case 2: hb_barrier (); return_trace (u.version2.sanitize<TLookup> (c));
#endif
default: return_trace (true);
}
@@ -4601,9 +4601,9 @@ struct GSUBGPOS
bool subset (hb_subset_layout_context_t *c) const
{
switch (u.version.major) {
case 1: return u.version1.subset<TLookup> (c);
case 1: hb_barrier (); return u.version1.subset<TLookup> (c);
#ifndef HB_NO_BEYOND_64K
case 2: return u.version2.subset<TLookup> (c);
case 2: hb_barrier (); return u.version2.subset<TLookup> (c);
#endif
default: return false;
}
@@ -4612,9 +4612,9 @@ struct GSUBGPOS
const ScriptList &get_script_list () const
{
switch (u.version.major) {
case 1: return this+u.version1.scriptList;
case 1: hb_barrier (); return this+u.version1.scriptList;
#ifndef HB_NO_BEYOND_64K
case 2: return this+u.version2.scriptList;
case 2: hb_barrier (); return this+u.version2.scriptList;
#endif
default: return Null (ScriptList);
}
@@ -4622,9 +4622,9 @@ struct GSUBGPOS
const FeatureList &get_feature_list () const
{
switch (u.version.major) {
case 1: return this+u.version1.featureList;
case 1: hb_barrier (); return this+u.version1.featureList;
#ifndef HB_NO_BEYOND_64K
case 2: return this+u.version2.featureList;
case 2: hb_barrier (); return this+u.version2.featureList;
#endif
default: return Null (FeatureList);
}
@@ -4632,9 +4632,9 @@ struct GSUBGPOS
unsigned int get_lookup_count () const
{
switch (u.version.major) {
case 1: return (this+u.version1.lookupList).len;
case 1: hb_barrier (); return (this+u.version1.lookupList).len;
#ifndef HB_NO_BEYOND_64K
case 2: return (this+u.version2.lookupList).len;
case 2: hb_barrier (); return (this+u.version2.lookupList).len;
#endif
default: return 0;
}
@@ -4642,9 +4642,9 @@ struct GSUBGPOS
const Lookup& get_lookup (unsigned int i) const
{
switch (u.version.major) {
case 1: return (this+u.version1.lookupList)[i];
case 1: hb_barrier (); return (this+u.version1.lookupList)[i];
#ifndef HB_NO_BEYOND_64K
case 2: return (this+u.version2.lookupList)[i];
case 2: hb_barrier (); return (this+u.version2.lookupList)[i];
#endif
default: return Null (Lookup);
}
@@ -4652,9 +4652,9 @@ struct GSUBGPOS
const FeatureVariations &get_feature_variations () const
{
switch (u.version.major) {
case 1: return (u.version.to_int () >= 0x00010001u && hb_barrier () ? this+u.version1.featureVars : Null (FeatureVariations));
case 1: hb_barrier (); return (u.version.to_int () >= 0x00010001u && hb_barrier () ? this+u.version1.featureVars : Null (FeatureVariations));
#ifndef HB_NO_BEYOND_64K
case 2: return this+u.version2.featureVars;
case 2: hb_barrier (); return this+u.version2.featureVars;
#endif
default: return Null (FeatureVariations);
}
+23 -23
View File
@@ -354,10 +354,10 @@ struct AxisValue
{
switch (u.format)
{
case 1: return u.format1.get_value ();
case 2: return u.format2.get_value ();
case 3: return u.format3.get_value ();
case 4: return u.format4.get_axis_record (axis_index).get_value ();
case 1: hb_barrier (); return u.format1.get_value ();
case 2: hb_barrier (); return u.format2.get_value ();
case 3: hb_barrier (); return u.format3.get_value ();
case 4: hb_barrier (); return u.format4.get_axis_record (axis_index).get_value ();
default:return 0.f;
}
}
@@ -366,9 +366,9 @@ struct AxisValue
{
switch (u.format)
{
case 1: return u.format1.get_axis_index ();
case 2: return u.format2.get_axis_index ();
case 3: return u.format3.get_axis_index ();
case 1: hb_barrier (); return u.format1.get_axis_index ();
case 2: hb_barrier (); return u.format2.get_axis_index ();
case 3: hb_barrier (); return u.format3.get_axis_index ();
/* case 4: Makes more sense for variable fonts which are handled by fvar in hb-style */
default:return -1;
}
@@ -378,10 +378,10 @@ struct AxisValue
{
switch (u.format)
{
case 1: return u.format1.get_value_name_id ();
case 2: return u.format2.get_value_name_id ();
case 3: return u.format3.get_value_name_id ();
case 4: return u.format4.get_value_name_id ();
case 1: hb_barrier (); return u.format1.get_value_name_id ();
case 2: hb_barrier (); return u.format2.get_value_name_id ();
case 3: hb_barrier (); return u.format3.get_value_name_id ();
case 4: hb_barrier (); return u.format4.get_value_name_id ();
default:return HB_OT_NAME_ID_INVALID;
}
}
@@ -392,10 +392,10 @@ struct AxisValue
if (unlikely (!c->may_dispatch (this, &u.format))) return c->no_dispatch_return_value ();
TRACE_DISPATCH (this, u.format);
switch (u.format) {
case 1: return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...));
case 2: return_trace (c->dispatch (u.format2, std::forward<Ts> (ds)...));
case 3: return_trace (c->dispatch (u.format3, std::forward<Ts> (ds)...));
case 4: return_trace (c->dispatch (u.format4, std::forward<Ts> (ds)...));
case 1: hb_barrier (); return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...));
case 2: hb_barrier (); return_trace (c->dispatch (u.format2, std::forward<Ts> (ds)...));
case 3: hb_barrier (); return_trace (c->dispatch (u.format3, std::forward<Ts> (ds)...));
case 4: hb_barrier (); return_trace (c->dispatch (u.format4, std::forward<Ts> (ds)...));
default:return_trace (c->default_return_value ());
}
}
@@ -405,10 +405,10 @@ struct AxisValue
{
switch (u.format)
{
case 1: return u.format1.keep_axis_value (axis_records, user_axes_location);
case 2: return u.format2.keep_axis_value (axis_records, user_axes_location);
case 3: return u.format3.keep_axis_value (axis_records, user_axes_location);
case 4: return u.format4.keep_axis_value (axis_records, user_axes_location);
case 1: hb_barrier (); return u.format1.keep_axis_value (axis_records, user_axes_location);
case 2: hb_barrier (); return u.format2.keep_axis_value (axis_records, user_axes_location);
case 3: hb_barrier (); return u.format3.keep_axis_value (axis_records, user_axes_location);
case 4: hb_barrier (); return u.format4.keep_axis_value (axis_records, user_axes_location);
default:return false;
}
}
@@ -422,10 +422,10 @@ struct AxisValue
switch (u.format)
{
case 1: return_trace (u.format1.sanitize (c));
case 2: return_trace (u.format2.sanitize (c));
case 3: return_trace (u.format3.sanitize (c));
case 4: return_trace (u.format4.sanitize (c));
case 1: hb_barrier (); return_trace (u.format1.sanitize (c));
case 2: hb_barrier (); return_trace (u.format2.sanitize (c));
case 3: hb_barrier (); return_trace (u.format3.sanitize (c));
case 4: hb_barrier (); return_trace (u.format4.sanitize (c));
default:return_trace (true);
}
}