[cairo-commit] 10 commits - perf/cairo-perf-diff perf/Makefile.am src/cairo-image-surface.c src/cairoint.h src/cairo-scaled-font.c src/cairo-xlib-display.c test/cairo-test.c test/radial-gradient.c test/radial-gradient.pdf.ref.png test/radial-gradient.ref.png test/user-font-rescale.c util/cairo-script

Chris Wilson ickle at kemper.freedesktop.org
Fri Jul 24 02:46:46 PDT 2009


 perf/Makefile.am                         |   11 +++-
 perf/cairo-perf-diff                     |    6 +-
 src/cairo-image-surface.c                |   35 +++++++++++++
 src/cairo-scaled-font.c                  |   80 ++++++++++++++++++-------------
 src/cairo-xlib-display.c                 |    6 ++
 src/cairoint.h                           |    1 
 test/cairo-test.c                        |    7 ++
 test/radial-gradient.c                   |   36 ++++++++-----
 test/radial-gradient.pdf.ref.png         |binary
 test/radial-gradient.ref.png             |binary
 test/user-font-rescale.c                 |   13 +----
 util/cairo-script/cairo-script-scanner.c |    6 +-
 12 files changed, 137 insertions(+), 64 deletions(-)

New commits:
commit 0466053099b7f27065267d49c84e9e24bff6c7a1
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Jul 23 23:45:01 2009 +0100

    [image] Discard redundant clears
    
    On slow machines the call to pixman_fill_sse2() on similar surfaces that
    we know are already zeroed takes a significant amount of time [12.77% of
    the profile for a firefox trace, cf to just 3% of the profile is spent
    inside memset].
    
    Rather than solve why the pixman_fill_sse2() is so slow, simply skip the
    redundant clears.

diff --git a/src/cairo-image-surface.c b/src/cairo-image-surface.c
index e7efdca..627f9ed 100644
--- a/src/cairo-image-surface.c
+++ b/src/cairo-image-surface.c
@@ -172,6 +172,7 @@ _cairo_image_surface_create_for_pixman_image (pixman_image_t		*pixman_image,
     surface->height = pixman_image_get_height (pixman_image);
     surface->stride = pixman_image_get_stride (pixman_image);
     surface->depth = pixman_image_get_depth (pixman_image);
+    surface->is_clear = FALSE;
 
     surface->clip_region = NULL;
 
@@ -358,6 +359,8 @@ _cairo_image_surface_create_with_pixman_format (unsigned char		*data,
 							    pixman_format);
     if (cairo_surface_status (surface))
 	pixman_image_unref (pixman_image);
+    else
+	((cairo_image_surface_t *)surface)->is_clear = TRUE;
 
     return surface;
 }
@@ -1113,6 +1116,8 @@ _cairo_image_surface_composite (cairo_operator_t	 op,
 	_cairo_pattern_release_surface (mask_pattern, &mask->base, &mask_attr);
 
     _cairo_pattern_release_surface (src_pattern, &src->base, &src_attr);
+    if (op != CAIRO_OPERATOR_CLEAR)
+	dst->is_clear = FALSE;
 
     return status;
 }
@@ -1171,6 +1176,9 @@ _cairo_image_surface_fill_rectangles (void		      *abstract_surface,
     if (pixman_rects != stack_rects)
 	free (pixman_rects);
 
+    if (op != CAIRO_OPERATOR_CLEAR)
+	surface->is_clear = FALSE;
+
     return status;
 }
 
