diff options
author | Adrian Johnson <ajohnson@redneon.com> | 2023-01-06 22:21:16 +1030 |
---|---|---|
committer | Adrian Johnson <ajohnson@redneon.com> | 2023-01-08 15:15:13 +1030 |
commit | 3c8dec60e5c9534ccfef25d1a916cf33eba911d4 (patch) | |
tree | 7ae534aff7179d3d1a376f52c10c8aab59b4cab0 /src/cairo-colr-glyph-render.c | |
parent | e892d0e92f9a1fe9d19b9da74c3f9b618187cb53 (diff) | |
download | cairo-3c8dec60e5c9534ccfef25d1a916cf33eba911d4.tar.gz |
Integrate COLR v1 renderer with cairo-ft-font.c
Diffstat (limited to 'src/cairo-colr-glyph-render.c')
-rw-r--r-- | src/cairo-colr-glyph-render.c | 51 |
1 files changed, 15 insertions, 36 deletions
diff --git a/src/cairo-colr-glyph-render.c b/src/cairo-colr-glyph-render.c index 68dd100c4..83e8a6229 100644 --- a/src/cairo-colr-glyph-render.c +++ b/src/cairo-colr-glyph-render.c @@ -29,23 +29,24 @@ * Matthias Clasen <mclasen@redhat.com> */ +#include "cairoint.h" +#include "cairo-array-private.h" +#include "cairo-ft-private.h" + +#include <assert.h> #include <math.h> -#include <string.h> #include <stdio.h> -#include <assert.h> - -#include <freetype/config/ftoption.h> -#include <freetype/ftcolor.h> -#include <freetype/ftglyph.h> -#include <freetype/ftoutln.h> -#include <freetype/ftsizes.h> +#include <string.h> -#include "cairoint.h" -#include "cairo-ft-private.h" +#if HAVE_FT_GET_COLOR_GLYPH_PAINT -#include "cairo-array-private.h" +#include <ft2build.h> +#include FT_CONFIG_OPTIONS_H +#include FT_COLOR_H +#include FT_GLYPH_H +#include FT_OUTLINE_H +#include FT_SIZES_H -#ifdef TT_SUPPORT_COLRV1 /* {{{ Utilities */ @@ -829,27 +830,6 @@ _cairo_colr_glyph_bounds (FT_Face face, return CAIRO_STATUS_CLIP_NOT_REPRESENTABLE; } -/* Return what COLR table version this glyph is using, 0 or 1. - * Return -1 if the glyph is not in the COLR table. - */ -int -_cairo_colr_glyph_version (FT_Face face, - unsigned long glyph) -{ - FT_OpaquePaint paint = { NULL, 0 }; - FT_UInt glyph_index, color_index; - FT_LayerIterator iter; - - if (FT_Get_Color_Glyph_Paint (face, glyph, FT_COLOR_INCLUDE_ROOT_TRANSFORM, &paint)) - return 1; - - iter.p = NULL; - if (FT_Get_Color_Glyph_Layer (face, glyph, &glyph_index, &color_index, &iter)) - return 0; - - return -1; -} - static int colorline_uses_foreground (FT_Face face, FT_ColorLine *colorline) @@ -1575,7 +1555,7 @@ add_sweep_gradient_patches (ColorLine *cl, a0, c0, 2 * M_PI, &color, pattern); - goto done; + return; } else { @@ -1586,7 +1566,6 @@ add_sweep_gradient_patches (ColorLine *cl, } } } -done: } } @@ -2106,6 +2085,6 @@ cleanup: /* }}} */ -#endif +#endif /* HAVE_FT_GET_COLOR_GLYPH_PAINT */ /* vim:set foldmethod=marker expandtab: */ |