summaryrefslogtreecommitdiffstatsci
path: root/src/cairo-tests/image-rotate.cpp
diff options
context:
space:
mode:
authorsuyambulingamrm <suyambu.rm@samsung.com>2014-07-03 14:35:02 +0530
committersuyambulingamrm <suyambu.rm@samsung.com>2014-07-03 14:35:02 +0530
commit80e178b1ff37e67d7067e91e5ed35a3c163e6c1d (patch)
treee0c235c89d4aeeaf42701d483fac97a7af57b3d6 /src/cairo-tests/image-rotate.cpp
parentb09db7c69f1eb13b5a841b1ab93306bbfa2df70e (diff)
Issue #104. Adapt cairo tests to cache image surface.
Diffstat (limited to 'src/cairo-tests/image-rotate.cpp')
-rw-r--r--src/cairo-tests/image-rotate.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/cairo-tests/image-rotate.cpp b/src/cairo-tests/image-rotate.cpp
index 9a6725d..2563d9c 100644
--- a/src/cairo-tests/image-rotate.cpp
+++ b/src/cairo-tests/image-rotate.cpp
@@ -15,11 +15,13 @@
#include "cairo-shapes.h"
static cairo_surface_t *image;
+static cairo_surface_t *cached_image;
int
ca_setup_image_rotate(caskbench_context_t *ctx)
{
image = cairoCreateSampleImage (ctx);
+ cached_image = cairoCacheImageSurface (ctx, image);
return 1;
}
@@ -27,6 +29,7 @@ void
ca_teardown_image_rotate(void)
{
cairo_surface_destroy (image);
+ cairo_surface_destroy (cached_image);
}
int
@@ -51,7 +54,7 @@ ca_test_image_rotate(caskbench_context_t* ctx)
cairo_translate(cr, w/2, h/2);
cairo_rotate(cr, i / 50.0); // TODO: Original rotates by counter/50
cairo_translate(cr, -iw/2, -ih/2);
- cairo_set_source_surface (cr, image, 0, 0);
+ cairo_set_source_surface (cr, cached_image, 0, 0);
#if 1
cairo_paint (cr);
#else