From 5bce0053463ff29386f1442f3720fd847d972263 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Fri, 16 Dec 2022 12:31:08 -0700 Subject: [PATCH] [colr] Flesh out variations for a few paints --- src/hb-ot-color-colr-table.hh | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/src/hb-ot-color-colr-table.hh b/src/hb-ot-color-colr-table.hh index 930182643..d55e687ad 100644 --- a/src/hb-ot-color-colr-table.hh +++ b/src/hb-ot-color-colr-table.hh @@ -458,9 +458,12 @@ struct Affine2x3 void paint_glyph (hb_paint_context_t *c, uint32_t varIdxBase) const { c->funcs->push_transform (c->data, - xx.to_float (), yx.to_float (), - xy.to_float (), yy.to_float (), - dx.to_float (), dy.to_float ()); + xx.to_float (c->instancer (varIdxBase, 0)), + yx.to_float (c->instancer (varIdxBase, 1)), + xy.to_float (c->instancer (varIdxBase, 2)), + yy.to_float (c->instancer (varIdxBase, 3)), + dx.to_float (c->instancer (varIdxBase, 4)), + dy.to_float (c->instancer (varIdxBase, 5))); } F16DOT16 xx; @@ -525,7 +528,9 @@ struct PaintSolid void paint_glyph (hb_paint_context_t *c, uint32_t varIdxBase) const { - c->funcs->solid (c->data, paletteIndex, alpha.to_float ()); + c->funcs->solid (c->data, + paletteIndex, + alpha.to_float (c->instancer (varIdxBase, 0))); } HBUINT8 format; /* format = 2(noVar) or 3(Var)*/ @@ -561,9 +566,12 @@ struct PaintLinearGradient hb_color_line_t cl = { this, format }; c->funcs->linear_gradient (c->data, &cl, - (float)x0, (float)y0, - (float)x1, (float)y1, - (float)x2, (float)y2); + x0 + c->instancer (varIdxBase, 0), + y0 + c->instancer (varIdxBase, 1), + x1 + c->instancer (varIdxBase, 2), + y1 + c->instancer (varIdxBase, 3), + x2 + c->instancer (varIdxBase, 4), + y2 + c->instancer (varIdxBase, 5)); } unsigned int get_color_stops (unsigned int start,