From 05150fbe3457625fca0ed73edc419f4fb353265f Mon Sep 17 00:00:00 2001 From: Frediano Ziglio Date: Sat, 17 Sep 2016 06:56:17 +0100 Subject: Rename surface argument to surface_cmd Attempt to use consistent naming. Usually we use surface name for RedSurface so make sure code reader do not get confused using a different name for RedSurfaceCmd. Signed-off-by: Frediano Ziglio Acked-by: Christophe Fergeau --- server/display-channel.c | 23 ++++++++++++----------- server/display-channel.h | 2 +- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/server/display-channel.c b/server/display-channel.c index c7043416..6a7228be 100644 --- a/server/display-channel.c +++ b/server/display-channel.c @@ -1959,42 +1959,43 @@ DisplayChannel* display_channel_new(SpiceServer *reds, RedWorker *worker, return display; } -void display_channel_process_surface_cmd(DisplayChannel *display, RedSurfaceCmd *surface, +void display_channel_process_surface_cmd(DisplayChannel *display, + const RedSurfaceCmd *surface_cmd, int loadvm) { uint32_t surface_id; RedSurface *red_surface; uint8_t *data; - surface_id = surface->surface_id; + surface_id = surface_cmd->surface_id; if SPICE_UNLIKELY(surface_id >= display->priv->n_surfaces) { return; } red_surface = &display->priv->surfaces[surface_id]; - switch (surface->type) { + switch (surface_cmd->type) { case QXL_SURFACE_CMD_CREATE: { - uint32_t height = surface->u.surface_create.height; - int32_t stride = surface->u.surface_create.stride; - int reloaded_surface = loadvm || (surface->flags & QXL_SURF_FLAG_KEEP_DATA); + uint32_t height = surface_cmd->u.surface_create.height; + int32_t stride = surface_cmd->u.surface_create.stride; + int reloaded_surface = loadvm || (surface_cmd->flags & QXL_SURF_FLAG_KEEP_DATA); if (red_surface->refs) { spice_warning("avoiding creating a surface twice"); break; } - data = surface->u.surface_create.data; + data = surface_cmd->u.surface_create.data; if (stride < 0) { /* No need to worry about overflow here, command should already be validated * when it is read, specifically red_get_surface_cmd */ data -= (int32_t)(stride * (height - 1)); } - display_channel_create_surface(display, surface_id, surface->u.surface_create.width, - height, stride, surface->u.surface_create.format, data, + display_channel_create_surface(display, surface_id, surface_cmd->u.surface_create.width, + height, stride, surface_cmd->u.surface_create.format, data, reloaded_surface, // reloaded surfaces will be sent on demand !reloaded_surface); - red_surface->create = surface->release_info_ext; + red_surface->create = surface_cmd->release_info_ext; break; } case QXL_SURFACE_CMD_DESTROY: @@ -2002,7 +2003,7 @@ void display_channel_process_surface_cmd(DisplayChannel *display, RedSurfaceCmd spice_warning("avoiding destroying a surface twice"); break; } - red_surface->destroy = surface->release_info_ext; + red_surface->destroy = surface_cmd->release_info_ext; display_channel_destroy_surface(display, surface_id); break; default: diff --git a/server/display-channel.h b/server/display-channel.h index 36633d58..bbae6f1d 100644 --- a/server/display-channel.h +++ b/server/display-channel.h @@ -277,7 +277,7 @@ void display_channel_process_draw (DisplayCha RedDrawable *red_drawable, uint32_t process_commands_generation); void display_channel_process_surface_cmd (DisplayChannel *display, - RedSurfaceCmd *surface, + const RedSurfaceCmd *surface_cmd, int loadvm); void display_channel_update_compression (DisplayChannel *display, DisplayChannelClient *dcc); -- cgit v1.2.3