mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2025-12-27 00:00:11 +01:00
[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.
This commit is contained in:
parent
21049a9a5e
commit
24c319fbae
1 changed files with 34 additions and 0 deletions
|
|
@ -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" },
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue