summaryrefslogtreecommitdiff
path: root/test/pdiff
diff options
context:
space:
mode:
Diffstat (limited to 'test/pdiff')
-rw-r--r--test/pdiff/Makefile.in2
-rw-r--r--test/pdiff/pdiff.c40
2 files changed, 29 insertions, 13 deletions
diff --git a/test/pdiff/Makefile.in b/test/pdiff/Makefile.in
index c011515..bfbde4c 100644
--- a/test/pdiff/Makefile.in
+++ b/test/pdiff/Makefile.in
@@ -97,6 +97,8 @@ CAIRO_CAN_TEST_PS_SURFACE_FALSE = @CAIRO_CAN_TEST_PS_SURFACE_FALSE@
CAIRO_CAN_TEST_PS_SURFACE_TRUE = @CAIRO_CAN_TEST_PS_SURFACE_TRUE@
CAIRO_CAN_TEST_SVG_SURFACE_FALSE = @CAIRO_CAN_TEST_SVG_SURFACE_FALSE@
CAIRO_CAN_TEST_SVG_SURFACE_TRUE = @CAIRO_CAN_TEST_SVG_SURFACE_TRUE@
+CAIRO_CAN_TEST_WIN32_PRINTING_SURFACE_FALSE = @CAIRO_CAN_TEST_WIN32_PRINTING_SURFACE_FALSE@
+CAIRO_CAN_TEST_WIN32_PRINTING_SURFACE_TRUE = @CAIRO_CAN_TEST_WIN32_PRINTING_SURFACE_TRUE@
CAIRO_CFLAGS = @CAIRO_CFLAGS@
CAIRO_HAS_ATSUI_FONT_FALSE = @CAIRO_HAS_ATSUI_FONT_FALSE@
CAIRO_HAS_ATSUI_FONT_TRUE = @CAIRO_HAS_ATSUI_FONT_TRUE@
diff --git a/test/pdiff/pdiff.c b/test/pdiff/pdiff.c
index 4f3226d..3f472f3 100644
--- a/test/pdiff/pdiff.c
+++ b/test/pdiff/pdiff.c
@@ -257,19 +257,19 @@ pdiff_compare (cairo_surface_t *surface_a,
unsigned int i;
/* assuming colorspaces are in Adobe RGB (1998) convert to XYZ */
- float *aX = xmalloc (dim * sizeof (float));
- float *aY = xmalloc (dim * sizeof (float));
- float *aZ = xmalloc (dim * sizeof (float));
- float *bX = xmalloc (dim * sizeof (float));
- float *bY = xmalloc (dim * sizeof (float));
- float *bZ = xmalloc (dim * sizeof (float));
- float *aLum = xmalloc (dim * sizeof (float));
- float *bLum = xmalloc (dim * sizeof (float));
-
- float *aA = xmalloc (dim * sizeof (float));
- float *bA = xmalloc (dim * sizeof (float));
- float *aB = xmalloc (dim * sizeof (float));
- float *bB = xmalloc (dim * sizeof (float));
+ float *aX;
+ float *aY;
+ float *aZ;
+ float *bX;
+ float *bY;
+ float *bZ;
+ float *aLum;
+ float *bLum;
+
+ float *aA;
+ float *bA;
+ float *aB;
+ float *bB;
unsigned int x, y, w, h;
@@ -289,6 +289,20 @@ pdiff_compare (cairo_surface_t *surface_a,
if (w < 3 || h < 3) /* too small for the Laplacian convolution */
return -1;
+ aX = xmalloc (dim * sizeof (float));
+ aY = xmalloc (dim * sizeof (float));
+ aZ = xmalloc (dim * sizeof (float));
+ bX = xmalloc (dim * sizeof (float));
+ bY = xmalloc (dim * sizeof (float));
+ bZ = xmalloc (dim * sizeof (float));
+ aLum = xmalloc (dim * sizeof (float));
+ bLum = xmalloc (dim * sizeof (float));
+
+ aA = xmalloc (dim * sizeof (float));
+ bA = xmalloc (dim * sizeof (float));
+ aB = xmalloc (dim * sizeof (float));
+ bB = xmalloc (dim * sizeof (float));
+
for (y = 0; y < h; y++) {
for (x = 0; x < w; x++) {
float r, g, b, l;