summaryrefslogtreecommitdiffstats
path: root/common
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
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')
-rw-r--r--common/canvas_base.c9
-rw-r--r--common/gl_canvas.c18
2 files changed, 12 insertions, 15 deletions
diff --git a/common/canvas_base.c b/common/canvas_base.c
index c5ab88a2..ba0fb214 100644
--- a/common/canvas_base.c
+++ b/common/canvas_base.c
@@ -1991,13 +1991,12 @@ static void canvas_clip_pixman(CanvasBase *canvas,
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);
+ uint32_t n = clip->rects->num_rects;
+ SpiceRect *now = clip->rects->rects;
pixman_region32_t clip;
- if (spice_pixman_region32_init_rects(&clip, now, *n)) {
+ if (spice_pixman_region32_init_rects(&clip, now, n)) {
pixman_region32_intersect(dest_region, dest_region, &clip);
pixman_region32_fini(&clip);
}
@@ -3191,7 +3190,7 @@ static void canvas_draw_stroke(SpiceCanvas *spice_canvas, SpiceRect *bbox,
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);
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);