summaryrefslogtreecommitdiffstats
path: root/common/gdi_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/gdi_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/gdi_canvas.c')
-rw-r--r--common/gdi_canvas.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/common/gdi_canvas.c b/common/gdi_canvas.c
index e3489941..9c520024 100644
--- a/common/gdi_canvas.c
+++ b/common/gdi_canvas.c
@@ -310,17 +310,14 @@ uint32_t raster_ops[] = {
static void set_path(GdiCanvas *canvas, SpicePath *s)
{
- SpicePathSeg* seg = (SpicePathSeg*)s->segments;
unsigned int i;
for (i = 0; i < s->num_segments; i++) {
- uint32_t flags = seg->flags;
+ SpicePathSeg* seg = s->segments[0];
SpicePointFix* point = seg->points;
SpicePointFix* end_point = point + seg->count;
- ASSERT(point < end_point);
- seg = (SpicePathSeg*)end_point;
- if (flags & SPICE_PATH_BEGIN) {
+ if (seg->flags & SPICE_PATH_BEGIN) {
BeginPath(canvas->dc);
if (!MoveToEx(canvas->dc, (int)fix_to_double(point->x), (int)fix_to_double(point->y),
NULL)) {
@@ -330,7 +327,7 @@ static void set_path(GdiCanvas *canvas, SpicePath *s)
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) {
POINT points[3];
@@ -355,9 +352,9 @@ static void set_path(GdiCanvas *canvas, SpicePath *s)
}
}
- if (flags & SPICE_PATH_END) {
+ if (seg->flags & SPICE_PATH_END) {
- if (flags & SPICE_PATH_CLOSE) {
+ if (seg->flags & SPICE_PATH_CLOSE) {
if (!CloseFigure(canvas->dc)) {
CANVAS_ERROR("CloseFigure failed");
}