2022-12-16 05:16:54 +01:00
|
|
|
#include "hb-ot-color-colr-table.hh"
|
|
|
|
|
|
|
|
namespace OT {
|
|
|
|
|
2022-12-21 22:43:19 +01:00
|
|
|
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);
|
2022-12-21 22:43:19 +01:00
|
|
|
c->funcs->push_group (c->data);
|
2022-12-16 23:27:18 +01:00
|
|
|
c->recurse (paint);
|
2022-12-21 22:43:19 +01:00
|
|
|
c->funcs->pop_group (c->data, HB_PAINT_COMPOSITE_MODE_SRC_OVER);
|
2022-12-16 05:16:54 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-12-21 22:43:19 +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
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2022-12-18 00:14:31 +01:00
|
|
|
/**
|
|
|
|
* hb_color_line_get_color_stops:
|
|
|
|
* @color_line: a #hb_color_line_t object
|
|
|
|
* @start: the index of the first color stop to return
|
|
|
|
* @count: (inout) (optional): Input = the maximum number of feature tags to return;
|
|
|
|
* Output = the actual number of feature tags returned (may be zero)
|
|
|
|
* @color_stops: (out) (array length=count) (optional): Array of #hb_color_stop_t to populate
|
|
|
|
*
|
|
|
|
* Fetches a list of color stops from the given color line object.
|
|
|
|
*
|
|
|
|
* Note that due to variations being applied, the returned color stops
|
|
|
|
* may be out of order. It is the callers responsibility to ensure that
|
|
|
|
* color stops are sorted by their offset before they are used.
|
|
|
|
*
|
|
|
|
* Return value: the total number of color stops in @cl
|
|
|
|
*
|
|
|
|
* Since: REPLACEME
|
|
|
|
*/
|
2022-12-16 05:16:54 +01:00
|
|
|
unsigned int
|
2022-12-18 00:14:31 +01:00
|
|
|
hb_color_line_get_color_stops (hb_color_line_t *color_line,
|
2022-12-16 05:16:54 +01:00
|
|
|
unsigned int start,
|
|
|
|
unsigned int *count,
|
|
|
|
hb_color_stop_t *color_stops)
|
|
|
|
{
|
2022-12-18 00:14:31 +01:00
|
|
|
if (color_line->is_variable)
|
2022-12-21 22:43:19 +01:00
|
|
|
return reinterpret_cast<const OT::ColorLine<OT::Variable> *>(color_line->base)->get_color_stops (color_line->c, start, count, color_stops, color_line->c->instancer);
|
2022-12-17 18:38:23 +01:00
|
|
|
else
|
2022-12-21 22:43:19 +01:00
|
|
|
return reinterpret_cast<const OT::ColorLine<OT::NoVariable> *>(color_line->base)->get_color_stops (color_line->c, start, count, color_stops, color_line->c->instancer);
|
2022-12-16 05:16:54 +01:00
|
|
|
}
|
|
|
|
|
2022-12-18 00:14:31 +01:00
|
|
|
/**
|
|
|
|
* hb_color_line_get_extend:
|
|
|
|
* @color_line: a #hb_color_line_t object
|
|
|
|
*
|
|
|
|
* Fetches the extend mode of the color line object.
|
|
|
|
*
|
|
|
|
* Since: REPLACEME
|
|
|
|
*/
|
2022-12-16 05:16:54 +01:00
|
|
|
hb_paint_extend_t
|
2022-12-18 00:14:31 +01:00
|
|
|
hb_color_line_get_extend (hb_color_line_t *color_line)
|
2022-12-16 05:16:54 +01:00
|
|
|
{
|
2022-12-18 00:14:31 +01:00
|
|
|
if (color_line->is_variable)
|
|
|
|
return reinterpret_cast<const OT::ColorLine<OT::Variable> *>(color_line->base)->get_extend ();
|
2022-12-17 18:38:23 +01:00
|
|
|
else
|
2022-12-18 00:14:31 +01:00
|
|
|
return reinterpret_cast<const OT::ColorLine<OT::NoVariable> *>(color_line->base)->get_extend ();
|
2022-12-16 05:16:54 +01:00
|
|
|
}
|