diff options
author | Søren Sandmann Pedersen <ssp@redhat.com> | 2012-08-10 18:44:57 -0400 |
---|---|---|
committer | Søren Sandmann Pedersen <ssp@redhat.com> | 2012-08-24 13:21:19 -0400 |
commit | b305afbd7f5ca2efb44f1e1cc68b3e89afa86136 (patch) | |
tree | 52eab9bccfa7df49da2741511fa1bb5b7e4caaec | |
parent | f0e71a72069cd6153000c0b18442f460505196f4 (diff) |
Add support for Composite command to the clientrender2
All the real work is being done in spice-common, so this patch is just
hooking up the virtual calls.
-rw-r--r-- | client/canvas.cpp | 7 | ||||
-rw-r--r-- | client/canvas.h | 1 | ||||
-rw-r--r-- | client/display_channel.cpp | 13 | ||||
-rw-r--r-- | client/display_channel.h | 1 | ||||
m--------- | spice-common | 0 |
5 files changed, 22 insertions, 0 deletions
diff --git a/client/canvas.cpp b/client/canvas.cpp index 7d1561a..f132186 100644 --- a/client/canvas.cpp +++ b/client/canvas.cpp @@ -114,6 +114,13 @@ void Canvas::draw_alpha_blend(SpiceMsgDisplayDrawAlphaBlend& alpha_blend, int si touched_bbox(&alpha_blend.base.box); } +void Canvas::draw_composite(SpiceMsgDisplayDrawComposite& composite, int size) +{ + begin_draw(composite.base, size, sizeof(SpiceMsgDisplayDrawComposite)); + _canvas->ops->draw_composite(_canvas, &composite.base.box, &composite.base.clip, &composite.data); + touched_bbox(&composite.base.box); +} + void Canvas::copy_bits(SpiceMsgDisplayCopyBits& copy, int size) { begin_draw(copy.base, size, sizeof(SpiceMsgDisplayCopyBits)); diff --git a/client/canvas.h b/client/canvas.h index 7702568..213a753 100644 --- a/client/canvas.h +++ b/client/canvas.h @@ -304,6 +304,7 @@ public: void draw_invers(SpiceMsgDisplayDrawInvers& invers, int size); void draw_rop3(SpiceMsgDisplayDrawRop3& rop3, int size); void draw_stroke(SpiceMsgDisplayDrawStroke& stroke, int size); + void draw_composite(SpiceMsgDisplayDrawComposite& composite, int size); void put_image( #ifdef WIN32 diff --git a/client/display_channel.cpp b/client/display_channel.cpp index 17bdf6a..d08072d 100644 --- a/client/display_channel.cpp +++ b/client/display_channel.cpp @@ -650,6 +650,8 @@ DisplayChannel::DisplayChannel(RedClient& client, uint32_t id, get_process_loop().add_trigger(_interrupt_update); set_draw_handlers(); + + set_capability(SPICE_DISPLAY_CAP_COMPOSITE); } DisplayChannel::~DisplayChannel() @@ -692,6 +694,8 @@ void DisplayChannel::set_draw_handlers() &DisplayChannel::handle_draw_transparent); handler->set_handler(SPICE_MSG_DISPLAY_DRAW_ALPHA_BLEND, &DisplayChannel::handle_draw_alpha_blend); + handler->set_handler(SPICE_MSG_DISPLAY_DRAW_COMPOSITE, + &DisplayChannel::handle_draw_composite); handler->set_handler(SPICE_MSG_DISPLAY_STREAM_DATA, &DisplayChannel::handle_stream_data); } @@ -712,6 +716,7 @@ void DisplayChannel::clear_draw_handlers() handler->set_handler(SPICE_MSG_DISPLAY_DRAW_TEXT, NULL); handler->set_handler(SPICE_MSG_DISPLAY_DRAW_TRANSPARENT, NULL); handler->set_handler(SPICE_MSG_DISPLAY_DRAW_ALPHA_BLEND, NULL); + handler->set_handler(SPICE_MSG_DISPLAY_DRAW_COMPOSITE, NULL); handler->set_handler(SPICE_MSG_DISPLAY_STREAM_DATA, NULL); } @@ -1735,6 +1740,14 @@ void DisplayChannel::handle_draw_alpha_blend(RedPeer::InMessage* message) DRAW(alpha_blend); } +void DisplayChannel::handle_draw_composite(RedPeer::InMessage* message) +{ + Canvas *canvas; + SpiceMsgDisplayDrawComposite* composite = (SpiceMsgDisplayDrawComposite*)message->data(); + canvas = _surfaces_cache[composite->base.surface_id]; + DRAW(composite); +} + void DisplayChannel::streams_time() { _next_timer_time = 0; diff --git a/client/display_channel.h b/client/display_channel.h index 72856f5..197ae73 100644 --- a/client/display_channel.h +++ b/client/display_channel.h @@ -173,6 +173,7 @@ private: void handle_draw_text(RedPeer::InMessage* message); void handle_draw_transparent(RedPeer::InMessage* message); void handle_draw_alpha_blend(RedPeer::InMessage* message); + void handle_draw_composite(RedPeer::InMessage* message); void on_streams_trigger(); virtual void on_update_completion(uint64_t mark); diff --git a/spice-common b/spice-common -Subproject f7f5b603f2ea078b224caf22ebfb3ddd4222fab +Subproject cac13917757f417f5f1dc4b21f855fd482877b2 |