diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2010-09-07 11:00:08 +0200 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2010-09-14 10:41:49 +0200 |
commit | 4207c49fe2a628aaafd2ff7be12b1c6680bfe6d3 (patch) | |
tree | 99446e90efcc60cedc6c42528bbc8429f509f555 | |
parent | 4efeef330249819189a7a99e2dc65d2b3bc2f17b (diff) | |
download | spice-4207c49fe2a628aaafd2ff7be12b1c6680bfe6d3.tar.gz spice-4207c49fe2a628aaafd2ff7be12b1c6680bfe6d3.tar.xz spice-4207c49fe2a628aaafd2ff7be12b1c6680bfe6d3.zip |
move command flags handling to the qxl parser
Pass through command flags to the qxl parser, so we can hide all
compat bits for spice 0.4 within the qxl parser.
-rw-r--r-- | server/red_parse_qxl.c | 18 | ||||
-rw-r--r-- | server/red_parse_qxl.h | 4 | ||||
-rw-r--r-- | server/red_worker.c | 10 |
3 files changed, 18 insertions, 14 deletions
diff --git a/server/red_parse_qxl.c b/server/red_parse_qxl.c index e0eba20f..adeadd63 100644 --- a/server/red_parse_qxl.c +++ b/server/red_parse_qxl.c @@ -734,8 +734,8 @@ static void red_put_clip(SpiceClip *red) } } -void red_get_drawable(RedMemSlotInfo *slots, int group_id, - RedDrawable *red, QXLPHYSICAL addr) +static void red_get_native_drawable(RedMemSlotInfo *slots, int group_id, + RedDrawable *red, QXLPHYSICAL addr, uint32_t flags) { QXLDrawable *qxl; int i; @@ -807,8 +807,8 @@ void red_get_drawable(RedMemSlotInfo *slots, int group_id, }; } -void red_get_compat_drawable(RedMemSlotInfo *slots, int group_id, - RedDrawable *red, QXLPHYSICAL addr) +static void red_get_compat_drawable(RedMemSlotInfo *slots, int group_id, + RedDrawable *red, QXLPHYSICAL addr, uint32_t flags) { QXLCompatDrawable *qxl; @@ -885,6 +885,16 @@ void red_get_compat_drawable(RedMemSlotInfo *slots, int group_id, }; } +void red_get_drawable(RedMemSlotInfo *slots, int group_id, + RedDrawable *red, QXLPHYSICAL addr, uint32_t flags) +{ + if (flags & QXL_COMMAND_FLAG_COMPAT) { + red_get_compat_drawable(slots, group_id, red, addr, flags); + } else { + red_get_native_drawable(slots, group_id, red, addr, flags); + } +} + void red_put_drawable(RedDrawable *red) { red_put_clip(&red->clip); diff --git a/server/red_parse_qxl.h b/server/red_parse_qxl.h index 1d972496..5de03256 100644 --- a/server/red_parse_qxl.h +++ b/server/red_parse_qxl.h @@ -113,9 +113,7 @@ typedef struct RedCursorCmd { void red_get_rect_ptr(SpiceRect *red, QXLRect *qxl); void red_get_drawable(RedMemSlotInfo *slots, int group_id, - RedDrawable *red, QXLPHYSICAL addr); -void red_get_compat_drawable(RedMemSlotInfo *slots, int group_id, - RedDrawable *red, QXLPHYSICAL addr); + RedDrawable *red, QXLPHYSICAL addr, uint32_t flags); void red_put_drawable(RedDrawable *red); void red_put_image(SpiceImage *red); diff --git a/server/red_worker.c b/server/red_worker.c index 74d26fec..f4e6f7cc 100644 --- a/server/red_worker.c +++ b/server/red_worker.c @@ -4350,13 +4350,9 @@ static int red_process_commands(RedWorker *worker, uint32_t max_pipe_size, int * switch (ext_cmd.cmd.type) { case QXL_CMD_DRAW: { RedDrawable *drawable = spice_new0(RedDrawable, 1); - if (ext_cmd.flags & QXL_COMMAND_FLAG_COMPAT) { - red_get_compat_drawable(&worker->mem_slots, ext_cmd.group_id, - drawable, ext_cmd.cmd.data); - } else { - red_get_drawable(&worker->mem_slots, ext_cmd.group_id, - drawable, ext_cmd.cmd.data); - } + + red_get_drawable(&worker->mem_slots, ext_cmd.group_id, + drawable, ext_cmd.cmd.data, ext_cmd.flags); red_process_drawable(worker, drawable, ext_cmd.group_id); break; } |