summaryrefslogtreecommitdiffstats
path: root/common/gdi_canvas.c
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2010-07-05 20:45:13 +0200
committerMarc-André Lureau <marcandre.lureau@gmail.com>2012-03-20 15:25:47 +0100
commit09d9a18702a48e83ec9b2c6f7c2cd47e6a5b87a1 (patch)
treed9ff4c116b3555b7cdc57318a913b6a76f4f1101 /common/gdi_canvas.c
parentbc8d26bfc0ba349889bedcb25e3af1eafd106fd5 (diff)
downloadspice-common-09d9a18702a48e83ec9b2c6f7c2cd47e6a5b87a1.tar.gz
spice-common-09d9a18702a48e83ec9b2c6f7c2cd47e6a5b87a1.tar.xz
spice-common-09d9a18702a48e83ec9b2c6f7c2cd47e6a5b87a1.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 e348994..9c52002 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");
}