[cairo-commit]
cairo/test .cvsignore, 1.68, 1.69 Makefile.am, 1.108,
1.109 buffer-diff.c, 1.9, 1.10 buffer-diff.h, 1.4,
1.5 cairo-test.c, 1.74, 1.75 caps-joins-ref.png, 1.1,
1.2 caps-joins.c, 1.1, 1.2 caps-sub-paths-ref.png, 1.1,
1.2 caps-sub-paths.c, 1.3,
1.4 clip-fill-rule-pixel-aligned-rgb24-ref.png, 1.1,
1.2 clip-fill-rule-rgb24-ref.png, 1.1,
1.2 clip-nesting-rgb24-ref.png, 1.1,
1.2 clip-operator-rgb24-ref.png, 1.2,
1.3 clip-twice-rgb24-ref.png, 1.1, 1.2 dash-caps-joins-ref.png,
1.1, 1.2 dash-caps-joins.c, 1.2,
1.3 dash-offset-negative-ref.png, 1.1,
1.2 dash-offset-negative.c, 1.1,
1.2 fill-and-stroke-rgb24-ref.png, 1.1,
1.2 fill-rule-rgb24-ref.png, 1.1,
1.2 gradient-alpha-rgb24-ref.png, 1.2,
1.3 leaky-polygon-ref.png, 1.2, 1.3 leaky-polygon.c, 1.3,
1.4 line-width-ref.png, 1.2, 1.3 line-width.c, 1.4,
1.5 mask-ctm-rgb24-ref.png, 1.1, 1.2 mask-rgb24-ref.png, 1.2,
1.3 mask-surface-ctm-rgb24-ref.png, 1.1, 1.2 multi-page.c, 1.2,
1.3 nil-surface-rgb24-ref.png, 1.1,
1.2 operator-clear-rgb24-ref.png, 1.2,
1.3 operator-source-rgb24-ref.png, 1.2,
1.3 paint-with-alpha-rgb24-ref.png, 1.1, 1.2 path-data-ref.png,
1.1, 1.2 path-data.c, 1.5, 1.6 png-flatten.c, NONE,
1.1 rel-path-rgb24-ref.png, 1.1,
1.2 scale-source-surface-paint-rgb24-ref.png, 1.1,
1.2 set-source-rgb24-ref.png, 1.1,
1.2 show-text-current-point-ref.png, 1.1,
1.2 show-text-current-point.c, 1.1,
1.2 source-surface-scale-paint-rgb24-ref.png, 1.1,
1.2 text-antialias-gray-ref.png, 1.3,
1.4 text-antialias-gray.c, 1.3,
1.4 text-antialias-none-ref.png, 1.3,
1.4 text-antialias-none.c, 1.4, 1.5 text-pattern-rgb24-ref.png,
1.2, 1.3 transforms-ref.png, 1.1, 1.2 transforms.c, 1.2,
1.3 trap-clip-rgb24-ref.png, 1.2,
1.3 unbounded-operator-rgb24-ref.png, 1.2, 1.3
Carl Worth
commit at pdx.freedesktop.org
Tue Jan 17 16:59:12 PST 2006
Committed by: cworth
Update of /cvs/cairo/cairo/test
In directory gabe:/tmp/cvs-serv6786
Modified Files:
.cvsignore Makefile.am buffer-diff.c buffer-diff.h
cairo-test.c caps-joins-ref.png caps-joins.c
caps-sub-paths-ref.png caps-sub-paths.c
clip-fill-rule-pixel-aligned-rgb24-ref.png
clip-fill-rule-rgb24-ref.png clip-nesting-rgb24-ref.png
clip-operator-rgb24-ref.png clip-twice-rgb24-ref.png
dash-caps-joins-ref.png dash-caps-joins.c
dash-offset-negative-ref.png dash-offset-negative.c
fill-and-stroke-rgb24-ref.png fill-rule-rgb24-ref.png
gradient-alpha-rgb24-ref.png leaky-polygon-ref.png
leaky-polygon.c line-width-ref.png line-width.c
mask-ctm-rgb24-ref.png mask-rgb24-ref.png
mask-surface-ctm-rgb24-ref.png multi-page.c
nil-surface-rgb24-ref.png operator-clear-rgb24-ref.png
operator-source-rgb24-ref.png paint-with-alpha-rgb24-ref.png
path-data-ref.png path-data.c rel-path-rgb24-ref.png
scale-source-surface-paint-rgb24-ref.png
set-source-rgb24-ref.png show-text-current-point-ref.png
show-text-current-point.c
source-surface-scale-paint-rgb24-ref.png
text-antialias-gray-ref.png text-antialias-gray.c
text-antialias-none-ref.png text-antialias-none.c
text-pattern-rgb24-ref.png transforms-ref.png transforms.c
trap-clip-rgb24-ref.png unbounded-operator-rgb24-ref.png
Added Files:
png-flatten.c
Log Message:
2006-01-17 Carl Worth <cworth at cworth.org>
Big change to the test infrastructure and supporting
internals. The goal now is to test both a COLOR_ALPHA and a COLOR
content for each surface backend, (since the semantics are
different and we probably need to support both in each backend.
The PS/PDF backends don't allow a content to be passed in right
now, so they fail against the rgb24 tests, but the trivial
addition to the constructors will allow them to pass all tests
with both content values.
* src/cairoint.h:
* src/cairo-image-surface.c:
(_cairo_image_surface_create_with_content),
(_cairo_image_surface_create_for_data_with_content),
(_cairo_image_surface_create_similar): And new constructors
(currently internal only) to create an image surface with a
cairo_content_t rather than a cairo_format_t.
* src/cairo-meta-surface-private.h:
* src/cairo-meta-surface.c: (_cairo_meta_surface_create),
(_cairo_meta_surface_create_similar): Add a cairo_content_t
argument to the constructor.
* src/cairo-paginated-surface-private.h:
* src/cairo-paginated-surface.c: (_cairo_paginated_surface_create),
(_cairo_paginated_surface_acquire_source_image), (_paint_page),
(_cairo_paginated_surface_show_page),
(_cairo_paginated_surface_snapshot): Add a cairo_content_t to the
constructor and use this content value when constructing
intermediate image surfaces in acquire_source, show_page,
copy_page, and snapshot.
* src/cairo-pdf-surface.c: (emit_image_rgb_data),
(_cairo_pdf_surface_composite_image), (emit_surface_pattern): Add
image flattening by compositing over white, as is done in
cairo-ps-surface.c.
* src/cairo-ps-surface.c:
(_cairo_ps_surface_create_for_stream_internal),
(cairo_ps_surface_create), (cairo_ps_surface_create_for_stream):
* src/cairo-pdf-surface.c:
(_cairo_pdf_surface_create_for_stream_internal),
(cairo_pdf_surface_create_for_stream), (cairo_pdf_surface_create),
Track changes to cairo-paginates-surface which now requires a
cairo_content_t value (no change to public PS/PDF constructors
yet).
* src/test-fallback-surface.h:
* src/test-fallback-surface.c: (_test_fallback_surface_create),
(_test_fallback_surface_create_similar):
* src/test-meta-surface.h:
* src/test-meta-surface.c: (_test_meta_surface_create):
* src/test-paginated-surface.h:
* src/test-paginated-surface.c:
(_test_paginated_surface_create_for_data): Track change in
meta-surface and paginated-surface interfaces by now accepting a
cairo_content_t rather than a cairo_format_t.
* test/.cvsignore: Ignore new output files (argb32 from pdf and ps
as well as rgb24 from test-fallback, test-meta, and
test-paginated).
* test/Makefile.am:
* test/png-flatten.c: (main): Add new utility for flattening PNG
images in order to generate the -argbf-ref.png images.
* test/buffer-diff.c: (image_diff_flattened):
* test/buffer-diff.h: Add image_diff_flattened for comparing
flattened output from PS and PDF backend with ARGB reference
images by first blending the reference images over white.
* test/cairo-test.c: (_cairo_test_content_name),
(create_image_surface), (create_test_fallback_surface),
(create_test_meta_surface), (create_test_paginated_surface),
(test_paginated_write_to_png), (create_cairo_glitz_glx_surface),
(create_cairo_glitz_agl_surface), (create_cairo_glitz_wgl_surface),
(create_win32_surface), (create_xcb_surface),
(create_xlib_surface), (create_ps_surface), (create_pdf_surface),
(create_svg_surface), (cairo_test_for_target),
(cairo_test_expecting): Get rid of conditional, format-specific
background-color initialization before running tests. Now uses
ARGB(0,0,0,0) in all cases. Switch from specifying tests with a
format value to specifying tests with a content value. Add support
for a 'fake' COLOR_ALPHA_FLATTENED content for testing the PS and
PDF output against a flattened version of the argb32 reference
images (first blended over white).
* test/multi-page.c: (main): Track change in
cairo_ps_surface_create (now requires cairo_content_t value).
* test/caps-joins.c: (draw):
* test/caps-sub-paths.c: (draw):
* test/dash-caps-joins.c: (draw):
* test/dash-offset-negative.c: (draw):
* test/leaky-polygon.c: (draw):
* test/line-width.c: (draw):
* test/path-data.c: (draw):
* test/show-text-current-point.c: (draw):
* test/text-antialias-gray.c: (draw):
* test/text-antialias-none.c: (draw):
* test/transforms.c: (draw): Adjust tests that draw in default
(black) to first paint white so that the results are visible.
* test/caps-joins-ref.png:
* test/caps-sub-paths-ref.png:
* test/dash-caps-joins-ref.png:
* test/dash-offset-negative-ref.png:
* test/leaky-polygon-ref.png:
* test/line-width-ref.png:
* test/path-data-ref.png:
* test/show-text-current-point-ref.png:
* test/text-antialias-gray-ref.png:
* test/text-antialias-none-ref.png:
* test/transforms-ref.png: Adjust ARGB32 reference images for new
white background for changed tests.
* test/clip-fill-rule-pixel-aligned-rgb24-ref.png:
* test/clip-fill-rule-rgb24-ref.png:
* test/clip-nesting-rgb24-ref.png:
* test/clip-operator-rgb24-ref.png:
* test/clip-twice-rgb24-ref.png:
* test/fill-and-stroke-rgb24-ref.png:
* test/fill-rule-rgb24-ref.png:
* test/gradient-alpha-rgb24-ref.png:
* test/mask-ctm-rgb24-ref.png:
* test/mask-rgb24-ref.png:
* test/mask-surface-ctm-rgb24-ref.png:
* test/nil-surface-rgb24-ref.png:
* test/operator-clear-rgb24-ref.png:
* test/operator-source-rgb24-ref.png:
* test/paint-with-alpha-rgb24-ref.png:
* test/rel-path-rgb24-ref.png:
* test/scale-source-surface-paint-rgb24-ref.png:
* test/set-source-rgb24-ref.png:
* test/source-surface-scale-paint-rgb24-ref.png:
* test/text-pattern-rgb24-ref.png:
* test/trap-clip-rgb24-ref.png:
* test/unbounded-operator-rgb24-ref.png: Adjust RGB24 reference
images for new black background due to changed initialization (and
the tests themselves being unchanged).
Index: .cvsignore
===================================================================
RCS file: /cvs/cairo/cairo/test/.cvsignore,v
retrieving revision 1.68
retrieving revision 1.69
diff -u -d -r1.68 -r1.69
--- .cvsignore 14 Jan 2006 14:53:45 -0000 1.68
+++ .cvsignore 18 Jan 2006 00:59:08 -0000 1.69
@@ -44,6 +44,7 @@
paint-with-alpha
path-data
pdf2png
+png-flatten
svg2png
svg-clip
svg-clip.svg
@@ -79,15 +80,22 @@
*-image-out.png
*-image-argb32-out.png
*-image-rgb24-out.png
+*-pdf-argb32-out.png
+*-pdf-argb32-out.pdf
*-pdf-rgb24-out.png
*-pdf-rgb24-out.pdf
+*-ps-argb32-out.png
+*-ps-argb32-out.ps
*-ps-rgb24-out.png
*-ps-rgb24-out.ps
*-svg-rgb24-out.png
*-svg-rgb24-out.svg
*-test-fallback-argb32-out.png
+*-test-fallback-rgb24-out.png
*-test-meta-argb32-out.png
+*-test-meta-rgb24-out.png
*-test-paginated-argb32-out.png
+*-test-paginated-rgb24-out.png
*-xcb-out.png
*-xcb-argb32-out.png
*-xcb-rgb24-out.png
Index: Makefile.am
===================================================================
RCS file: /cvs/cairo/cairo/test/Makefile.am,v
retrieving revision 1.108
retrieving revision 1.109
diff -u -d -r1.108 -r1.109
--- Makefile.am 13 Jan 2006 00:35:12 -0000 1.108
+++ Makefile.am 18 Jan 2006 00:59:08 -0000 1.109
@@ -347,8 +347,9 @@
rel_path_LDADD = $(LDADDS)
xlib_surface_LDADD = $(LDADDS)
-noinst_PROGRAMS = imagediff
+noinst_PROGRAMS = imagediff png-flatten
imagediff_LDADD = $(LDADDS)
+png_flatten_LDADD = $(LDADDS)
if CAIRO_CAN_TEST_PDF_SURFACE
noinst_PROGRAMS += pdf2png
Index: buffer-diff.c
===================================================================
RCS file: /cvs/cairo/cairo/test/buffer-diff.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- buffer-diff.c 5 Aug 2005 18:15:04 -0000 1.9
+++ buffer-diff.c 18 Jan 2006 00:59:08 -0000 1.10
@@ -187,3 +187,97 @@
return pixels_changed;
}
+
+/* Like image_diff, but first "flatten" the contents of filename_b by
+ * blending over white.
+ *
+ * Yes, this is an ugly copy-and-paste of another function. I'm doing
+ * this for two reasons:
+ *
+ * 1) I want to rewrite all of the image_diff interfaces anyway
+ * (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.
+ */
+int
+image_diff_flattened (const char *filename_a,
+ const char *filename_b,
+ const char *filename_diff)
+{
+ int pixels_changed;
+ 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;
+ cairo_surface_t *buf_b_surface, *b_flat_surface;
+ cairo_t *cr;
+ read_png_status_t status;
+
+ status = read_png_argb32 (filename_a, &buf_a, &width_a, &height_a, &stride_a);
+ if (status)
+ return -1;
+
+ status = read_png_argb32 (filename_b, &buf_b, &width_b, &height_b, &stride_b);
+ if (status) {
+ free (buf_a);
+ return -1;
+ }
+
+ if (width_a != width_b ||
+ height_a != height_b ||
+ stride_a != stride_b)
+ {
+ cairo_test_log ("Error: Image size mismatch: (%dx%d@%d) vs. (%dx%d@%d)\n"
+ " for %s vs. %s\n",
+ width_a, height_a, stride_a,
+ width_b, height_b, stride_b,
+ filename_a, filename_b);
+ free (buf_a);
+ free (buf_b);
+ return -1;
+ }
+
+ buf_b_surface = cairo_image_surface_create_for_data (buf_b,
+ CAIRO_FORMAT_ARGB32,
+ width_b, height_b,
+ stride_b);
+
+ buf_diff = xcalloc (stride_a * height_a, 1);
+
+ b_flat = xcalloc (stride_b * height_b, 1);
+
+ b_flat_surface = cairo_image_surface_create_for_data (b_flat,
+ CAIRO_FORMAT_ARGB32,
+ width_b, height_b,
+ stride_b);
+ 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, b_flat, buf_diff,
+ width_a, height_a, stride_a);
+
+ if (pixels_changed) {
+ FILE *png_file = fopen (filename_diff, "wb");
+ write_png_argb32 (buf_diff, png_file, width_a, height_a, stride_a);
+ fclose (png_file);
+ } else {
+ xunlink (filename_diff);
+ }
+
+ free (buf_a);
+ free (buf_b);
+ free (b_flat);
+ free (buf_diff);
+
+ return pixels_changed;
+}
Index: buffer-diff.h
===================================================================
RCS file: /cvs/cairo/cairo/test/buffer-diff.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- buffer-diff.h 5 Aug 2005 18:15:04 -0000 1.4
+++ buffer-diff.h 18 Jan 2006 00:59:08 -0000 1.5
@@ -59,4 +59,11 @@
const char *filename_b,
const char *filename_diff);
+/* Like image_diff, but blending the contents of b over white first. */
+int
+image_diff_flattened (const char *filename_a,
+ const char *filename_b,
+ const char *filename_diff);
+
+
#endif
Index: cairo-test.c
===================================================================
RCS file: /cvs/cairo/cairo/test/cairo-test.c,v
retrieving revision 1.74
retrieving revision 1.75
diff -u -d -r1.74 -r1.75
--- cairo-test.c 3 Jan 2006 17:23:48 -0000 1.74
+++ cairo-test.c 18 Jan 2006 00:59:08 -0000 1.75
@@ -59,9 +59,12 @@
#define CAIRO_TEST_LOG_SUFFIX ".log"
#define CAIRO_TEST_PNG_SUFFIX "-out.png"
#define CAIRO_TEST_REF_SUFFIX "-ref.png"
-#define CAIRO_TEST_RGB24_REF_SUFFIX "-rgb24-ref.png"
#define CAIRO_TEST_DIFF_SUFFIX "-diff.png"
+/* A fake format we use for the flattened ARGB output of the PS and
+ * PDF surfaces. */
+#define CAIRO_TEST_CONTENT_COLOR_ALPHA_FLATTENED -1
+
/* Static data is messy, but we're coding for tests here, not a
* general-purpose library, and it keeps the tests cleaner to avoid a
* context object there, (though not a whole lot). */
@@ -147,8 +150,9 @@
}
typedef cairo_surface_t *
-(*cairo_test_create_target_surface_t) (cairo_test_t *test, cairo_format_t format,
- void **closure);
+(*cairo_test_create_target_surface_t) (cairo_test_t *test,
+ cairo_content_t content,
+ void **closure);
typedef cairo_status_t
(*cairo_test_write_to_png_t) (cairo_surface_t *surface, const char *filename);
@@ -159,7 +163,7 @@
typedef struct _cairo_test_target
{
const char *name;
- cairo_format_t reference_format;
+ cairo_content_t content;
cairo_test_create_target_surface_t create_target_surface;
cairo_test_write_to_png_t write_to_png;
cairo_test_cleanup_target_t cleanup_target;
@@ -167,22 +171,37 @@
} cairo_test_target_t;
static char *
-cairo_target_format_name (const cairo_test_target_t *target)
+_cairo_test_content_name (cairo_content_t content)
{
- char *format;
-
- if (target->reference_format == CAIRO_FORMAT_RGB24)
- format = "rgb24";
- else
- format = "argb32";
- return format;
+ switch (content) {
+ case CAIRO_CONTENT_COLOR:
+ return "rgb24";
+ case CAIRO_CONTENT_COLOR_ALPHA:
+ case CAIRO_TEST_CONTENT_COLOR_ALPHA_FLATTENED:
+ return "argb32";
+ default:
+ assert (0); /* not reached */
+ return "---";
+ }
}
static cairo_surface_t *
-create_image_surface (cairo_test_t *test, cairo_format_t format,
- void **closure)
+create_image_surface (cairo_test_t *test,
+ cairo_content_t content,
+ void **closure)
{
*closure = NULL;
+ cairo_format_t format;
+
+ if (content == CAIRO_CONTENT_COLOR_ALPHA) {
+ format = CAIRO_FORMAT_ARGB32;
+ } else if (content == CAIRO_CONTENT_COLOR) {
+ format = CAIRO_FORMAT_RGB24;
+ } else {
+ assert (0); /* not reached */
+ return NULL;
+ }
+
return cairo_image_surface_create (format, test->width, test->height);
}
@@ -193,41 +212,44 @@
#include "test-paginated-surface.h"
static cairo_surface_t *
-create_test_fallback_surface (cairo_test_t *test, cairo_format_t format,
- void **closure)
+create_test_fallback_surface (cairo_test_t *test,
+ cairo_content_t content,
+ void **closure)
{
*closure = NULL;
- return _test_fallback_surface_create (format, test->width, test->height);
+ return _test_fallback_surface_create (content, test->width, test->height);
}
static cairo_surface_t *
-create_test_meta_surface (cairo_test_t *test, cairo_format_t format,
- void **closure)
+create_test_meta_surface (cairo_test_t *test,
+ cairo_content_t content,
+ void **closure)
{
*closure = NULL;
- return _test_meta_surface_create (format, test->width, test->height);
+ return _test_meta_surface_create (content, test->width, test->height);
}
static const cairo_user_data_key_t test_paginated_closure_key;
typedef struct {
unsigned char *data;
- cairo_format_t format;
+ cairo_content_t content;
int width;
int height;
int stride;
} test_paginated_closure_t;
static cairo_surface_t *
-create_test_paginated_surface (cairo_test_t *test, cairo_format_t format,
- void **closure)
+create_test_paginated_surface (cairo_test_t *test,
+ cairo_content_t content,
+ void **closure)
{
test_paginated_closure_t *tpc;
cairo_surface_t *surface;
*closure = tpc = xmalloc (sizeof (test_paginated_closure_t));
- tpc->format = format;
+ tpc->content = content;
tpc->width = test->width;
tpc->height = test->height;
tpc->stride = test->width * 4;
@@ -235,7 +257,7 @@
tpc->data = xcalloc (tpc->stride * test->height, 1);
surface = _test_paginated_surface_create_for_data (tpc->data,
- tpc->format,
+ tpc->content,
tpc->width,
tpc->height,
tpc->stride);
@@ -262,12 +284,25 @@
const char *filename)
{
cairo_surface_t *image;
+ cairo_format_t format;
test_paginated_closure_t *tpc;
tpc = cairo_surface_get_user_data (surface, &test_paginated_closure_key);
+ switch (tpc->content) {
+ case CAIRO_CONTENT_COLOR:
+ format = CAIRO_FORMAT_RGB24;
+ break;
+ case CAIRO_CONTENT_COLOR_ALPHA:
+ format = CAIRO_FORMAT_ARGB32;
+ break;
+ default:
+ assert (0); /* not reached */
+ return CAIRO_STATUS_NO_MEMORY;
+ }
+
image = cairo_image_surface_create_for_data (tpc->data,
- tpc->format,
+ format,
tpc->width,
tpc->height,
tpc->stride);
@@ -299,7 +334,7 @@
typedef struct _glitz_target_closure_base {
int width;
int height;
- cairo_format_t format;
+ cairo_content_t content;
} glitz_target_closure_base_t;
#if CAIRO_CAN_TEST_GLITZ_GLX_SURFACE
@@ -425,7 +460,7 @@
static cairo_surface_t *
create_cairo_glitz_glx_surface (cairo_test_t *test,
- cairo_format_t format,
+ cairo_content_t content,
void **closure)
{
int width = test->width;
@@ -451,15 +486,15 @@
gxtc->scr = DefaultScreen(gxtc->dpy);
- switch (format) {
- case CAIRO_FORMAT_RGB24:
+ switch (content) {
+ case CAIRO_CONTENT_COLOR:
glitz_surface = create_glitz_glx_surface (GLITZ_STANDARD_RGB24, width, height, gxtc);
break;
- case CAIRO_FORMAT_ARGB32:
+ case CAIRO_CONTENT_COLOR_ALPHA:
glitz_surface = create_glitz_glx_surface (GLITZ_STANDARD_ARGB32, width, height, gxtc);
break;
default:
- cairo_test_log ("Invalid format for glitz-glx test: %d\n", format);
+ cairo_test_log ("Invalid content for glitz-glx test: %d\n", content);
goto FAIL_CLOSE_DISPLAY;
}
if (!glitz_surface) {
@@ -471,7 +506,7 @@
gxtc->base.width = test->width;
gxtc->base.height = test->height;
- gxtc->base.format = format;
+ gxtc->base.content = content;
cairo_surface_set_user_data (surface, &glitz_closure_key,
gxtc, NULL);
@@ -568,7 +603,7 @@
static cairo_surface_t *
create_cairo_glitz_agl_surface (cairo_test_t *test,
- cairo_format_t format,
+ cairo_content_t content,
void **closure)
{
glitz_surface_t *glitz_surface;
@@ -579,15 +614,15 @@
*closure = aglc = xmalloc (sizeof (glitz_agl_target_closure_t));
- switch (format) {
- case CAIRO_FORMAT_RGB24:
+ switch (content) {
+ case CAIRO_CONTENT_COLOR:
glitz_surface = create_glitz_agl_surface (GLITZ_STANDARD_RGB24, test->width, test->height, NULL);
break;
- case CAIRO_FORMAT_ARGB32:
+ case CAIRO_CONTENT_COLOR_ALPHA:
glitz_surface = create_glitz_agl_surface (GLITZ_STANDARD_ARGB32, test->width, test->height, NULL);
break;
default:
- cairo_test_log ("Invalid format for glitz-agl test: %d\n", format);
+ cairo_test_log ("Invalid content for glitz-agl test: %d\n", content);
goto FAIL;
}
@@ -598,7 +633,7 @@
aglc->base.width = test->width;
aglc->base.height = test->height;
- aglc->base.format = format;
+ aglc->base.content = content;
cairo_surface_set_user_data (surface, &glitz_closure_key, aglc, NULL);
return surface;
@@ -684,7 +719,7 @@
static cairo_surface_t *
create_cairo_glitz_wgl_surface (cairo_test_t *test,
- cairo_format_t format,
+ cairo_content_t content,
void **closure)
{
glitz_surface_t *glitz_surface;
@@ -695,15 +730,15 @@
*closure = wglc = xmalloc (sizeof (glitz_wgl_target_closure_t));
- switch (format) {
- case CAIRO_FORMAT_RGB24:
+ switch (content) {
+ case CAIRO_CONTENT_COLOR:
glitz_surface = create_glitz_wgl_surface (GLITZ_STANDARD_RGB24, test->width, test->height, NULL);
break;
- case CAIRO_FORMAT_ARGB32:
+ case CAIRO_CONTENT_COLOR_ALPHA:
glitz_surface = create_glitz_wgl_surface (GLITZ_STANDARD_ARGB32, test->width, test->height, NULL);
break;
default:
- cairo_test_log ("Invalid format for glitz-wgl test: %d\n", format);
+ cairo_test_log ("Invalid content for glitz-wgl test: %d\n", content);
goto FAIL;
}
@@ -714,7 +749,7 @@
wglc->base.width = test->width;
wglc->base.height = test->height;
- wglc->base.format = format;
+ wglc->base.content = content;
cairo_surface_set_user_data (surface, &glitz_closure_key, wglc, NULL);
return surface;
@@ -760,8 +795,9 @@
} win32_target_closure_t;
static cairo_surface_t *
-create_win32_surface (cairo_test_t *test, cairo_format_t format,
- void **closure)
+create_win32_surface (cairo_test_t *test,
+ cairo_content_t content,
+ void **closure)
{
int width = test->width;
int height = test->height;
@@ -910,6 +946,7 @@
cairo_surface_t *surface;
XCBConnection *c;
XCBRenderPICTFORMINFO render_format;
+ cairo_format_t format;
*closure = xtc = xmalloc (sizeof (xcb_target_closure_t));
@@ -934,7 +971,19 @@
width, height);
}
- render_format = _format_from_cairo (c, CAIRO_FORMAT_ARGB32);
+ switch (content) {
+ case CAIRO_CONTENT_COLOR:
+ format = CAIRO_FORMAT_RGB24;
+ break;
+ case CAIRO_CONTENT_COLOR_ALPHA:
+ format = CAIRO_FORMAT_ARGB32;
+ break;
+ default:
+ cairo_test_log ("Invalid content for XCB test: %d\n", content);
+ return NULL;
+ }
+
+ render_format = _format_from_cairo (c, format);
if (render_format.id.xid == 0)
return NULL;
surface = cairo_xcb_surface_create_with_xrender_format (c, xtc->drawable,
@@ -964,8 +1013,9 @@
} xlib_target_closure_t;
static cairo_surface_t *
-create_xlib_surface (cairo_test_t *test, cairo_format_t format,
- void **closure)
+create_xlib_surface (cairo_test_t *test,
+ cairo_content_t content,
+ void **closure)
{
int width = test->width;
int height = test->height;
@@ -997,15 +1047,15 @@
* extension. That would probably be through another
* cairo_test_target which would use an extended version of
* cairo_test_xlib_disable_render. */
- switch (format) {
- case CAIRO_FORMAT_ARGB32:
+ switch (content) {
+ case CAIRO_CONTENT_COLOR_ALPHA:
xrender_format = XRenderFindStandardFormat (dpy, PictStandardARGB32);
break;
- case CAIRO_FORMAT_RGB24:
+ case CAIRO_CONTENT_COLOR:
xrender_format = XRenderFindStandardFormat (dpy, PictStandardRGB24);
break;
default:
- cairo_test_log ("Invalid format for xlib test: %d\n", format);
+ cairo_test_log ("Invalid content for xlib test: %d\n", content);
return NULL;
}
if (xrender_format == NULL) {
@@ -1055,23 +1105,27 @@
} ps_target_closure_t;
static cairo_surface_t *
-create_ps_surface (cairo_test_t *test, cairo_format_t format,
- void **closure)
+create_ps_surface (cairo_test_t *test,
+ cairo_content_t content,
+ void **closure)
{
int width = test->width;
int height = test->height;
ps_target_closure_t *ptc;
cairo_surface_t *surface;
- /* This is the only format supported by the PS surface backend. */
- assert (format == CAIRO_FORMAT_RGB24);
+ /* Sanitize back to a real cairo_content_t value. */
+ if (content == CAIRO_TEST_CONTENT_COLOR_ALPHA_FLATTENED)
+ content = CAIRO_CONTENT_COLOR_ALPHA;
*closure = ptc = xmalloc (sizeof (ps_target_closure_t));
ptc->width = width;
ptc->height = height;
- xasprintf (&ptc->filename, "%s-%s%s", test->name, "ps-rgb24-out", ".ps");
+ xasprintf (&ptc->filename, "%s-ps-%s-out.ps",
+ test->name, _cairo_test_content_name (content));
+
surface = cairo_ps_surface_create (ptc->filename, width, height);
if (cairo_surface_status (surface)) {
free (ptc->filename);
@@ -1120,7 +1174,7 @@
static cairo_surface_t *
create_pdf_surface (cairo_test_t *test,
- cairo_format_t format,
+ cairo_content_t content,
void **closure)
{
int width = test->width;
@@ -1128,15 +1182,18 @@
pdf_target_closure_t *ptc;
cairo_surface_t *surface;
- /* XXX: Is this the only format supported by the PDF surface backend? */
- assert (format == CAIRO_FORMAT_RGB24);
+ /* Sanitizie back to a real cairo_content_t value. */
+ if (content == CAIRO_TEST_CONTENT_COLOR_ALPHA_FLATTENED)
+ content = CAIRO_CONTENT_COLOR_ALPHA;
*closure = ptc = xmalloc (sizeof (pdf_target_closure_t));
ptc->width = width;
ptc->height = height;
- xasprintf (&ptc->filename, "%s-%s%s", test->name, "pdf-rgb24-out", ".pdf");
+ xasprintf (&ptc->filename, "%s-pdf-%s-out.pdf",
+ test->name, _cairo_test_content_name (content));
+
surface = cairo_pdf_surface_create (ptc->filename, width, height);
if (cairo_surface_status (surface)) {
free (ptc->filename);
@@ -1185,17 +1242,15 @@
} svg_target_closure_t;
static cairo_surface_t *
-create_svg_surface (cairo_test_t *test, cairo_format_t format,
- void **closure)
+create_svg_surface (cairo_test_t *test,
+ cairo_content_t content,
+ void **closure)
{
int width = test->width;
int height = test->height;
svg_target_closure_t *ptc;
cairo_surface_t *surface;
- /* This is the only format supported by the PS surface backend. */
- assert (format == CAIRO_FORMAT_RGB24);
-
*closure = ptc = xmalloc (sizeof (svg_target_closure_t));
ptc->width = width;
@@ -1255,28 +1310,28 @@
srcdir = getenv ("srcdir");
if (!srcdir)
srcdir = ".";
- format = cairo_target_format_name (target);
+ format = _cairo_test_content_name (target->content);
xasprintf (&png_name, "%s-%s-%s%s", test->name,
target->name, format, CAIRO_TEST_PNG_SUFFIX);
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) {
- char *ref_suffix;
free (ref_name);
- if (target->reference_format == CAIRO_FORMAT_RGB24)
- ref_suffix = CAIRO_TEST_RGB24_REF_SUFFIX;
+ if (target->content == CAIRO_CONTENT_COLOR_ALPHA ||
+ target->content == CAIRO_TEST_CONTENT_COLOR_ALPHA_FLATTENED)
+ xasprintf (&ref_name, "%s/%s%s", srcdir, test->name,
+ CAIRO_TEST_REF_SUFFIX);
else
- ref_suffix = CAIRO_TEST_REF_SUFFIX;
- xasprintf (&ref_name, "%s/%s%s", srcdir, test->name,
- ref_suffix);
+ xasprintf (&ref_name, "%s/%s-%s%s", srcdir, test->name,
+ format,CAIRO_TEST_REF_SUFFIX);
}
xasprintf (&diff_name, "%s-%s-%s%s", test->name,
target->name, format, CAIRO_TEST_DIFF_SUFFIX);
/* Run the actual drawing code. */
- surface = (target->create_target_surface) (test, target->reference_format, &target->closure);
+ surface = (target->create_target_surface) (test, target->content, &target->closure);
if (surface == NULL) {
cairo_test_log ("Error: Failed to set %s target\n", target->name);
ret = CAIRO_TEST_UNTESTED;
@@ -1285,11 +1340,10 @@
cr = cairo_create (surface);
+ /* Clear to transparent (or black) depending on whether the target
+ * surface supports alpha. */
cairo_save (cr);
- if (target->reference_format == CAIRO_FORMAT_RGB24)
- cairo_set_source_rgba (cr, 1, 1, 1, 1);
- else
- cairo_set_source_rgba (cr, 0, 0, 0, 0);
+ cairo_set_source_rgba (cr, 0, 0, 0, 0);
cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
cairo_paint (cr);
cairo_restore (cr);
@@ -1316,7 +1370,10 @@
if (test->width != 0 && test->height != 0) {
int pixels_changed;
(target->write_to_png) (surface, png_name);
- pixels_changed = image_diff (png_name, ref_name, diff_name);
+ if (target->content == CAIRO_TEST_CONTENT_COLOR_ALPHA_FLATTENED)
+ pixels_changed = image_diff_flattened (png_name, ref_name, diff_name);
+ else
+ pixels_changed = image_diff (png_name, ref_name, diff_name);
if (pixels_changed) {
if (pixels_changed > 0)
cairo_test_log ("Error: %d pixels differ from reference image %s\n",
@@ -1355,90 +1412,102 @@
cairo_test_target_t **targets_to_test;
cairo_test_target_t targets[] =
{
- { "image", CAIRO_FORMAT_ARGB32,
+ { "image", CAIRO_CONTENT_COLOR_ALPHA,
create_image_surface, cairo_surface_write_to_png, NULL},
- { "image", CAIRO_FORMAT_RGB24,
+ { "image", CAIRO_CONTENT_COLOR,
create_image_surface, cairo_surface_write_to_png, NULL},
#ifdef CAIRO_HAS_TEST_SURFACES
- { "test-fallback", CAIRO_FORMAT_ARGB32,
+ { "test-fallback", CAIRO_CONTENT_COLOR_ALPHA,
create_test_fallback_surface, cairo_surface_write_to_png, NULL },
- { "test-meta", CAIRO_FORMAT_ARGB32,
+ { "test-fallback", CAIRO_CONTENT_COLOR,
+ create_test_fallback_surface, cairo_surface_write_to_png, NULL },
+ { "test-meta", CAIRO_CONTENT_COLOR_ALPHA,
create_test_meta_surface, cairo_surface_write_to_png, NULL },
- { "test-paginated", CAIRO_FORMAT_ARGB32,
+ { "test-meta", CAIRO_CONTENT_COLOR,
+ create_test_meta_surface, cairo_surface_write_to_png, NULL },
+ { "test-paginated", CAIRO_CONTENT_COLOR_ALPHA,
+ create_test_paginated_surface,
+ test_paginated_write_to_png,
+ cleanup_test_paginated },
+ { "test-paginated", CAIRO_CONTENT_COLOR,
create_test_paginated_surface,
test_paginated_write_to_png,
cleanup_test_paginated },
#endif
#ifdef CAIRO_HAS_GLITZ_SURFACE
#if CAIRO_CAN_TEST_GLITZ_GLX_SURFACE
- { "glitz-glx", CAIRO_FORMAT_ARGB32,
+ { "glitz-glx", CAIRO_CONTENT_COLOR_ALPHA,
create_cairo_glitz_glx_surface, cairo_surface_write_to_png,
cleanup_cairo_glitz_glx },
- { "glitz-glx", CAIRO_FORMAT_RGB24,
+ { "glitz-glx", CAIRO_CONTENT_COLOR,
create_cairo_glitz_glx_surface, cairo_surface_write_to_png,
cleanup_cairo_glitz_glx },
#endif
#if CAIRO_CAN_TEST_GLITZ_AGL_SURFACE
- { "glitz-agl", CAIRO_FORMAT_ARGB32,
+ { "glitz-agl", CAIRO_CONTENT_COLOR_ALPHA,
create_cairo_glitz_agl_surface, cairo_surface_write_to_png,
cleanup_cairo_glitz_agl },
- { "glitz-agl", CAIRO_FORMAT_RGB24,
+ { "glitz-agl", CAIRO_CONTENT_COLOR,
create_cairo_glitz_agl_surface, cairo_surface_write_to_png,
cleanup_cairo_glitz_agl },
#endif
#if CAIRO_CAN_TEST_GLITZ_WGL_SURFACE
- { "glitz-wgl", CAIRO_FORMAT_ARGB32,
+ { "glitz-wgl", CAIRO_CONTENT_COLOR_ALPHA,
create_cairo_glitz_wgl_surface, cairo_surface_write_to_png,
cleanup_cairo_glitz_wgl },
- { "glitz-wgl", CAIRO_FORMAT_RGB24,
+ { "glitz-wgl", CAIRO_CONTENT_COLOR,
create_cairo_glitz_wgl_surface, cairo_surface_write_to_png,
cleanup_cairo_glitz_wgl },
#endif
#endif /* CAIRO_HAS_GLITZ_SURFACE */
#if 0 && CAIRO_HAS_QUARTZ_SURFACE
- { "quartz", CAIRO_FORMAT_RGB24,
+ { "quartz", CAIRO_CONTENT_COLOR,
create_quartz_surface, cairo_surface_write_to_png,
cleanup_quartz },
#endif
#if CAIRO_HAS_WIN32_SURFACE
- { "win32", CAIRO_FORMAT_RGB24,
+ { "win32", CAIRO_CONTENT_COLOR,
create_win32_surface, cairo_surface_write_to_png, cleanup_win32 },
#endif
#if CAIRO_HAS_XCB_SURFACE
- { "xcb", CAIRO_FORMAT_ARGB32,
+ { "xcb", CAIRO_CONTENT_COLOR_ALPHA,
create_xcb_surface, cairo_surface_write_to_png, cleanup_xcb},
#endif
#if CAIRO_HAS_XLIB_SURFACE
- { "xlib", CAIRO_FORMAT_ARGB32,
+ { "xlib", CAIRO_CONTENT_COLOR_ALPHA,
create_xlib_surface, cairo_surface_write_to_png, cleanup_xlib},
- { "xlib", CAIRO_FORMAT_RGB24,
+ { "xlib", CAIRO_CONTENT_COLOR,
create_xlib_surface, cairo_surface_write_to_png, cleanup_xlib},
#endif
#if CAIRO_HAS_PS_SURFACE
- { "ps", CAIRO_FORMAT_RGB24,
+ { "ps", CAIRO_TEST_CONTENT_COLOR_ALPHA_FLATTENED,
+ create_ps_surface, ps_surface_write_to_png, cleanup_ps },
+ { "ps", CAIRO_CONTENT_COLOR,
create_ps_surface, ps_surface_write_to_png, cleanup_ps },
#endif
#if CAIRO_HAS_PDF_SURFACE && CAIRO_CAN_TEST_PDF_SURFACE
- { "pdf", CAIRO_FORMAT_RGB24,
+ { "pdf", CAIRO_TEST_CONTENT_COLOR_ALPHA_FLATTENED,
+ create_pdf_surface, pdf_surface_write_to_png, cleanup_pdf },
+ { "pdf", CAIRO_CONTENT_COLOR,
create_pdf_surface, pdf_surface_write_to_png, cleanup_pdf },
#endif
#if CAIRO_HAS_SVG_SURFACE && CAIRO_CAN_TEST_SVG_SURFACE
- { "svg", CAIRO_FORMAT_RGB24,
+ { "svg", CAIRO_CONTENT_COLOR_ALPHA,
create_svg_surface, svg_surface_write_to_png, cleanup_svg },
#endif
#if CAIRO_HAS_BEOS_SURFACE
- { "beos", CAIRO_FORMAT_RGB24,
+ { "beos", CAIRO_CONTENT_COLOR,
create_beos_surface, cairo_surface_write_to_png, cleanup_beos},
- { "beos_bitmap", CAIRO_FORMAT_RGB24,
+ { "beos_bitmap", CAIRO_CONTENT_COLOR,
create_beos_bitmap_surface, cairo_surface_write_to_png, cleanup_beos_bitmap},
- { "beos_bitmap", CAIRO_FORMAT_ARGB32,
+ { "beos_bitmap", CAIRO_CONTENT_COLOR_ALPHA,
create_beos_bitmap_surface, cairo_surface_write_to_png, cleanup_beos_bitmap},
#endif
#if CAIRO_HAS_DIRECTFB_SURFACE
- { "directfb", CAIRO_FORMAT_RGB24,
+ { "directfb", CAIRO_CONTENT_COLOR,
create_directfb_surface, cairo_surface_write_to_png, cleanup_directfb},
- { "directfb_bitmap", CAIRO_FORMAT_ARGB32,
+ { "directfb_bitmap", CAIRO_CONTENT_COLOR_ALPHA,
create_directfb_bitmap_surface, cairo_surface_write_to_png,cleanup_directfb},
#endif
};
@@ -1483,13 +1552,15 @@
for (i = 0; i < num_targets; i++) {
cairo_test_target_t *target = targets_to_test[i];
cairo_test_log ("Testing %s with %s target\n", test->name, target->name);
- printf ("%s-%s-%s:\t", test->name, target->name, cairo_target_format_name(target));
+ printf ("%s-%s-%s:\t", test->name, target->name,
+ _cairo_test_content_name (target->content));
status = cairo_test_for_target (test, draw, target);
-
cairo_test_log ("TEST: %s TARGET: %s FORMAT: %s RESULT: ",
- test->name, target->name, cairo_target_format_name(target));
+ test->name, target->name,
+ _cairo_test_content_name (target->content));
+
switch (status) {
case CAIRO_TEST_SUCCESS:
printf ("PASS\n");
Index: caps-joins-ref.png
===================================================================
RCS file: /cvs/cairo/cairo/test/caps-joins-ref.png,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
Binary files /tmp/cvsr8MKCF and /tmp/cvsdY5HIr differ
Index: caps-joins.c
===================================================================
RCS file: /cvs/cairo/cairo/test/caps-joins.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- caps-joins.c 27 Sep 2005 18:35:18 -0000 1.1
+++ caps-joins.c 18 Jan 2006 00:59:08 -0000 1.2
@@ -52,6 +52,12 @@
static cairo_test_status_t
draw (cairo_t *cr, int width, int height)
{
+ /* 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);
+
cairo_set_line_width (cr, LINE_WIDTH);
cairo_translate (cr, PAD, PAD);
Index: caps-sub-paths-ref.png
===================================================================
RCS file: /cvs/cairo/cairo/test/caps-sub-paths-ref.png,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
Binary files /tmp/cvsdym9dH and /tmp/cvs7Gmeot differ
Index: caps-sub-paths.c
===================================================================
RCS file: /cvs/cairo/cairo/test/caps-sub-paths.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- caps-sub-paths.c 23 Aug 2005 14:51:56 -0000 1.3
+++ caps-sub-paths.c 18 Jan 2006 00:59:08 -0000 1.4
@@ -39,6 +39,12 @@
static cairo_test_status_t
draw (cairo_t *cr, int width, int height)
{
+ /* 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);
+
cairo_set_line_width (cr, 4);
cairo_set_line_cap (cr, CAIRO_LINE_CAP_ROUND);
Index: clip-fill-rule-pixel-aligned-rgb24-ref.png
===================================================================
RCS file: /cvs/cairo/cairo/test/clip-fill-rule-pixel-aligned-rgb24-ref.png,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
Binary files /tmp/cvshZuzhL and /tmp/cvsDDSJvx differ
Index: clip-fill-rule-rgb24-ref.png
===================================================================
RCS file: /cvs/cairo/cairo/test/clip-fill-rule-rgb24-ref.png,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
Binary files /tmp/cvssEaDWL and /tmp/cvsV9QCcy differ
Index: clip-nesting-rgb24-ref.png
===================================================================
RCS file: /cvs/cairo/cairo/test/clip-nesting-rgb24-ref.png,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
Binary files /tmp/cvsrR2BoK and /tmp/cvsBoasGw differ
Index: clip-operator-rgb24-ref.png
===================================================================
RCS file: /cvs/cairo/cairo/test/clip-operator-rgb24-ref.png,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
Binary files /tmp/cvsgxoJvN and /tmp/cvsVtWCPz differ
Index: clip-twice-rgb24-ref.png
===================================================================
RCS file: /cvs/cairo/cairo/test/clip-twice-rgb24-ref.png,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
Binary files /tmp/cvs3XpadO and /tmp/cvsVsx2yA differ
Index: dash-caps-joins-ref.png
===================================================================
RCS file: /cvs/cairo/cairo/test/dash-caps-joins-ref.png,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
Binary files /tmp/cvs4NOxDM and /tmp/cvsPa9j1y differ
Index: dash-caps-joins.c
===================================================================
RCS file: /cvs/cairo/cairo/test/dash-caps-joins.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- dash-caps-joins.c 27 Sep 2005 19:44:32 -0000 1.2
+++ dash-caps-joins.c 18 Jan 2006 00:59:08 -0000 1.3
@@ -60,6 +60,12 @@
{
double dash[] = {LINE_WIDTH, 1.5 * LINE_WIDTH};
+ /* 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);
+
cairo_set_line_width (cr, LINE_WIDTH);
cairo_set_dash (cr, dash, sizeof(dash)/sizeof(dash[0]), - 2 * LINE_WIDTH);
Index: dash-offset-negative-ref.png
===================================================================
RCS file: /cvs/cairo/cairo/test/dash-offset-negative-ref.png,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
Binary files /tmp/cvsEXpCAQ and /tmp/cvs9afr2C differ
Index: dash-offset-negative.c
===================================================================
RCS file: /cvs/cairo/cairo/test/dash-offset-negative.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- dash-offset-negative.c 19 Aug 2005 19:02:14 -0000 1.1
+++ dash-offset-negative.c 18 Jan 2006 00:59:08 -0000 1.2
@@ -45,6 +45,12 @@
{
double dashes[] = { 1 };
+ /* 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);
+
cairo_set_line_width (cr, 2);
/* Basic 1-1 dash pattern */
Index: fill-and-stroke-rgb24-ref.png
===================================================================
RCS file: /cvs/cairo/cairo/test/fill-and-stroke-rgb24-ref.png,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
Binary files /tmp/cvsWbAD9R and /tmp/cvsj8KeFE differ
Index: fill-rule-rgb24-ref.png
===================================================================
RCS file: /cvs/cairo/cairo/test/fill-rule-rgb24-ref.png,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
Binary files /tmp/cvsv3PfOS and /tmp/cvsTXBGlF differ
Index: gradient-alpha-rgb24-ref.png
===================================================================
RCS file: /cvs/cairo/cairo/test/gradient-alpha-rgb24-ref.png,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
Binary files /tmp/cvsAbzDgR and /tmp/cvsjCxSPD differ
Index: leaky-polygon-ref.png
===================================================================
RCS file: /cvs/cairo/cairo/test/leaky-polygon-ref.png,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
Binary files /tmp/cvsd35c2R and /tmp/cvsJWbpDE differ
Index: leaky-polygon.c
===================================================================
RCS file: /cvs/cairo/cairo/test/leaky-polygon.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- leaky-polygon.c 29 Mar 2005 08:02:19 -0000 1.3
+++ leaky-polygon.c 18 Jan 2006 00:59:08 -0000 1.4
@@ -65,6 +65,12 @@
static cairo_test_status_t
draw (cairo_t *cr, int width, int height)
{
+ /* 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);
+
cairo_scale (cr, 1.0/(1<<16), 1.0/(1<<16));
cairo_move_to (cr, 131072,39321);
Index: line-width-ref.png
===================================================================
RCS file: /cvs/cairo/cairo/test/line-width-ref.png,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
Binary files /tmp/cvs7q9EvT and /tmp/cvsdYhQaG differ
Index: line-width.c
===================================================================
RCS file: /cvs/cairo/cairo/test/line-width.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- line-width.c 14 Apr 2005 21:42:27 -0000 1.4
+++ line-width.c 18 Jan 2006 00:59:08 -0000 1.5
@@ -41,6 +41,10 @@
{
int i;
+ /* We draw in black, so paint white first. */
+ cairo_set_source_rgb (cr, 1.0, 1.0, 1.0); /* white */
+ cairo_paint (cr);
+
cairo_set_source_rgb (cr, 0, 0, 0);
cairo_translate (cr, 2, 2);
Index: mask-ctm-rgb24-ref.png
===================================================================
RCS file: /cvs/cairo/cairo/test/mask-ctm-rgb24-ref.png,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
Binary files /tmp/cvsxT6pqX and /tmp/cvsn5El9J differ
Index: mask-rgb24-ref.png
===================================================================
RCS file: /cvs/cairo/cairo/test/mask-rgb24-ref.png,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
Binary files /tmp/cvsu7ur5X and /tmp/cvs1yNJQK differ
Index: mask-surface-ctm-rgb24-ref.png
===================================================================
RCS file: /cvs/cairo/cairo/test/mask-surface-ctm-rgb24-ref.png,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
Binary files /tmp/cvs5XTvIW and /tmp/cvsVA3PvJ differ
Index: multi-page.c
===================================================================
RCS file: /cvs/cairo/cairo/test/multi-page.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- multi-page.c 13 Jan 2006 00:47:06 -0000 1.2
+++ multi-page.c 18 Jan 2006 00:59:08 -0000 1.3
@@ -159,7 +159,7 @@
filename = "multi-page.pdf";
surface = cairo_pdf_surface_create (filename,
- WIDTH_IN_POINTS, HEIGHT_IN_POINTS);
+ WIDTH_IN_POINTS, HEIGHT_IN_POINTS);
status = cairo_surface_status (surface);
if (status) {
cairo_test_log ("Failed to create pdf surface for file %s: %s\n",
Index: nil-surface-rgb24-ref.png
===================================================================
RCS file: /cvs/cairo/cairo/test/nil-surface-rgb24-ref.png,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
Binary files /tmp/cvsRHTfB0 and /tmp/cvsDpKpsN differ
Index: operator-clear-rgb24-ref.png
===================================================================
RCS file: /cvs/cairo/cairo/test/operator-clear-rgb24-ref.png,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
Binary files /tmp/cvsIsI82Y and /tmp/cvsFpbbWL differ
Index: operator-source-rgb24-ref.png
===================================================================
RCS file: /cvs/cairo/cairo/test/operator-source-rgb24-ref.png,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
Binary files /tmp/cvsDbIt91 and /tmp/cvsNKEx4O differ
Index: paint-with-alpha-rgb24-ref.png
===================================================================
RCS file: /cvs/cairo/cairo/test/paint-with-alpha-rgb24-ref.png,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
Binary files /tmp/cvsgdLuU2 and /tmp/cvsLWfqRP differ
Index: path-data-ref.png
===================================================================
RCS file: /cvs/cairo/cairo/test/path-data-ref.png,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
Binary files /tmp/cvsJBkOd1 and /tmp/cvsDhrzcO differ
Index: path-data.c
===================================================================
RCS file: /cvs/cairo/cairo/test/path-data.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- path-data.c 6 Jul 2005 21:52:01 -0000 1.5
+++ path-data.c 18 Jan 2006 00:59:08 -0000 1.6
@@ -95,6 +95,12 @@
{
cairo_path_t *path;
+ /* 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);
+
/* copy path, munge, and fill */
cairo_translate (cr, 5, 5);
make_path (cr);
--- NEW FILE: png-flatten.c ---
(This appears to be a binary file; contents omitted.)
Index: rel-path-rgb24-ref.png
===================================================================
RCS file: /cvs/cairo/cairo/test/rel-path-rgb24-ref.png,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
Binary files /tmp/cvsqGwvl5 and /tmp/cvsTsyCoS differ
Index: scale-source-surface-paint-rgb24-ref.png
===================================================================
RCS file: /cvs/cairo/cairo/test/scale-source-surface-paint-rgb24-ref.png,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
Binary files /tmp/cvstpR9M3 and /tmp/cvsB4s9RQ differ
Index: set-source-rgb24-ref.png
===================================================================
RCS file: /cvs/cairo/cairo/test/set-source-rgb24-ref.png,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
Binary files /tmp/cvss6HtS6 and /tmp/cvsxXJuZT differ
Index: show-text-current-point-ref.png
===================================================================
RCS file: /cvs/cairo/cairo/test/show-text-current-point-ref.png,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
Binary files /tmp/cvs7mY9B7 and /tmp/cvsRMZaLU differ
Index: show-text-current-point.c
===================================================================
RCS file: /cvs/cairo/cairo/test/show-text-current-point.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- show-text-current-point.c 24 Aug 2005 08:13:36 -0000 1.1
+++ show-text-current-point.c 18 Jan 2006 00:59:08 -0000 1.2
@@ -38,6 +38,12 @@
{
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);
+
cairo_select_font_face (cr, "Bitstream Vera Sans",
CAIRO_FONT_SLANT_NORMAL,
CAIRO_FONT_WEIGHT_NORMAL);
Index: source-surface-scale-paint-rgb24-ref.png
===================================================================
RCS file: /cvs/cairo/cairo/test/source-surface-scale-paint-rgb24-ref.png,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
Binary files /tmp/cvsy1YBzZ and /tmp/cvswtuoMM differ
Index: text-antialias-gray-ref.png
===================================================================
RCS file: /cvs/cairo/cairo/test/text-antialias-gray-ref.png,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
Binary files /tmp/cvsN6rhZX and /tmp/cvsaNC0dL differ
Index: text-antialias-gray.c
===================================================================
RCS file: /cvs/cairo/cairo/test/text-antialias-gray.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- text-antialias-gray.c 31 Aug 2005 22:08:05 -0000 1.3
+++ text-antialias-gray.c 18 Jan 2006 00:59:08 -0000 1.4
@@ -42,6 +42,12 @@
cairo_font_options_t *font_options;
static char black[] = "black", blue[] = "blue";
+ /* 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);
+
cairo_select_font_face (cr, "Bitstream Vera Sans",
CAIRO_FONT_SLANT_NORMAL,
CAIRO_FONT_WEIGHT_NORMAL);
Index: text-antialias-none-ref.png
===================================================================
RCS file: /cvs/cairo/cairo/test/text-antialias-none-ref.png,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
Binary files /tmp/cvs1mM3V1 and /tmp/cvsOhqQeP differ
Index: text-antialias-none.c
===================================================================
RCS file: /cvs/cairo/cairo/test/text-antialias-none.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- text-antialias-none.c 31 Aug 2005 22:08:05 -0000 1.4
+++ text-antialias-none.c 18 Jan 2006 00:59:08 -0000 1.5
@@ -42,6 +42,12 @@
cairo_font_options_t *font_options;
static char black[] = "black", blue[] = "blue";
+ /* 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);
+
cairo_select_font_face (cr, "Bitstream Vera Sans",
CAIRO_FONT_SLANT_NORMAL,
CAIRO_FONT_WEIGHT_NORMAL);
Index: text-pattern-rgb24-ref.png
===================================================================
RCS file: /cvs/cairo/cairo/test/text-pattern-rgb24-ref.png,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
Binary files /tmp/cvstuHwv3 and /tmp/cvscGU4RQ differ
Index: transforms-ref.png
===================================================================
RCS file: /cvs/cairo/cairo/test/transforms-ref.png,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
Binary files /tmp/cvs2tNs93 and /tmp/cvsUfpRxR differ
Index: transforms.c
===================================================================
RCS file: /cvs/cairo/cairo/test/transforms.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- transforms.c 6 May 2005 20:32:53 -0000 1.2
+++ transforms.c 18 Jan 2006 00:59:08 -0000 1.3
@@ -51,6 +51,12 @@
static cairo_test_status_t
draw (cairo_t *cr, int width, int height)
{
+ /* 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);
+
cairo_translate (cr, 5, 5);
draw_L_shape (cr);
Index: trap-clip-rgb24-ref.png
===================================================================
RCS file: /cvs/cairo/cairo/test/trap-clip-rgb24-ref.png,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
Binary files /tmp/cvs8z00m3 and /tmp/cvs4mfIPQ differ
Index: unbounded-operator-rgb24-ref.png
===================================================================
RCS file: /cvs/cairo/cairo/test/unbounded-operator-rgb24-ref.png,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
Binary files /tmp/cvs9T5yS6 and /tmp/cvsoInCnU differ
More information about the cairo-commit
mailing list