diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2010-06-22 10:59:52 +0200 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2010-06-29 12:30:19 +0200 |
commit | 11034dda428865e442dd2c981851500ed96b9a0c (patch) | |
tree | c04e6a09c35d989e318f130c6cbc21ecf624b2c3 /server/red_parse_qxl.c | |
parent | c17fdfd053b9520309a45a79b949a610a74efd3e (diff) | |
download | spice-11034dda428865e442dd2c981851500ed96b9a0c.tar.gz spice-11034dda428865e442dd2c981851500ed96b9a0c.tar.xz spice-11034dda428865e442dd2c981851500ed96b9a0c.zip |
qxl abi: parse QXLDrawable.
Diffstat (limited to 'server/red_parse_qxl.c')
-rw-r--r-- | server/red_parse_qxl.c | 88 |
1 files changed, 88 insertions, 0 deletions
diff --git a/server/red_parse_qxl.c b/server/red_parse_qxl.c new file mode 100644 index 00000000..b22cb836 --- /dev/null +++ b/server/red_parse_qxl.c @@ -0,0 +1,88 @@ +/* -*- Mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */ +/* + Copyright (C) 2009,2010 Red Hat, Inc. + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. +*/ + +#include "red_common.h" +#include "red_memslots.h" +#include "red_parse_qxl.h" + +void red_get_drawable(RedMemSlotInfo *slots, int group_id, + RedDrawable *red, SPICE_ADDRESS addr) +{ + QXLDrawable *qxl; + int i; + + qxl = (QXLDrawable *)get_virt(slots, addr, sizeof(*qxl), group_id); + red->release_info = &qxl->release_info; + + red->bbox = qxl->bbox; + red->clip = qxl->clip; + red->effect = qxl->effect; + red->mm_time = qxl->mm_time; + red->self_bitmap = qxl->self_bitmap; + red->self_bitmap_area = qxl->self_bitmap_area; + red->surface_id = qxl->surface_id; + + for (i = 0; i < 3; i++) { + red->surfaces_dest[i] = qxl->surfaces_dest[i]; + red->surfaces_rects[i] = qxl->surfaces_rects[i]; + } + + red->type = qxl->type; + switch (red->type) { + case QXL_DRAW_ALPHA_BLEND: + red->u.alpha_blend = qxl->u.alpha_blend; + break; + case QXL_DRAW_BLACKNESS: + red->u.blackness = qxl->u.blackness; + break; + case QXL_DRAW_BLEND: + red->u.blend = qxl->u.blend; + break; + case QXL_DRAW_COPY: + red->u.copy = qxl->u.copy; + break; + case QXL_DRAW_FILL: + red->u.fill = qxl->u.fill; + break; + case QXL_DRAW_INVERS: + red->u.invers = qxl->u.invers; + break; + case QXL_DRAW_NOP: + break; + case QXL_DRAW_ROP3: + red->u.rop3 = qxl->u.rop3; + break; + case QXL_DRAW_STROKE: + red->u.stroke = qxl->u.stroke; + break; + case QXL_DRAW_TEXT: + red->u.text = qxl->u.text; + break; + case QXL_DRAW_TRANSPARENT: + red->u.transparent = qxl->u.transparent; + break; + case QXL_DRAW_WHITENESS: + red->u.whiteness = qxl->u.whiteness; + break; + }; +} + +void red_put_drawable(RedDrawable *red) +{ + /* nothing yet */ +} |