diff options
author | Frediano Ziglio <fziglio@redhat.com> | 2016-09-17 06:56:17 +0100 |
---|---|---|
committer | Frediano Ziglio <fziglio@redhat.com> | 2016-09-27 14:29:39 +0100 |
commit | 05150fbe3457625fca0ed73edc419f4fb353265f (patch) | |
tree | 2c81bdda1efbfa7631d3cb0a0e9d6cdb73d21c7b | |
parent | a874ebadff3545bf0804119ed28c7a97f04ddccf (diff) |
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 <fziglio@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
-rw-r--r-- | server/display-channel.c | 23 | ||||
-rw-r--r-- | 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); |