diff options
author | Uli Schlachter <psychon@znc.in> | 2014-02-05 21:07:48 +0100 |
---|---|---|
committer | Uli Schlachter <psychon@znc.in> | 2014-02-05 21:07:48 +0100 |
commit | 87f39925bf65fbac5b8bcbbb474593fac3045e22 (patch) | |
tree | b95a76eee00141833db40cc89699c5652da63625 | |
parent | 4144307dbfbe7b297135d9ea4b080cae7e06b997 (diff) |
Reverts at least 7ab34f302be72d9dda54d936b6d69bc7c534c885,
0266cb821fbf0bdd307af7bbcbbd22c4a14201fc and
690c61aa54c27e4d35b04d0173abd5931fce507d.
Sadly, no tests needed to be touched, only the generic test runner
infrastructure. I guess this doesn't really say that this feature is well-tested
by the test suite.
-rw-r--r-- | src/cairo-default-context.c | 6 | ||||
-rw-r--r-- | src/cairo-paginated-surface.c | 2 | ||||
-rw-r--r-- | src/cairo-surface-subsurface.c | 12 | ||||
-rw-r--r-- | src/cairo-surface.c | 58 | ||||
-rw-r--r-- | src/cairo.h | 10 | ||||
-rw-r--r-- | src/cairoint.h | 7 | ||||
-rw-r--r-- | test/cairo-test-private.h | 72 | ||||
-rw-r--r-- | test/cairo-test-runner.c | 68 | ||||
-rw-r--r-- | test/cairo-test.c | 66 | ||||
-rw-r--r-- | util/cairo-script/cairo-script-operators.c | 48 |
10 files changed, 87 insertions, 262 deletions
diff --git a/src/cairo-default-context.c b/src/cairo-default-context.c index 1e5067b..a95bbfc 100644 --- a/src/cairo-default-context.c +++ b/src/cairo-default-context.c @@ -189,9 +189,9 @@ _cairo_default_context_push_group (void *abstract_cr, cairo_content_t content) parent_surface->device_transform.x0 - extents.x, parent_surface->device_transform.y0 - extents.y); - cairo_surface_set_device_scale (group_surface, - parent_surface->device_transform.xx, - parent_surface->device_transform.yy); + _cairo_surface_set_device_scale (group_surface, + parent_surface->device_transform.xx, + parent_surface->device_transform.yy); /* If we have a current path, we need to adjust it to compensate for * the device offset just applied. */ diff --git a/src/cairo-paginated-surface.c b/src/cairo-paginated-surface.c index 68e4e0e..fe9ccee 100644 --- a/src/cairo-paginated-surface.c +++ b/src/cairo-paginated-surface.c @@ -308,7 +308,7 @@ _paint_fallback_image (cairo_paginated_surface_t *surface, image = _cairo_paginated_surface_create_image_surface (surface, ceil (width * x_scale), ceil (height * y_scale)); - cairo_surface_set_device_scale (image, x_scale, y_scale); + _cairo_surface_set_device_scale (image, x_scale, y_scale); /* set_device_offset just sets the x0/y0 components of the matrix; * so we have to do the scaling manually. */ cairo_surface_set_device_offset (image, -x*x_scale, -y*y_scale); diff --git a/src/cairo-surface-subsurface.c b/src/cairo-surface-subsurface.c index b7dfd9d..6842121 100644 --- a/src/cairo-surface-subsurface.c +++ b/src/cairo-surface-subsurface.c @@ -501,9 +501,9 @@ cairo_surface_create_for_rectangle (cairo_surface_t *target, surface->snapshot = NULL; - cairo_surface_set_device_scale (&surface->base, - target->device_transform.xx, - target->device_transform.yy); + _cairo_surface_set_device_scale (&surface->base, + target->device_transform.xx, + target->device_transform.yy); return &surface->base; } @@ -543,9 +543,9 @@ _cairo_surface_create_for_rectangle_int (cairo_surface_t *target, surface->snapshot = NULL; - cairo_surface_set_device_scale (&surface->base, - target->device_transform.xx, - target->device_transform.yy); + _cairo_surface_set_device_scale (&surface->base, + target->device_transform.xx, + target->device_transform.yy); return &surface->base; } diff --git a/src/cairo-surface.c b/src/cairo-surface.c index d550131..65984d2 100644 --- a/src/cairo-surface.c +++ b/src/cairo-surface.c @@ -523,9 +523,9 @@ cairo_surface_create_similar (cairo_surface_t *other, return surface; _cairo_surface_copy_similar_properties (surface, other); - cairo_surface_set_device_scale (surface, - other->device_transform.xx, - other->device_transform.yy); + _cairo_surface_set_device_scale (surface, + other->device_transform.xx, + other->device_transform.yy); if (unlikely (surface->status)) return surface; @@ -1648,28 +1648,26 @@ cairo_surface_mark_dirty_rectangle (cairo_surface_t *surface, slim_hidden_def (cairo_surface_mark_dirty_rectangle); /** - * cairo_surface_set_device_scale: + * _cairo_surface_set_device_scale: * @surface: a #cairo_surface_t * @sx: a scale factor in the X direction * @sy: a scale factor in the Y direction * - * Sets an scale that is multiplied to the device coordinates determined - * by the CTM when drawing to @surface. One common use for this is to - * render to very high resolution display devices at a scale factor, so - * that code that assumes 1 pixel will be a certain size will still work. - * Setting a transformation via cairo_translate() isn't - * sufficient to do this, since functions like - * cairo_device_to_user() will expose the hidden scale. - * - * Note that the scale affects drawing to the surface as well as - * using the surface in a source pattern. + * Private function for setting an extra scale factor to affect all + * drawing to a surface. This is used, for example, when replaying a + * recording surface to an image fallback intended for an eventual + * vector-oriented backend. Since the recording surface will record + * coordinates in one backend space, but the image fallback uses a + * different backend space, (differing by the fallback resolution + * scale factors), we need a scale factor correction. * - * Since: 1.14 + * Caution: Not all places we use device transform correctly handle + * both a translate and a scale. An audit would be nice. **/ void -cairo_surface_set_device_scale (cairo_surface_t *surface, - double sx, - double sy) +_cairo_surface_set_device_scale (cairo_surface_t *surface, + double sx, + double sy) { cairo_status_t status; @@ -1701,30 +1699,6 @@ cairo_surface_set_device_scale (cairo_surface_t *surface, _cairo_observers_notify (&surface->device_transform_observers, surface); } -slim_hidden_def (cairo_surface_set_device_scale); - -/** - * cairo_surface_get_device_scale: - * @surface: a #cairo_surface_t - * @x_scale: the scale in the X direction, in device units - * @y_scale: the scale in the Y direction, in device units - * - * This function returns the previous device offset set by - * cairo_surface_set_device_scale(). - * - * Since: 1.14 - **/ -void -cairo_surface_get_device_scale (cairo_surface_t *surface, - double *x_scale, - double *y_scale) -{ - if (x_scale) - *x_scale = surface->device_transform.xx; - if (y_scale) - *y_scale = surface->device_transform.yy; -} -slim_hidden_def (cairo_surface_get_device_scale); /** * cairo_surface_set_device_offset: diff --git a/src/cairo.h b/src/cairo.h index 2e69793..958310e 100644 --- a/src/cairo.h +++ b/src/cairo.h @@ -2462,16 +2462,6 @@ cairo_surface_mark_dirty_rectangle (cairo_surface_t *surface, int height); cairo_public void -cairo_surface_set_device_scale (cairo_surface_t *surface, - double x_scale, - double y_scale); - -cairo_public void -cairo_surface_get_device_scale (cairo_surface_t *surface, - double *x_scale, - double *y_scale); - -cairo_public void cairo_surface_set_device_offset (cairo_surface_t *surface, double x_offset, double y_offset); diff --git a/src/cairoint.h b/src/cairoint.h index 44e0ec5..052e1ad 100644 --- a/src/cairoint.h +++ b/src/cairoint.h @@ -1417,6 +1417,11 @@ cairo_private_no_warn cairo_bool_t _cairo_surface_get_extents (cairo_surface_t *surface, cairo_rectangle_int_t *extents); +cairo_private void +_cairo_surface_set_device_scale (cairo_surface_t *surface, + double sx, + double sy); + cairo_private cairo_bool_t _cairo_surface_has_device_transform (cairo_surface_t *surface) cairo_pure; @@ -1947,7 +1952,6 @@ slim_hidden_proto (cairo_surface_destroy); slim_hidden_proto (cairo_surface_finish); slim_hidden_proto (cairo_surface_flush); slim_hidden_proto (cairo_surface_get_device_offset); -slim_hidden_proto (cairo_surface_get_device_scale); slim_hidden_proto (cairo_surface_get_font_options); slim_hidden_proto (cairo_surface_get_mime_data); slim_hidden_proto (cairo_surface_has_show_text_glyphs); @@ -1955,7 +1959,6 @@ slim_hidden_proto (cairo_surface_mark_dirty); slim_hidden_proto (cairo_surface_mark_dirty_rectangle); slim_hidden_proto_no_warn (cairo_surface_reference); slim_hidden_proto (cairo_surface_set_device_offset); -slim_hidden_proto (cairo_surface_set_device_scale); slim_hidden_proto (cairo_surface_set_fallback_resolution); slim_hidden_proto (cairo_surface_set_mime_data); slim_hidden_proto (cairo_surface_show_page); diff --git a/test/cairo-test-private.h b/test/cairo-test-private.h index cfd22de..3e40324 100644 --- a/test/cairo-test-private.h +++ b/test/cairo-test-private.h @@ -1,72 +0,0 @@ -/* - * Copyright © 2004 Red Hat, Inc. - * Copyright © 2008 Chris Wilson - * - * Permission to use, copy, modify, distribute, and sell this software - * and its documentation for any purpose is hereby granted without - * fee, provided that the above copyright notice appear in all copies - * and that both that copyright notice and this permission notice - * appear in supporting documentation, and that the name of - * Red Hat, Inc. not be used in advertising or publicity pertaining to - * distribution of the software without specific, written prior - * permission. Red Hat, Inc. makes no representations about the - * suitability of this software for any purpose. It is provided "as - * is" without express or implied warranty. - * - * RED HAT, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS - * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS, IN NO EVENT SHALL RED HAT, INC. BE LIABLE FOR ANY SPECIAL, - * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER - * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR - * IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - * Author: Carl D. Worth <cworth@cworth.org> - * Chris Wilson <chris@chris-wilson.co.uk> - */ - -#ifndef _CAIRO_TEST_PRIVATE_H_ -#define _CAIRO_TEST_PRIVATE_H_ - -#include "cairo-test.h" - -/* For communication between the core components of cairo-test and not - * for the tests themselves. - */ - -CAIRO_BEGIN_DECLS - -typedef enum { - DIRECT, - SIMILAR -} cairo_test_similar_t; - -cairo_test_similar_t -cairo_test_target_has_similar (const cairo_test_context_t *ctx, - const cairo_boilerplate_target_t *target); - -cairo_test_status_t -_cairo_test_context_run_for_target (cairo_test_context_t *ctx, - const cairo_boilerplate_target_t *target, - cairo_bool_t similar, - int dev_offset, int dev_scale); - -void -_cairo_test_context_init_for_test (cairo_test_context_t *ctx, - const cairo_test_context_t *parent, - const cairo_test_t *test); - -void -cairo_test_init (cairo_test_context_t *ctx, - const char *test_name, - const char *output); - -void -cairo_test_fini (cairo_test_context_t *ctx); - -void -_cairo_test_runner_register_tests (void); - -CAIRO_END_DECLS - -#endif /* _CAIRO_TEST_PRIVATE_H_ */ diff --git a/test/cairo-test-runner.c b/test/cairo-test-runner.c index 3fb3ae5..a0ddcd2 100644 --- a/test/cairo-test-runner.c +++ b/test/cairo-test-runner.c @@ -69,7 +69,6 @@ typedef struct _cairo_test_runner { cairo_test_context_t base; unsigned int num_device_offsets; - unsigned int num_device_scales; cairo_bool_t passed; int num_passed; @@ -233,7 +232,7 @@ _cairo_test_runner_draw (cairo_test_runner_t *runner, cairo_test_context_t *ctx, const cairo_boilerplate_target_t *target, cairo_bool_t similar, - int device_offset, int device_scale) + int device_offset) { #if SHOULD_FORK if (! runner->foreground) { @@ -245,7 +244,7 @@ _cairo_test_runner_draw (cairo_test_runner_t *runner, case 0: /* child */ exit (_cairo_test_context_run_for_target (ctx, target, - similar, device_offset, device_scale)); + similar, device_offset)); default: return _cairo_test_wait (pid); @@ -253,7 +252,7 @@ _cairo_test_runner_draw (cairo_test_runner_t *runner, } #endif return _cairo_test_context_run_for_target (ctx, target, - similar, device_offset, device_scale); + similar, device_offset); } static void @@ -700,7 +699,7 @@ main (int argc, char **argv) cairo_test_runner_t runner; cairo_test_list_t *test_list; cairo_test_status_t *target_status; - unsigned int n, m, k; + unsigned int n, m; char targets[4096]; int len; char *cairo_tests_env; @@ -716,7 +715,6 @@ main (int argc, char **argv) memset (&runner, 0, sizeof (runner)); runner.num_device_offsets = 1; - runner.num_device_scales = 1; if (is_running_under_debugger ()) runner.foreground = TRUE; @@ -758,9 +756,6 @@ main (int argc, char **argv) if (runner.full_test & TEST_OFFSET) { runner.num_device_offsets = 2; } - if (runner.full_test & TEST_SCALE) { - runner.num_device_scales = 2; - } target_status = NULL; /* silence the compiler */ if (! runner.list_only) { @@ -928,35 +923,32 @@ main (int argc, char **argv) cairo_test_target_has_similar (&ctx, target) : DIRECT; for (m = 0; m < runner.num_device_offsets; m++) { - for (k = 0; k < runner.num_device_scales; k++) { - int dev_offset = m * 25; - int dev_scale = k + 1; - cairo_test_similar_t similar; - - for (similar = DIRECT; similar <= has_similar; similar++) { - status = _cairo_test_runner_draw (&runner, &ctx, target, - similar, dev_offset, dev_scale); - switch (status) { - case CAIRO_TEST_SUCCESS: - target_skipped = FALSE; - break; - case CAIRO_TEST_XFAILURE: - target_xfailed = TRUE; - break; - case CAIRO_TEST_NEW: - case CAIRO_TEST_FAILURE: - target_failed = TRUE; - break; - case CAIRO_TEST_ERROR: - target_error = TRUE; - break; - case CAIRO_TEST_NO_MEMORY: - case CAIRO_TEST_CRASHED: - target_crashed = TRUE; - break; - case CAIRO_TEST_UNTESTED: - break; - } + int dev_offset = m * 25; + cairo_test_similar_t similar; + + for (similar = DIRECT; similar <= has_similar; similar++) { + status = _cairo_test_runner_draw (&runner, &ctx, target, + similar, dev_offset); + switch (status) { + case CAIRO_TEST_SUCCESS: + target_skipped = FALSE; + break; + case CAIRO_TEST_XFAILURE: + target_xfailed = TRUE; + break; + case CAIRO_TEST_NEW: + case CAIRO_TEST_FAILURE: + target_failed = TRUE; + break; + case CAIRO_TEST_ERROR: + target_error = TRUE; + break; + case CAIRO_TEST_NO_MEMORY: + case CAIRO_TEST_CRASHED: + target_crashed = TRUE; + break; + case CAIRO_TEST_UNTESTED: + break; } } } diff --git a/test/cairo-test.c b/test/cairo-test.c index 119506d..255ea8b 100644 --- a/test/cairo-test.c +++ b/test/cairo-test.c @@ -101,7 +101,6 @@ static cairo_bool_t print_fail_on_stdout; static int cairo_test_timeout = 60; #define NUM_DEVICE_OFFSETS 2 -#define NUM_DEVICE_SCALE 2 cairo_bool_t cairo_test_mkdir (const char *path) @@ -431,8 +430,8 @@ cairo_test_target_has_similar (const cairo_test_context_t *ctx, target->content, ctx->test->width, ctx->test->height, - ctx->test->width* NUM_DEVICE_SCALE + 25 * NUM_DEVICE_OFFSETS, - ctx->test->height* NUM_DEVICE_SCALE + 25 * NUM_DEVICE_OFFSETS, + ctx->test->width + 25 * NUM_DEVICE_OFFSETS, + ctx->test->height + 25 * NUM_DEVICE_OFFSETS, CAIRO_BOILERPLATE_MODE_TEST, &closure); if (surface == NULL) @@ -629,7 +628,6 @@ static cairo_test_status_t cairo_test_for_target (cairo_test_context_t *ctx, const cairo_boilerplate_target_t *target, int dev_offset, - int dev_scale, cairo_bool_t similar) { cairo_test_status_t status; @@ -637,7 +635,6 @@ cairo_test_for_target (cairo_test_context_t *ctx, cairo_t *cr; const char *empty_str = ""; char *offset_str; - char *scale_str; char *base_name, *base_path; char *out_png_path; char *ref_path = NULL, *ref_png_path, *cmp_png_path = NULL; @@ -669,23 +666,15 @@ cairo_test_for_target (cairo_test_context_t *ctx, else offset_str = (char *) empty_str; - if (dev_scale != 1) - xasprintf (&scale_str, ".x%d", dev_scale); - else - scale_str = (char *) empty_str; - - xasprintf (&base_name, "%s.%s.%s%s%s%s", + xasprintf (&base_name, "%s.%s.%s%s%s", ctx->test_name, target->name, format, similar ? ".similar" : "", - offset_str, - scale_str); + offset_str); if (offset_str != empty_str) free (offset_str); - if (scale_str != empty_str) - free (scale_str); ref_png_path = cairo_test_reference_filename (ctx, base_name, @@ -793,8 +782,6 @@ cairo_test_for_target (cairo_test_context_t *ctx, width = ctx->test->width; height = ctx->test->height; if (width && height) { - width *= dev_scale; - height *= dev_scale; width += dev_offset; height += dev_offset; } @@ -823,8 +810,8 @@ REPEAT: surface = (target->create_surface) (base_path, target->content, width, height, - ctx->test->width * NUM_DEVICE_SCALE + 25 * NUM_DEVICE_OFFSETS, - ctx->test->height * NUM_DEVICE_SCALE + 25 * NUM_DEVICE_OFFSETS, + ctx->test->width + 25 * NUM_DEVICE_OFFSETS, + ctx->test->height + 25 * NUM_DEVICE_OFFSETS, CAIRO_BOILERPLATE_MODE_TEST, &closure); if (surface == NULL) { @@ -891,7 +878,6 @@ REPEAT: } cairo_surface_set_device_offset (surface, dev_offset, dev_offset); - cairo_surface_set_device_scale (surface, dev_scale, dev_scale); cr = cairo_create (surface); if (cairo_set_user_data (cr, &_cairo_test_context_key, (void*) ctx, NULL)) { @@ -1485,7 +1471,7 @@ cairo_test_status_t _cairo_test_context_run_for_target (cairo_test_context_t *ctx, const cairo_boilerplate_target_t *target, cairo_bool_t similar, - int dev_offset, int dev_scale) + int dev_offset) { cairo_test_status_t status; @@ -1496,15 +1482,15 @@ _cairo_test_context_run_for_target (cairo_test_context_t *ctx, return CAIRO_TEST_UNTESTED; cairo_test_log (ctx, - "Testing %s with %s%s target (dev offset %d scale: %d)\n", + "Testing %s with %s%s target (dev offset %d)\n", ctx->test_name, similar ? " (similar) " : "", target->name, - dev_offset, dev_scale); + dev_offset); - printf ("%s.%s.%s [%dx%d]%s:\t", ctx->test_name, target->name, + printf ("%s.%s.%s [%d]%s:\t", ctx->test_name, target->name, cairo_boilerplate_content_name (target->content), - dev_offset, dev_scale, + dev_offset, similar ? " (similar)": ""); fflush (stdout); @@ -1533,7 +1519,7 @@ _cairo_test_context_run_for_target (cairo_test_context_t *ctx, old_sigalrm_handler = signal (SIGALRM, segfault_handler); #endif if (0 == setjmp (jmpbuf)) - status = cairo_test_for_target (ctx, target, dev_offset, dev_scale, similar); + status = cairo_test_for_target (ctx, target, dev_offset, similar); else status = CAIRO_TEST_CRASHED; #ifdef SIGSEGV @@ -1552,17 +1538,17 @@ _cairo_test_context_run_for_target (cairo_test_context_t *ctx, signal (SIGALRM, old_sigalrm_handler); #endif } else { - status = cairo_test_for_target (ctx, target, dev_offset, dev_scale, similar); + status = cairo_test_for_target (ctx, target, dev_offset, similar); } #else - status = cairo_test_for_target (ctx, target, dev_offset, dev_scale, similar); + status = cairo_test_for_target (ctx, target, dev_offset, similar); #endif cairo_test_log (ctx, - "TEST: %s TARGET: %s FORMAT: %s OFFSET: %d SCALE: %d SIMILAR: %d RESULT: ", + "TEST: %s TARGET: %s FORMAT: %s OFFSET: %d SIMILAR: %d RESULT: ", ctx->test_name, target->name, cairo_boilerplate_content_name (target->content), - dev_offset, dev_scale, similar); + dev_offset, similar); switch (status) { case CAIRO_TEST_SUCCESS: printf ("PASS\n"); @@ -1584,9 +1570,9 @@ _cairo_test_context_run_for_target (cairo_test_context_t *ctx, fflush (stdout); } cairo_test_log (ctx, "CRASHED\n"); - fprintf (stderr, "%s.%s.%s [%dx%d]%s:\t%s!!!CRASHED!!!%s\n", + fprintf (stderr, "%s.%s.%s [%d]%s:\t%s!!!CRASHED!!!%s\n", ctx->test_name, target->name, - cairo_boilerplate_content_name (target->content), dev_offset, dev_scale, similar ? " (similar)" : "", + cairo_boilerplate_content_name (target->content), dev_offset, similar ? " (similar)" : "", fail_face, normal_face); break; @@ -1599,9 +1585,9 @@ _cairo_test_context_run_for_target (cairo_test_context_t *ctx, fflush (stdout); } cairo_test_log (ctx, "ERROR\n"); - fprintf (stderr, "%s.%s.%s [%dx%d]%s:\t%s!!!ERROR!!!%s\n", + fprintf (stderr, "%s.%s.%s [%d]%s:\t%s!!!ERROR!!!%s\n", ctx->test_name, target->name, - cairo_boilerplate_content_name (target->content), dev_offset, dev_scale, similar ? " (similar)" : "", + cairo_boilerplate_content_name (target->content), dev_offset, similar ? " (similar)" : "", fail_face, normal_face); break; @@ -1613,9 +1599,9 @@ _cairo_test_context_run_for_target (cairo_test_context_t *ctx, printf ("\r"); fflush (stdout); } - fprintf (stderr, "%s.%s.%s [%dx%d]%s:\t%sXFAIL%s\n", + fprintf (stderr, "%s.%s.%s [%d]%s:\t%sXFAIL%s\n", ctx->test_name, target->name, - cairo_boilerplate_content_name (target->content), dev_offset, dev_scale, similar ? " (similar)" : "", + cairo_boilerplate_content_name (target->content), dev_offset, similar ? " (similar)" : "", xfail_face, normal_face); cairo_test_log (ctx, "XFAIL\n"); break; @@ -1628,9 +1614,9 @@ _cairo_test_context_run_for_target (cairo_test_context_t *ctx, printf ("\r"); fflush (stdout); } - fprintf (stderr, "%s.%s.%s [%dx%d]%s:\t%sNEW%s\n", + fprintf (stderr, "%s.%s.%s [%d]%s:\t%sNEW%s\n", ctx->test_name, target->name, - cairo_boilerplate_content_name (target->content), dev_offset, dev_scale, similar ? " (similar)" : "", + cairo_boilerplate_content_name (target->content), dev_offset, similar ? " (similar)" : "", fail_face, normal_face); cairo_test_log (ctx, "NEW\n"); break; @@ -1644,9 +1630,9 @@ _cairo_test_context_run_for_target (cairo_test_context_t *ctx, printf ("\r"); fflush (stdout); } - fprintf (stderr, "%s.%s.%s [%dx%d]%s:\t%sFAIL%s\n", + fprintf (stderr, "%s.%s.%s [%d]%s:\t%sFAIL%s\n", ctx->test_name, target->name, - cairo_boilerplate_content_name (target->content), dev_offset, dev_scale, similar ? " (similar)" : "", + cairo_boilerplate_content_name (target->content), dev_offset, similar ? " (similar)" : "", fail_face, normal_face); cairo_test_log (ctx, "FAIL\n"); break; diff --git a/util/cairo-script/cairo-script-operators.c b/util/cairo-script/cairo-script-operators.c index d4af312..fe2d479 100644 --- a/util/cairo-script/cairo-script-operators.c +++ b/util/cairo-script/cairo-script-operators.c @@ -4850,30 +4850,6 @@ _set_device_offset (csi_t *ctx) } static csi_status_t -_set_device_scale (csi_t *ctx) -{ - csi_status_t status; - cairo_surface_t *surface; - double x, y; - - check (3); - - status = _csi_ostack_get_number (ctx, 0, &y); - if (_csi_unlikely (status)) - return status; - status = _csi_ostack_get_number (ctx, 1, &x); - if (_csi_unlikely (status)) - return status; - status = _csi_ostack_get_surface (ctx, 2, &surface); - if (_csi_unlikely (status)) - return status; - - cairo_surface_set_device_scale (surface, x, y); - pop (2); - return CSI_STATUS_SUCCESS; -} - -static csi_status_t _set_extend (csi_t *ctx) { csi_status_t status; @@ -6127,29 +6103,6 @@ _surface (csi_t *ctx) } } - status = csi_name_new_static (ctx, &key, "device-scale"); - if (_csi_unlikely (status)) { - cairo_surface_destroy (surface); - return status; - } - if (csi_dictionary_has (dict, key.datum.name)) { - status = csi_dictionary_get (ctx, dict, key.datum.name, &obj); - if (_csi_unlikely (status)) - return status; - - if (csi_object_get_type (&obj) == CSI_OBJECT_TYPE_ARRAY) { - csi_array_t *array = obj.datum.array; - - if (array->stack.len == 2) { - cairo_surface_set_device_scale (surface, - csi_number_get_value - (&array->stack.objects[0]), - csi_number_get_value - (&array->stack.objects[1])); - } - } - } - obj.type = CSI_OBJECT_TYPE_SURFACE; obj.datum.surface = surface; pop (1); @@ -6586,7 +6539,6 @@ _defs[] = { { "set-antialias", _set_antialias }, { "set-dash", _set_dash }, { "set-device-offset", _set_device_offset }, - { "set-device-scale", _set_device_scale }, { "set-extend", _set_extend }, { "set-fallback-resolution", _set_fallback_resolution }, { "set-fill-rule", _set_fill_rule }, |