Drop hb-ot-color-colr-table.cc

Move everything into the .hh file.
This commit is contained in:
Matthias Clasen 2023-01-01 09:23:07 -05:00 committed by خالد حسني (Khaled Hosny)
parent 27684f14be
commit dc5179d465
6 changed files with 24 additions and 33 deletions

View File

@ -70,7 +70,6 @@ HB_BASE_sources = \
hb-ot-cmap-table.hh \ hb-ot-cmap-table.hh \
hb-ot-color-cbdt-table.hh \ hb-ot-color-cbdt-table.hh \
hb-ot-color-colr-table.hh \ hb-ot-color-colr-table.hh \
hb-ot-color-colr-table.cc \
hb-ot-color-cpal-table.hh \ hb-ot-color-cpal-table.hh \
hb-ot-color-sbix-table.hh \ hb-ot-color-sbix-table.hh \
hb-ot-color-svg-table.hh \ hb-ot-color-svg-table.hh \

View File

@ -14,7 +14,6 @@
#include "hb-number.cc" #include "hb-number.cc"
#include "hb-ot-cff1-table.cc" #include "hb-ot-cff1-table.cc"
#include "hb-ot-cff2-table.cc" #include "hb-ot-cff2-table.cc"
#include "hb-ot-color-colr-table.cc"
#include "hb-ot-color.cc" #include "hb-ot-color.cc"
#include "hb-ot-face.cc" #include "hb-ot-face.cc"
#include "hb-ot-font.cc" #include "hb-ot-font.cc"

View File

@ -19,7 +19,6 @@
#include "hb-number.cc" #include "hb-number.cc"
#include "hb-ot-cff1-table.cc" #include "hb-ot-cff1-table.cc"
#include "hb-ot-cff2-table.cc" #include "hb-ot-cff2-table.cc"
#include "hb-ot-color-colr-table.cc"
#include "hb-ot-color.cc" #include "hb-ot-color.cc"
#include "hb-ot-face.cc" #include "hb-ot-face.cc"
#include "hb-ot-font.cc" #include "hb-ot-font.cc"

View File

@ -1,27 +0,0 @@
#include "hb-ot-color-colr-table.hh"
namespace OT {
void PaintColrLayers::paint_glyph (hb_paint_context_t *c) const
{
const LayerList &paint_offset_lists = c->get_colr_table ()->get_layerList ();
for (unsigned i = firstLayerIndex; i < firstLayerIndex + numLayers; i++)
{
const Paint &paint = paint_offset_lists.get_paint (i);
c->funcs->push_group (c->data);
c->recurse (paint);
c->funcs->pop_group (c->data, HB_PAINT_COMPOSITE_MODE_SRC_OVER);
}
}
void PaintColrGlyph::paint_glyph (hb_paint_context_t *c) const
{
const COLR *colr_table = c->get_colr_table ();
const Paint *paint = colr_table->get_base_glyph_paint (gid);
// TODO apply clipbox
if (paint)
c->recurse (*paint);
}
}

View File

@ -562,7 +562,7 @@ struct PaintColrLayers
return_trace (c->check_struct (this)); return_trace (c->check_struct (this));
} }
HB_INTERNAL void paint_glyph (hb_paint_context_t *c) const; inline void paint_glyph (hb_paint_context_t *c) const;
HBUINT8 format; /* format = 1 */ HBUINT8 format; /* format = 1 */
HBUINT8 numLayers; HBUINT8 numLayers;
@ -820,7 +820,7 @@ struct PaintColrGlyph
return_trace (c->check_struct (this)); return_trace (c->check_struct (this));
} }
HB_INTERNAL void paint_glyph (hb_paint_context_t *c) const; inline void paint_glyph (hb_paint_context_t *c) const;
HBUINT8 format; /* format = 11 */ HBUINT8 format; /* format = 11 */
HBUINT16 gid; HBUINT16 gid;
@ -2154,6 +2154,28 @@ hb_paint_context_t::recurse (const Paint &paint)
depth_left++; depth_left++;
} }
void PaintColrLayers::paint_glyph (hb_paint_context_t *c) const
{
const LayerList &paint_offset_lists = c->get_colr_table ()->get_layerList ();
for (unsigned i = firstLayerIndex; i < firstLayerIndex + numLayers; i++)
{
const Paint &paint = paint_offset_lists.get_paint (i);
c->funcs->push_group (c->data);
c->recurse (paint);
c->funcs->pop_group (c->data, HB_PAINT_COMPOSITE_MODE_SRC_OVER);
}
}
void PaintColrGlyph::paint_glyph (hb_paint_context_t *c) const
{
const COLR *colr_table = c->get_colr_table ();
const Paint *paint = colr_table->get_base_glyph_paint (gid);
// TODO apply clipbox
if (paint)
c->recurse (*paint);
}
} /* namespace OT */ } /* namespace OT */
#endif /* HB_OT_COLOR_COLR_TABLE_HH */ #endif /* HB_OT_COLOR_COLR_TABLE_HH */

View File

@ -78,7 +78,6 @@ hb_base_sources = files(
'hb-ot-cmap-table.hh', 'hb-ot-cmap-table.hh',
'hb-ot-color-cbdt-table.hh', 'hb-ot-color-cbdt-table.hh',
'hb-ot-color-colr-table.hh', 'hb-ot-color-colr-table.hh',
'hb-ot-color-colr-table.cc',
'hb-ot-color-cpal-table.hh', 'hb-ot-color-cpal-table.hh',
'hb-ot-color-sbix-table.hh', 'hb-ot-color-sbix-table.hh',
'hb-ot-color-svg-table.hh', 'hb-ot-color-svg-table.hh',