mirror of
https://github.com/harfbuzz/harfbuzz.git
synced 2025-04-05 21:45:06 +00:00
[COLR] Switch to using (existing) accelerator
This commit is contained in:
parent
17ddc84406
commit
9efd17e225
4 changed files with 28 additions and 6 deletions
|
@ -2112,8 +2112,29 @@ struct COLR
|
|||
{
|
||||
accelerator_t (hb_face_t *face)
|
||||
{ colr = hb_sanitize_context_t ().reference_table<COLR> (face); }
|
||||
|
||||
~accelerator_t () { this->colr.destroy (); }
|
||||
|
||||
#ifndef HB_NO_PAINT
|
||||
bool
|
||||
get_extents (hb_font_t *font,
|
||||
hb_codepoint_t glyph,
|
||||
hb_glyph_extents_t *extents) const
|
||||
{
|
||||
return colr->get_extents (font, glyph, extents);
|
||||
}
|
||||
|
||||
bool paint_glyph (hb_font_t *font,
|
||||
hb_codepoint_t glyph,
|
||||
hb_paint_funcs_t *funcs, void *data,
|
||||
unsigned int palette_index,
|
||||
hb_color_t foreground,
|
||||
bool clip = true) const
|
||||
{
|
||||
return colr->paint_glyph (font, glyph, funcs, data, palette_index, foreground, clip);
|
||||
}
|
||||
#endif
|
||||
|
||||
bool is_valid () { return colr.get_blob ()->length; }
|
||||
|
||||
void closure_glyphs (hb_codepoint_t glyph,
|
||||
|
@ -2147,7 +2168,7 @@ struct COLR
|
|||
const DeltaSetIndexMap *get_delta_set_index_map_ptr () const
|
||||
{ return colr->get_delta_set_index_map_ptr (); }
|
||||
|
||||
private:
|
||||
public:
|
||||
hb_blob_ptr_t<COLR> colr;
|
||||
};
|
||||
|
||||
|
|
|
@ -204,7 +204,7 @@ hb_ot_color_palette_get_colors (hb_face_t *face,
|
|||
hb_bool_t
|
||||
hb_ot_color_has_layers (hb_face_t *face)
|
||||
{
|
||||
return face->table.COLR->has_v0_data ();
|
||||
return face->table.COLR->colr->has_v0_data ();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -221,7 +221,7 @@ hb_ot_color_has_layers (hb_face_t *face)
|
|||
hb_bool_t
|
||||
hb_ot_color_has_paint (hb_face_t *face)
|
||||
{
|
||||
return face->table.COLR->has_v1_data ();
|
||||
return face->table.COLR->colr->has_v1_data ();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -240,7 +240,7 @@ hb_bool_t
|
|||
hb_ot_color_glyph_has_paint (hb_face_t *face,
|
||||
hb_codepoint_t glyph)
|
||||
{
|
||||
return face->table.COLR->has_paint_for_glyph (glyph);
|
||||
return face->table.COLR->colr->has_paint_for_glyph (glyph);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -266,7 +266,7 @@ hb_ot_color_glyph_get_layers (hb_face_t *face,
|
|||
unsigned int *layer_count, /* IN/OUT. May be NULL. */
|
||||
hb_ot_color_layer_t *layers /* OUT. May be NULL. */)
|
||||
{
|
||||
return face->table.COLR->get_glyph_layers (glyph, start_offset, layer_count, layers);
|
||||
return face->table.COLR->colr->get_glyph_layers (glyph, start_offset, layer_count, layers);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -136,7 +136,7 @@ HB_OT_TABLE (AAT, feat)
|
|||
|
||||
/* OpenType color fonts. */
|
||||
#ifndef HB_NO_COLOR
|
||||
HB_OT_CORE_TABLE (OT, COLR)
|
||||
HB_OT_ACCELERATOR (OT, COLR)
|
||||
HB_OT_CORE_TABLE (OT, CPAL)
|
||||
HB_OT_ACCELERATOR (OT, CBDT)
|
||||
HB_OT_ACCELERATOR (OT, sbix)
|
||||
|
|
|
@ -36,6 +36,7 @@
|
|||
#include "hb-ot-name-table.hh"
|
||||
#include "hb-ot-post-table.hh"
|
||||
#include "OT/Color/CBDT/CBDT.hh"
|
||||
#include "OT/Color/COLR/COLR.hh"
|
||||
#include "OT/Color/sbix/sbix.hh"
|
||||
#include "OT/Color/svg/svg.hh"
|
||||
#include "hb-ot-layout-gdef-table.hh"
|
||||
|
|
Loading…
Add table
Reference in a new issue