[Spice-commits] 3 commits - client/display_channel.cpp common/canvas_base.c common/gdi_canvas.c common/gl_canvas.c server/red_worker.c spice1.proto spice.proto
Alexander Larsson
alexl at kemper.freedesktop.org
Thu Jun 24 05:33:47 PDT 2010
client/display_channel.cpp | 2 -
common/canvas_base.c | 3 --
common/gdi_canvas.c | 6 -----
common/gl_canvas.c | 6 -----
server/red_worker.c | 50 ++++++++++++++++-----------------------------
spice.proto | 39 ++++++++++++++++-------------------
spice1.proto | 11 +++------
7 files changed, 41 insertions(+), 76 deletions(-)
New commits:
commit 897e5633c2d4e0d8fe91986b6e030dd1436b8fa8
Author: Alexander Larsson <alexl at redhat.com>
Date: Thu Jun 24 14:33:06 2010 +0200
spice.proto: surface_create.format is of type surface_fmt
diff --git a/spice.proto b/spice.proto
index d66445d..1aa2788 100644
--- a/spice.proto
+++ b/spice.proto
@@ -770,7 +770,7 @@ channel DisplayChannel : BaseChannel {
uint32 surface_id;
uint32 width;
uint32 height;
- uint32 format;
+ surface_fmt format;
surface_flags flags;
} @ctype(SpiceMsgSurfaceCreate) surface_create;
commit 7a9c42704f4efd70543f209ee3f46a3959dc5962
Author: Alexander Larsson <alexl at redhat.com>
Date: Thu Jun 24 14:31:01 2010 +0200
Use smaller size for enums and flags on the network
This makes the protocol more compact. This was mainly done for the commonly
used types. Some seldom used ones are still 32bit for future compatibility.
diff --git a/spice.proto b/spice.proto
index acb9488..d66445d 100644
--- a/spice.proto
+++ b/spice.proto
@@ -64,7 +64,7 @@ enum32 notify_visibility {
HIGH,
};
-flags32 mouse_mode {
+flags16 mouse_mode {
SERVER,
CLIENT,
};
@@ -251,27 +251,27 @@ channel MainChannel : BaseChannel {
} @ctype(SpiceMsgcMainAgentTokens) agent_token;
};
-enum32 clip_type {
+enum8 clip_type {
NONE,
RECTS
};
-flags32 path_flags { /* TODO: C enum names changes */
+flags8 path_flags { /* TODO: C enum names changes */
BEGIN = 0,
END = 1,
CLOSE = 3,
BEZIER = 4,
} @prefix(SPICE_PATH_);
-enum32 video_codec_type {
+enum8 video_codec_type {
MJPEG = 1,
};
-flags32 stream_flags {
+flags8 stream_flags {
TOP_DOWN = 0,
};
-enum32 brush_type {
+enum8 brush_type {
NONE,
SOLID,
PATTERN,
@@ -361,7 +361,7 @@ enum8 line_join {
MITER,
};
-flags16 string_flags {
+flags8 string_flags {
RASTER_A1,
RASTER_A4,
RASTER_A8,
@@ -382,7 +382,7 @@ enum32 surface_fmt {
32_ARGB = 96
};
-flags16 alpha_flags {
+flags8 alpha_flags {
DEST_HAS_ALPHA,
SRC_SURFACE_HAS_ALPHA
};
@@ -787,13 +787,13 @@ channel DisplayChannel : BaseChannel {
} init = 101;
};
-flags32 keyboard_modifier_flags {
+flags16 keyboard_modifier_flags {
SCROLL_LOCK,
NUM_LOCK,
CAPS_LOCK
};
-enum32 mouse_button {
+enum8 mouse_button {
INVALID,
LEFT,
MIDDLE,
@@ -802,7 +802,7 @@ enum32 mouse_button {
DOWN,
};
-flags32 mouse_button_mask {
+flags16 mouse_button_mask {
LEFT,
MIDDLE,
RIGHT
@@ -857,7 +857,7 @@ channel InputsChannel : BaseChannel {
Empty mouse_motion_ack = 111;
};
-enum16 cursor_type {
+enum8 cursor_type {
ALPHA,
MONO,
COLOR4,
@@ -867,7 +867,7 @@ enum16 cursor_type {
COLOR32,
};
-flags32 cursor_flags {
+flags16 cursor_flags {
NONE, /* Means no cursor */
CACHE_ME,
FROM_CACHE,
@@ -924,13 +924,13 @@ channel CursorChannel : BaseChannel {
Empty inval_all;
};
-enum32 audio_data_mode {
+enum16 audio_data_mode {
INVALID,
RAW,
CELT_0_5_1,
};
-enum32 audio_fmt {
+enum16 audio_fmt {
INVALID,
S16,
};
@@ -984,7 +984,7 @@ channel RecordChannel : BaseChannel {
} start_mark;
};
-enum32 tunnel_service_type {
+enum16 tunnel_service_type {
INVALID,
GENERIC,
IPP,
commit 9655dc30e99ee0fd75cce4de7f436849c15228d1
Author: Alexander Larsson <alexl at redhat.com>
Date: Thu Jun 24 14:30:00 2010 +0200
Remove support for clip by path
This is not supported currently anyway and was not generated before.
diff --git a/client/display_channel.cpp b/client/display_channel.cpp
index 5469653..95840b5 100644
--- a/client/display_channel.cpp
+++ b/client/display_channel.cpp
@@ -1294,7 +1294,7 @@ void DisplayChannel::set_clip_rects(const SpiceClip& clip, uint32_t& num_clip_re
num_clip_rects = 0;
clip_rects = NULL;
break;
- case SPICE_CLIP_TYPE_PATH:
+ default:
THROW("unexpected clip type");
}
}
diff --git a/common/canvas_base.c b/common/canvas_base.c
index 2b00f09..700fcb4 100644
--- a/common/canvas_base.c
+++ b/common/canvas_base.c
@@ -2004,9 +2004,6 @@ static void canvas_clip_pixman(CanvasBase *canvas,
break;
}
- case SPICE_CLIP_TYPE_PATH:
- CANVAS_ERROR("clip paths not supported anymore");
- break;
default:
CANVAS_ERROR("invalid clip type");
}
diff --git a/common/gdi_canvas.c b/common/gdi_canvas.c
index 76a7674..594eacf 100644
--- a/common/gdi_canvas.c
+++ b/common/gdi_canvas.c
@@ -430,12 +430,6 @@ static void set_clip(GdiCanvas *canvas, SpiceClip *clip)
}
break;
}
- case SPICE_CLIP_TYPE_PATH:
- set_path(canvas, SPICE_GET_ADDRESS(clip->data));
- if (SelectClipPath(canvas->dc, RGN_COPY) == ERROR) {
- CANVAS_ERROR("Unable to SelectClipPath");
- }
- break;
default:
CANVAS_ERROR("invalid clip type");
}
diff --git a/common/gl_canvas.c b/common/gl_canvas.c
index 688b635..b16f25f 100644
--- a/common/gl_canvas.c
+++ b/common/gl_canvas.c
@@ -198,12 +198,6 @@ static void set_clip(GLCanvas *canvas, SpiceRect *bbox, SpiceClip *clip)
}
break;
}
- case SPICE_CLIP_TYPE_PATH: {
- GLCPath path = get_path(canvas, SPICE_GET_ADDRESS(clip->data));
- glc_clip_path(canvas->glc, path, GLC_CLIP_OP_SET);
- glc_path_destroy(path);
- break;
- }
default:
CANVAS_ERROR("invalid clip type");
}
diff --git a/server/red_worker.c b/server/red_worker.c
index b9ada15..97ca75d 100644
--- a/server/red_worker.c
+++ b/server/red_worker.c
@@ -3890,11 +3890,6 @@ static inline void red_process_drawable(RedWorker *worker, QXLDrawable *drawable
add_clip_rects(worker, &rgn, drawable->clip.data + SPICE_OFFSETOF(QXLClipRects, chunk), group_id);
region_and(&item->tree_item.base.rgn, &rgn);
region_destroy(&rgn);
- } else if (drawable->clip.type == SPICE_CLIP_TYPE_PATH) {
- item->tree_item.effect = QXL_EFFECT_BLEND;
-#ifdef PIPE_DEBUG
- printf("TEST: DRAWABLE: QXL_CLIP_TYPE_PATH\n");
-#endif
}
/*
surface->refs is affected by a drawable (that is
@@ -4083,9 +4078,6 @@ static void localize_clip(RedWorker *worker, SpiceClip *clip, uint32_t group_id)
} while (chunk);
break;
}
- case SPICE_CLIP_TYPE_PATH:
- localize_path(worker, &clip->data, group_id);
- break;
default:
red_printf("invalid clip type");
}
@@ -4100,9 +4092,6 @@ static void unlocalize_clip(SpiceClip *clip)
free((void *)clip->data);
clip->data = 0;
break;
- case SPICE_CLIP_TYPE_PATH:
- unlocalize_path(&clip->data);
- break;
default:
red_printf("invalid clip type");
}
@@ -5393,18 +5382,16 @@ static void fill_base(DisplayChannel *display_channel, Drawable *drawable)
{
RedChannel *channel = &display_channel->base;
SpiceMsgDisplayBase base;
- SpiceMarshaller *cliprects_data_out, *clippath_data_out;
+ SpiceMarshaller *cliprects_data_out;
base.surface_id = drawable->surface_id;
base.box = drawable->qxl_drawable->bbox;
base.clip = drawable->qxl_drawable->clip;
spice_marshall_DisplayBase(channel->send_data.marshaller, &base,
- &cliprects_data_out, &clippath_data_out);
+ &cliprects_data_out);
if (cliprects_data_out) {
fill_rects_clip(channel, cliprects_data_out, base.clip.data, drawable->group_id);
- } else if (clippath_data_out) {
- fill_path(display_channel, clippath_data_out, base.clip.data, drawable->group_id);
}
}
@@ -7354,14 +7341,7 @@ static void surface_lossy_region_update(RedWorker *worker, DisplayChannel *displ
surface_lossy_region = &display_channel->surface_client_lossy_region[item->surface_id];
drawable = item->qxl_drawable;
- if ((drawable->clip.type == SPICE_CLIP_TYPE_NONE) ||
- ((drawable->clip.type == SPICE_CLIP_TYPE_PATH) && lossy)) {
- if (!lossy) {
- region_remove(surface_lossy_region, &drawable->bbox);
- } else {
- region_add(surface_lossy_region, &drawable->bbox);
- }
- } else if (drawable->clip.type == SPICE_CLIP_TYPE_RECTS) {
+ if (drawable->clip.type == SPICE_CLIP_TYPE_RECTS ) {
QRegion clip_rgn;
QRegion draw_region;
region_init(&clip_rgn);
@@ -7379,7 +7359,13 @@ static void surface_lossy_region_update(RedWorker *worker, DisplayChannel *displ
region_destroy(&clip_rgn);
region_destroy(&draw_region);
- } // else SPICE_CLIP_TYPE_PATH and lossless: leave the area as is
+ } else { /* no clip */
+ if (!lossy) {
+ region_remove(surface_lossy_region, &drawable->bbox);
+ } else {
+ region_add(surface_lossy_region, &drawable->bbox);
+ }
+ }
}
static inline int drawable_intersects_with_areas(Drawable *drawable, int surface_ids[],
@@ -9092,7 +9078,7 @@ static void red_send_image(DisplayChannel *display_channel, ImageItem *item)
int lz_comp = FALSE;
spice_image_compression_t comp_mode;
SpiceMsgDisplayDrawCopy copy;
- SpiceMarshaller *cliprects_data_out, *clippath_data_out, *src_bitmap_out, *mask_bitmap_out;
+ SpiceMarshaller *cliprects_data_out, *src_bitmap_out, *mask_bitmap_out;
SpiceMarshaller *bitmap_palette_out, *data_out, *lzplt_palette_out;
ASSERT(display_channel && item);
@@ -9139,7 +9125,7 @@ static void red_send_image(DisplayChannel *display_channel, ImageItem *item)
SpiceMarshaller *m = channel->send_data.marshaller;
spice_marshall_msg_display_draw_copy(m, ©,
- &cliprects_data_out, &clippath_data_out,
+ &cliprects_data_out,
&src_bitmap_out, &mask_bitmap_out);
compress_send_data_t comp_send_data = {0};
@@ -9217,7 +9203,7 @@ static void red_display_send_upgrade(DisplayChannel *display_channel, UpgradeIte
RedChannel *channel;
QXLDrawable *qxl_drawable;
SpiceMsgDisplayDrawCopy copy;
- SpiceMarshaller *cliprects_data_out, *clippath_data_out, *src_bitmap_out, *mask_bitmap_out;
+ SpiceMarshaller *cliprects_data_out, *src_bitmap_out, *mask_bitmap_out;
int i;
ASSERT(display_channel && item && item->drawable);
@@ -9239,7 +9225,7 @@ static void red_display_send_upgrade(DisplayChannel *display_channel, UpgradeIte
SpiceMarshaller *m = channel->send_data.marshaller;
spice_marshall_msg_display_draw_copy(m, ©,
- &cliprects_data_out, &clippath_data_out,
+ &cliprects_data_out,
&src_bitmap_out, &mask_bitmap_out);
spice_marshaller_add_uint32(cliprects_data_out, item->n_rects);
@@ -9260,7 +9246,7 @@ static void red_display_send_stream_start(DisplayChannel *display_channel, Strea
ASSERT(stream);
channel->send_data.header->type = SPICE_MSG_DISPLAY_STREAM_CREATE;
SpiceMsgDisplayStreamCreate stream_create;
- SpiceMarshaller *cliprects_data_out, *clippath_data_out;
+ SpiceMarshaller *cliprects_data_out;
stream_create.surface_id = 0;
stream_create.id = agent - display_channel->stream_agents;
@@ -9282,7 +9268,7 @@ static void red_display_send_stream_start(DisplayChannel *display_channel, Strea
}
spice_marshall_msg_display_stream_create(channel->send_data.marshaller, &stream_create,
- &cliprects_data_out, &clippath_data_out);
+ &cliprects_data_out);
if (stream->current) {
@@ -9313,14 +9299,14 @@ static void red_display_send_stream_clip(DisplayChannel *display_channel,
channel->send_data.header->type = SPICE_MSG_DISPLAY_STREAM_CLIP;
SpiceMsgDisplayStreamClip stream_clip;
- SpiceMarshaller *cliprects_data_out, *clippath_data_out;
+ SpiceMarshaller *cliprects_data_out;
stream_clip.id = agent - display_channel->stream_agents;
stream_clip.clip.type = item->clip_type;
stream_clip.clip.data = 0;
spice_marshall_msg_display_stream_clip(channel->send_data.marshaller, &stream_clip,
- &cliprects_data_out, &clippath_data_out);
+ &cliprects_data_out);
if (stream_clip.clip.type == SPICE_CLIP_TYPE_RECTS) {
spice_marshaller_add_uint32(cliprects_data_out, item->n_rects);
diff --git a/spice.proto b/spice.proto
index 199fa38..acb9488 100644
--- a/spice.proto
+++ b/spice.proto
@@ -253,8 +253,7 @@ channel MainChannel : BaseChannel {
enum32 clip_type {
NONE,
- RECTS,
- PATH,
+ RECTS
};
flags32 path_flags { /* TODO: C enum names changes */
@@ -414,8 +413,6 @@ struct Clip {
switch (type) {
case RECTS:
ClipRects *data @outvar(cliprects);
- case PATH:
- Path *data @outvar(clippath);
} u @anon;
};
diff --git a/spice1.proto b/spice1.proto
index 0efe74b..dbe57b5 100644
--- a/spice1.proto
+++ b/spice1.proto
@@ -253,8 +253,7 @@ channel MainChannel : BaseChannel {
enum32 clip_type {
NONE,
- RECTS,
- PATH,
+ RECTS
};
flags32 path_flags { /* TODO: C enum names changes */
@@ -382,12 +381,10 @@ struct Path {
struct Clip {
clip_type type;
switch (type) {
- case NONE:
- uint64 data @zero;
- case RECTS:
+ case RECTS:
ClipRects *data @outvar(cliprects);
- case PATH:
- Path *data @outvar(clippath);
+ default:
+ uint64 data @zero;
} u @anon;
};
More information about the Spice-commits
mailing list