diff --git a/src/hb-cairo.cc b/src/hb-cairo.cc index 027664bcf..f16b7c3c2 100644 --- a/src/hb-cairo.cc +++ b/src/hb-cairo.cc @@ -321,11 +321,11 @@ hb_cairo_paint_custom_palette_color (hb_paint_funcs_t *funcs, hb_color_t *color, void *user_data HB_UNUSED) { -#define HB_DEADBEEF HB_TAG(0xDE,0xAD,0xBE,0xEF) - #ifdef HAVE_CAIRO_FONT_OPTIONS_GET_CUSTOM_PALETTE_COLOR cairo_t *cr = (cairo_t *) paint_data; +#define HB_DEADBEEF HB_TAG(0xDE,0xAD,0xBE,0xEF) + hb_map_t *color_cache = (hb_map_t *) cairo_get_user_data (cr, &color_cache_key); hb_codepoint_t *c; if (likely (color_cache && color_cache->has (color_index, &c))) @@ -357,13 +357,14 @@ hb_cairo_paint_custom_palette_color (hb_paint_funcs_t *funcs, return true; } cairo_font_options_destroy (options); -#endif if (likely (color_cache)) color_cache->set (color_index, HB_DEADBEEF); #undef HB_DEADBEEF +#endif + return false; }