diff --git a/src/OT/Color/COLR/COLR.hh b/src/OT/Color/COLR/COLR.hh index 05d756733..98125fcce 100644 --- a/src/OT/Color/COLR/COLR.hh +++ b/src/OT/Color/COLR/COLR.hh @@ -226,37 +226,37 @@ struct hb_colrv1_closure_context_t : {} }; -#ifndef HB_NO_SUBSET_DEPEND +#ifndef HB_NO_SUBSET_DEPEND struct hb_colrv1_depend_context_t : - hb_dispatch_context_t + hb_dispatch_context_t { template return_t dispatch (const T &obj) { if (unlikely (nesting_level_left == 0)) - return false; + return hb_empty_t (); nesting_level_left--; obj.dependv1 (this); nesting_level_left++; - return true; + return hb_empty_t (); } - static return_t default_return_value () { return false; } + static return_t default_return_value () { return hb_empty_t (); } const COLR* get_colr_table () const - { return reinterpret_cast (base); } + { return colr; } public: - const void *base; + const COLR *colr; hb_depend_data_builder_t *depend_data; unsigned nesting_level_left; hb_codepoint_t source_gid; - hb_colrv1_depend_context_t (const void *base_, + hb_colrv1_depend_context_t (const COLR *colr_, hb_depend_data_builder_t *depend_data_, unsigned nesting_level_left_ = HB_MAX_NESTING_LEVEL) : - base (base_), + colr (colr_), depend_data (depend_data_), nesting_level_left (nesting_level_left_), source_gid (0) @@ -520,11 +520,7 @@ template class Var> struct ColorLine { #ifndef HB_NO_SUBSET_DEPEND - void dependv1 (hb_colrv1_depend_context_t * c) const - { - for (const auto &stop : stops.iter ()) - stop.dependv1 (c); - } + void dependv1 (hb_colrv1_depend_context_t * c) const {} #endif void closurev1 (hb_colrv1_closure_context_t* c) const @@ -723,9 +719,9 @@ struct Affine2x3 struct PaintColrLayers { #ifndef HB_NO_SUBSET_DEPEND - void dependv1 (hb_colrv1_depend_context_t* c) const; + HB_INTERNAL void dependv1 (hb_colrv1_depend_context_t* c) const; #endif - void closurev1 (hb_colrv1_closure_context_t* c) const; + HB_INTERNAL void closurev1 (hb_colrv1_closure_context_t* c) const; bool subset (hb_subset_context_t *c, const ItemVarStoreInstancer &instancer HB_UNUSED) const @@ -812,10 +808,7 @@ template class Var> struct PaintLinearGradient { #ifndef HB_NO_SUBSET_DEPEND - void dependv1 (hb_colrv1_depend_context_t* c) const - { - (this+colorLine).dependv1 (c); - } + void dependv1 (hb_colrv1_depend_context_t* c) const {} #endif void closurev1 (hb_colrv1_closure_context_t* c) const @@ -889,10 +882,7 @@ template class Var> struct PaintRadialGradient { #ifndef HB_NO_SUBSET_DEPEND - void dependv1 (hb_colrv1_depend_context_t* c) const - { - (this+colorLine).dependv1 (c); - } + void dependv1 (hb_colrv1_depend_context_t* c) const {} #endif void closurev1 (hb_colrv1_closure_context_t* c) const @@ -966,10 +956,7 @@ template class Var> struct PaintSweepGradient { #ifndef HB_NO_SUBSET_DEPEND - void dependv1 (hb_colrv1_depend_context_t* c) const - { - (this+colorLine).dependv1 (c); - } + void dependv1 (hb_colrv1_depend_context_t* c) const {} #endif void closurev1 (hb_colrv1_closure_context_t* c) const @@ -1037,9 +1024,9 @@ struct PaintSweepGradient struct PaintGlyph { #ifndef HB_NO_SUBSET_DEPEND - void dependv1 (hb_colrv1_depend_context_t* c) const; + HB_INTERNAL void dependv1 (hb_colrv1_depend_context_t* c) const; #endif - void closurev1 (hb_colrv1_closure_context_t* c) const; + HB_INTERNAL void closurev1 (hb_colrv1_closure_context_t* c) const; bool subset (hb_subset_context_t *c, const ItemVarStoreInstancer &instancer) const @@ -1083,9 +1070,9 @@ struct PaintGlyph struct PaintColrGlyph { #ifndef HB_NO_SUBSET_DEPEND - void dependv1 (hb_colrv1_depend_context_t* c) const; + HB_INTERNAL void dependv1 (hb_colrv1_depend_context_t* c) const; #endif - void closurev1 (hb_colrv1_closure_context_t* c) const; + HB_INTERNAL void closurev1 (hb_colrv1_closure_context_t* c) const; bool subset (hb_subset_context_t *c, const ItemVarStoreInstancer &instancer HB_UNUSED) const @@ -1634,9 +1621,9 @@ struct PaintSkewAroundCenter struct PaintComposite { #ifndef HB_NO_SUBSET_DEPEND - void dependv1 (hb_colrv1_depend_context_t* c) const; + HB_INTERNAL void dependv1 (hb_colrv1_depend_context_t* c) const; #endif - void closurev1 (hb_colrv1_closure_context_t* c) const; + HB_INTERNAL void closurev1 (hb_colrv1_closure_context_t* c) const; bool subset (hb_subset_context_t *c, const ItemVarStoreInstancer &instancer) const @@ -1746,9 +1733,6 @@ struct ClipBoxFormat2 : Variable } } -#ifndef HB_NO_SUBSET_DEPEND - void dependv1 (hb_colrv1_depend_context_t* c) const; -#endif void closurev1 (hb_colrv1_closure_context_t* c) const { c->variation_indices->add_range (varIdxBase, varIdxBase + 3); } }; @@ -1766,16 +1750,6 @@ struct ClipBox } } -#ifndef HB_NO_SUBSET_DEPEND - void dependv1 (hb_colrv1_depend_context_t* c) const - { - switch (u.format.v) { - case 2: u.format2.dependv1 (c); - default:return; - } - } -#endif - void closurev1 (hb_colrv1_closure_context_t* c) const { switch (u.format.v) { @@ -1831,13 +1805,6 @@ struct ClipRecord int cmp (hb_codepoint_t g) const { return g < startGlyphID ? -1 : g <= endGlyphID ? 0 : +1; } -#ifndef HB_NO_SUBSET_DEPEND - void dependv1 (hb_colrv1_depend_context_t* c, const void *base) const - { - (base+clipBox).dependv1 (c); - } -#endif - void closurev1 (hb_colrv1_closure_context_t* c, const void *base) const { if (!c->glyphs->intersects (startGlyphID, endGlyphID)) return; diff --git a/src/OT/Color/COLR/colrv1-depend.hh b/src/OT/Color/COLR/colrv1-depend.hh index 17ada53f2..f09b96841 100644 --- a/src/OT/Color/COLR/colrv1-depend.hh +++ b/src/OT/Color/COLR/colrv1-depend.hh @@ -73,7 +73,6 @@ template class Var> HB_INTERNAL void PaintTransform::dependv1 (hb_colrv1_depend_context_t* c) const { (this+src).dispatch (c); - (this+transform).dependv1 (c); } HB_INTERNAL void PaintTranslate::dependv1 (hb_colrv1_depend_context_t* c) const