summaryrefslogtreecommitdiffstats
path: root/common/gl_canvas.h
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2010-03-03 15:08:58 +0100
committerAlexander Larsson <alexl@redhat.com>2010-03-08 19:45:28 +0100
commitf8217d8b96f35fd297c74df1da6428b56b01149a (patch)
treeba51569d697f284b0048337202c74539a8f6a193 /common/gl_canvas.h
parent05697e502d709974f9b94feca5d9bdde20b993be (diff)
downloadspice-f8217d8b96f35fd297c74df1da6428b56b01149a.tar.gz
spice-f8217d8b96f35fd297c74df1da6428b56b01149a.tar.xz
spice-f8217d8b96f35fd297c74df1da6428b56b01149a.zip
Move virtualization of canvas drawing into common/canvas_base
Instead of having two virtualizations of the canvas we push the virtualization into the canvas code itself. This not only avoids the duplication of this code, it also makes the exposed API for the canvas much smaller (in terms of exported API). It also lets us use the virtualization to implement basic support for operations in canvas_base which is then overridden by each canvas implementation.
Diffstat (limited to 'common/gl_canvas.h')
-rw-r--r--common/gl_canvas.h47
1 files changed, 5 insertions, 42 deletions
diff --git a/common/gl_canvas.h b/common/gl_canvas.h
index ee272a8a..29737ec8 100644
--- a/common/gl_canvas.h
+++ b/common/gl_canvas.h
@@ -21,55 +21,18 @@
#include "canvas_base.h"
#include "region.h"
-typedef struct GLCanvas GLCanvas;
-
-void gl_canvas_draw_fill(GLCanvas *canvas, SpiceRect *bbox, SpiceClip *clip, SpiceFill *fill);
-void gl_canvas_draw_copy(GLCanvas *canvas, SpiceRect *bbox, SpiceClip *clip, SpiceCopy *copy);
-void gl_canvas_draw_opaque(GLCanvas *canvas, SpiceRect *bbox, SpiceClip *clip, SpiceOpaque *opaque);
-void gl_canvas_draw_blend(GLCanvas *canvas, SpiceRect *bbox, SpiceClip *clip, SpiceBlend *blend);
-void gl_canvas_draw_alpha_blend(GLCanvas *canvas, SpiceRect *bbox, SpiceClip *clip, SpiceAlphaBlnd *alpha_blend);
-void gl_canvas_draw_transparent(GLCanvas *canvas, SpiceRect *bbox, SpiceClip *clip, SpiceTransparent *transparent);
-void gl_canvas_draw_whiteness(GLCanvas *canvas, SpiceRect *bbox, SpiceClip *clip, SpiceWhiteness *whiteness);
-void gl_canvas_draw_blackness(GLCanvas *canvas, SpiceRect *bbox, SpiceClip *clip, SpiceBlackness *blackness);
-void gl_canvas_draw_invers(GLCanvas *canvas, SpiceRect *bbox, SpiceClip *clip, SpiceInvers *invers);
-void gl_canvas_draw_rop3(GLCanvas *canvas, SpiceRect *bbox, SpiceClip *clip, SpiceRop3 *rop3);
-void gl_canvas_draw_stroke(GLCanvas *canvas, SpiceRect *bbox, SpiceClip *clip, SpiceStroke *stroke);
-void gl_canvas_draw_text(GLCanvas *canvas, SpiceRect *bbox, SpiceClip *clip, SpiceText *text);
-
-void gl_canvas_copy_pixels(GLCanvas *canvas, SpiceRect *bbox, SpiceClip *clip, SpicePoint *src_pos);
-void gl_canvas_read_pixels(GLCanvas *canvas, uint8_t *dest, int dest_stride, const SpiceRect *area);
-
-void gl_canvas_put_image(GLCanvas *canvas, const SpiceRect *dest, const uint8_t *src_data,
- uint32_t src_width, uint32_t src_height, int src_stride,
- const QRegion *clip);
-
-void gl_canvas_clear(GLCanvas *canvas);
-
-void gl_canvas_set_top_mask(GLCanvas *canvas, QRegion *region);
-void gl_canvas_clear_top_mask(GLCanvas *canvas);
-
-#ifdef CAIRO_CANVAS_ACCESS_TEST
-void gl_canvas_set_access_params(GLCanvas *canvas, unsigned long base, unsigned long max);
-#endif
-
-void *gl_canvas_get_usr_data(GLCanvas *canvas);
-
+SpiceCanvas *gl_canvas_create(int width, int height, int depth
#ifdef CAIRO_CANVAS_CACHE
-GLCanvas *gl_canvas_create(void *usr_data, int width, int height, int depth,
- SpiceImageCache *bits_cache,
- SpicePaletteCache *palette_cache
+ , 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,
- SpiceImageCache *bits_cache
-#else
-GLCanvas *gl_canvas_create(void *usr_data, int width, int height, int depth
+ , SpiceImageCache *bits_cache
#endif
, SpiceGlzDecoder *glz_decoder
#ifndef CAIRO_CANVAS_NO_CHUNKS
, SpiceVirtMapping *virt_mapping
#endif
);
-void gl_canvas_destroy(GLCanvas *, int);
-
+void gl_canvas_set_textures_lost(SpiceCanvas *canvas, int textures_lost);
void gl_canvas_init();