[PATCH] [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.

Bertram Felgenhauer int-e at gmx.de
Sat Feb 16 00:22:01 PST 2008


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

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" },
-- 
1.5.3


--pf9I7BMVVzbSWLtt--


More information about the cairo mailing list