[Spice-devel] [PATCH spice-server 1/8] red-parse-qxl: Use same fuction to parse blend and copy commands

Jonathon Jongsma jjongsma at redhat.com
Wed Nov 9 16:32:41 UTC 2016


Acked-by: Jonathon Jongsma <jjongsma at redhat.com>


On Fri, 2016-11-04 at 13:16 +0000, Frediano Ziglio wrote:
> SpiceBlend and SpiceCopy are just different names for the same
> structure.
> 
> Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
> ---
>  server/red-parse-qxl.c | 15 ++++-----------
>  1 file changed, 4 insertions(+), 11 deletions(-)
> 
> diff --git a/server/red-parse-qxl.c b/server/red-parse-qxl.c
> index d75e27e..aa911f3 100644
> --- a/server/red-parse-qxl.c
> +++ b/server/red-parse-qxl.c
> @@ -706,15 +706,8 @@ static void red_put_copy(SpiceCopy *red)
>      red_put_qmask(&red->mask);
>  }
>  
> -static void red_get_blend_ptr(RedMemSlotInfo *slots, int group_id,
> -                             SpiceBlend *red, QXLBlend *qxl,
> uint32_t flags)
> -{
> -    red->src_bitmap      = red_get_image(slots, group_id, qxl-
> >src_bitmap, flags, FALSE);
> -   red_get_rect_ptr(&red->src_area, &qxl->src_area);
> -   red->rop_descriptor  = qxl->rop_descriptor;
> -   red->scale_mode      = qxl->scale_mode;
> -   red_get_qmask_ptr(slots, group_id, &red->mask, &qxl->mask,
> flags);
> -}
> +// these types are really the same thing
> +#define red_get_blend_ptr red_get_copy_ptr
>  
>  static void red_put_blend(SpiceBlend *red)
>  {
> @@ -1074,7 +1067,7 @@ static int
> red_get_native_drawable(RedMemSlotInfo *slots, int group_id,
>                                &red->u.blackness, &qxl->u.blackness,
> flags);
>          break;
>      case QXL_DRAW_BLEND:
> -        red_get_blend_ptr(slots, group_id, &red->u.blend, &qxl-
> >u.blend, flags);
> +        error = red_get_blend_ptr(slots, group_id, &red->u.blend,
> &qxl->u.blend, flags);
>          break;
>      case QXL_DRAW_COPY:
>          error = red_get_copy_ptr(slots, group_id, &red->u.copy,
> &qxl->u.copy, flags);
> @@ -1157,7 +1150,7 @@ static int
> red_get_compat_drawable(RedMemSlotInfo *slots, int group_id,
>                                &red->u.blackness, &qxl->u.blackness,
> flags);
>          break;
>      case QXL_DRAW_BLEND:
> -        red_get_blend_ptr(slots, group_id, &red->u.blend, &qxl-
> >u.blend, flags);
> +        error = red_get_blend_ptr(slots, group_id, &red->u.blend,
> &qxl->u.blend, flags);
>          break;
>      case QXL_DRAW_COPY:
>          error = red_get_copy_ptr(slots, group_id, &red->u.copy,
> &qxl->u.copy, flags);


More information about the Spice-devel mailing list