harfbuzz/src/hb-ot-color-colr-table.cc

28 lines
719 B
C++
Raw Normal View History

2022-12-16 05:16:54 +01:00
#include "hb-ot-color-colr-table.hh"
namespace OT {
void PaintColrLayers::paint_glyph (hb_paint_context_t *c) const
2022-12-16 05:16:54 +01:00
{
const LayerList &paint_offset_lists = c->get_colr_table ()->get_layerList ();
for (unsigned i = firstLayerIndex; i < firstLayerIndex + numLayers; i++)
{
2022-12-17 18:22:32 +01:00
const Paint &paint = paint_offset_lists.get_paint (i);
c->funcs->push_group (c->data);
2022-12-16 23:27:18 +01:00
c->recurse (paint);
c->funcs->pop_group (c->data, HB_PAINT_COMPOSITE_MODE_SRC_OVER);
2022-12-16 05:16:54 +01:00
}
}
void PaintColrGlyph::paint_glyph (hb_paint_context_t *c) const
2022-12-16 05:16:54 +01:00
{
const COLR *colr_table = c->get_colr_table ();
const Paint *paint = colr_table->get_base_glyph_paint (gid);
2022-12-17 19:33:56 +01:00
// TODO apply clipbox
2022-12-16 05:16:54 +01:00
if (paint)
2022-12-16 23:27:18 +01:00
c->recurse (*paint);
2022-12-16 05:16:54 +01:00
}
}