[cairo-commit] perf/cairo-perf-cover.c

Bertram Felgenhauer inte at kemper.freedesktop.org
Tue Feb 19 13:50:28 PST 2008


 perf/cairo-perf-cover.c |   34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)

New commits:
commit 24c319fbae9ea4a43bf4e1fdf94d069b4ad78904
Author: Bertram Felgenhauer <int-e at gmx.de>
Date:   Sat Feb 16 09:22:01 2008 +0100

    [perf] add tests for magnified and minified image sources.
    With this change, cairo's performance testsuite will catch performance
    regressions in pixman's fbFetchTransformed path.

diff --git a/perf/cairo-perf-cover.c b/perf/cairo-perf-cover.c
index bd12f07..30942d2 100644
--- a/perf/cairo-perf-cover.c
+++ b/perf/cairo-perf-cover.c
@@ -97,6 +97,38 @@ set_source_image_surface_rgba (cairo_t	*cr,
 }
 
 static void
+set_source_image_surface_rgba_mag (cairo_t	*cr,
+				   int	 	width,
+				   int	 	height)
+{
+    cairo_surface_t *source;
+
+    source = cairo_image_surface_create (CAIRO_FORMAT_ARGB32,
+					 width/2, height/2);
+    cairo_scale(cr, 2.1, 2.1);
+    init_and_set_source_surface (cr, source, width/2, height/2);
+    cairo_scale(cr, 1/2.1, 1/2.1);
+
+    cairo_surface_destroy (source);
+}
+
+static void
+set_source_image_surface_rgba_min (cairo_t	*cr,
+				   int	 	width,
+				   int	 	height)
+{
+    cairo_surface_t *source;
+
+    source = cairo_image_surface_create (CAIRO_FORMAT_ARGB32,
+					 width*2, height*2);
+    cairo_scale(cr, 1/1.9, 1/1.9);
+    init_and_set_source_surface (cr, source, width*2, height*2);
+    cairo_scale(cr, 1.9, 1.9);
+
+    cairo_surface_destroy (source);
+}
+
+static void
 set_source_similar_surface_rgb (cairo_t	*cr,
 				int	 width,
 				int	 height)
@@ -208,6 +240,8 @@ cairo_perf_cover_sources_and_operators (cairo_perf_t		*perf,
 	{ set_source_solid_rgba, "solid_rgba" },
 	{ set_source_image_surface_rgb, "image_rgb" },
 	{ set_source_image_surface_rgba, "image_rgba" },
+	{ set_source_image_surface_rgba_mag, "image_rgba_mag" },
+	{ set_source_image_surface_rgba_min, "image_rgba_min" },
 	{ set_source_similar_surface_rgb, "similar_rgb" },
 	{ set_source_similar_surface_rgba, "similar_rgba" },
 	{ set_source_linear_rgb, "linear_rgb" },


More information about the cairo-commit mailing list