diff options
| author | suyambulingamrm <suyambu.rm@samsung.com> | 2014-07-03 14:35:02 +0530 |
|---|---|---|
| committer | suyambulingamrm <suyambu.rm@samsung.com> | 2014-07-03 14:35:02 +0530 |
| commit | 80e178b1ff37e67d7067e91e5ed35a3c163e6c1d (patch) | |
| tree | e0c235c89d4aeeaf42701d483fac97a7af57b3d6 /src/cairo-tests/image.cpp | |
| parent | b09db7c69f1eb13b5a841b1ab93306bbfa2df70e (diff) | |
Issue #104. Adapt cairo tests to cache image surface.
Diffstat (limited to 'src/cairo-tests/image.cpp')
| -rw-r--r-- | src/cairo-tests/image.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/cairo-tests/image.cpp b/src/cairo-tests/image.cpp index 767b80f..3989899 100644 --- a/src/cairo-tests/image.cpp +++ b/src/cairo-tests/image.cpp @@ -15,11 +15,13 @@ #include <cairo-shapes.h> static cairo_surface_t *image; +static cairo_surface_t *cached_image; int ca_setup_image(caskbench_context_t *ctx) { image = cairoCreateSampleImage (ctx); + cached_image = cairoCacheImageSurface (ctx, image); return 1; } @@ -27,6 +29,7 @@ void ca_teardown_image(void) { cairo_surface_destroy (image); + cairo_surface_destroy (cached_image); } int @@ -44,7 +47,7 @@ ca_test_image(caskbench_context_t* ctx) for (int i=0; i<ctx->size; i++) { double x = (double)rand()/RAND_MAX * pw; double y = (double)rand()/RAND_MAX * ph; - cairo_set_source_surface (cr, image, x, y); + cairo_set_source_surface (cr, cached_image, x, y); #if 1 cairo_paint (cr); #else |