mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice-common
synced 2025-12-26 14:18:36 +00:00
canvas-base: remove user data from CanvasBase
Neither Spice nor spice-gtk are using this since the following commit in Spice "server: remove OpenGL" c5c176a5c7718177f23b07981556b5d460627498 Signed-off-by: Victor Toso <victortoso@redhat.com> Acked-by: Pavel Grunt <pgrunt@redhat.com>
This commit is contained in:
parent
5f241e655b
commit
580ca81536
@ -153,9 +153,6 @@ typedef struct CanvasBase {
|
||||
GlzData glz_data;
|
||||
SpiceJpegDecoder* jpeg;
|
||||
SpiceZlibDecoder* zlib;
|
||||
|
||||
void *usr_data;
|
||||
spice_destroy_fn_t usr_data_destroy;
|
||||
} CanvasBase;
|
||||
|
||||
typedef enum {
|
||||
@ -1909,38 +1906,8 @@ static void canvas_base_destroy(CanvasBase *canvas)
|
||||
#ifdef GDI_CANVAS
|
||||
DeleteDC(canvas->dc);
|
||||
#endif
|
||||
|
||||
if (canvas->usr_data && canvas->usr_data_destroy) {
|
||||
canvas->usr_data_destroy (canvas->usr_data);
|
||||
canvas->usr_data = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/* This is kind of lame, but it protects against multiple
|
||||
instances of these functions. We really should stop including
|
||||
canvas_base.c and build it separately instead */
|
||||
#ifdef CANVAS_SINGLE_INSTANCE
|
||||
|
||||
void spice_canvas_set_usr_data(SpiceCanvas *spice_canvas,
|
||||
void *data,
|
||||
spice_destroy_fn_t destroy_fn)
|
||||
{
|
||||
CanvasBase *canvas = (CanvasBase *)spice_canvas;
|
||||
if (canvas->usr_data && canvas->usr_data_destroy) {
|
||||
canvas->usr_data_destroy (canvas->usr_data);
|
||||
}
|
||||
canvas->usr_data = data;
|
||||
canvas->usr_data_destroy = destroy_fn;
|
||||
}
|
||||
|
||||
void *spice_canvas_get_usr_data(SpiceCanvas *spice_canvas)
|
||||
{
|
||||
CanvasBase *canvas = (CanvasBase *)spice_canvas;
|
||||
return canvas->usr_data;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
static void canvas_clip_pixman(CanvasBase *canvas,
|
||||
pixman_region32_t *dest_region,
|
||||
SpiceClip *clip)
|
||||
|
||||
@ -310,9 +310,6 @@ typedef struct {
|
||||
pixman_image_t *(*get_image)(SpiceCanvas *canvas, int force_opaque);
|
||||
} SpiceCanvasOps;
|
||||
|
||||
void spice_canvas_set_usr_data(SpiceCanvas *canvas, void *data, spice_destroy_fn_t destroy_fn);
|
||||
void *spice_canvas_get_usr_data(SpiceCanvas *canvas);
|
||||
|
||||
struct _SpiceCanvas {
|
||||
SpiceCanvasOps *ops;
|
||||
};
|
||||
|
||||
Loading…
Reference in New Issue
Block a user