summaryrefslogtreecommitdiffstats
path: root/common/gl_canvas.c
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2010-02-08 15:38:24 +0100
committerAlexander Larsson <alexl@redhat.com>2010-02-23 14:43:20 +0100
commit0b0342ee7ece8ea5a811cfb05c70f03ca4e3bde3 (patch)
tree7e4ce72080519d7d55df6f3dadc63b6784c0856b /common/gl_canvas.c
parent7537acd630e8973c92bb769b56d78836372b30c2 (diff)
downloadspice-0b0342ee7ece8ea5a811cfb05c70f03ca4e3bde3.tar.gz
spice-0b0342ee7ece8ea5a811cfb05c70f03ca4e3bde3.tar.xz
spice-0b0342ee7ece8ea5a811cfb05c70f03ca4e3bde3.zip
Turn image and palette cache into c style dynamic interface
Instead of passing a bunch of function pointer and an opaque pointer we make a real type and add a vtable pointer to it. This means we can simplify all the canvas constructors, etc.
Diffstat (limited to 'common/gl_canvas.c')
-rw-r--r--common/gl_canvas.c26
1 files changed, 6 insertions, 20 deletions
diff --git a/common/gl_canvas.c b/common/gl_canvas.c
index 124bcfe7..329d97b2 100644
--- a/common/gl_canvas.c
+++ b/common/gl_canvas.c
@@ -787,18 +787,11 @@ static int need_init = 1;
#ifdef CAIRO_CANVAS_CACHE
GLCanvas *gl_canvas_create(void *usr_data, int width, int height, int depth,
- void *bits_cache_opaque,
- bits_cache_put_fn_t bits_cache_put,
- bits_cache_get_fn_t bits_cache_get,
- void *palette_cache_opaque,
- palette_cache_put_fn_t palette_cache_put,
- palette_cache_get_fn_t palette_cache_get,
- palette_cache_release_fn_t palette_cache_release
+ SpiceImageCache *bits_cache,
+ SpicePaletteCache *palette_cache
#elif defined(CAIRO_CANVAS_IMAGE_CACHE)
GLCanvas *gl_canvas_create(void *usr_data, int width, int height, int depth,
- void *bits_cache_opaque,
- bits_cache_put_fn_t bits_cache_put,
- bits_cache_get_fn_t bits_cache_get
+ SpiceImageCache *bits_cache
#else
GLCanvas *gl_canvas_create(void *usr_data, int width, int height, int depth
#endif
@@ -826,18 +819,11 @@ GLCanvas *gl_canvas_create(void *usr_data, int width, int height, int depth
canvas->private_data = NULL;
#ifdef CAIRO_CANVAS_CACHE
init_ok = canvas_base_init(&canvas->base, depth,
- bits_cache_opaque,
- bits_cache_put,
- bits_cache_get,
- palette_cache_opaque,
- palette_cache_put,
- palette_cache_get,
- palette_cache_release
+ bits_cache,
+ palette_cache
#elif defined(CAIRO_CANVAS_IMAGE_CACHE)
init_ok = canvas_base_init(&canvas->base, depth,
- bits_cache_opaque,
- bits_cache_put,
- bits_cache_get
+ bits_cache
#else
init_ok = canvas_base_init(&canvas->base, depth
#endif