michael@0: # HG changeset patch michael@0: # User Robert O'Callahan michael@0: # Date 1294019288 -46800 michael@0: # Node ID 8857392e37aea7475ed6d8ee4b45023e1233bcec michael@0: # Parent c53f60831c43cca397dfed8adf8d350aeec7d3ca michael@0: Bug 363861. Part 2: Introduce cairo_surface_get/set_subpixel_antialiasing. r=jrmuizel,sr=vlad,a=blocking michael@0: michael@0: diff --git a/gfx/cairo/cairo/src/cairo-quartz-surface.c b/gfx/cairo/cairo/src/cairo-quartz-surface.c michael@0: --- a/gfx/cairo/cairo/src/cairo-quartz-surface.c michael@0: +++ b/gfx/cairo/cairo/src/cairo-quartz-surface.c michael@0: @@ -2473,16 +2473,17 @@ _cairo_quartz_surface_show_glyphs (void michael@0: cairo_int_status_t rv = CAIRO_STATUS_SUCCESS; michael@0: cairo_quartz_drawing_state_t state; michael@0: float xprev, yprev; michael@0: int i; michael@0: CGFontRef cgfref = NULL; michael@0: michael@0: cairo_bool_t isClipping = FALSE; michael@0: cairo_bool_t didForceFontSmoothing = FALSE; michael@0: + cairo_antialias_t effective_antialiasing; michael@0: michael@0: if (IS_EMPTY(surface)) michael@0: return CAIRO_STATUS_SUCCESS; michael@0: michael@0: if (num_glyphs <= 0) michael@0: return CAIRO_STATUS_SUCCESS; michael@0: michael@0: if (cairo_scaled_font_get_type (scaled_font) != CAIRO_FONT_TYPE_QUARTZ) michael@0: @@ -2514,16 +2515,22 @@ _cairo_quartz_surface_show_glyphs (void michael@0: goto BAIL; michael@0: } michael@0: michael@0: /* this doesn't addref */ michael@0: cgfref = _cairo_quartz_scaled_font_get_cg_font_ref (scaled_font); michael@0: CGContextSetFont (state.context, cgfref); michael@0: CGContextSetFontSize (state.context, 1.0); michael@0: michael@0: + effective_antialiasing = scaled_font->options.antialias; michael@0: + if (effective_antialiasing == CAIRO_ANTIALIAS_SUBPIXEL && michael@0: + !surface->base.permit_subpixel_antialiasing) { michael@0: + effective_antialiasing = CAIRO_ANTIALIAS_GRAY; michael@0: + } michael@0: + michael@0: switch (scaled_font->options.antialias) { michael@0: case CAIRO_ANTIALIAS_SUBPIXEL: michael@0: CGContextSetShouldAntialias (state.context, TRUE); michael@0: CGContextSetShouldSmoothFonts (state.context, TRUE); michael@0: if (CGContextSetAllowsFontSmoothingPtr && michael@0: !CGContextGetAllowsFontSmoothingPtr (state.context)) michael@0: { michael@0: didForceFontSmoothing = TRUE; michael@0: diff --git a/gfx/cairo/cairo/src/cairo-surface-private.h b/gfx/cairo/cairo/src/cairo-surface-private.h michael@0: --- a/gfx/cairo/cairo/src/cairo-surface-private.h michael@0: +++ b/gfx/cairo/cairo/src/cairo-surface-private.h michael@0: @@ -58,16 +58,17 @@ struct _cairo_surface { michael@0: michael@0: cairo_reference_count_t ref_count; michael@0: cairo_status_t status; michael@0: unsigned int unique_id; michael@0: michael@0: unsigned finished : 1; michael@0: unsigned is_clear : 1; michael@0: unsigned has_font_options : 1; michael@0: + unsigned permit_subpixel_antialiasing : 1; michael@0: michael@0: cairo_user_data_array_t user_data; michael@0: cairo_user_data_array_t mime_data; michael@0: michael@0: cairo_matrix_t device_transform; michael@0: cairo_matrix_t device_transform_inverse; michael@0: michael@0: /* The actual resolution of the device, in dots per inch. */ michael@0: diff --git a/gfx/cairo/cairo/src/cairo-surface.c b/gfx/cairo/cairo/src/cairo-surface.c michael@0: --- a/gfx/cairo/cairo/src/cairo-surface.c michael@0: +++ b/gfx/cairo/cairo/src/cairo-surface.c michael@0: @@ -49,17 +49,18 @@ const cairo_surface_t name = { \ michael@0: NULL, /* backend */ \ michael@0: CAIRO_SURFACE_TYPE_IMAGE, /* type */ \ michael@0: CAIRO_CONTENT_COLOR, /* content */ \ michael@0: CAIRO_REFERENCE_COUNT_INVALID, /* ref_count */ \ michael@0: status, /* status */ \ michael@0: 0, /* unique id */ \ michael@0: FALSE, /* finished */ \ michael@0: TRUE, /* is_clear */ \ michael@0: - FALSE, /* has_font_options */ \ michael@0: + FALSE, /* has_font_options */ \ michael@0: + FALSE, /* permit_subpixel_antialiasing */ \ michael@0: { 0, 0, 0, NULL, }, /* user_data */ \ michael@0: { 0, 0, 0, NULL, }, /* mime_data */ \ michael@0: { 1.0, 0.0, 0.0, 1.0, 0.0, 0.0 }, /* device_transform */ \ michael@0: { 1.0, 0.0, 0.0, 1.0, 0.0, 0.0 }, /* device_transform_inverse */ \ michael@0: 0.0, /* x_resolution */ \ michael@0: 0.0, /* y_resolution */ \ michael@0: 0.0, /* x_fallback_resolution */ \ michael@0: 0.0, /* y_fallback_resolution */ \ michael@0: @@ -342,46 +343,48 @@ _cairo_surface_init (cairo_surface_t * michael@0: surface->content = content; michael@0: surface->type = backend->type; michael@0: michael@0: CAIRO_REFERENCE_COUNT_INIT (&surface->ref_count, 1); michael@0: surface->status = CAIRO_STATUS_SUCCESS; michael@0: surface->unique_id = _cairo_surface_allocate_unique_id (); michael@0: surface->finished = FALSE; michael@0: surface->is_clear = FALSE; michael@0: + surface->has_font_options = FALSE; michael@0: + surface->permit_subpixel_antialiasing = TRUE; michael@0: michael@0: _cairo_user_data_array_init (&surface->user_data); michael@0: _cairo_user_data_array_init (&surface->mime_data); michael@0: michael@0: cairo_matrix_init_identity (&surface->device_transform); michael@0: cairo_matrix_init_identity (&surface->device_transform_inverse); michael@0: michael@0: surface->x_resolution = CAIRO_SURFACE_RESOLUTION_DEFAULT; michael@0: surface->y_resolution = CAIRO_SURFACE_RESOLUTION_DEFAULT; michael@0: michael@0: surface->x_fallback_resolution = CAIRO_SURFACE_FALLBACK_RESOLUTION_DEFAULT; michael@0: surface->y_fallback_resolution = CAIRO_SURFACE_FALLBACK_RESOLUTION_DEFAULT; michael@0: michael@0: _cairo_array_init (&surface->snapshots, sizeof (cairo_surface_t *)); michael@0: surface->snapshot_of = NULL; michael@0: - michael@0: - surface->has_font_options = FALSE; michael@0: } michael@0: michael@0: static void michael@0: _cairo_surface_copy_similar_properties (cairo_surface_t *surface, michael@0: cairo_surface_t *other) michael@0: { michael@0: if (other->has_font_options || other->backend != surface->backend) { michael@0: cairo_font_options_t options; michael@0: michael@0: cairo_surface_get_font_options (other, &options); michael@0: _cairo_surface_set_font_options (surface, &options); michael@0: } michael@0: michael@0: + surface->permit_subpixel_antialiasing = other->permit_subpixel_antialiasing; michael@0: + michael@0: cairo_surface_set_fallback_resolution (surface, michael@0: other->x_fallback_resolution, michael@0: other->y_fallback_resolution); michael@0: } michael@0: michael@0: cairo_surface_t * michael@0: _cairo_surface_create_similar_scratch (cairo_surface_t *other, michael@0: cairo_content_t content, michael@0: @@ -2482,16 +2485,67 @@ cairo_surface_has_show_text_glyphs (cair michael@0: michael@0: if (surface->backend->has_show_text_glyphs) michael@0: return surface->backend->has_show_text_glyphs (surface); michael@0: else michael@0: return surface->backend->show_text_glyphs != NULL; michael@0: } michael@0: slim_hidden_def (cairo_surface_has_show_text_glyphs); michael@0: michael@0: +/** michael@0: + * cairo_surface_set_subpixel_antialiasing: michael@0: + * @surface: a #cairo_surface_t michael@0: + * michael@0: + * Sets whether the surface permits subpixel antialiasing. By default, michael@0: + * surfaces permit subpixel antialiasing. michael@0: + * michael@0: + * Enabling subpixel antialiasing for CONTENT_COLOR_ALPHA surfaces generally michael@0: + * requires that the pixels in the areas under a subpixel antialiasing michael@0: + * operation already be opaque. michael@0: + * michael@0: + * Since: 1.12 michael@0: + **/ michael@0: +void michael@0: +cairo_surface_set_subpixel_antialiasing (cairo_surface_t *surface, michael@0: + cairo_subpixel_antialiasing_t enabled) michael@0: +{ michael@0: + if (surface->status) michael@0: + return; michael@0: + michael@0: + if (surface->finished) { michael@0: + _cairo_surface_set_error (surface, CAIRO_STATUS_SURFACE_FINISHED); michael@0: + return; michael@0: + } michael@0: + michael@0: + surface->permit_subpixel_antialiasing = michael@0: + enabled == CAIRO_SUBPIXEL_ANTIALIASING_ENABLED; michael@0: +} michael@0: +slim_hidden_def (cairo_surface_set_subpixel_antialiasing); michael@0: + michael@0: +/** michael@0: + * cairo_surface_get_subpixel_antialiasing: michael@0: + * @surface: a #cairo_surface_t michael@0: + * michael@0: + * Gets whether the surface supports subpixel antialiasing. By default, michael@0: + * CAIRO_CONTENT_COLOR surfaces support subpixel antialiasing but other michael@0: + * surfaces do not. michael@0: + * michael@0: + * Since: 1.12 michael@0: + **/ michael@0: +cairo_subpixel_antialiasing_t michael@0: +cairo_surface_get_subpixel_antialiasing (cairo_surface_t *surface) michael@0: +{ michael@0: + if (surface->status) michael@0: + return CAIRO_SUBPIXEL_ANTIALIASING_DISABLED; michael@0: + michael@0: + return surface->permit_subpixel_antialiasing ? michael@0: + CAIRO_SUBPIXEL_ANTIALIASING_ENABLED : CAIRO_SUBPIXEL_ANTIALIASING_DISABLED; michael@0: +} michael@0: +slim_hidden_def (cairo_surface_get_subpixel_antialiasing); michael@0: + michael@0: /* Note: the backends may modify the contents of the glyph array as long as michael@0: * they do not return %CAIRO_INT_STATUS_UNSUPPORTED. This makes it possible to michael@0: * avoid copying the array again and again, and edit it in-place. michael@0: * Backends are in fact free to use the array as a generic buffer as they michael@0: * see fit. michael@0: * michael@0: * For show_glyphs backend method, and NOT for show_text_glyphs method, michael@0: * when they do return UNSUPPORTED, they may adjust remaining_glyphs to notify michael@0: diff --git a/gfx/cairo/cairo/src/cairo-win32-font.c b/gfx/cairo/cairo/src/cairo-win32-font.c michael@0: --- a/gfx/cairo/cairo/src/cairo-win32-font.c michael@0: +++ b/gfx/cairo/cairo/src/cairo-win32-font.c michael@0: @@ -1380,16 +1380,17 @@ _cairo_win32_scaled_font_show_glyphs (vo michael@0: cairo_win32_surface_t *surface = (cairo_win32_surface_t *)generic_surface; michael@0: cairo_status_t status; michael@0: michael@0: if (width == 0 || height == 0) michael@0: return CAIRO_STATUS_SUCCESS; michael@0: michael@0: if (_cairo_surface_is_win32 (generic_surface) && michael@0: surface->format == CAIRO_FORMAT_RGB24 && michael@0: + (generic_surface->permit_subpixel_antialiasing || scaled_font->quality != CLEARTYPE_QUALITY) && michael@0: op == CAIRO_OPERATOR_OVER && michael@0: _cairo_pattern_is_opaque_solid (pattern)) { michael@0: michael@0: cairo_solid_pattern_t *solid_pattern = (cairo_solid_pattern_t *)pattern; michael@0: michael@0: /* When compositing OVER on a GDI-understood surface, with a michael@0: * solid opaque color, we can just call ExtTextOut directly. michael@0: */ michael@0: @@ -1411,16 +1412,18 @@ _cairo_win32_scaled_font_show_glyphs (vo michael@0: * surface by drawing the the glyphs onto a DIB, black-on-white then michael@0: * inverting. GDI outputs gamma-corrected images so inverted black-on-white michael@0: * is very different from white-on-black. We favor the more common michael@0: * case where the final output is dark-on-light. michael@0: */ michael@0: cairo_win32_surface_t *tmp_surface; michael@0: cairo_surface_t *mask_surface; michael@0: cairo_surface_pattern_t mask; michael@0: + cairo_bool_t use_subpixel_antialiasing = michael@0: + scaled_font->quality == CLEARTYPE_QUALITY && generic_surface->permit_subpixel_antialiasing; michael@0: RECT r; michael@0: michael@0: tmp_surface = (cairo_win32_surface_t *)cairo_win32_surface_create_with_dib (CAIRO_FORMAT_ARGB32, width, height); michael@0: if (tmp_surface->base.status) michael@0: return tmp_surface->base.status; michael@0: michael@0: r.left = 0; michael@0: r.top = 0; michael@0: @@ -1432,17 +1435,17 @@ _cairo_win32_scaled_font_show_glyphs (vo michael@0: scaled_font, RGB (0, 0, 0), michael@0: dest_x, dest_y, michael@0: glyphs, num_glyphs); michael@0: if (status) { michael@0: cairo_surface_destroy (&tmp_surface->base); michael@0: return status; michael@0: } michael@0: michael@0: - if (scaled_font->quality == CLEARTYPE_QUALITY) { michael@0: + if (use_subpixel_antialiasing) { michael@0: /* For ClearType, we need a 4-channel mask. If we are compositing on michael@0: * a surface with alpha, we need to compute the alpha channel of michael@0: * the mask (we just copy the green channel). But for a destination michael@0: * surface without alpha the alpha channel of the mask is ignored michael@0: */ michael@0: michael@0: if (surface->format != CAIRO_FORMAT_RGB24) michael@0: _compute_argb32_mask_alpha (tmp_surface); michael@0: @@ -1460,17 +1463,17 @@ _cairo_win32_scaled_font_show_glyphs (vo michael@0: michael@0: /* For op == OVER, no-cleartype, a possible optimization here is to michael@0: * draw onto an intermediate ARGB32 surface and alpha-blend that with the michael@0: * destination michael@0: */ michael@0: _cairo_pattern_init_for_surface (&mask, mask_surface); michael@0: cairo_surface_destroy (mask_surface); michael@0: michael@0: - if (scaled_font->quality == CLEARTYPE_QUALITY) michael@0: + if (use_subpixel_antialiasing) michael@0: mask.base.has_component_alpha = TRUE; michael@0: michael@0: status = _cairo_surface_composite (op, pattern, michael@0: &mask.base, michael@0: &surface->base, michael@0: source_x, source_y, michael@0: 0, 0, michael@0: dest_x, dest_y, michael@0: diff --git a/gfx/cairo/cairo/src/cairo-xlib-surface.c b/gfx/cairo/cairo/src/cairo-xlib-surface.c michael@0: --- a/gfx/cairo/cairo/src/cairo-xlib-surface.c michael@0: +++ b/gfx/cairo/cairo/src/cairo-xlib-surface.c michael@0: @@ -3570,16 +3570,17 @@ typedef struct _cairo_xlib_font_glyphset michael@0: GlyphSet glyphset; michael@0: cairo_format_t format; michael@0: XRenderPictFormat *xrender_format; michael@0: cairo_xlib_font_glyphset_free_glyphs_t *pending_free_glyphs; michael@0: } cairo_xlib_font_glyphset_info_t; michael@0: michael@0: typedef struct _cairo_xlib_surface_font_private { michael@0: cairo_scaled_font_t *scaled_font; michael@0: + cairo_scaled_font_t *grayscale_font; michael@0: cairo_xlib_hook_t close_display_hook; michael@0: cairo_xlib_display_t *display; michael@0: cairo_xlib_font_glyphset_info_t glyphset_info[NUM_GLYPHSETS]; michael@0: } cairo_xlib_surface_font_private_t; michael@0: michael@0: /* callback from CloseDisplay */ michael@0: static void michael@0: _cairo_xlib_surface_remove_scaled_font (cairo_xlib_display_t *display, michael@0: @@ -3599,16 +3600,20 @@ _cairo_xlib_surface_remove_scaled_font ( michael@0: michael@0: _cairo_scaled_font_reset_cache (scaled_font); michael@0: CAIRO_MUTEX_UNLOCK (scaled_font->mutex); michael@0: michael@0: if (font_private != NULL) { michael@0: Display *dpy; michael@0: int i; michael@0: michael@0: + if (font_private->grayscale_font) { michael@0: + cairo_scaled_font_destroy (font_private->grayscale_font); michael@0: + } michael@0: + michael@0: dpy = _cairo_xlib_display_get_dpy (display); michael@0: for (i = 0; i < NUM_GLYPHSETS; i++) { michael@0: cairo_xlib_font_glyphset_info_t *glyphset_info; michael@0: michael@0: glyphset_info = &font_private->glyphset_info[i]; michael@0: if (glyphset_info->glyphset) michael@0: XRenderFreeGlyphSet (dpy, glyphset_info->glyphset); michael@0: michael@0: @@ -3629,16 +3634,17 @@ _cairo_xlib_surface_font_init (Display michael@0: cairo_status_t status; michael@0: int i; michael@0: michael@0: font_private = malloc (sizeof (cairo_xlib_surface_font_private_t)); michael@0: if (unlikely (font_private == NULL)) michael@0: return _cairo_error (CAIRO_STATUS_NO_MEMORY); michael@0: michael@0: font_private->scaled_font = scaled_font; michael@0: + font_private->grayscale_font = NULL; michael@0: status = _cairo_xlib_display_get (dpy, &font_private->display); michael@0: if (unlikely (status)) { michael@0: free (font_private); michael@0: return status; michael@0: } michael@0: michael@0: /* initialize and hook into the CloseDisplay callback */ michael@0: font_private->close_display_hook.func = michael@0: @@ -3671,16 +3677,20 @@ _cairo_xlib_surface_scaled_font_fini (ca michael@0: { michael@0: cairo_xlib_surface_font_private_t *font_private; michael@0: michael@0: font_private = scaled_font->surface_private; michael@0: if (font_private != NULL) { michael@0: cairo_xlib_display_t *display; michael@0: int i; michael@0: michael@0: + if (font_private->grayscale_font) { michael@0: + cairo_scaled_font_destroy (font_private->grayscale_font); michael@0: + } michael@0: + michael@0: display = font_private->display; michael@0: _cairo_xlib_remove_close_display_hook (display, michael@0: &font_private->close_display_hook); michael@0: michael@0: for (i = 0; i < NUM_GLYPHSETS; i++) { michael@0: cairo_xlib_font_glyphset_info_t *glyphset_info; michael@0: michael@0: glyphset_info = &font_private->glyphset_info[i]; michael@0: @@ -4417,16 +4427,62 @@ _cairo_xlib_surface_owns_font (cairo_xli michael@0: (font_private != NULL && font_private->display != dst->display)) michael@0: { michael@0: return FALSE; michael@0: } michael@0: michael@0: return TRUE; michael@0: } michael@0: michael@0: +/* Gets a grayscale version of scaled_font. The grayscale version is cached michael@0: + * in our surface_private data. michael@0: + */ michael@0: +static cairo_scaled_font_t * michael@0: +_cairo_xlib_get_grayscale_font (cairo_xlib_surface_t *dst, michael@0: + cairo_scaled_font_t *scaled_font) michael@0: +{ michael@0: + cairo_xlib_surface_font_private_t *font_private = scaled_font->surface_private; michael@0: + cairo_bool_t needs_font; michael@0: + michael@0: + if (font_private == NULL) { michael@0: + cairo_status_t status = _cairo_xlib_surface_font_init (dst->dpy, scaled_font); michael@0: + if (unlikely (status)) michael@0: + return _cairo_scaled_font_create_in_error (status); michael@0: + font_private = scaled_font->surface_private; michael@0: + } michael@0: + michael@0: + CAIRO_MUTEX_LOCK (scaled_font->mutex); michael@0: + needs_font = !font_private->grayscale_font; michael@0: + CAIRO_MUTEX_UNLOCK (scaled_font->mutex); michael@0: + michael@0: + if (needs_font) { michael@0: + cairo_font_options_t options; michael@0: + cairo_scaled_font_t *new_font; michael@0: + michael@0: + options = scaled_font->options; michael@0: + options.antialias = CAIRO_ANTIALIAS_GRAY; michael@0: + new_font = cairo_scaled_font_create (scaled_font->font_face, michael@0: + &scaled_font->font_matrix, michael@0: + &scaled_font->ctm, &options); michael@0: + michael@0: + CAIRO_MUTEX_LOCK (scaled_font->mutex); michael@0: + if (!font_private->grayscale_font) { michael@0: + font_private->grayscale_font = new_font; michael@0: + new_font = NULL; michael@0: + } michael@0: + CAIRO_MUTEX_UNLOCK (scaled_font->mutex); michael@0: + michael@0: + if (new_font) { michael@0: + cairo_scaled_font_destroy (new_font); michael@0: + } michael@0: + } michael@0: + michael@0: + return font_private->grayscale_font; michael@0: +} michael@0: + michael@0: static cairo_int_status_t michael@0: _cairo_xlib_surface_show_glyphs (void *abstract_dst, michael@0: cairo_operator_t op, michael@0: const cairo_pattern_t *src_pattern, michael@0: cairo_glyph_t *glyphs, michael@0: int num_glyphs, michael@0: cairo_scaled_font_t *scaled_font, michael@0: cairo_clip_t *clip, michael@0: @@ -4475,16 +4531,21 @@ _cairo_xlib_surface_show_glyphs (void michael@0: michael@0: operation = _categorize_composite_operation (dst, op, src_pattern, TRUE); michael@0: if (operation == DO_UNSUPPORTED) michael@0: return UNSUPPORTED ("unsupported op"); michael@0: michael@0: if (! _cairo_xlib_surface_owns_font (dst, scaled_font)) michael@0: return UNSUPPORTED ("unowned font"); michael@0: michael@0: + if (!dst->base.permit_subpixel_antialiasing && michael@0: + scaled_font->options.antialias == CAIRO_ANTIALIAS_SUBPIXEL) { michael@0: + scaled_font = _cairo_xlib_get_grayscale_font (dst, scaled_font); michael@0: + } michael@0: + michael@0: X_DEBUG ((dst->dpy, "show_glyphs (dst=%x)", (unsigned int) dst->drawable)); michael@0: michael@0: if (clip_region != NULL && michael@0: cairo_region_num_rectangles (clip_region) == 1) michael@0: { michael@0: cairo_rectangle_int_t glyph_extents; michael@0: const cairo_rectangle_int_t *clip_extents; michael@0: michael@0: diff --git a/gfx/cairo/cairo/src/cairo.h b/gfx/cairo/cairo/src/cairo.h michael@0: --- a/gfx/cairo/cairo/src/cairo.h michael@0: +++ b/gfx/cairo/cairo/src/cairo.h michael@0: @@ -2101,16 +2101,35 @@ cairo_public void michael@0: cairo_surface_copy_page (cairo_surface_t *surface); michael@0: michael@0: cairo_public void michael@0: cairo_surface_show_page (cairo_surface_t *surface); michael@0: michael@0: cairo_public cairo_bool_t michael@0: cairo_surface_has_show_text_glyphs (cairo_surface_t *surface); michael@0: michael@0: +/** michael@0: + * _cairo_subpixel_antialiasing_t: michael@0: + * @CAIRO_SUBPIXEL_ANTIALIASING_ENABLED: subpixel antialiasing is enabled michael@0: + * for this surface. michael@0: + * @CAIRO_SUBPIXEL_ANTIALIASING_DISABLED: subpixel antialiasing is disabled michael@0: + * for this surface. michael@0: + */ michael@0: +typedef enum _cairo_subpixel_antialiasing_t { michael@0: + CAIRO_SUBPIXEL_ANTIALIASING_ENABLED, michael@0: + CAIRO_SUBPIXEL_ANTIALIASING_DISABLED michael@0: +} cairo_subpixel_antialiasing_t; michael@0: + michael@0: +cairo_public void michael@0: +cairo_surface_set_subpixel_antialiasing (cairo_surface_t *surface, michael@0: + cairo_subpixel_antialiasing_t enabled); michael@0: + michael@0: +cairo_public cairo_subpixel_antialiasing_t michael@0: +cairo_surface_get_subpixel_antialiasing (cairo_surface_t *surface); michael@0: + michael@0: /* Image-surface functions */ michael@0: michael@0: /** michael@0: * cairo_format_t: michael@0: * @CAIRO_FORMAT_ARGB32: each pixel is a 32-bit quantity, with michael@0: * alpha in the upper 8 bits, then red, then green, then blue. michael@0: * The 32-bit quantities are stored native-endian. Pre-multiplied michael@0: * alpha is used. (That is, 50% transparent red is 0x80800000, michael@0: diff --git a/gfx/cairo/cairo/src/cairoint.h b/gfx/cairo/cairo/src/cairoint.h michael@0: --- a/gfx/cairo/cairo/src/cairoint.h michael@0: +++ b/gfx/cairo/cairo/src/cairoint.h michael@0: @@ -2750,16 +2750,18 @@ slim_hidden_proto (cairo_surface_destroy michael@0: slim_hidden_proto (cairo_surface_finish); michael@0: slim_hidden_proto (cairo_surface_flush); michael@0: slim_hidden_proto (cairo_surface_get_content); michael@0: slim_hidden_proto (cairo_surface_get_device_offset); michael@0: slim_hidden_proto (cairo_surface_get_font_options); michael@0: slim_hidden_proto (cairo_surface_get_mime_data); michael@0: slim_hidden_proto (cairo_surface_get_type); michael@0: slim_hidden_proto (cairo_surface_has_show_text_glyphs); michael@0: +slim_hidden_proto (cairo_surface_set_subpixel_antialiasing); michael@0: +slim_hidden_proto (cairo_surface_get_subpixel_antialiasing); michael@0: slim_hidden_proto (cairo_surface_mark_dirty_rectangle); michael@0: slim_hidden_proto_no_warn (cairo_surface_reference); michael@0: slim_hidden_proto (cairo_surface_set_device_offset); michael@0: slim_hidden_proto (cairo_surface_set_fallback_resolution); michael@0: slim_hidden_proto (cairo_surface_set_mime_data); michael@0: slim_hidden_proto (cairo_surface_show_page); michael@0: slim_hidden_proto (cairo_surface_status); michael@0: slim_hidden_proto (cairo_text_cluster_allocate);