@@ -1300,6 +1308,9 @@ _cairo_image_surface_composite_trapezoids (cairo_operator_t	op,
 
     pixman_image_unref (mask);
 
+    if (op != CAIRO_OPERATOR_CLEAR)
+	dst->is_clear = FALSE;
+
     if (! _cairo_operator_bounded_by_mask (op)) {
 	status = _cairo_surface_composite_shape_fixup_unbounded (&dst->base,
 								 &attributes,
@@ -1458,6 +1469,9 @@ _cairo_image_surface_span_renderer_finish (void *abstract_renderer)
 		rects->width, rects->height,
 		dst->clip_region);
 	}
+
+	if (renderer->op != CAIRO_OPERATOR_CLEAR)
+	    dst->is_clear = FALSE;
     }
     if (status != CAIRO_STATUS_SUCCESS)
 	return _cairo_span_renderer_set_error (abstract_renderer,
@@ -1567,6 +1581,25 @@ _cairo_image_surface_get_font_options (void                  *abstract_surface,
     cairo_font_options_set_hint_metrics (options, CAIRO_HINT_METRICS_ON);
 }
 
+static cairo_int_status_t
+_cairo_image_surface_paint (void *abstract_surface,
+			    cairo_operator_t	 op,
+			    const cairo_pattern_t *source,
+			    cairo_clip_t	    *clip)
+{
+    /* we know that surfaces are calloc, so ignore any redundant clears */
+    if (op == CAIRO_OPERATOR_CLEAR && clip == NULL) {
+	cairo_image_surface_t *surface = abstract_surface;
+
+	if (surface->is_clear)
+	    return CAIRO_STATUS_SUCCESS;
+
+	surface->is_clear = TRUE;
+    }
+
+    return CAIRO_INT_STATUS_UNSUPPORTED;
+}
+
 /**
  * _cairo_surface_is_image:
  * @surface: a #cairo_surface_t
@@ -1605,7 +1638,7 @@ const cairo_surface_backend_t _cairo_image_surface_backend = {
     NULL, /* font_fini */
     NULL, /* glyph_fini */
 
-    NULL, /* paint */
+    _cairo_image_surface_paint,
     NULL, /* mask */
     NULL, /* stroke */
     NULL, /* fill */
diff --git a/src/cairoint.h b/src/cairoint.h
index 3cd0cb3..6010e20 100644
--- a/src/cairoint.h
+++ b/src/cairoint.h
@@ -857,6 +857,7 @@ struct _cairo_image_surface {
     pixman_image_t *pixman_image;
     cairo_region_t *clip_region;
 
+    unsigned is_clear : 1;
     unsigned owns_data : 1;
     unsigned transparency : 2;
 };
commit 8b8e03503d7a4fdacfc48e0b35c9b02d7a08c1e2
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Jul 23 22:00:05 2009 +0100

    [script] mark scan_read() inline
    
    Small function that is critical to performance whilst scanning scripts.

diff --git a/util/cairo-script/cairo-script-scanner.c b/util/cairo-script/cairo-script-scanner.c
index 3cc3957..1d717f4 100644
--- a/util/cairo-script/cairo-script-scanner.c
+++ b/util/cairo-script/cairo-script-scanner.c
@@ -665,17 +665,17 @@ base85_end (csi_t *ctx, csi_scanner_t *scan, cairo_bool_t deflate)
 	longjmp (scan->jmpbuf, status);
 }
 
-static void
+static inline void
 scan_read (csi_scanner_t *scan, csi_file_t *src, void *ptr, int len)
 {
     uint8_t *data = ptr;
-    while (len) {
+    do {
 	int ret = csi_file_read (src, data, len);
 	if (_csi_unlikely (ret == 0))
 	    longjmp (scan->jmpbuf, _csi_error (CSI_STATUS_READ_ERROR));
 	data += ret;
 	len -= ret;
-    }
+    } while (_csi_unlikely (len));
 }
 
 static void
commit f02ba09475b751fba411addb96718dbcb1de5132
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Jul 23 20:23:51 2009 +0100

    [xlib] Check workqueue before taking the display mutex
    
    Optimistically check to see if there is any outstanding work before
    checking under the mutex. We don't care if we occasionally do not run the
    queue this time due to contention, since we will most likely check again
    very shortly or clean up with the display.

