[Spice-devel] [spice-common v1 3/4] canvas-base: remove user data from CanvasBase
Victor Toso
victortoso at redhat.com
Mon Nov 28 17:41:02 UTC 2016
Hi,
On Thu, Nov 24, 2016 at 10:51:14AM +0100, Pavel Grunt wrote:
> On Wed, 2016-11-23 at 14:56 +0100, Victor Toso wrote:
> > From: Victor Toso <me at victortoso.com>
> >
> > Neither Spice nor spice-gtk seems to be using this. Likely a
> > leftover
> > from the past.
>
> related to opengl ?
> spice-server commit c5c176a5c7718177f23b07981556b5d460627498
Seems that opengl was using it, I did not look into when it was
introduced, only that it was moved in
3b73f93cf2f623b52595a62e48d3a705f21496cc and that it was removed.
Adding to the commit log that last usage of this internal api was on
c5c176a5c7718177f23b07981556b5d460627498 looks good enough?
toso
>
> >
> > 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;
> > };
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20161128/b1af59f5/attachment.sig>
More information about the Spice-devel
mailing list