diff options
| author | Bryce Harrington <b.harrington@samsung.com> | 2014-07-03 12:05:32 -0700 |
|---|---|---|
| committer | Bryce Harrington <b.harrington@samsung.com> | 2014-07-03 12:05:32 -0700 |
| commit | b056641ef302205719974aac5f8f4e2e56fe9f3e (patch) | |
| tree | e0c235c89d4aeeaf42701d483fac97a7af57b3d6 /src/cairo-tests/image-scale.cpp | |
| parent | 47de2e7053b90da347e739a220c698bde8313ce9 (diff) | |
| parent | 80e178b1ff37e67d7067e91e5ed35a3c163e6c1d (diff) | |
Merge pull request #122 from Samsung/Issue_104
Issue 104. Image surface caching.
Diffstat (limited to 'src/cairo-tests/image-scale.cpp')
| -rw-r--r-- | src/cairo-tests/image-scale.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/cairo-tests/image-scale.cpp b/src/cairo-tests/image-scale.cpp index 85f50d7..47e1e65 100644 --- a/src/cairo-tests/image-scale.cpp +++ b/src/cairo-tests/image-scale.cpp @@ -16,11 +16,13 @@ #include <math.h> static cairo_surface_t *image; +static cairo_surface_t *cached_image; int ca_setup_image_scale(caskbench_context_t *ctx) { image = cairoCreateSampleImage (ctx); + cached_image = cairoCacheImageSurface (ctx, image); return 1; } @@ -28,6 +30,7 @@ void ca_teardown_image_scale(void) { cairo_surface_destroy (image); + cairo_surface_destroy (cached_image); } int @@ -53,7 +56,7 @@ ca_test_image_scale(caskbench_context_t *ctx) cairo_translate(cr,x,y); cairo_scale(cr, width_ratio, height_ratio); - cairo_set_source_surface (cr, image, 0, 0); + cairo_set_source_surface (cr, cached_image, 0, 0); // Scale without blur cairo_pattern_set_filter (cairo_get_source(cr), CAIRO_FILTER_FAST); #if 1 |