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.
This commit is contained in:
Gerd Hoffmann 2010-09-07 11:00:08 +02:00
parent 4efeef3302
commit 4207c49fe2
3 changed files with 18 additions and 14 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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;
}