[Spice-devel] [RFC v4 43/62] server/red_worker: red_create_surface - check for dcc before sending messages

Marc-André Lureau marcandre.lureau at gmail.com
Mon May 2 16:55:14 PDT 2011


I suppose there is a good reason, but I don't know it.
red_create_surface_item() handles dcc = NULL, so why do we want to
avoid it here?

On Tue, Apr 26, 2011 at 12:55 PM, Alon Levy <alevy at redhat.com> wrote:
> ---
>  server/red_worker.c |    9 ++++++---
>  1 files changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/server/red_worker.c b/server/red_worker.c
> index 2c8ce2e..75d222f 100644
> --- a/server/red_worker.c
> +++ b/server/red_worker.c
> @@ -8850,8 +8850,9 @@ static inline void red_create_surface(RedWorker *worker, Surfaces *surfaces,
>         if (!surface->context.canvas) {
>             PANIC("drawing canvas creating failed - can`t create same type canvas");
>         }
> -
> -        red_create_surface_item(worker, dcc, surface_id);
> +        if (dcc) {
> +            red_create_surface_item(worker, dcc, surface_id);
> +        }
>         return;
>     }
>
> @@ -8862,7 +8863,9 @@ static inline void red_create_surface(RedWorker *worker, Surfaces *surfaces,
>                                                             surface->context.format, line_0);
>         if (surface->context.canvas) { //no need canvas check
>             worker->renderer = worker->renderers[i];
> -            red_create_surface_item(worker, dcc, surface_id);
> +            if (dcc) {
> +                red_create_surface_item(worker, dcc, surface_id);
> +            }
>             return;
>         }
>     }
> --
> 1.7.4.4
>
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/spice-devel
>



-- 
Marc-André Lureau


More information about the Spice-devel mailing list