diff options
author | Adrian Johnson <ajohnson@redneon.com> | 2023-02-11 04:18:03 +0000 |
---|---|---|
committer | Adrian Johnson <ajohnson@redneon.com> | 2023-02-11 04:18:03 +0000 |
commit | f2f2d20a367be0e120dc901089d1fd294094a8f2 (patch) | |
tree | 14d8e74e0e797b538389ac2256a98401f8d3cb99 /src/cairo-font-options.c | |
parent | 876ee0bb49e2bf94bbc4d06514459ae6a31935b2 (diff) | |
parent | e85c242f0a4306f829b9587233dd366f2443a620 (diff) | |
download | cairo-f2f2d20a367be0e120dc901089d1fd294094a8f2.tar.gz |
Merge branch 'fix-valgrind-errors' into 'master'
Fix some problems found by valgrind
See merge request cairo/cairo!452
Diffstat (limited to 'src/cairo-font-options.c')
-rw-r--r-- | src/cairo-font-options.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/cairo-font-options.c b/src/cairo-font-options.c index fa3d3c4e1..33ee617b8 100644 --- a/src/cairo-font-options.c +++ b/src/cairo-font-options.c @@ -105,6 +105,41 @@ _cairo_font_options_init_copy (cairo_font_options_t *options, } } +cairo_bool_t +_cairo_font_options_compare (const cairo_font_options_t *a, + const cairo_font_options_t *b) +{ + if (a->antialias != b->antialias || + a->subpixel_order != b->subpixel_order || + a->lcd_filter != b->lcd_filter || + a->hint_style != b->hint_style || + a->hint_metrics != b->hint_metrics || + a->round_glyph_positions != b->round_glyph_positions || + a->color_mode != b->color_mode || + a->palette_index != b->palette_index || + a->custom_palette_size != b->custom_palette_size) + { + return FALSE; + } + + if (a->variations && b->variations && strcmp (a->variations, b->variations) != 0) + return FALSE; + else if (a->variations != b->variations) + return FALSE; + + if (a->custom_palette && b->custom_palette && + memcmp (a->custom_palette, b->custom_palette, sizeof (cairo_palette_color_t) * a->custom_palette_size) != 0) + { + return FALSE; + } + else if (a->custom_palette != b->custom_palette) + { + return FALSE; + } + + return TRUE; +} + /** * cairo_font_options_create: * |