mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-12-01 10:34:23 +01:00
[COLR] Switch to using (existing) accelerator
This commit is contained in:
1 parent
b652d02eb9
commit
3f89843df3
4 files changed
+28
-6
No files matched your search
@@ -2096,8 +2096,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,
|
||||
@@ -2131,7 +2152,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;
|
||||
};
|
||||
|
||||
|
||||
+4
-4
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -139,7 +139,7 @@ HB_OT_ACCELERATOR (AAT, hvgl)
|
||||
|
||||
/* 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"
|
||||
|
||||
Reference in new issue
Block a user