[Spice-devel] [PATCH 5/6] qxl abi: parse QXLOpaque.

Gerd Hoffmann kraxel at redhat.com
Wed Jun 23 04:03:46 PDT 2010


Also adapt to tyops fix (s/rop_decriptor/rop_descriptor/).
---
 common/canvas_base.c   |    2 +-
 common/gl_canvas.c     |    4 ++--
 server/red_parse_qxl.c |   23 +++++++++++++++++++++++
 server/red_worker.c    |    2 +-
 spice.proto            |    2 +-
 spice1.proto           |    2 +-
 6 files changed, 29 insertions(+), 6 deletions(-)

diff --git a/common/canvas_base.c b/common/canvas_base.c
index 090556b..6dd1f92 100644
--- a/common/canvas_base.c
+++ b/common/canvas_base.c
@@ -2521,7 +2521,7 @@ static void canvas_draw_opaque(SpiceCanvas *spice_canvas, SpiceRect *bbox, Spice
     canvas_mask_pixman(canvas, &dest_region, &opaque->mask,
                        bbox->left, bbox->top);
 
-    rop = ropd_descriptor_to_rop(opaque->rop_decriptor,
+    rop = ropd_descriptor_to_rop(opaque->rop_descriptor,
                                  ROP_INPUT_BRUSH,
                                  ROP_INPUT_SRC);
 
diff --git a/common/gl_canvas.c b/common/gl_canvas.c
index 8fdf899..64afba8 100644
--- a/common/gl_canvas.c
+++ b/common/gl_canvas.c
@@ -395,7 +395,7 @@ static void gl_canvas_draw_opaque(SpiceCanvas *spice_canvas, SpiceRect *bbox, Sp
     set_clip(canvas, bbox, clip);
     set_mask(canvas, &opaque->mask, bbox->left, bbox->top);
 
-    glc_set_op(canvas->glc, (opaque->rop_decriptor & SPICE_ROPD_INVERS_SRC) ? GLC_OP_COPY_INVERTED :
+    glc_set_op(canvas->glc, (opaque->rop_descriptor & SPICE_ROPD_INVERS_SRC) ? GLC_OP_COPY_INVERTED :
                GLC_OP_COPY);
     surface = canvas_get_image(&canvas->base, opaque->src_bitmap, FALSE);
     surface_to_image(canvas, surface, &image, 0);
@@ -405,7 +405,7 @@ static void gl_canvas_draw_opaque(SpiceCanvas *spice_canvas, SpiceRect *bbox, Sp
     pixman_image_unref(surface);
 
     set_brush(canvas, &opaque->brush);
-    set_op(canvas, opaque->rop_decriptor & ~SPICE_ROPD_INVERS_SRC);
+    set_op(canvas, opaque->rop_descriptor & ~SPICE_ROPD_INVERS_SRC);
     SET_GLC_RECT(&fill_rect, bbox);
     glc_fill_rect(canvas->glc, &fill_rect);
 
diff --git a/server/red_parse_qxl.c b/server/red_parse_qxl.c
index 7dad295..0620fcb 100644
--- a/server/red_parse_qxl.c
+++ b/server/red_parse_qxl.c
@@ -28,6 +28,17 @@ static void red_get_fill_ptr(RedMemSlotInfo *slots, int group_id,
     red->mask           = qxl->mask;
 }
 
+static void red_get_opaque_ptr(RedMemSlotInfo *slots, int group_id,
+                               SpiceOpaque *red, QXLOpaque *qxl)
+{
+   red->src_bitmap     = qxl->src_bitmap;
+   red->src_area       = qxl->src_area;
+   red->brush          = qxl->brush;
+   red->rop_descriptor = qxl->rop_descriptor;
+   red->scale_mode     = qxl->scale_mode;
+   red->mask           = qxl->mask;
+}
+
 static void red_get_alpha_blend_ptr(RedMemSlotInfo *slots, int group_id,
                                     SpiceAlphaBlnd *red, QXLAlphaBlnd *qxl)
 {
@@ -85,6 +96,9 @@ void red_get_drawable(RedMemSlotInfo *slots, int group_id,
     case QXL_DRAW_FILL:
         red_get_fill_ptr(slots, group_id, &red->u.fill, &qxl->u.fill);
         break;
+    case QXL_DRAW_OPAQUE:
+        red_get_opaque_ptr(slots, group_id, &red->u.opaque, &qxl->u.opaque);
+        break;
     case QXL_DRAW_INVERS:
         red->u.invers = qxl->u.invers;
         break;
@@ -105,6 +119,9 @@ void red_get_drawable(RedMemSlotInfo *slots, int group_id,
     case QXL_DRAW_WHITENESS:
         red->u.whiteness = qxl->u.whiteness;
         break;
+    default:
+        red_error("unknown type");
+        break;
     };
 }
 
@@ -139,6 +156,9 @@ void red_get_compat_drawable(RedMemSlotInfo *slots, int group_id,
     case QXL_DRAW_FILL:
         red_get_fill_ptr(slots, group_id, &red->u.fill, &qxl->u.fill);
         break;
+    case QXL_DRAW_OPAQUE:
+        red_get_opaque_ptr(slots, group_id, &red->u.opaque, &qxl->u.opaque);
+        break;
     case QXL_DRAW_INVERS:
         red->u.invers = qxl->u.invers;
         break;
@@ -159,6 +179,9 @@ void red_get_compat_drawable(RedMemSlotInfo *slots, int group_id,
     case QXL_DRAW_WHITENESS:
         red->u.whiteness = qxl->u.whiteness;
         break;
+    default:
+        red_error("unknown type");
+        break;
     };
 }
 
diff --git a/server/red_worker.c b/server/red_worker.c
index a8f2e4b..6b054e0 100644
--- a/server/red_worker.c
+++ b/server/red_worker.c
@@ -7747,7 +7747,7 @@ static void red_lossy_send_qxl_draw_opaque(RedWorker *worker,
     BitmapData src_bitmap_data;
     BitmapData brush_bitmap_data;
 
-    rop = drawable->u.opaque.rop_decriptor;
+    rop = drawable->u.opaque.rop_descriptor;
     src_allowed_lossy = !((rop & SPICE_ROPD_OP_OR) ||
                           (rop & SPICE_ROPD_OP_AND) ||
                           (rop & SPICE_ROPD_OP_XOR));
diff --git a/spice.proto b/spice.proto
index 9f6fc98..1474d50 100644
--- a/spice.proto
+++ b/spice.proto
@@ -667,7 +667,7 @@ channel DisplayChannel : BaseChannel {
 	    Image *src_bitmap;
 	    Rect src_area;
 	    Brush brush;
-	    ropd rop_decriptor;
+	    ropd rop_descriptor;
 	    image_scale_mode scale_mode;
 	    QMask mask @outvar(mask);
 	} data;
diff --git a/spice1.proto b/spice1.proto
index 1613ffb..03143b2 100644
--- a/spice1.proto
+++ b/spice1.proto
@@ -614,7 +614,7 @@ channel DisplayChannel : BaseChannel {
 	    Image *src_bitmap;
 	    Rect src_area;
 	    Brush brush;
-	    ropd rop_decriptor;
+	    ropd rop_descriptor;
 	    image_scale_mode scale_mode;
 	    QMask mask @outvar(mask);
 	} data;
-- 
1.6.5.2



More information about the Spice-devel mailing list