diff --git a/src/cairo-xlib-display.c b/src/cairo-xlib-display.c
index 65df2b7..92e96ba 100644
--- a/src/cairo-xlib-display.c
+++ b/src/cairo-xlib-display.c
@@ -457,6 +457,12 @@ _cairo_xlib_display_notify (cairo_xlib_display_t *display)
     cairo_xlib_job_t *jobs, *job, *freelist;
     Display *dpy = display->display;
 
+    /* Optimistic atomic pointer read -- don't care if it is wrong due to
+     * contention as we will check again very shortly.
+     */
+    if (display->workqueue == NULL)
+	return;
+
     CAIRO_MUTEX_LOCK (display->mutex);
     jobs = display->workqueue;
     while (jobs != NULL) {
commit 4dc62bbedc5d8669c0508963497c568d0202f579
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Jul 23 19:34:10 2009 +0100

    [test] Extend radial gradients to check r2 < r1
    
    Include additional gradients to cover the cases where r1 > r2, as a pixman
    bug was exposed by:
       [Bug 22908] Invalid output of radial gradient
       http://bugs.freedesktop.org/show_bug.cgi?id=22908

diff --git a/test/radial-gradient.c b/test/radial-gradient.c
index 9793fea..a6d145c 100644
--- a/test/radial-gradient.c
+++ b/test/radial-gradient.c
@@ -29,7 +29,7 @@
 #define NUM_GRADIENTS 4
 #define NUM_EXTEND 4
 #define SIZE 60
-#define WIDTH (SIZE * NUM_GRADIENTS)
+#define WIDTH (SIZE * NUM_GRADIENTS * NUM_GRADIENTS)
 #define HEIGHT (SIZE * NUM_EXTEND)
 
 static void
@@ -37,18 +37,22 @@ draw_gradient (cairo_t		*cr,
 	       int		x,
 	       int		y,
 	       int		size,
-	       double		offset,
-	       double		inner_radius,
+	       double		r1_offset,
+	       double		r1_radius,
+	       double		r2_offset,
+	       double		r2_radius,
 	       cairo_extend_t	extend)
 {
     cairo_pattern_t *pattern;
 
     cairo_save (cr);
 
-    pattern = cairo_pattern_create_radial (x + size/2.0 + offset,
-					   y + size/2.0 + offset, inner_radius,
-					   x + size/2.0,
-					   y + size/2.0, size/3.0);
+    pattern = cairo_pattern_create_radial (x + size/2.0 + r1_offset,
+					   y + size/2.0 + r1_offset,
+					   r1_radius,
+					   x + size/2.0 + r2_offset,
+					   y + size/2.0 + r2_offset,
+					   r2_radius);
     cairo_pattern_add_color_stop_rgba (pattern, 0.0,
 				       1.0, 0.0, 0.0, 1.0);
     cairo_pattern_add_color_stop_rgba (pattern, sqrt (1.0 / 2.0),
@@ -71,8 +75,7 @@ draw_gradient (cairo_t		*cr,
 static cairo_test_status_t
 draw (cairo_t *cr, int width, int height)
 {
-    int i, j;
-    double inner_radius, offset;
+    int i, j, k;
     cairo_extend_t extend[NUM_EXTEND] = {
 	CAIRO_EXTEND_NONE,
 	CAIRO_EXTEND_REPEAT,
@@ -84,10 +87,17 @@ draw (cairo_t *cr, int width, int height)
 
     for (j = 0; j < NUM_EXTEND; j++) {
 	for (i = 0; i < NUM_GRADIENTS; i++) {
-	    offset = i % 2 ? SIZE / 12.0 : 0.0;
-	    inner_radius = i >= NUM_EXTEND / 2 ? SIZE / 6.0 : 0.0;
-	    draw_gradient (cr, i * SIZE, j * SIZE, SIZE,
-			   offset, inner_radius, extend[j]);
+	    double r1_offset = i % 2 ? SIZE / 12.0 : 0.0;
+	    double r1_radius = i >= NUM_GRADIENTS / 2 ? SIZE / 6.0 : 0.0;
+	    for (k = 0; k < NUM_GRADIENTS; k++) {
+		double r2_offset = k % 2 ? SIZE / 12.0 : 0.0;
+		double r2_radius = k >= NUM_GRADIENTS / 2 ? SIZE / 3.0 : SIZE / 12.;
+		draw_gradient (cr,
+			       i * SIZE * NUM_GRADIENTS + k * SIZE, j * SIZE, SIZE,
+			       r1_offset, r1_radius,
+			       r2_offset, r2_radius,
+			       extend[j]);
+	    }
 	}
     }
 
diff --git a/test/radial-gradient.pdf.ref.png b/test/radial-gradient.pdf.ref.png
index dbb7312..5bbd733 100644
Binary files a/test/radial-gradient.pdf.ref.png and b/test/radial-gradient.pdf.ref.png differ
diff --git a/test/radial-gradient.ref.png b/test/radial-gradient.ref.png
index ab10858..bec83b7 100644
Binary files a/test/radial-gradient.ref.png and b/test/radial-gradient.ref.png differ
commit e98e2690cb4ac475819394334cb5e61a8e3d5557
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Wed Jul 22 18:32:47 2009 +0100

    [test] Fix use of uninitialized widths.
    
    user-font-rescale copied unitialized values from the widths array into
    the desired array. Although these corresponded to unused glyphs and so
    were never used during the rendering, the values may have been illegal
    causing FPE as they were copied.

diff --git a/test/user-font-rescale.c b/test/user-font-rescale.c
index ae56ef8..54b3a20 100644
--- a/test/user-font-rescale.c
+++ b/test/user-font-rescale.c
@@ -257,11 +257,11 @@ get_user_font_face (cairo_font_face_t *substitute_font,
 					       text, -1,
 					       &glyphs, &num_glyphs,
 					       NULL, NULL, NULL);
-    if (status) {
-	cairo_font_options_destroy (options);
-	cairo_scaled_font_destroy (measure);
+    cairo_font_options_destroy (options);
+    cairo_scaled_font_destroy (measure);
+
+    if (status)
 	return status;
-    }
 
     /* find the glyph range the text covers */
     max_index = glyphs[0].index;
@@ -274,7 +274,7 @@ get_user_font_face (cairo_font_face_t *substitute_font,
     }
 
     count = max_index - min_index + 1;
-    widths = xmalloc (sizeof(double) * count);
+    widths = xcalloc (sizeof (double), count);
     /* measure all of the necessary glyphs individually */
     for (i=0; i<num_glyphs; i++) {
 	cairo_text_extents_t extents;
@@ -284,9 +284,6 @@ get_user_font_face (cairo_font_face_t *substitute_font,
 
     cairo_glyph_free (glyphs);
 
-    cairo_font_options_destroy (options);
-    cairo_scaled_font_destroy (measure);
-
     status = create_rescaled_font (substitute_font,
 				   min_index, count, widths,
 				   out);
commit 596dec95610ef02d86ede94eca5b83221b0b533a
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Wed Jul 22 18:15:38 2009 +0100

    [test] Trap SIGFPE
    
    Note the crash if we hit a floating-point exception.

diff --git a/test/cairo-test.c b/test/cairo-test.c
index 34dd600..430acc1 100644
--- a/test/cairo-test.c
+++ b/test/cairo-test.c
@@ -1509,6 +1509,7 @@ _cairo_test_context_run_for_target (cairo_test_context_t *ctx,
 #if defined(HAVE_SIGNAL_H) && defined(HAVE_SETJMP_H)
     if (ctx->thread == 0 && ! RUNNING_ON_VALGRIND) {
 	void (* volatile old_segfault_handler)(int);
+	void (* volatile old_segfpe_handler)(int);
 	void (* volatile old_sigpipe_handler)(int);
 	void (* volatile old_sigabrt_handler)(int);
 	void (* volatile old_sigalrm_handler)(int);
@@ -1517,6 +1518,9 @@ _cairo_test_context_run_for_target (cairo_test_context_t *ctx,
 #ifdef SIGSEGV
 	old_segfault_handler = signal (SIGSEGV, segfault_handler);
 #endif
+#ifdef SIGFPE
+	old_segfpe_handler = signal (SIGFPE, segfault_handler);
+#endif
 #ifdef SIGPIPE
 	old_sigpipe_handler = signal (SIGPIPE, segfault_handler);
 #endif
@@ -1533,6 +1537,9 @@ _cairo_test_context_run_for_target (cairo_test_context_t *ctx,
 #ifdef SIGSEGV
 	signal (SIGSEGV, old_segfault_handler);
 #endif
+#ifdef SIGFPE
+	signal (SIGFPE, old_segfpe_handler);
+#endif
 #ifdef SIGPIPE
 	signal (SIGPIPE, old_sigpipe_handler);
 #endif
commit 0561539880b480273767a9559da89a25970802e2
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Wed Jul 22 18:31:37 2009 +0100

    [scaled-font] cairo_scaled_font_glyph_extents() initialise extents
    
    Ensure that the extents are zeroed on error.

diff --git a/src/cairo-scaled-font.c b/src/cairo-scaled-font.c
index a6b13cf..2b5b26d 100644
--- a/src/cairo-scaled-font.c
+++ b/src/cairo-scaled-font.c
@@ -1428,22 +1428,22 @@ cairo_scaled_font_glyph_extents (cairo_scaled_font_t   *scaled_font,
     extents->x_advance = 0.0;
     extents->y_advance = 0.0;
 
-    if (scaled_font->status)
-	return;
+    if (unlikely (scaled_font->status))
+	goto ZERO_EXTENTS;
 
     if (num_glyphs == 0)
-	return;
+	goto ZERO_EXTENTS;
 
-    if (num_glyphs < 0) {
+    if (unlikely (num_glyphs < 0)) {
 	_cairo_error_throw (CAIRO_STATUS_NEGATIVE_COUNT);
 	/* XXX Can't propagate error */
-	return;
+	goto ZERO_EXTENTS;
     }
 
-    if (glyphs == NULL) {
+    if (unlikely (glyphs == NULL)) {
 	_cairo_error_throw (CAIRO_STATUS_NULL_POINTER);
 	/* XXX Can't propagate error */
-	return;
+	goto ZERO_EXTENTS;
     }
 
     _cairo_scaled_font_freeze_cache (scaled_font);
@@ -1514,6 +1514,15 @@ cairo_scaled_font_glyph_extents (cairo_scaled_font_t   *scaled_font,
 
  UNLOCK:
     _cairo_scaled_font_thaw_cache (scaled_font);
+    return;
+
+ZERO_EXTENTS:
+    extents->x_bearing = 0.0;
+    extents->y_bearing = 0.0;
+    extents->width  = 0.0;
+    extents->height = 0.0;
+    extents->x_advance = 0.0;
+    extents->y_advance = 0.0;
 }
 slim_hidden_def (cairo_scaled_font_glyph_extents);
 
commit 5c843b5f8eca4b6f9756644143bc1be3bc3cbc84
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Tue Jul 21 20:43:28 2009 +0100

    [scaled-font] Skip empty glyphs
    
    Skip the composition of empty glyphs - prevents redundant calls through
    the stack.

diff --git a/src/cairo-scaled-font.c b/src/cairo-scaled-font.c
index bf5a4f7..a6b13cf 100644
--- a/src/cairo-scaled-font.c
+++ b/src/cairo-scaled-font.c
@@ -2028,7 +2028,6 @@ _cairo_scaled_font_show_glyphs (cairo_scaled_font_t	*scaled_font,
 
     for (i = 0; i < num_glyphs; i++) {
 	int x, y;
-	cairo_surface_pattern_t glyph_pattern;
 	cairo_image_surface_t *glyph_surface;
 	cairo_scaled_glyph_t *scaled_glyph;
 
@@ -2046,8 +2045,7 @@ _cairo_scaled_font_show_glyphs (cairo_scaled_font_t	*scaled_font,
 	 * glyph. Later we'll deal with different formats. */
 	if (mask == NULL) {
 	    mask_format = glyph_surface->format;
-	    mask = cairo_image_surface_create (mask_format,
-					       width, height);
+	    mask = cairo_image_surface_create (mask_format, width, height);
 	    status = mask->status;
 	    if (unlikely (status))
 		goto CLEANUP_MASK;
@@ -2074,10 +2072,9 @@ _cairo_scaled_font_show_glyphs (cairo_scaled_font_t	*scaled_font,
 		break;
 	    }
 
-	    new_mask = cairo_image_surface_create (mask_format,
-						   width, height);
-	    if (new_mask->status) {
-		status = new_mask->status;
+	    new_mask = cairo_image_surface_create (mask_format, width, height);
+	    status = new_mask->status;
+	    if (unlikely (status)) {
 		cairo_surface_destroy (new_mask);
 		goto CLEANUP_MASK;
 	    }
@@ -2105,33 +2102,41 @@ _cairo_scaled_font_show_glyphs (cairo_scaled_font_t	*scaled_font,
 	    mask = new_mask;
 	}
 
-	/* round glyph locations to the nearest pixel */
-	/* XXX: FRAGILE: We're ignoring device_transform scaling here. A bug? */
-	x = _cairo_lround (glyphs[i].x - glyph_surface->base.device_transform.x0);
-	y = _cairo_lround (glyphs[i].y - glyph_surface->base.device_transform.y0);
+	if (glyph_surface->width && glyph_surface->height) {
+	    cairo_surface_pattern_t glyph_pattern;
 
-	_cairo_pattern_init_for_surface (&glyph_pattern, &glyph_surface->base);
+	    /* round glyph locations to the nearest pixel */
+	    /* XXX: FRAGILE: We're ignoring device_transform scaling here. A bug? */
+	    x = _cairo_lround (glyphs[i].x -
+			       glyph_surface->base.device_transform.x0);
+	    y = _cairo_lround (glyphs[i].y -
+			       glyph_surface->base.device_transform.y0);
 
-	status = _cairo_surface_composite (CAIRO_OPERATOR_ADD,
-					   &white_pattern.base,
-					   &glyph_pattern.base,
-					   mask,
-					   0, 0,
-					   0, 0,
-					   x - dest_x, y - dest_y,
-					   glyph_surface->width,
-					   glyph_surface->height,
-					   NULL);
+	    _cairo_pattern_init_for_surface (&glyph_pattern,
+					     &glyph_surface->base);
 
-	_cairo_pattern_fini (&glyph_pattern.base);
+	    status = _cairo_surface_composite (CAIRO_OPERATOR_ADD,
+					       &white_pattern.base,
+					       &glyph_pattern.base,
+					       mask,
+					       0, 0,
+					       0, 0,
+					       x - dest_x, y - dest_y,
+					       glyph_surface->width,
+					       glyph_surface->height,
+					       NULL);
 
-	if (unlikely (status))
-	    goto CLEANUP_MASK;
+	    _cairo_pattern_fini (&glyph_pattern.base);
+
+	    if (unlikely (status))
+		goto CLEANUP_MASK;
+	}
     }
 
-    if (mask_format == CAIRO_FORMAT_ARGB32)
+    if (mask_format == CAIRO_FORMAT_ARGB32) {
 	pixman_image_set_component_alpha (((cairo_image_surface_t*) mask)->
 					  pixman_image, TRUE);
+    }
     _cairo_pattern_init_for_surface (&mask_pattern, mask);
 
     status = _cairo_surface_composite (op, pattern, &mask_pattern.base,
commit 0c4692a1d0667f5850f59c65754a3ffbaf688afe
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Mon Jul 20 23:34:55 2009 +0100

    [perf] Specify html file on cmdline instead of redirecting all output
    
    Redirecting all output was causing the build messages to be entangled with
    the Performance Change html.

diff --git a/perf/Makefile.am b/perf/Makefile.am
index 149b714..a62ad95 100644
--- a/perf/Makefile.am
+++ b/perf/Makefile.am
@@ -145,9 +145,9 @@ perf: cairo-perf$(EXEEXT) cairo-perf-trace$(EXEEXT)
 html-local: index.html
 
 perf-tag.html : cairo-perf${EXEEXT}
-	$(CAIRO_PERF_ENVIRONMENT) ./cairo-perf-diff -t -h `git describe --abbrev=0` HEAD > $@
+	$(CAIRO_PERF_ENVIRONMENT) ./cairo-perf-diff -t -h $@ `git describe --abbrev=0` HEAD
 perf-commit.html : cairo-perf${EXEEXT}
-	$(CAIRO_PERF_ENVIRONMENT) ./cairo-perf-diff -t -h HEAD > $@
+	$(CAIRO_PERF_ENVIRONMENT) ./cairo-perf-diff -t -h $@ HEAD
 
 # Summarise changes in index.html, with details in links
 index.html: perf-tag.html perf-commit.html
diff --git a/perf/cairo-perf-diff b/perf/cairo-perf-diff
index 50a014a..469da89 100755
--- a/perf/cairo-perf-diff
+++ b/perf/cairo-perf-diff
@@ -58,7 +58,7 @@ benchmarks="cairo-perf"
 while true; do
     case $1 in
         -f|--force) force_cairo_perf="true";;
-        -h|--html) html_output="true";;
+        -h|--html) html_output="$2"; shift ;;
         -t|--trace) benchmarks="${benchmarks} cairo-perf-trace";;
         *) break;;
     esac
@@ -243,9 +243,9 @@ if [ ! -e $new ]; then
     new=`rev2perf $new`
 fi
 
-if [ "$html_output" != "true" ]; then
+if [ -z "$html_output" ]; then
     $CAIRO_DIR/perf/cairo-perf-diff-files $old $new
 else
     $CAIRO_DIR/perf/cairo-perf-diff-files $old $new |
-    $CAIRO_DIR/perf/make-html.py
+    $CAIRO_DIR/perf/make-html.py > $html_output
 fi
commit 1ec1d6148e85d4a9b9da825ea57adb0b8ceba1c0
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Mon Jul 20 22:42:44 2009 +0100

    [perf] Compare performance against most recent tag.

diff --git a/perf/Makefile.am b/perf/Makefile.am
index 2fd427c..149b714 100644
--- a/perf/Makefile.am
+++ b/perf/Makefile.am
@@ -144,9 +144,14 @@ perf: cairo-perf$(EXEEXT) cairo-perf-trace$(EXEEXT)
 
 html-local: index.html
 
-index.html: cairo-perf$(EXEEXT)
+perf-tag.html : cairo-perf${EXEEXT}
+	$(CAIRO_PERF_ENVIRONMENT) ./cairo-perf-diff -t -h `git describe --abbrev=0` HEAD > $@
+perf-commit.html : cairo-perf${EXEEXT}
 	$(CAIRO_PERF_ENVIRONMENT) ./cairo-perf-diff -t -h HEAD > $@
 
+# Summarise changes in index.html, with details in links
+index.html: perf-tag.html perf-commit.html
+	echo "<html><head><title>Performance Changes</title></head><body>Against <a href=\"perf-tag.html\">"`git describe --abbrev=0`"</a><br><a href=\"perf-commit.html\">Latest commit</a></body>" > $@
 
 EXTRA_VALGRIND_FLAGS = $(CAIRO_EXTRA_VALGRIND_FLAGS)
 VALGRIND_MEMCHECK_FLAGS = \


More information about the cairo-commit mailing list