[Spice-commits] 2 commits - common/canvas_base.c common/gdi_canvas.c python_modules/demarshal.py

Alexander Larsson alexl at kemper.freedesktop.org
Thu Jul 1 07:46:31 PDT 2010


 common/canvas_base.c        |    4 ++--
 common/gdi_canvas.c         |   36 ++++++++++++++++++------------------
 python_modules/demarshal.py |    4 ++--
 3 files changed, 22 insertions(+), 22 deletions(-)

New commits:
commit 7e0099e18e98452d909d76997258ed0f44cf9a19
Author: Alexander Larsson <alexl at redhat.com>
Date:   Thu Jul 1 16:46:12 2010 +0200

    Fix build on win32

diff --git a/common/canvas_base.c b/common/canvas_base.c
index 866b4e6..319c4fd 100644
--- a/common/canvas_base.c
+++ b/common/canvas_base.c
@@ -3079,7 +3079,7 @@ static void canvas_draw_stroke(SpiceCanvas *spice_canvas, SpiceRect *bbox,
     };
     SpicePathSeg *seg;
     StrokeLines lines;
-    int i;
+    unsigned int i;
     int dashed;
 
     pixman_region32_init_rect(&gc.dest_region,
@@ -3140,7 +3140,7 @@ static void canvas_draw_stroke(SpiceCanvas *spice_canvas, SpiceRect *bbox,
 
         if (stroke->attr.flags & SPICE_LINE_FLAGS_START_WITH_GAP) {
             gc.base.dash[stroke->attr.style_nseg - 1] = fix_to_int(style[0]);
-            for (i = 0; i < stroke->attr.style_nseg - 1; i++) {
+            for (i = 0; i < (unsigned int)(stroke->attr.style_nseg - 1); i++) {
                 gc.base.dash[i] = fix_to_int(style[i+1]);
             }
             gc.base.dashOffset = gc.base.dash[0];
diff --git a/common/gdi_canvas.c b/common/gdi_canvas.c
index 52ae0a6..e348994 100644
--- a/common/gdi_canvas.c
+++ b/common/gdi_canvas.c
@@ -311,11 +311,11 @@ uint32_t raster_ops[] = {
 static void set_path(GdiCanvas *canvas, SpicePath *s)
 {
     SpicePathSeg* seg = (SpicePathSeg*)s->segments;
-    int i;
+    unsigned int i;
 
     for (i = 0; i < s->num_segments; i++) {
         uint32_t flags = seg->flags;
-        SpicePointFix* point = (SpicePointFix*)seg->data;
+        SpicePointFix* point = seg->points;
         SpicePointFix* end_point = point + seg->count;
         ASSERT(point < end_point);
         seg = (SpicePathSeg*)end_point;
@@ -391,10 +391,10 @@ static void set_clip(GdiCanvas *canvas, SpiceClip *clip)
         }
         break;
     case SPICE_CLIP_TYPE_RECTS: {
-        uint32_t *n = (uint32_t *)SPICE_GET_ADDRESS(clip->data);
+        uint32_t n = clip->rects->num_rects;
 
-        SpiceRect *now = (SpiceRect *)(n + 1);
-        SpiceRect *end = now + *n;
+        SpiceRect *now = clip->rects->rects;
+        SpiceRect *end = now + n;
 
         if (now < end) {
             HRGN main_hrgn;
@@ -1026,10 +1026,10 @@ static void gdi_canvas_draw_fill(SpiceCanvas *spice_canvas, SpiceRect *bbox, Spi
     if (brush_lock) {
         RecurciveLock b_lock(*brush_lock);
         gdi_draw_bitmap_redrop(canvas->dc, bbox, bbox, canvas->dc, &bitmapmask,
-                               fill->rop_decriptor, fill->brush.type != SPICE_BRUSH_TYPE_NONE);
+                               fill->rop_descriptor, fill->brush.type != SPICE_BRUSH_TYPE_NONE);
     } else {
         gdi_draw_bitmap_redrop(canvas->dc, bbox, bbox, canvas->dc, &bitmapmask,
-                               fill->rop_decriptor, fill->brush.type != SPICE_BRUSH_TYPE_NONE);
+                               fill->rop_descriptor, fill->brush.type != SPICE_BRUSH_TYPE_NONE);
     }
 
     free_mask(&bitmapmask);
@@ -1052,7 +1052,7 @@ static void gdi_canvas_draw_copy(SpiceCanvas *spice_canvas, SpiceRect *bbox, Spi
         set_scale_mode(canvas, copy->scale_mode);
         set_clip(canvas, clip);
         gdi_draw_bitmap_redrop(canvas->dc, &copy->src_area, bbox, gdi_surface->dc,
-                               &bitmapmask, copy->rop_decriptor, 0);
+                               &bitmapmask, copy->rop_descriptor, 0);
     } else {
         surface = canvas_get_image(&canvas->base, copy->src_bitmap, FALSE);
         pixman_data = (PixmanData *)pixman_image_get_destroy_data(surface);
@@ -1069,13 +1069,13 @@ static void gdi_canvas_draw_copy(SpiceCanvas *spice_canvas, SpiceRect *bbox, Spi
             dc = create_compatible_dc();
             prev_bitmap = (HBITMAP)SelectObject(dc, pixman_data->bitmap);
             gdi_draw_bitmap_redrop(canvas->dc, &copy->src_area, bbox, dc,
-                                   &bitmapmask, copy->rop_decriptor, 0);
+                                   &bitmapmask, copy->rop_descriptor, 0);
             SelectObject(dc, prev_bitmap);
             DeleteObject(dc);
             ReleaseMutex(pixman_data->mutex);
         } else {
             gdi_draw_image(canvas->dc, &copy->src_area, bbox, surface, &bitmapmask,
-                           copy->rop_decriptor, 0);
+                           copy->rop_descriptor, 0);
         }
 
         pixman_image_unref(surface);
@@ -1309,7 +1309,7 @@ static void gdi_canvas_draw_opaque(SpiceCanvas *spice_canvas, SpiceRect *bbox, S
     uint8_t rop3;
     RecurciveMutex *brush_lock;
 
-    rop3 = calc_rop3_src_brush(opaque->rop_decriptor);
+    rop3 = calc_rop3_src_brush(opaque->rop_descriptor);
 
     gdi_surface = (GdiCanvas *)canvas_get_surface(&canvas->base, opaque->src_bitmap);
     if (gdi_surface) {
@@ -1384,7 +1384,7 @@ static void gdi_canvas_draw_blend(SpiceCanvas *spice_canvas, SpiceRect *bbox, Sp
         set_scale_mode(canvas, blend->scale_mode);
         set_clip(canvas, clip);
         gdi_draw_bitmap_redrop(canvas->dc, &blend->src_area, bbox, gdi_surface->dc,
-                               &bitmapmask, blend->rop_decriptor, 0);
+                               &bitmapmask, blend->rop_descriptor, 0);
     }  else {
         surface = canvas_get_image(&canvas->base, blend->src_bitmap, FALSE);
         pixman_data = (PixmanData *)pixman_image_get_destroy_data(surface);
@@ -1401,13 +1401,13 @@ static void gdi_canvas_draw_blend(SpiceCanvas *spice_canvas, SpiceRect *bbox, Sp
             dc = create_compatible_dc();
             prev_bitmap = (HBITMAP)SelectObject(dc, pixman_data->bitmap);
             gdi_draw_bitmap_redrop(canvas->dc, &blend->src_area, bbox, dc,
-                                   &bitmapmask, blend->rop_decriptor, 0);
+                                   &bitmapmask, blend->rop_descriptor, 0);
             SelectObject(dc, prev_bitmap);
             DeleteObject(dc);
             ReleaseMutex(pixman_data->mutex);
         } else {
             gdi_draw_image(canvas->dc, &blend->src_area, bbox, surface,
-				           &bitmapmask, blend->rop_decriptor, 0);
+				           &bitmapmask, blend->rop_descriptor, 0);
         }
 
         pixman_image_unref(surface);
@@ -1749,12 +1749,12 @@ static void gdi_canvas_draw_stroke(SpiceCanvas *spice_canvas, SpiceRect *bbox, S
         user_style = gdi_get_userstyle(canvas, stroke->attr.style_nseg,
                                        stroke->attr.style,
                                        !!(stroke->attr.flags & SPICE_LINE_FLAGS_START_WITH_GAP));
-        hpen = ExtCreatePen(PS_GEOMETRIC | PS_USERSTYLE,
-                            1.0,
+        hpen = ExtCreatePen(PS_COSMETIC | PS_USERSTYLE,
+                            1,
                             &logbrush, stroke->attr.style_nseg, (DWORD *)user_style);
     } else {
-        hpen = ExtCreatePen(PS_GEOMETRIC,
-                            1.0,
+        hpen = ExtCreatePen(PS_COSMETIC,
+                            1,
                             &logbrush, 0, NULL);
     }
     prev_hpen = (HPEN)SelectObject(canvas->dc, hpen);
commit 4c74e73e1da95db388a57ef05900b7b7a65dd32b
Author: Alexander Larsson <alexl at redhat.com>
Date:   Thu Jul 1 16:45:04 2010 +0200

    Fix 32bit failure in demarshaller
    
    Due to a typo we always read offsets as pointers, never as SPICE_ADDRESS.

diff --git a/python_modules/demarshal.py b/python_modules/demarshal.py
index b819513..023c3f6 100644
--- a/python_modules/demarshal.py
+++ b/python_modules/demarshal.py
@@ -837,14 +837,14 @@ def write_ptr_info_check(writer):
             is_ptr = "ptr_info[%s].is_ptr" % index
             dest = "ptr_info[%s].dest" % index
             with writer.if_block("%s == 0" % offset, newline=False):
-                with writer.if_block("%s == 0" % is_ptr, newline=False):
+                with writer.if_block(is_ptr, newline=False):
                     writer.assign("*(void **)(%s)" % dest, "NULL")
                 with writer.block(" else"):
                     writer.assign("*(SPICE_ADDRESS *)(%s)" % dest, "0")
             with writer.block(" else"):
                 writer.comment("Align to 32 bit").newline()
                 writer.assign("end", "(uint8_t *)SPICE_ALIGN((size_t)end, 4)")
-                with writer.if_block("%s == 0" % is_ptr, newline=False):
+                with writer.if_block(is_ptr, newline=False):
                     writer.assign("*(void **)(%s)" % dest, "(void *)end")
                 with writer.block(" else"):
                     writer.assign("*(SPICE_ADDRESS *)(%s)" % dest, "(SPICE_ADDRESS)end")


More information about the Spice-commits mailing list