[Spice-devel] [spice-common v2 3/4] canvas-base: remove user data from CanvasBase

Victor Toso victortoso at redhat.com
Mon Nov 28 17:56:56 UTC 2016


From: Victor Toso <me at victortoso.com>

Neither Spice nor spice-gtk are using this since the
following commit in Spice "server: remove OpenGL"
c5c176a5c7718177f23b07981556b5d460627498

Signed-off-by: Victor Toso <victortoso at redhat.com>
---
 common/canvas_base.c | 33 ---------------------------------
 common/canvas_base.h |  3 ---
 2 files changed, 36 deletions(-)

diff --git a/common/canvas_base.c b/common/canvas_base.c
index 89c7b43..8f653e0 100644
--- a/common/canvas_base.c
+++ b/common/canvas_base.c
@@ -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)
diff --git a/common/canvas_base.h b/common/canvas_base.h
index 637cdc1..78e6368 100644
--- a/common/canvas_base.h
+++ b/common/canvas_base.h
@@ -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;
 };
-- 
2.9.3



More information about the Spice-devel mailing list