From 24c319fbae9ea4a43bf4e1fdf94d069b4ad78904 Mon Sep 17 00:00:00 2001 From: Bertram Felgenhauer Date: Sat, 16 Feb 2008 09:22:01 +0100 Subject: [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. --- perf/cairo-perf-cover.c | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'perf') diff --git a/perf/cairo-perf-cover.c b/perf/cairo-perf-cover.c index bd12f0733..30942d271 100644 --- a/perf/cairo-perf-cover.c +++ b/perf/cairo-perf-cover.c @@ -96,6 +96,38 @@ set_source_image_surface_rgba (cairo_t *cr, cairo_surface_destroy (source); } +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, @@ -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" }, -- cgit v1.2.3