summaryrefslogtreecommitdiffstats
path: root/common/gl_canvas.c
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2010-07-05 20:45:13 +0200
committerAlexander Larsson <alexl@redhat.com>2010-07-05 20:45:13 +0200
commitf39d64f40bca094396d5002dcfcd38eaa281c9af (patch)
tree5e25c5d01bf1bd390f119ec3146f4f6b56dee2b4 /common/gl_canvas.c
parent6dcf43912e752b8c61199017718ccfb067b45576 (diff)
downloadspice-f39d64f40bca094396d5002dcfcd38eaa281c9af.tar.gz
spice-f39d64f40bca094396d5002dcfcd38eaa281c9af.tar.xz
spice-f39d64f40bca094396d5002dcfcd38eaa281c9af.zip
Convert SpicePath.segments to a pointer array
Diffstat (limited to 'common/gl_canvas.c')
-rw-r--r--common/gl_canvas.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/common/gl_canvas.c b/common/gl_canvas.c
index 3e02a25e..f0e10dd7 100644
--- a/common/gl_canvas.c
+++ b/common/gl_canvas.c
@@ -115,20 +115,18 @@ static GLCPath get_path(GLCanvas *canvas, SpicePath *s)
{
GLCPath path = glc_path_create(canvas->glc);
int i;
- SpicePathSeg* seg = (SpicePathSeg*)s->segments;
for (i = 0; i < s->num_segments; i++) {
- uint32_t flags = seg->flags;
+ SpicePathSeg* seg = s->segments[i];
SpicePointFix* point = seg->points;
SpicePointFix* end_point = point + seg->count;
- seg = (SpicePathSeg*)end_point;
- if (flags & SPICE_PATH_BEGIN) {
+ if (seg->flags & SPICE_PATH_BEGIN) {
glc_path_move_to(path, fix_to_double(point->x), fix_to_double(point->y));
point++;
}
- if (flags & SPICE_PATH_BEZIER) {
+ if (seg->flags & SPICE_PATH_BEZIER) {
ASSERT((point - end_point) % 3 == 0);
for (; point + 2 < end_point; point += 3) {
glc_path_curve_to(path,
@@ -141,8 +139,8 @@ static GLCPath get_path(GLCanvas *canvas, SpicePath *s)
glc_path_line_to(path, fix_to_double(point->x), fix_to_double(point->y));
}
}
- if (flags & SPICE_PATH_END) {
- if (flags & SPICE_PATH_CLOSE) {
+ if (seg->flags & SPICE_PATH_END) {
+ if (seg->flags & SPICE_PATH_CLOSE) {
glc_path_close(path);
}
}