From 1b42bc8033bc4682c9688086c08ca3ad306a2ae8 Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Tue, 16 Sep 2008 17:04:38 -0700 Subject: [PATCH] Make the lcd_filter API private During the cairo summit it was decided that this API is to freetype- specific to be in the general cairo interface for now. This will likely come back again soon as a cairo_ft-specific interface. --- doc/public/tmpl/cairo-font-options.sgml | 29 ------------------------- src/cairo-font-options.c | 11 +++++----- src/cairo-types-private.h | 25 +++++++++++++++++++++ src/cairo-xlib-screen.c | 2 +- src/cairo.h | 28 ------------------------ src/cairoint.h | 8 ++++++- test/font-options.c | 4 ---- test/text-antialias-subpixel.c | 1 - 8 files changed, 38 insertions(+), 70 deletions(-) diff --git a/doc/public/tmpl/cairo-font-options.sgml b/doc/public/tmpl/cairo-font-options.sgml index 62a6b309c..501abf414 100644 --- a/doc/public/tmpl/cairo-font-options.sgml +++ b/doc/public/tmpl/cairo-font-options.sgml @@ -137,35 +137,6 @@ output on a particular display. @Returns: - - - - - -@CAIRO_LCD_FILTER_DEFAULT: -@CAIRO_LCD_FILTER_NONE: -@CAIRO_LCD_FILTER_INTRA_PIXEL: -@CAIRO_LCD_FILTER_FIR3: -@CAIRO_LCD_FILTER_FIR5: - - - - - - -@options: -@lcd_filter: - - - - - - - -@options: -@Returns: - - diff --git a/src/cairo-font-options.c b/src/cairo-font-options.c index b3fb27483..64a89110c 100644 --- a/src/cairo-font-options.c +++ b/src/cairo-font-options.c @@ -335,7 +335,7 @@ cairo_font_options_get_subpixel_order (const cairo_font_options_t *options) } /** - * cairo_font_options_set_lcd_filter: + * _cairo_font_options_set_lcd_filter: * @options: a #cairo_font_options_t * @lcd_filter: the new LCD filter * @@ -347,18 +347,17 @@ cairo_font_options_get_subpixel_order (const cairo_font_options_t *options) * Since: 1.8 **/ void -cairo_font_options_set_lcd_filter (cairo_font_options_t *options, - cairo_lcd_filter_t lcd_filter) +_cairo_font_options_set_lcd_filter (cairo_font_options_t *options, + cairo_lcd_filter_t lcd_filter) { if (cairo_font_options_status (options)) return; options->lcd_filter = lcd_filter; } -slim_hidden_def (cairo_font_options_set_lcd_filter); /** - * cairo_font_options_get_lcd_filter: + * _cairo_font_options_get_lcd_filter: * @options: a #cairo_font_options_t * * Gets the LCD filter for the font options object. @@ -369,7 +368,7 @@ slim_hidden_def (cairo_font_options_set_lcd_filter); * Since: 1.8 **/ cairo_lcd_filter_t -cairo_font_options_get_lcd_filter (const cairo_font_options_t *options) +_cairo_font_options_get_lcd_filter (const cairo_font_options_t *options) { if (cairo_font_options_status ((cairo_font_options_t *) options)) return CAIRO_LCD_FILTER_DEFAULT; diff --git a/src/cairo-types-private.h b/src/cairo-types-private.h index c2d962def..006aec07e 100644 --- a/src/cairo-types-private.h +++ b/src/cairo-types-private.h @@ -115,6 +115,31 @@ struct _cairo_array { cairo_bool_t is_snapshot; }; + +/** + * cairo_lcd_filter_t: + * @CAIRO_LCD_FILTER_DEFAULT: Use the default LCD filter for + * font backend and target device + * @CAIRO_LCD_FILTER_NONE: Do not perform LCD filtering + * @CAIRO_LCD_FILTER_INTRA_PIXEL: Intra-pixel filter + * @CAIRO_LCD_FILTER_FIR3: FIR filter with a 3x3 kernel + * @CAIRO_LCD_FILTER_FIR5: FIR filter with a 5x5 kernel + * + * The LCD filter specifies the low-pass filter applied to LCD-optimized + * bitmaps generated with an antialiasing mode of %CAIRO_ANTIALIAS_SUBPIXEL. + * + * Note: This API was temporarily made available in the public + * interface during the 1.7.x development series, but was made private + * before 1.8. + **/ +typedef enum _cairo_lcd_filter { + CAIRO_LCD_FILTER_DEFAULT, + CAIRO_LCD_FILTER_NONE, + CAIRO_LCD_FILTER_INTRA_PIXEL, + CAIRO_LCD_FILTER_FIR3, + CAIRO_LCD_FILTER_FIR5 +} cairo_lcd_filter_t; + struct _cairo_font_options { cairo_antialias_t antialias; cairo_subpixel_order_t subpixel_order; diff --git a/src/cairo-xlib-screen.c b/src/cairo-xlib-screen.c index 4a26eee5f..37e341889 100644 --- a/src/cairo-xlib-screen.c +++ b/src/cairo-xlib-screen.c @@ -278,7 +278,7 @@ _cairo_xlib_init_screen_font_options (Display *dpy, cairo_xlib_screen_info_t *in cairo_font_options_set_hint_style (&info->font_options, hint_style); cairo_font_options_set_antialias (&info->font_options, antialias); cairo_font_options_set_subpixel_order (&info->font_options, subpixel_order); - cairo_font_options_set_lcd_filter (&info->font_options, lcd_filter); + _cairo_font_options_set_lcd_filter (&info->font_options, lcd_filter); cairo_font_options_set_hint_metrics (&info->font_options, CAIRO_HINT_METRICS_ON); } diff --git a/src/cairo.h b/src/cairo.h index ad6d5b5c8..6758a4d01 100644 --- a/src/cairo.h +++ b/src/cairo.h @@ -1041,28 +1041,6 @@ typedef enum _cairo_subpixel_order { CAIRO_SUBPIXEL_ORDER_VBGR } cairo_subpixel_order_t; -/** - * cairo_lcd_filter_t: - * @CAIRO_LCD_FILTER_DEFAULT: Use the default LCD filter for - * font backend and target device - * @CAIRO_LCD_FILTER_NONE: Do not perform LCD filtering - * @CAIRO_LCD_FILTER_INTRA_PIXEL: Intra-pixel filter - * @CAIRO_LCD_FILTER_FIR3: FIR filter with a 3x3 kernel - * @CAIRO_LCD_FILTER_FIR5: FIR filter with a 5x5 kernel - * - * The LCD filter specifies the low-pass filter applied to LCD-optimized - * bitmaps generated with an antialiasing mode of %CAIRO_ANTIALIAS_SUBPIXEL. - * - * Since: 1.8 - **/ -typedef enum _cairo_lcd_filter { - CAIRO_LCD_FILTER_DEFAULT, - CAIRO_LCD_FILTER_NONE, - CAIRO_LCD_FILTER_INTRA_PIXEL, - CAIRO_LCD_FILTER_FIR3, - CAIRO_LCD_FILTER_FIR5 -} cairo_lcd_filter_t; - /** * cairo_hint_style_t: * @CAIRO_HINT_STYLE_DEFAULT: Use the default hint style for @@ -1168,12 +1146,6 @@ cairo_font_options_set_subpixel_order (cairo_font_options_t *options, cairo_public cairo_subpixel_order_t cairo_font_options_get_subpixel_order (const cairo_font_options_t *options); -cairo_public void -cairo_font_options_set_lcd_filter (cairo_font_options_t *options, - cairo_lcd_filter_t lcd_filter); -cairo_public cairo_lcd_filter_t -cairo_font_options_get_lcd_filter (const cairo_font_options_t *options); - cairo_public void cairo_font_options_set_hint_style (cairo_font_options_t *options, cairo_hint_style_t hint_style); diff --git a/src/cairoint.h b/src/cairoint.h index 0f10bd897..da57c3e6f 100644 --- a/src/cairoint.h +++ b/src/cairoint.h @@ -1342,6 +1342,13 @@ cairo_private void _cairo_font_options_init_copy (cairo_font_options_t *options, const cairo_font_options_t *other); +cairo_private void +_cairo_font_options_set_lcd_filter (cairo_font_options_t *options, + cairo_lcd_filter_t lcd_filter); + +cairo_private cairo_lcd_filter_t +_cairo_font_options_get_lcd_filter (const cairo_font_options_t *options); + /* cairo-hull.c */ cairo_private cairo_status_t _cairo_hull_compute (cairo_pen_vertex_t *vertices, int *num_vertices); @@ -2375,7 +2382,6 @@ slim_hidden_proto (cairo_font_options_merge); slim_hidden_proto (cairo_font_options_set_antialias); slim_hidden_proto (cairo_font_options_set_hint_metrics); slim_hidden_proto (cairo_font_options_set_hint_style); -slim_hidden_proto (cairo_font_options_set_lcd_filter); slim_hidden_proto (cairo_font_options_set_subpixel_order); slim_hidden_proto (cairo_font_options_status); slim_hidden_proto (cairo_get_current_point); diff --git a/test/font-options.c b/test/font-options.c index 90c7441b6..fd61a73e6 100644 --- a/test/font-options.c +++ b/test/font-options.c @@ -70,10 +70,6 @@ main (void) cairo_font_options_get_subpixel_order (NULL); assert (cairo_font_options_get_subpixel_order (default_options) == CAIRO_SUBPIXEL_ORDER_DEFAULT); - cairo_font_options_set_lcd_filter (NULL, CAIRO_LCD_FILTER_DEFAULT); - cairo_font_options_get_lcd_filter (NULL); - assert (cairo_font_options_get_lcd_filter (default_options) == CAIRO_LCD_FILTER_DEFAULT); - cairo_font_options_set_hint_style (NULL, CAIRO_HINT_STYLE_DEFAULT); cairo_font_options_get_hint_style (NULL); assert (cairo_font_options_get_hint_style (default_options) == CAIRO_HINT_STYLE_DEFAULT); diff --git a/test/text-antialias-subpixel.c b/test/text-antialias-subpixel.c index a9989973f..a92d64f90 100644 --- a/test/text-antialias-subpixel.c +++ b/test/text-antialias-subpixel.c @@ -57,7 +57,6 @@ draw (cairo_t *cr, int width, int height) cairo_get_font_options (cr, font_options); cairo_font_options_set_antialias (font_options, CAIRO_ANTIALIAS_SUBPIXEL); cairo_font_options_set_subpixel_order (font_options, CAIRO_SUBPIXEL_ORDER_RGB); - cairo_font_options_set_lcd_filter (font_options, CAIRO_LCD_FILTER_NONE); cairo_set_font_options (cr, font_options); cairo_font_options_destroy (font_options);