[cairo-commit] 3 commits - test/cairo-test-trace.c test/Makefile.am

Chris Wilson ickle at kemper.freedesktop.org
Sat Jun 13 13:44:45 PDT 2009


 test/Makefile.am        |    3 ++-
 test/cairo-test-trace.c |   17 ++++++++++-------
 2 files changed, 12 insertions(+), 8 deletions(-)

New commits:
commit 216a2e24c7375e48677ce30f9fe8fb3d8bbdd10d
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Sat Jun 13 21:40:05 2009 +0100

    [test] Minor tweak to cairo-test-trace
    
    Cleanse the code of a couple of redundant pointer manipulations.

diff --git a/test/cairo-test-trace.c b/test/cairo-test-trace.c
index 6d0bab8..1db4439 100644
--- a/test/cairo-test-trace.c
+++ b/test/cairo-test-trace.c
@@ -553,7 +553,7 @@ write_images (const char *trace, struct slave *slave, int num_slaves)
 }
 
 static size_t
-allocate_image_for_slave (uint8_t *base, size_t *offset, struct slave *slave)
+allocate_image_for_slave (uint8_t *base, size_t offset, struct slave *slave)
 {
     struct request_image rq;
     int size;
@@ -564,16 +564,16 @@ allocate_image_for_slave (uint8_t *base, size_t *offset, struct slave *slave)
 
     size = rq.height * rq.stride;
     size = (size + 127) & -128;
-    data = base + *offset;
-    *offset += size;
-    assert (*offset <= DATA_SIZE);
+    data = base + offset;
+    offset += size;
+    assert (offset <= DATA_SIZE);
 
     assert (slave->image == NULL);
     slave->image = cairo_image_surface_create_for_data (data, rq.format,
 							rq.width, rq.height,
 							rq.stride);
 
-    return data - base;
+    return offset;
 }
 
 static cairo_bool_t
@@ -645,8 +645,10 @@ test_run (void *base,
 		    if (slaves[i].image_serial == 0) {
 			size_t offset;
 
-			offset =
-			    allocate_image_for_slave (base, &image, &slaves[i]);
+			image =
+			    allocate_image_for_slave (base,
+						      offset = image,
+						      &slaves[i]);
 			if (! writen (pfd[n].fd, &offset, sizeof (offset)))
 			    goto out;
 		    } else {
commit 2ab4245c866bcefb755a33f7eaa6ef1277f82df1
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Sat Jun 13 21:33:09 2009 +0100

    [test] Need SOURCE when copying image data
    
    As cairo-test-trace does not clear the image data before reuse, using
    the default OVER operator will cause differing results for each process
    when inadvertently alpha blending into the shared memory region. As we
    essentially want to just copy the source pixels, be explicit and set the
    SOURCE operator.

diff --git a/test/cairo-test-trace.c b/test/cairo-test-trace.c
index d42ff3d..6d0bab8 100644
--- a/test/cairo-test-trace.c
+++ b/test/cairo-test-trace.c
@@ -282,6 +282,7 @@ push_surface (test_runner_thread_t *thread,
     cr = cairo_create (image);
     cairo_surface_destroy (image);
 
+    cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
     cairo_set_source_surface (cr, source, 0, 0);
     cairo_paint (cr);
     cairo_destroy (cr);
commit e003d665fe45905606a792e4a783f65fc7e84550
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Sat Jun 13 19:18:11 2009 +0100

    [test] Disable compilation of cairo-test-trace without shm_open()
    
    Remember to only add cairo-test-trace to the list of EXTRA_PROGRAM so long
    as we can actually compile it.

diff --git a/test/Makefile.am b/test/Makefile.am
index 8e153d0..1472c5c 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -96,6 +96,7 @@ cairo_test_suite_LDADD += -lpthread
 endif
 
 if HAVE_SHM
+EXTRA_PROGRAMS += cairo-test-trace
 cairo_test_trace_SOURCES =		\
 	cairo-test-trace.c
 cairo_test_trace_LDADD =		\
@@ -1168,7 +1169,7 @@ $(top_builddir)/test/pdiff/libpdiff.la:
 $(top_builddir)/util/cairo-script/libcairo-script-interpreter.la: $(top_builddir)/src/libcairo.la
 	cd $(top_builddir)/util/cairo-script && $(MAKE) $(AM_MAKEFLAGS) libcairo-script-interpreter.la
 
-EXTRA_PROGRAMS += imagediff png-flatten cairo-test-trace
+EXTRA_PROGRAMS += imagediff png-flatten
 
 imagediff_SOURCES = \
 	imagediff.c	\


More information about the cairo-commit mailing list