diff --git a/src/cairo-paginated-surface.c b/src/cairo-paginated-surface.c index 4938b381a..79b39560d 100644 --- a/src/cairo-paginated-surface.c +++ b/src/cairo-paginated-surface.c @@ -163,6 +163,25 @@ _cairo_paginated_surface_finish (void *abstract_surface) return CAIRO_STATUS_SUCCESS; } +static cairo_surface_t * +_cairo_paginated_surface_create_image_surface (void *abstract_surface, + int width, + int height) +{ + cairo_paginated_surface_t *surface = abstract_surface; + cairo_surface_t *image; + cairo_font_options_t options; + + image = _cairo_image_surface_create_with_content (surface->content, + width, + height); + + cairo_surface_get_font_options (surface, &options); + _cairo_surface_set_font_options (image, &options); + + return image; +} + static cairo_status_t _cairo_paginated_surface_acquire_source_image (void *abstract_surface, cairo_image_surface_t **image_out, @@ -174,9 +193,9 @@ _cairo_paginated_surface_acquire_source_image (void *abstract_surface, _cairo_surface_get_extents (surface->target, &extents); - image = _cairo_image_surface_create_with_content (surface->content, - extents.width, - extents.height); + image = _cairo_paginated_surface_create_image_surface (surface, + extents.width, + extents.height); _cairo_meta_surface_replay (surface->meta, image); @@ -221,9 +240,9 @@ _paint_page (cairo_paginated_surface_t *surface) double y_scale = surface->base.y_fallback_resolution / 72.0; cairo_matrix_t matrix; - image = _cairo_image_surface_create_with_content (surface->content, - surface->width * x_scale, - surface->height * y_scale); + image = _cairo_paginated_surface_create_image_surface (surface, + surface->width * x_scale, + surface->height * y_scale); _cairo_surface_set_device_scale (image, x_scale, y_scale); _cairo_meta_surface_replay (surface->meta, image); @@ -460,9 +479,9 @@ _cairo_paginated_surface_snapshot (void *abstract_other) _cairo_surface_get_extents (other->target, &extents); - surface = _cairo_image_surface_create_with_content (other->content, - extents.width, - extents.height); + surface = _cairo_paginated_surface_create_image_surface (other, + extents.width, + extents.height); _cairo_meta_surface_replay (other->meta, surface); diff --git a/src/cairo-pdf-surface.c b/src/cairo-pdf-surface.c index 132c604d1..b546fcf0b 100644 --- a/src/cairo-pdf-surface.c +++ b/src/cairo-pdf-surface.c @@ -454,19 +454,6 @@ _cairo_pdf_surface_clear (cairo_pdf_surface_t *surface) _cairo_array_truncate (&surface->streams, 0); } -static cairo_surface_t * -_cairo_pdf_surface_create_similar (void *abstract_src, - cairo_content_t content, - int width, - int height) -{ - cairo_format_t format = _cairo_format_from_content (content); - - /* Just return an image for now, until PDF surface can be used - * as source. */ - return cairo_image_surface_create (format, width, height); -} - static cairo_pdf_resource_t _cairo_pdf_surface_open_stream (cairo_pdf_surface_t *surface, const char *fmt, @@ -2646,7 +2633,7 @@ _cairo_pdf_surface_set_paginated_mode (void *abstract_surface, static const cairo_surface_backend_t cairo_pdf_surface_backend = { CAIRO_SURFACE_TYPE_PDF, - _cairo_pdf_surface_create_similar, + NULL, /* create_similar */ _cairo_pdf_surface_finish, NULL, /* acquire_source_image */ NULL, /* release_source_image */ diff --git a/src/cairo-ps-surface.c b/src/cairo-ps-surface.c index e0b611de6..fd58a9e8d 100644 --- a/src/cairo-ps-surface.c +++ b/src/cairo-ps-surface.c @@ -1140,19 +1140,6 @@ cairo_ps_surface_dsc_begin_page_setup (cairo_surface_t *surface) } } -static cairo_surface_t * -_cairo_ps_surface_create_similar (void *abstract_src, - cairo_content_t content, - int width, - int height) -{ - cairo_format_t format = _cairo_format_from_content (content); - - /* Just return an image for now, until PS surface can be used - * as source. */ - return cairo_image_surface_create (format, width, height); -} - static cairo_status_t _cairo_ps_surface_finish (void *abstract_surface) { @@ -2127,7 +2114,7 @@ _cairo_ps_surface_set_paginated_mode (void *abstract_surface, static const cairo_surface_backend_t cairo_ps_surface_backend = { CAIRO_SURFACE_TYPE_PS, - _cairo_ps_surface_create_similar, + NULL, /* create_similar */ _cairo_ps_surface_finish, NULL, /* acquire_source_image */ NULL, /* release_source_image */ diff --git a/src/cairo-surface.c b/src/cairo-surface.c index 777b95427..3fd9176c3 100644 --- a/src/cairo-surface.c +++ b/src/cairo-surface.c @@ -237,6 +237,8 @@ _cairo_surface_init (cairo_surface_t *surface, surface->current_clip_serial = 0; surface->is_snapshot = FALSE; + + surface->has_font_options = FALSE; } cairo_surface_t * @@ -245,15 +247,28 @@ _cairo_surface_create_similar_scratch (cairo_surface_t *other, int width, int height) { + cairo_surface_t *surface = NULL; + cairo_font_options_t options; + cairo_format_t format = _cairo_format_from_content (content); if (other->status) return (cairo_surface_t*) &_cairo_surface_nil; if (other->backend->create_similar) - return other->backend->create_similar (other, content, width, height); - else - return cairo_image_surface_create (format, width, height); + surface = other->backend->create_similar (other, content, width, height); + + if (!surface) + surface = cairo_image_surface_create (format, width, height); + + cairo_surface_get_font_options (other, &options); + _cairo_surface_set_font_options (surface, &options); + + cairo_surface_set_fallback_resolution (surface, + other->x_fallback_resolution, + other->y_fallback_resolution); + + return surface; } /** @@ -264,9 +279,12 @@ _cairo_surface_create_similar_scratch (cairo_surface_t *other, * @height: height of the new surface (in device-space units) * * Create a new surface that is as compatible as possible with an - * existing surface. The new surface will use the same backend as - * @other unless that is not possible for some reason. The type of the - * returned surface may be examined with cairo_surface_get_type(). + * existing surface. For example the new surface will have the same + * fallback resolution and font options as @other. Generally, the new + * surface will also use the same backend as @other, unless that is + * not possible for some reason. The type of the returned surface may + * be examined with cairo_surface_get_type(). + * * Initially the surface contents are all 0 (transparent if contents * have transparency, black otherwise.) * @@ -505,6 +523,33 @@ cairo_surface_set_user_data (cairo_surface_t *surface, key, user_data, destroy); } +/** + * _cairo_surface_set_font_options: + * @surface: a #cairo_surface_t + * @options: a #cairo_font_options_t object that contains the + * options to use for this surface instead of backend's default + * font options. + * + * Sets the default font rendering options for the surface. + * This is useful to correctly propagate default font options when + * falling back to an image surface in a backend implementation. + * This affects the options returned in cairo_surface_get_font_options(). + * + * If @options is %NULL the surface options are reset to those of + * the backend default. + **/ +void +_cairo_surface_set_font_options (cairo_surface_t *surface, + cairo_font_options_t *options) +{ + if (options) { + surface->has_font_options = TRUE; + _cairo_font_options_init_copy (&surface->font_options, options); + } else { + surface->has_font_options = FALSE; + } +} + /** * cairo_surface_get_font_options: * @surface: a #cairo_surface_t @@ -521,11 +566,17 @@ void cairo_surface_get_font_options (cairo_surface_t *surface, cairo_font_options_t *options) { - if (!surface->finished && surface->backend->get_font_options) { - surface->backend->get_font_options (surface, options); - } else { - _cairo_font_options_init_default (options); + if (!surface->has_font_options) { + surface->has_font_options = TRUE; + + if (!surface->finished && surface->backend->get_font_options) { + surface->backend->get_font_options (surface, &surface->font_options); + } else { + _cairo_font_options_init_default (&surface->font_options); + } } + + _cairo_font_options_init_copy (options, &surface->font_options); } /** diff --git a/src/cairo-xlib-surface.c b/src/cairo-xlib-surface.c index faf132a3b..4ed29b7e3 100644 --- a/src/cairo-xlib-surface.c +++ b/src/cairo-xlib-surface.c @@ -221,10 +221,11 @@ _cairo_xlib_surface_create_similar_with_format (void *abstract_src, /* As a good first approximation, if the display doesn't have even * the most elementary RENDER operation, then we're better off - * using image surfaces for all temporary operations + * using image surfaces for all temporary operations, so return NULL + * and let the fallback code happen. */ if (!CAIRO_SURFACE_RENDER_HAS_COMPOSITE(src)) { - return cairo_image_surface_create (format, width, height); + return NULL; } pix = XCreatePixmap (dpy, RootWindowOfScreen (src->screen), diff --git a/src/cairoint.h b/src/cairoint.h index 7d7a7f236..034463aa2 100644 --- a/src/cairoint.h +++ b/src/cairoint.h @@ -932,6 +932,14 @@ struct _cairo_surface { /* A "snapshot" surface is immutable. See _cairo_surface_snapshot. */ cairo_bool_t is_snapshot; + + /* + * Surface font options, falling back to backend's default options, + * and set using _cairo_surface_set_font_options(), and propagated by + * cairo_surface_create_similar(). + */ + cairo_bool_t has_font_options; + cairo_font_options_t font_options; }; struct _cairo_image_surface { @@ -1709,6 +1717,10 @@ _cairo_surface_init (cairo_surface_t *surface, const cairo_surface_backend_t *backend, cairo_content_t content); +void +_cairo_surface_set_font_options (cairo_surface_t *surface, + cairo_font_options_t *options); + cairo_private cairo_clip_mode_t _cairo_surface_get_clip_mode (cairo_surface_t *surface); diff --git a/test/buffer-diff.c b/test/buffer-diff.c index ff4935e40..0244ecd02 100644 --- a/test/buffer-diff.c +++ b/test/buffer-diff.c @@ -92,9 +92,12 @@ buffer_diff_core (unsigned char *_buf_a, for (channel = 0; channel < 4; channel++) { unsigned char value_a = (row_a[x] >> (channel*8)); unsigned char value_b = (row_b[x] >> (channel*8)); - double diff; + unsigned char diff; diff = value_a - value_b; - diff_pixel |= (unsigned char)(128 + diff / 3.0) << (channel*8); + diff *= 4; /* emphasize */ + if (diff > 255) + diff = 255; + diff_pixel |= diff << (channel*8); } pixels_changed++; @@ -226,8 +229,7 @@ image_diff (const char *filename_a, * (should use cairo_image_surface_create_from_png, should save * loaded buffers for re-use). * - * 2) Vlad has an outstanding patch against buffer-diff.c and I think - * this will be kinder to his merge pain. + * 2) There is a second reason no more. */ int image_diff_flattened (const char *filename_a, @@ -242,7 +244,8 @@ image_diff_flattened (const char *filename_a, unsigned int width_a, height_a, stride_a; unsigned int width_b, height_b, stride_b; unsigned char *buf_a, *buf_b, *buf_diff; - unsigned char *b_flat; + unsigned char *a_flat, *b_flat; + cairo_surface_t *buf_a_surface, *a_flat_surface; cairo_surface_t *buf_b_surface, *b_flat_surface; cairo_t *cr; read_png_status_t status; @@ -275,33 +278,50 @@ image_diff_flattened (const char *filename_a, return -1; } + buf_a_surface = cairo_image_surface_create_for_data (buf_a, + CAIRO_FORMAT_ARGB32, + width_a + ax, height_a + ay, + stride_a); buf_b_surface = cairo_image_surface_create_for_data (buf_b, CAIRO_FORMAT_ARGB32, - width_b + bx, height_b + bx, + width_b + bx, height_b + by, stride_b); buf_diff = xcalloc (stride_a * height_a, 1); - b_flat = xcalloc (stride_a * height_a, 1); + a_flat = xcalloc (stride_a * height_a, 1); + b_flat = xcalloc (stride_b * height_b, 1); + a_flat_surface = cairo_image_surface_create_for_data (a_flat, + CAIRO_FORMAT_ARGB32, + width_a, height_a, + stride_a); + cairo_surface_set_device_offset (a_flat_surface, -ax, -ay); b_flat_surface = cairo_image_surface_create_for_data (b_flat, CAIRO_FORMAT_ARGB32, width_b, height_b, stride_b); cairo_surface_set_device_offset (b_flat_surface, -bx, -by); - cr = cairo_create (b_flat_surface); + cr = cairo_create (a_flat_surface); + cairo_set_source_rgb (cr, 1, 1, 1); + cairo_paint (cr); + cairo_set_source_surface (cr, buf_a_surface, 0, 0); + cairo_paint (cr); + cairo_destroy (cr); + cairo_surface_destroy (a_flat_surface); + cairo_surface_destroy (buf_a_surface); + cr = cairo_create (b_flat_surface); cairo_set_source_rgb (cr, 1, 1, 1); cairo_paint (cr); cairo_set_source_surface (cr, buf_b_surface, 0, 0); cairo_paint (cr); - cairo_destroy (cr); cairo_surface_destroy (b_flat_surface); cairo_surface_destroy (buf_b_surface); - pixels_changed = buffer_diff (buf_a + (ay * stride_a) + ax * 4, + pixels_changed = buffer_diff (a_flat, b_flat, buf_diff, width_a, height_a, @@ -317,6 +337,7 @@ image_diff_flattened (const char *filename_a, free (buf_a); free (buf_b); + free (a_flat); free (b_flat); free (buf_diff); diff --git a/test/cairo-test.c b/test/cairo-test.c index ea580bed8..dee30a941 100644 --- a/test/cairo-test.c +++ b/test/cairo-test.c @@ -65,6 +65,19 @@ typedef enum cairo_internal_surface_type { CAIRO_INTERNAL_SURFACE_TYPE_TEST_PAGINATED } cairo_internal_surface_type_t; +static const char *vector_ignored_tests[] = { + /* We can't match the results of tests that depend on + * CAIRO_ANTIALIAS_NONE/SUBPIXEL for vector backends + * (nor do we care). */ + "ft-text-antialias-none", + "rectangle-rounding-error", + "text-antialias-gray", + "text-antialias-none", + "text-antialias-subpixel", + "unantialiased-shapes", + NULL +}; + #ifdef _MSC_VER #define vsnprintf _vsnprintf #define access _access @@ -180,7 +193,7 @@ static void xunlink (const char *pathname) { if (unlink (pathname) < 0 && errno != ENOENT) { - cairo_test_log (" Error: Cannot remove %s: %s\n", + cairo_test_log ("Error: Cannot remove %s: %s\n", pathname, strerror (errno)); exit (1); } @@ -1156,6 +1169,11 @@ create_ps_surface (cairo_test_t *test, int height = test->height; ps_target_closure_t *ptc; cairo_surface_t *surface; + int i; + + for (i = 0; vector_ignored_tests[i] != NULL; i++) + if (strcmp (test->name, vector_ignored_tests[i]) == 0) + return NULL; /* Sanitize back to a real cairo_content_t value. */ if (content == CAIRO_TEST_CONTENT_COLOR_ALPHA_FLATTENED) @@ -1219,7 +1237,7 @@ ps_surface_write_to_png (cairo_surface_t *surface, const char *filename) } cairo_surface_finish (surface); - sprintf (command, "gs -q -r72 -g%dx%d -dSAFER -dBATCH -dNOPAUSE -sDEVICE=png16m -sOutputFile=%s %s", + sprintf (command, "gs -q -r72 -g%dx%d -dSAFER -dBATCH -dNOPAUSE -sDEVICE=pngalpha -sOutputFile=%s %s", ptc->width, ptc->height, filename, ptc->filename); if (system (command) == 0) return CAIRO_STATUS_SUCCESS; @@ -1240,15 +1258,6 @@ cleanup_ps (void *closure) #if CAIRO_HAS_PDF_SURFACE && CAIRO_CAN_TEST_PDF_SURFACE #include "cairo-pdf.h" -static const char *pdf_ignored_tests[] = { - /* We can't match the results of tests that depend on - * CAIRO_ANTIALIAS_NONE, (nor do we care). */ - "ft-text-antialias-none", - "rectangle-rounding-error", - "unantialiased-shapes", - NULL -}; - cairo_user_data_key_t pdf_closure_key; typedef struct _pdf_target_closure @@ -1270,8 +1279,8 @@ create_pdf_surface (cairo_test_t *test, cairo_surface_t *surface; int i; - for (i = 0; pdf_ignored_tests[i] != NULL; i++) - if (strcmp (test->name, pdf_ignored_tests[i]) == 0) + for (i = 0; vector_ignored_tests[i] != NULL; i++) + if (strcmp (test->name, vector_ignored_tests[i]) == 0) return NULL; /* Sanitize back to a real cairo_content_t value. */ @@ -1359,14 +1368,6 @@ cleanup_pdf (void *closure) #if CAIRO_HAS_SVG_SURFACE && CAIRO_CAN_TEST_SVG_SURFACE #include "cairo-svg.h" -static const char *svg_ignored_tests[] = { - /* rectangle-rounding-error uses CAIRO_ANTIALIAS_NONE, - * which is not supported */ - "ft-text-antialias-none", - "rectangle-rounding-error", - NULL -}; - cairo_user_data_key_t svg_closure_key; typedef struct _svg_target_closure @@ -1387,8 +1388,8 @@ create_svg_surface (cairo_test_t *test, svg_target_closure_t *ptc; cairo_surface_t *surface; - for (i = 0; svg_ignored_tests[i] != NULL; i++) - if (strcmp (test->name, svg_ignored_tests[i]) == 0) + for (i = 0; vector_ignored_tests[i] != NULL; i++) + if (strcmp (test->name, vector_ignored_tests[i]) == 0) return NULL; *closure = ptc = xmalloc (sizeof (svg_target_closure_t)); @@ -1469,6 +1470,63 @@ cleanup_svg (void *closure) } #endif /* CAIRO_HAS_SVG_SURFACE && CAIRO_CAN_TEST_SVG_SURFACE */ +const char * +cairo_ref_name_for_test_target_format (const char *test_name, + const char *target_name, + const char *format) +{ + char *ref_name = NULL; + + /* First look for a target/format-specific reference image. */ + xasprintf (&ref_name, "%s/%s-%s-%s%s", srcdir, + test_name, + target_name, + format, + CAIRO_TEST_REF_SUFFIX); + if (access (ref_name, F_OK) != 0) + free (ref_name); + else + goto done; + + /* Next, look for taget-specifc reference image. */ + xasprintf (&ref_name, "%s/%s-%s%s", srcdir, + test_name, + target_name, + CAIRO_TEST_REF_SUFFIX); + if (access (ref_name, F_OK) != 0) + free (ref_name); + else + goto done; + + /* Next, look for format-specifc reference image. */ + xasprintf (&ref_name, "%s/%s-%s%s", srcdir, + test_name, + format, + CAIRO_TEST_REF_SUFFIX); + if (access (ref_name, F_OK) != 0) + free (ref_name); + else + goto done; + + /* Finally, look for the standard reference image. */ + xasprintf (&ref_name, "%s/%s%s", srcdir, + test_name, + CAIRO_TEST_REF_SUFFIX); + if (access (ref_name, F_OK) != 0) + free (ref_name); + else + goto done; + + xasprintf (&ref_name, "/dev/null"); + cairo_test_log ("Error: Cannot find reference image for %s/%s-%s-%s%s\n",srcdir, + test_name, + target_name, + CAIRO_TEST_REF_SUFFIX); + +done: + return ref_name; +} + static cairo_test_status_t cairo_test_for_target (cairo_test_t *test, cairo_test_target_t *target, @@ -1478,41 +1536,29 @@ cairo_test_for_target (cairo_test_t *test, cairo_surface_t *surface; cairo_t *cr; char *png_name, *ref_name, *diff_name, *offset_str; - char *format; cairo_test_status_t ret; cairo_content_t expected_content; + cairo_font_options_t *font_options; + const char *format; /* Get the strings ready that we'll need. */ format = _cairo_test_content_name (target->content); - if (dev_offset) xasprintf (&offset_str, "-%d", dev_offset); else offset_str = strdup(""); - xasprintf (&png_name, "%s-%s-%s%s%s", test->name, - target->name, format, offset_str, CAIRO_TEST_PNG_SUFFIX); - - /* First look for a target/format-specific reference image. */ - xasprintf (&ref_name, "%s/%s-%s-%s%s", srcdir, test->name, - target->name, format, CAIRO_TEST_REF_SUFFIX); - if (access (ref_name, F_OK) != 0) { - free (ref_name); - - /* Next, look for format-specifc reference image. */ - xasprintf (&ref_name, "%s/%s-%s%s", srcdir, test->name, - format,CAIRO_TEST_REF_SUFFIX); - - if (access (ref_name, F_OK) != 0) { - free (ref_name); - - /* Finally, look for the standard reference image. */ - xasprintf (&ref_name, "%s/%s%s", srcdir, test->name, - CAIRO_TEST_REF_SUFFIX); - } - } - xasprintf (&diff_name, "%s-%s-%s%s%s", test->name, - target->name, format, offset_str, CAIRO_TEST_DIFF_SUFFIX); + xasprintf (&png_name, "%s-%s-%s%s%s", + test->name, + target->name, + format, + offset_str, CAIRO_TEST_PNG_SUFFIX); + ref_name = cairo_ref_name_for_test_target_format (test->name, target->name, format); + xasprintf (&diff_name, "%s-%s-%s%s%s", + test->name, + target->name, + format, + offset_str, CAIRO_TEST_DIFF_SUFFIX); /* Run the actual drawing code. */ if (test->width && test->height) { @@ -1567,6 +1613,15 @@ cairo_test_for_target (cairo_test_t *test, cairo_paint (cr); cairo_restore (cr); + /* Set all components of font_options to avoid backend differences + * and reduce number of needed reference images. */ + font_options = cairo_font_options_create (); + cairo_font_options_set_hint_style (font_options, CAIRO_HINT_STYLE_NONE); + cairo_font_options_set_hint_metrics (font_options, CAIRO_HINT_METRICS_ON); + cairo_font_options_set_antialias (font_options, CAIRO_ANTIALIAS_GRAY); + cairo_set_font_options (cr, font_options); + cairo_font_options_destroy (font_options); + status = (test->draw) (cr, test->width, test->height); /* Then, check all the different ways it could fail. */ diff --git a/test/caps-joins-alpha-svg-argb32-ref.png b/test/caps-joins-alpha-svg-ref.png similarity index 100% rename from test/caps-joins-alpha-svg-argb32-ref.png rename to test/caps-joins-alpha-svg-ref.png diff --git a/test/caps-joins-alpha-svg-rgb24-ref.png b/test/caps-joins-alpha-svg-rgb24-ref.png deleted file mode 100644 index 24689364f..000000000 Binary files a/test/caps-joins-alpha-svg-rgb24-ref.png and /dev/null differ diff --git a/test/caps-joins-ps-argb32-ref.png b/test/caps-joins-ps-argb32-ref.png index d6742957a..c126d34c9 100644 Binary files a/test/caps-joins-ps-argb32-ref.png and b/test/caps-joins-ps-argb32-ref.png differ diff --git a/test/caps-sub-paths-ps-argb32-ref.png b/test/caps-sub-paths-ps-argb32-ref.png index a7bc1acb4..a53aad855 100644 Binary files a/test/caps-sub-paths-ps-argb32-ref.png and b/test/caps-sub-paths-ps-argb32-ref.png differ diff --git a/test/clip-fill-rule-ps-argb32-ref.png b/test/clip-fill-rule-ps-argb32-ref.png index 6d97e04de..f06a1a2c5 100644 Binary files a/test/clip-fill-rule-ps-argb32-ref.png and b/test/clip-fill-rule-ps-argb32-ref.png differ diff --git a/test/clip-nesting-ps-argb32-ref.png b/test/clip-nesting-ps-argb32-ref.png index 1bd43d7a1..41f7160c3 100644 Binary files a/test/clip-nesting-ps-argb32-ref.png and b/test/clip-nesting-ps-argb32-ref.png differ diff --git a/test/clip-operator.c b/test/clip-operator.c index 52cbba61d..4d262f855 100644 --- a/test/clip-operator.c +++ b/test/clip-operator.c @@ -144,7 +144,6 @@ draw (cairo_t *cr, int width, int height) { int j, x, y; cairo_operator_t op; - cairo_font_options_t *font_options; cairo_pattern_t *pattern; cairo_select_font_face (cr, "Bitstream Vera Sans", @@ -152,14 +151,6 @@ draw (cairo_t *cr, int width, int height) CAIRO_FONT_WEIGHT_NORMAL); cairo_set_font_size (cr, 0.9 * HEIGHT); - font_options = cairo_font_options_create (); - - cairo_font_options_set_hint_style (font_options, CAIRO_HINT_STYLE_NONE); - cairo_font_options_set_antialias (font_options, CAIRO_ANTIALIAS_GRAY); - - cairo_set_font_options (cr, font_options); - cairo_font_options_destroy (font_options); - for (j = 0; j < ARRAY_SIZE (draw_funcs); j++) { for (op = CAIRO_OPERATOR_CLEAR; op < N_OPERATORS; op++) { x = op * (WIDTH + PAD) + PAD; diff --git a/test/clip-twice-ps-argb32-ref.png b/test/clip-twice-ps-argb32-ref.png index 9ec76b4ef..0cb618622 100644 Binary files a/test/clip-twice-ps-argb32-ref.png and b/test/clip-twice-ps-argb32-ref.png differ diff --git a/test/composite-integer-translate-over-svg-argb32-ref.png b/test/composite-integer-translate-over-svg-ref.png similarity index 100% rename from test/composite-integer-translate-over-svg-argb32-ref.png rename to test/composite-integer-translate-over-svg-ref.png diff --git a/test/composite-integer-translate-over-svg-rgb24-ref.png b/test/composite-integer-translate-over-svg-rgb24-ref.png deleted file mode 100644 index 2a0212e0e..000000000 Binary files a/test/composite-integer-translate-over-svg-rgb24-ref.png and /dev/null differ diff --git a/test/dash-caps-joins-ps-argb32-ref.png b/test/dash-caps-joins-ps-argb32-ref.png index 629b97b34..68d2c6d47 100644 Binary files a/test/dash-caps-joins-ps-argb32-ref.png and b/test/dash-caps-joins-ps-argb32-ref.png differ diff --git a/test/dash-offset-negative-ps-argb32-ref.png b/test/dash-offset-negative-ps-argb32-ref.png index 518e1c925..f1d56fec2 100644 Binary files a/test/dash-offset-negative-ps-argb32-ref.png and b/test/dash-offset-negative-ps-argb32-ref.png differ diff --git a/test/dash-scale-ps-argb32-ref.png b/test/dash-scale-ps-argb32-ref.png index 0320a8b92..efe8b1191 100644 Binary files a/test/dash-scale-ps-argb32-ref.png and b/test/dash-scale-ps-argb32-ref.png differ diff --git a/test/dash-zero-length-ps-argb32-ref.png b/test/dash-zero-length-ps-argb32-ref.png index 897f25f5e..6c334e102 100644 Binary files a/test/dash-zero-length-ps-argb32-ref.png and b/test/dash-zero-length-ps-argb32-ref.png differ diff --git a/test/degenerate-path-ps-argb32-ref.png b/test/degenerate-path-ps-argb32-ref.png index f16f0f68f..4b3d8e330 100644 Binary files a/test/degenerate-path-ps-argb32-ref.png and b/test/degenerate-path-ps-argb32-ref.png differ diff --git a/test/fill-and-stroke-alpha-svg-argb32-ref.png b/test/fill-and-stroke-alpha-svg-ref.png similarity index 100% rename from test/fill-and-stroke-alpha-svg-argb32-ref.png rename to test/fill-and-stroke-alpha-svg-ref.png diff --git a/test/fill-and-stroke-alpha-svg-rgb24-ref.png b/test/fill-and-stroke-alpha-svg-rgb24-ref.png deleted file mode 100644 index 812c897da..000000000 Binary files a/test/fill-and-stroke-alpha-svg-rgb24-ref.png and /dev/null differ diff --git a/test/fill-and-stroke-ps-argb32-ref.png b/test/fill-and-stroke-ps-argb32-ref.png index 0df3205df..850f0cbba 100644 Binary files a/test/fill-and-stroke-ps-argb32-ref.png and b/test/fill-and-stroke-ps-argb32-ref.png differ diff --git a/test/fill-rule-ps-argb32-ref.png b/test/fill-rule-ps-argb32-ref.png index b5487e683..971b5601a 100644 Binary files a/test/fill-rule-ps-argb32-ref.png and b/test/fill-rule-ps-argb32-ref.png differ diff --git a/test/font-matrix-translation-ps-argb32-ref.png b/test/font-matrix-translation-ps-argb32-ref.png new file mode 100644 index 000000000..9f6a25231 Binary files /dev/null and b/test/font-matrix-translation-ps-argb32-ref.png differ diff --git a/test/font-matrix-translation-svg-ref.png b/test/font-matrix-translation-svg-ref.png new file mode 100644 index 000000000..92ad17b2d Binary files /dev/null and b/test/font-matrix-translation-svg-ref.png differ diff --git a/test/font-matrix-translation.c b/test/font-matrix-translation.c index dbdeb8731..067cbb5be 100644 --- a/test/font-matrix-translation.c +++ b/test/font-matrix-translation.c @@ -64,7 +64,6 @@ box_text (cairo_t *cr, const char *utf8, double x, double y) static cairo_test_status_t draw (cairo_t *cr, int width, int height) { - cairo_font_options_t *font_options; cairo_text_extents_t extents; cairo_matrix_t matrix; @@ -76,14 +75,6 @@ draw (cairo_t *cr, int width, int height) CAIRO_FONT_WEIGHT_NORMAL); cairo_set_font_size (cr, TEXT_SIZE); - font_options = cairo_font_options_create (); - - cairo_font_options_set_hint_style (font_options, CAIRO_HINT_STYLE_NONE); - cairo_font_options_set_antialias (font_options, CAIRO_ANTIALIAS_GRAY); - - cairo_set_font_options (cr, font_options); - cairo_font_options_destroy (font_options); - cairo_translate (cr, PAD, PAD); cairo_set_line_width (cr, 1.0); diff --git a/test/ft-font-create-for-ft-face.c b/test/ft-font-create-for-ft-face.c index 64a32241c..066b175d3 100644 --- a/test/ft-font-create-for-ft-face.c +++ b/test/ft-font-create-for-ft-face.c @@ -80,6 +80,8 @@ draw (cairo_t *cr, int width, int height) font_options = cairo_font_options_create (); + cairo_get_font_options (cr, font_options); + scaled_font = cairo_scaled_font_create (font_face, &font_matrix, &ctm, diff --git a/test/ft-text-antialias-none-ps-argb32-ref.png b/test/ft-text-antialias-none-ps-argb32-ref.png index ea33b0e58..4f7ee8324 100644 Binary files a/test/ft-text-antialias-none-ps-argb32-ref.png and b/test/ft-text-antialias-none-ps-argb32-ref.png differ diff --git a/test/ft-text-antialias-none.c b/test/ft-text-antialias-none.c index 55a6fa3c8..e4a34e968 100644 --- a/test/ft-text-antialias-none.c +++ b/test/ft-text-antialias-none.c @@ -55,8 +55,7 @@ create_scaled_font (cairo_t * cr) font_options = cairo_font_options_create (); - /* disable hinting */ - cairo_font_options_set_hint_style (font_options, CAIRO_HINT_STYLE_NONE); + cairo_get_font_options (cr, font_options); pattern = FcPatternCreate (); diff --git a/test/ft-text-vertical-layout-pdf-argb32-ref.png b/test/ft-text-vertical-layout-pdf-argb32-ref.png index dcc3d8bde..19f26b6cc 100644 Binary files a/test/ft-text-vertical-layout-pdf-argb32-ref.png and b/test/ft-text-vertical-layout-pdf-argb32-ref.png differ diff --git a/test/ft-text-vertical-layout-ps-argb32-ref.png b/test/ft-text-vertical-layout-ps-argb32-ref.png index b832e235f..9213bacb9 100644 Binary files a/test/ft-text-vertical-layout-ps-argb32-ref.png and b/test/ft-text-vertical-layout-ps-argb32-ref.png differ diff --git a/test/ft-text-vertical-layout-ref.png b/test/ft-text-vertical-layout-ref.png index a7a059085..7ec34ef84 100644 Binary files a/test/ft-text-vertical-layout-ref.png and b/test/ft-text-vertical-layout-ref.png differ diff --git a/test/ft-text-vertical-layout-svg-argb32-ref.png b/test/ft-text-vertical-layout-svg-argb32-ref.png deleted file mode 100644 index bf4db9b5b..000000000 Binary files a/test/ft-text-vertical-layout-svg-argb32-ref.png and /dev/null differ diff --git a/test/ft-text-vertical-layout-svg-ref.png b/test/ft-text-vertical-layout-svg-ref.png new file mode 100644 index 000000000..9bdba3220 Binary files /dev/null and b/test/ft-text-vertical-layout-svg-ref.png differ diff --git a/test/ft-text-vertical-layout-svg-rgb24-ref.png b/test/ft-text-vertical-layout-svg-rgb24-ref.png deleted file mode 100644 index 91bfc1dec..000000000 Binary files a/test/ft-text-vertical-layout-svg-rgb24-ref.png and /dev/null differ diff --git a/test/ft-text-vertical-layout.c b/test/ft-text-vertical-layout.c index d7638eeec..f8958ea00 100644 --- a/test/ft-text-vertical-layout.c +++ b/test/ft-text-vertical-layout.c @@ -55,10 +55,7 @@ create_scaled_font (cairo_t * cr) font_options = cairo_font_options_create (); - /* disable hinting */ - cairo_font_options_set_hint_style (font_options, CAIRO_HINT_STYLE_NONE); - /* enable antialias and override screen settings */ - cairo_font_options_set_antialias (font_options, CAIRO_ANTIALIAS_GRAY); + cairo_get_font_options (cr, font_options); pattern = FcPatternCreate (); @@ -102,7 +99,7 @@ draw (cairo_t *cr, int width, int height) { cairo_text_extents_t extents; cairo_scaled_font_t * scaled_font; - static char black[] = "AB", blue[] = "cd"; + static char black[] = "AB", blue[] = "AB"; /* We draw in the default black, so paint white first. */ cairo_save (cr); diff --git a/test/glyph-cache-pressure-pdf-argb32-ref.png b/test/glyph-cache-pressure-pdf-argb32-ref.png deleted file mode 100644 index 8b9031c2d..000000000 Binary files a/test/glyph-cache-pressure-pdf-argb32-ref.png and /dev/null differ diff --git a/test/glyph-cache-pressure-ps-argb32-ref.png b/test/glyph-cache-pressure-ps-argb32-ref.png index cc02ff68c..e51bca7ae 100644 Binary files a/test/glyph-cache-pressure-ps-argb32-ref.png and b/test/glyph-cache-pressure-ps-argb32-ref.png differ diff --git a/test/glyph-cache-pressure-svg-argb32-ref.png b/test/glyph-cache-pressure-svg-argb32-ref.png deleted file mode 100644 index 0a49bc4c2..000000000 Binary files a/test/glyph-cache-pressure-svg-argb32-ref.png and /dev/null differ diff --git a/test/glyph-cache-pressure-svg-rgb24-ref.png b/test/glyph-cache-pressure-svg-ref.png similarity index 100% rename from test/glyph-cache-pressure-svg-rgb24-ref.png rename to test/glyph-cache-pressure-svg-ref.png diff --git a/test/glyph-cache-pressure.c b/test/glyph-cache-pressure.c index 5b5e6c45d..ba90fa362 100644 --- a/test/glyph-cache-pressure.c +++ b/test/glyph-cache-pressure.c @@ -61,8 +61,6 @@ cairo_test_t test = { static cairo_test_status_t draw (cairo_t *cr, int width, int height) { - cairo_font_options_t *font_options; - /* We draw in the default black, so paint white first. */ cairo_save (cr); cairo_set_source_rgb (cr, 1.0, 1.0, 1.0); /* white */ @@ -76,14 +74,6 @@ draw (cairo_t *cr, int width, int height) CAIRO_FONT_WEIGHT_NORMAL); cairo_set_font_size (cr, TEXT_SIZE); - font_options = cairo_font_options_create (); - - cairo_font_options_set_hint_style (font_options, CAIRO_HINT_STYLE_NONE); - cairo_font_options_set_antialias (font_options, CAIRO_ANTIALIAS_GRAY); - - cairo_set_font_options (cr, font_options); - cairo_font_options_destroy (font_options); - cairo_set_source_rgb (cr, 0, 0, 0); /* black */ cairo_move_to (cr, 1, TEXT_SIZE); diff --git a/test/leaky-polygon-ps-argb32-ref.png b/test/leaky-polygon-ps-argb32-ref.png index 23af504ec..a8ba77170 100644 Binary files a/test/leaky-polygon-ps-argb32-ref.png and b/test/leaky-polygon-ps-argb32-ref.png differ diff --git a/test/line-width-ps-argb32-ref.png b/test/line-width-ps-argb32-ref.png index ef6abb74e..4c64e6c63 100644 Binary files a/test/line-width-ps-argb32-ref.png and b/test/line-width-ps-argb32-ref.png differ diff --git a/test/line-width-scale-ps-argb32-ref.png b/test/line-width-scale-ps-argb32-ref.png index 2f01fc708..4b4330204 100644 Binary files a/test/line-width-scale-ps-argb32-ref.png and b/test/line-width-scale-ps-argb32-ref.png differ diff --git a/test/linear-gradient-svg-argb32-ref.png b/test/linear-gradient-svg-ref.png similarity index 100% rename from test/linear-gradient-svg-argb32-ref.png rename to test/linear-gradient-svg-ref.png diff --git a/test/linear-gradient-svg-rgb24-ref.png b/test/linear-gradient-svg-rgb24-ref.png deleted file mode 100644 index 4ed4bfa83..000000000 Binary files a/test/linear-gradient-svg-rgb24-ref.png and /dev/null differ diff --git a/test/new-sub-path-ps-argb32-ref.png b/test/new-sub-path-ps-argb32-ref.png index 23b7e7598..76c50fb3e 100644 Binary files a/test/new-sub-path-ps-argb32-ref.png and b/test/new-sub-path-ps-argb32-ref.png differ diff --git a/test/operator-clear.c b/test/operator-clear.c index 575ce1d0a..ea9fcf8fc 100644 --- a/test/operator-clear.c +++ b/test/operator-clear.c @@ -159,21 +159,12 @@ static cairo_test_status_t draw (cairo_t *cr, int width, int height) { int i, j, x, y; - cairo_font_options_t *font_options; cairo_pattern_t *pattern; cairo_select_font_face (cr, "Bitstream Vera Sans", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL); - font_options = cairo_font_options_create (); - - cairo_font_options_set_hint_style (font_options, CAIRO_HINT_STYLE_NONE); - cairo_font_options_set_antialias (font_options, CAIRO_ANTIALIAS_GRAY); - - cairo_set_font_options (cr, font_options); - cairo_font_options_destroy (font_options); - for (j = 0; j < ARRAY_SIZE (draw_funcs); j++) { for (i = 0; i < ARRAY_SIZE (pattern_funcs); i++) { x = i * (WIDTH + PAD) + PAD; diff --git a/test/operator-source.c b/test/operator-source.c index 6784622e5..4bea7935e 100644 --- a/test/operator-source.c +++ b/test/operator-source.c @@ -198,21 +198,12 @@ static cairo_test_status_t draw (cairo_t *cr, int width, int height) { int i, j, x, y; - cairo_font_options_t *font_options; cairo_pattern_t *pattern; cairo_select_font_face (cr, "Bitstream Vera Sans", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL); - font_options = cairo_font_options_create (); - - cairo_font_options_set_hint_style (font_options, CAIRO_HINT_STYLE_NONE); - cairo_font_options_set_antialias (font_options, CAIRO_ANTIALIAS_GRAY); - - cairo_set_font_options (cr, font_options); - cairo_font_options_destroy (font_options); - for (j = 0; j < ARRAY_SIZE (draw_funcs); j++) { for (i = 0; i < ARRAY_SIZE (pattern_funcs); i++) { x = i * (WIDTH + PAD) + PAD; diff --git a/test/paint-source-alpha-svg-argb32-ref.png b/test/paint-source-alpha-svg-ref.png similarity index 100% rename from test/paint-source-alpha-svg-argb32-ref.png rename to test/paint-source-alpha-svg-ref.png diff --git a/test/paint-source-alpha-svg-rgb24-ref.png b/test/paint-source-alpha-svg-rgb24-ref.png deleted file mode 100644 index 3b3a990c6..000000000 Binary files a/test/paint-source-alpha-svg-rgb24-ref.png and /dev/null differ diff --git a/test/paint-with-alpha-svg-argb32-ref.png b/test/paint-with-alpha-svg-ref.png similarity index 100% rename from test/paint-with-alpha-svg-argb32-ref.png rename to test/paint-with-alpha-svg-ref.png diff --git a/test/paint-with-alpha-svg-rgb24-ref.png b/test/paint-with-alpha-svg-rgb24-ref.png deleted file mode 100644 index 97a2100e4..000000000 Binary files a/test/paint-with-alpha-svg-rgb24-ref.png and /dev/null differ diff --git a/test/path-data-ps-argb32-ref.png b/test/path-data-ps-argb32-ref.png index b724a0f89..647fafbf5 100644 Binary files a/test/path-data-ps-argb32-ref.png and b/test/path-data-ps-argb32-ref.png differ diff --git a/test/pixman-rotate-svg-argb32-ref.png b/test/pixman-rotate-svg-argb32-ref.png new file mode 100644 index 000000000..08d750bdd Binary files /dev/null and b/test/pixman-rotate-svg-argb32-ref.png differ diff --git a/test/pixman-rotate-svg-rgb24-ref.png b/test/pixman-rotate-svg-rgb24-ref.png new file mode 100644 index 000000000..349fd5ce8 Binary files /dev/null and b/test/pixman-rotate-svg-rgb24-ref.png differ diff --git a/test/rectangle-rounding-error-ps-argb32-ref.png b/test/rectangle-rounding-error-ps-argb32-ref.png deleted file mode 100644 index 2753f6d24..000000000 Binary files a/test/rectangle-rounding-error-ps-argb32-ref.png and /dev/null differ diff --git a/test/select-font-face-pdf-argb32-ref.png b/test/select-font-face-pdf-argb32-ref.png deleted file mode 100644 index 540b9944f..000000000 Binary files a/test/select-font-face-pdf-argb32-ref.png and /dev/null differ diff --git a/test/select-font-face-ps-argb32-ref.png b/test/select-font-face-ps-argb32-ref.png index fdb3ad2d9..d8d84a5e2 100644 Binary files a/test/select-font-face-ps-argb32-ref.png and b/test/select-font-face-ps-argb32-ref.png differ diff --git a/test/select-font-face-ref.png b/test/select-font-face-ref.png index 8c3c1530d..b3d232200 100644 Binary files a/test/select-font-face-ref.png and b/test/select-font-face-ref.png differ diff --git a/test/select-font-face-svg-argb32-ref.png b/test/select-font-face-svg-argb32-ref.png deleted file mode 100644 index 50b8f4963..000000000 Binary files a/test/select-font-face-svg-argb32-ref.png and /dev/null differ diff --git a/test/select-font-face-svg-ref.png b/test/select-font-face-svg-ref.png new file mode 100644 index 000000000..e2e93b583 Binary files /dev/null and b/test/select-font-face-svg-ref.png differ diff --git a/test/select-font-face-svg-rgb24-ref.png b/test/select-font-face-svg-rgb24-ref.png deleted file mode 100644 index 50b8f4963..000000000 Binary files a/test/select-font-face-svg-rgb24-ref.png and /dev/null differ diff --git a/test/select-font-face.c b/test/select-font-face.c index 30daf25dd..57120ca15 100644 --- a/test/select-font-face.c +++ b/test/select-font-face.c @@ -39,23 +39,12 @@ cairo_test_t test = { static cairo_test_status_t draw (cairo_t *cr, int width, int height) { - cairo_font_options_t *font_options; - /* We draw in the default black, so paint white first. */ cairo_save (cr); cairo_set_source_rgb (cr, 1.0, 1.0, 1.0); /* white */ cairo_paint (cr); cairo_restore (cr); - font_options = cairo_font_options_create (); - - cairo_font_options_set_hint_style (font_options, CAIRO_HINT_STYLE_NONE); - cairo_font_options_set_hint_metrics (font_options, CAIRO_HINT_METRICS_OFF); - cairo_font_options_set_antialias (font_options, CAIRO_ANTIALIAS_GRAY); - - cairo_set_font_options (cr, font_options); - cairo_font_options_destroy (font_options); - cairo_set_source_rgb (cr, 0, 0, 0); /* black */ cairo_select_font_face (cr, "Bitstream Vera Serif", diff --git a/test/show-glyphs-many.c b/test/show-glyphs-many.c index f9137e6c9..9931a2594 100644 --- a/test/show-glyphs-many.c +++ b/test/show-glyphs-many.c @@ -91,7 +91,6 @@ static cairo_test_status_t draw (cairo_t *cr, int width, int height) { cairo_glyph_t glyphs[NUM_GLYPHS]; - cairo_font_options_t *font_options; int i; /* Initialize our giant array of glyphs. */ @@ -110,14 +109,6 @@ draw (cairo_t *cr, int width, int height) CAIRO_FONT_WEIGHT_NORMAL); cairo_set_font_size (cr, TEXT_SIZE); - font_options = cairo_font_options_create (); - - cairo_font_options_set_hint_style (font_options, CAIRO_HINT_STYLE_NONE); - cairo_font_options_set_antialias (font_options, CAIRO_ANTIALIAS_GRAY); - - cairo_set_font_options (cr, font_options); - cairo_font_options_destroy (font_options); - cairo_show_glyphs (cr, glyphs, NUM_GLYPHS); return CAIRO_TEST_SUCCESS; diff --git a/test/show-text-current-point-pdf-argb32-ref.png b/test/show-text-current-point-pdf-argb32-ref.png deleted file mode 100644 index 61b0dfaff..000000000 Binary files a/test/show-text-current-point-pdf-argb32-ref.png and /dev/null differ diff --git a/test/show-text-current-point-ps-argb32-ref.png b/test/show-text-current-point-ps-argb32-ref.png index 3213d7f86..e3f7e7fa0 100644 Binary files a/test/show-text-current-point-ps-argb32-ref.png and b/test/show-text-current-point-ps-argb32-ref.png differ diff --git a/test/show-text-current-point-svg-argb32-ref.png b/test/show-text-current-point-svg-argb32-ref.png deleted file mode 100644 index 717ad7e42..000000000 Binary files a/test/show-text-current-point-svg-argb32-ref.png and /dev/null differ diff --git a/test/show-text-current-point-svg-rgb24-ref.png b/test/show-text-current-point-svg-ref.png similarity index 100% rename from test/show-text-current-point-svg-rgb24-ref.png rename to test/show-text-current-point-svg-ref.png diff --git a/test/show-text-current-point.c b/test/show-text-current-point.c index ebd364452..5ff367588 100644 --- a/test/show-text-current-point.c +++ b/test/show-text-current-point.c @@ -39,8 +39,6 @@ cairo_test_t test = { static cairo_test_status_t draw (cairo_t *cr, int width, int height) { - cairo_font_options_t *font_options; - /* We draw in the default black, so paint white first. */ cairo_save (cr); cairo_set_source_rgb (cr, 1.0, 1.0, 1.0); /* white */ @@ -52,14 +50,6 @@ draw (cairo_t *cr, int width, int height) CAIRO_FONT_WEIGHT_NORMAL); cairo_set_font_size (cr, TEXT_SIZE); - font_options = cairo_font_options_create (); - - cairo_font_options_set_hint_style (font_options, CAIRO_HINT_STYLE_NONE); - cairo_font_options_set_antialias (font_options, CAIRO_ANTIALIAS_GRAY); - - cairo_set_font_options (cr, font_options); - cairo_font_options_destroy (font_options); - cairo_set_source_rgb (cr, 0, 0, 0); /* black */ cairo_move_to (cr, 0, TEXT_SIZE); diff --git a/test/text-antialias-gray-pdf-argb32-ref.png b/test/text-antialias-gray-pdf-argb32-ref.png deleted file mode 100644 index adf74a80c..000000000 Binary files a/test/text-antialias-gray-pdf-argb32-ref.png and /dev/null differ diff --git a/test/text-antialias-gray-ps-argb32-ref.png b/test/text-antialias-gray-ps-argb32-ref.png deleted file mode 100644 index 9087b7aa2..000000000 Binary files a/test/text-antialias-gray-ps-argb32-ref.png and /dev/null differ diff --git a/test/text-antialias-gray-svg-argb32-ref.png b/test/text-antialias-gray-svg-argb32-ref.png deleted file mode 100644 index aa64fbbec..000000000 Binary files a/test/text-antialias-gray-svg-argb32-ref.png and /dev/null differ diff --git a/test/text-antialias-gray-svg-rgb24-ref.png b/test/text-antialias-gray-svg-rgb24-ref.png deleted file mode 100644 index 20f0d5806..000000000 Binary files a/test/text-antialias-gray-svg-rgb24-ref.png and /dev/null differ diff --git a/test/text-antialias-gray.c b/test/text-antialias-gray.c index 0c9f30dd7..8090d8e06 100644 --- a/test/text-antialias-gray.c +++ b/test/text-antialias-gray.c @@ -57,12 +57,9 @@ draw (cairo_t *cr, int width, int height) cairo_set_font_size (cr, TEXT_SIZE); font_options = cairo_font_options_create (); - - cairo_font_options_set_hint_style (font_options, CAIRO_HINT_STYLE_NONE); + cairo_get_font_options (cr, font_options); cairo_font_options_set_antialias (font_options, CAIRO_ANTIALIAS_GRAY); - cairo_set_font_options (cr, font_options); - cairo_font_options_destroy (font_options); cairo_set_source_rgb (cr, 0, 0, 0); /* black */ cairo_text_extents (cr, black, &extents); diff --git a/test/text-antialias-none-pdf-argb32-ref.png b/test/text-antialias-none-pdf-argb32-ref.png deleted file mode 100644 index adf74a80c..000000000 Binary files a/test/text-antialias-none-pdf-argb32-ref.png and /dev/null differ diff --git a/test/text-antialias-none-ps-argb32-ref.png b/test/text-antialias-none-ps-argb32-ref.png deleted file mode 100644 index 9087b7aa2..000000000 Binary files a/test/text-antialias-none-ps-argb32-ref.png and /dev/null differ diff --git a/test/text-antialias-none-svg-argb32-ref.png b/test/text-antialias-none-svg-argb32-ref.png deleted file mode 100644 index aa64fbbec..000000000 Binary files a/test/text-antialias-none-svg-argb32-ref.png and /dev/null differ diff --git a/test/text-antialias-none-svg-rgb24-ref.png b/test/text-antialias-none-svg-rgb24-ref.png deleted file mode 100644 index 20f0d5806..000000000 Binary files a/test/text-antialias-none-svg-rgb24-ref.png and /dev/null differ diff --git a/test/text-antialias-none.c b/test/text-antialias-none.c index 32f7a0ed4..f9c86a9a7 100644 --- a/test/text-antialias-none.c +++ b/test/text-antialias-none.c @@ -57,12 +57,9 @@ draw (cairo_t *cr, int width, int height) cairo_set_font_size (cr, TEXT_SIZE); font_options = cairo_font_options_create (); - - cairo_font_options_set_hint_style (font_options, CAIRO_HINT_STYLE_NONE); + cairo_get_font_options (cr, font_options); cairo_font_options_set_antialias (font_options, CAIRO_ANTIALIAS_NONE); - cairo_set_font_options (cr, font_options); - cairo_font_options_destroy (font_options); cairo_set_source_rgb (cr, 0, 0, 0); /* black */ cairo_text_extents (cr, black, &extents); diff --git a/test/text-antialias-subpixel-pdf-argb32-ref.png b/test/text-antialias-subpixel-pdf-argb32-ref.png deleted file mode 100644 index adf74a80c..000000000 Binary files a/test/text-antialias-subpixel-pdf-argb32-ref.png and /dev/null differ diff --git a/test/text-antialias-subpixel-ps-argb32-ref.png b/test/text-antialias-subpixel-ps-argb32-ref.png deleted file mode 100644 index 9087b7aa2..000000000 Binary files a/test/text-antialias-subpixel-ps-argb32-ref.png and /dev/null differ diff --git a/test/text-antialias-subpixel-svg-argb32-ref.png b/test/text-antialias-subpixel-svg-argb32-ref.png deleted file mode 100644 index aa64fbbec..000000000 Binary files a/test/text-antialias-subpixel-svg-argb32-ref.png and /dev/null differ diff --git a/test/text-antialias-subpixel-svg-rgb24-ref.png b/test/text-antialias-subpixel-svg-rgb24-ref.png deleted file mode 100644 index 20f0d5806..000000000 Binary files a/test/text-antialias-subpixel-svg-rgb24-ref.png and /dev/null differ diff --git a/test/text-antialias-subpixel.c b/test/text-antialias-subpixel.c index aba989087..af0112a8f 100644 --- a/test/text-antialias-subpixel.c +++ b/test/text-antialias-subpixel.c @@ -53,16 +53,12 @@ draw (cairo_t *cr, int width, int height) CAIRO_FONT_WEIGHT_NORMAL); cairo_set_font_size (cr, TEXT_SIZE); - /* Sub-pixel antialiasing with unhinted glyphs can be pretty ugly - * (bad color fringing). The reason we turn off hints here is to - * try to get repeatable glyph shapes on multiple systems, not for - * any aesthetic reason. */ font_options = cairo_font_options_create (); - - cairo_font_options_set_hint_style (font_options, CAIRO_HINT_STYLE_NONE); + 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_set_font_options (cr, font_options); + cairo_font_options_destroy (font_options); cairo_set_source_rgb (cr, 0, 0, 0); /* black */ diff --git a/test/text-pattern-pdf-argb32-ref.png b/test/text-pattern-pdf-argb32-ref.png deleted file mode 100644 index 17afd64f2..000000000 Binary files a/test/text-pattern-pdf-argb32-ref.png and /dev/null differ diff --git a/test/text-pattern-ps-argb32-ref.png b/test/text-pattern-ps-argb32-ref.png deleted file mode 100644 index 1bc8dd40b..000000000 Binary files a/test/text-pattern-ps-argb32-ref.png and /dev/null differ diff --git a/test/text-pattern-svg-argb32-ref.png b/test/text-pattern-svg-argb32-ref.png index 79dc52dbf..73e3edfe7 100644 Binary files a/test/text-pattern-svg-argb32-ref.png and b/test/text-pattern-svg-argb32-ref.png differ diff --git a/test/text-pattern.c b/test/text-pattern.c index 40a2a4545..02feb2289 100644 --- a/test/text-pattern.c +++ b/test/text-pattern.c @@ -40,17 +40,8 @@ cairo_test_t test = { static cairo_test_status_t draw (cairo_t *cr, int width, int height) { - cairo_font_options_t *font_options; cairo_pattern_t *pat; - font_options = cairo_font_options_create (); - - cairo_font_options_set_hint_style (font_options, CAIRO_HINT_STYLE_NONE); - cairo_font_options_set_antialias (font_options, CAIRO_ANTIALIAS_GRAY); - - cairo_set_font_options (cr, font_options); - cairo_font_options_destroy (font_options); - cairo_select_font_face (cr, "Bitstream Vera Sans", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL); diff --git a/test/text-rotate.c b/test/text-rotate.c index abc6baa5b..50d907b24 100644 --- a/test/text-rotate.c +++ b/test/text-rotate.c @@ -110,9 +110,8 @@ draw (cairo_t *cr, int width, int height) font_options = cairo_font_options_create (); - cairo_font_options_set_hint_style (font_options, CAIRO_HINT_STYLE_NONE); + cairo_get_font_options (cr, font_options); cairo_font_options_set_hint_metrics (font_options, CAIRO_HINT_METRICS_OFF); - cairo_font_options_set_antialias (font_options, CAIRO_ANTIALIAS_GRAY); cairo_set_font_options (cr, font_options); cairo_font_options_destroy (font_options); diff --git a/test/transforms-ps-argb32-ref.png b/test/transforms-ps-argb32-ref.png index 4858364f6..5d5cfa978 100644 Binary files a/test/transforms-ps-argb32-ref.png and b/test/transforms-ps-argb32-ref.png differ diff --git a/test/unantialiased-shapes-ps-argb32-ref.png b/test/unantialiased-shapes-ps-argb32-ref.png deleted file mode 100644 index dc64e3616..000000000 Binary files a/test/unantialiased-shapes-ps-argb32-ref.png and /dev/null differ diff --git a/test/unantialiased-shapes-svg-argb32-ref.png b/test/unantialiased-shapes-svg-argb32-ref.png deleted file mode 100644 index da297735b..000000000 Binary files a/test/unantialiased-shapes-svg-argb32-ref.png and /dev/null differ diff --git a/test/unantialiased-shapes-svg-rgb24-ref.png b/test/unantialiased-shapes-svg-rgb24-ref.png deleted file mode 100644 index da297735b..000000000 Binary files a/test/unantialiased-shapes-svg-rgb24-ref.png and /dev/null differ diff --git a/test/unbounded-operator.c b/test/unbounded-operator.c index 70dab83fe..d3a6f3542 100644 --- a/test/unbounded-operator.c +++ b/test/unbounded-operator.c @@ -145,21 +145,12 @@ static cairo_test_status_t draw (cairo_t *cr, int width, int height) { int i, j, x, y; - cairo_font_options_t *font_options; cairo_pattern_t *pattern; cairo_select_font_face (cr, "Bitstream Vera Sans", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL); - font_options = cairo_font_options_create (); - - cairo_font_options_set_hint_style (font_options, CAIRO_HINT_STYLE_NONE); - cairo_font_options_set_antialias (font_options, CAIRO_ANTIALIAS_GRAY); - - cairo_set_font_options (cr, font_options); - cairo_font_options_destroy (font_options); - for (j = 0; j < ARRAY_SIZE (draw_funcs); j++) { for (i = 0; i < ARRAY_SIZE (operators); i++) { x = i * (WIDTH + PAD) + PAD;