summaryrefslogtreecommitdiffstats
path: root/common/gl_canvas.c
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2010-06-25 16:20:25 +0200
committerGerd Hoffmann <kraxel@redhat.com>2010-06-30 22:34:57 +0200
commitf87f63fdf58a16e62c6fcb3c4c7e11f801292ea9 (patch)
tree19eb3c0fd45ea48182fa1538bca1bd07c630c3bb /common/gl_canvas.c
parent905c6283d5f6c50ffe637f4dcb315c1345c0a0b2 (diff)
downloadspice-f87f63fdf58a16e62c6fcb3c4c7e11f801292ea9.tar.gz
spice-f87f63fdf58a16e62c6fcb3c4c7e11f801292ea9.tar.xz
spice-f87f63fdf58a16e62c6fcb3c4c7e11f801292ea9.zip
qxl-abi: handle clip rect and path references.
red_parse_qxl.c starts to follow QXLPHYSICAL references and build up data structures. Can zap a bunch of get_virt calls in red_worker.c, followed by cleanups. (de-) marshaller needs updates to deal with that. Also I suspect with the get_virt() calls being gone we can offload more work to generated marshaller code. client doesn't build.
Diffstat (limited to 'common/gl_canvas.c')
-rw-r--r--common/gl_canvas.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/common/gl_canvas.c b/common/gl_canvas.c
index 059bd04a..59fb1a7a 100644
--- a/common/gl_canvas.c
+++ b/common/gl_canvas.c
@@ -111,17 +111,15 @@ static pixman_image_t *canvas_surf_to_trans_surf(GLCImage *image,
return ret;
}
-static GLCPath get_path(GLCanvas *canvas, void *addr)
+static GLCPath get_path(GLCanvas *canvas, SpicePath *s)
{
GLCPath path = glc_path_create(canvas->glc);
- uint32_t* data_size = (uint32_t*)addr;
- uint32_t more = *data_size;
-
- SpicePathSeg* seg = (SpicePathSeg*)(data_size + 1);
+ uint32_t more = s->size;
+ SpicePathSeg* seg = s->segments;
do {
uint32_t flags = seg->flags;
- SpicePointFix* point = (SpicePointFix*)seg->data;
+ SpicePointFix* point = seg->points;
SpicePointFix* end_point = point + seg->count;
ASSERT(point < end_point);
more -= ((unsigned long)end_point - (unsigned long)seg);
@@ -178,11 +176,11 @@ static void set_clip(GLCanvas *canvas, SpiceRect *bbox, SpiceClip *clip)
case SPICE_CLIP_TYPE_NONE:
break;
case SPICE_CLIP_TYPE_RECTS: {
- uint32_t *n = (uint32_t *)SPICE_GET_ADDRESS(clip->data);
- SpiceRect *now = (SpiceRect *)(n + 1);
- SpiceRect *end = now + *n;
+ uint32_t n = clip->rects->num_rects;
+ SpiceRect *now = clip->rects->rects;
+ SpiceRect *end = now + n;
- if (*n == 0) {
+ if (n == 0) {
rect.x = rect.y = 0;
rect.width = rect.height = 0;
glc_clip_rect(canvas->glc, &rect, GLC_CLIP_OP_SET);