[Spice-commits] server/display-channel.c server/display-channel.h server/red_worker.c

Frediano Ziglio fziglio at kemper.freedesktop.org
Thu Nov 26 07:38:53 PST 2015


 server/display-channel.c |   22 ++++++++++++++++++----
 server/display-channel.h |    2 --
 server/red_worker.c      |   14 --------------
 3 files changed, 18 insertions(+), 20 deletions(-)

New commits:
commit 7258e5a688f27f76d99ed3b0b84e1ddcb289e2e5
Author: Marc-André Lureau <marcandre.lureau at gmail.com>
Date:   Tue Oct 1 17:11:10 2013 +0200

    worker: move red_pipes_remove_drawable
    
    Acked-by: Fabiano FidĂȘncio <fidencio at redhat.com>

diff --git a/server/display-channel.c b/server/display-channel.c
index 3e2419d..b817bbe 100644
--- a/server/display-channel.c
+++ b/server/display-channel.c
@@ -398,6 +398,20 @@ static void current_remove_drawable(DisplayChannel *display, Drawable *item)
     display->current_size--;
 }
 
+static void drawable_remove_from_pipes(Drawable *drawable)
+{
+    DrawablePipeItem *dpi;
+    RingItem *item, *next;
+
+    RING_FOREACH_SAFE(item, next, &drawable->pipes) {
+        dpi = SPICE_CONTAINEROF(item, DrawablePipeItem, base);
+        if (pipe_item_is_linked(&dpi->dpi_pipe_item)) {
+            red_channel_client_pipe_remove_and_release(RED_CHANNEL_CLIENT(dpi->dcc),
+                                                       &dpi->dpi_pipe_item);
+        }
+    }
+}
+
 static void current_remove(DisplayChannel *display, TreeItem *item)
 {
     TreeItem *now = item;
@@ -410,7 +424,7 @@ static void current_remove(DisplayChannel *display, TreeItem *item)
         if (now->type == TREE_ITEM_TYPE_DRAWABLE) {
             Drawable *drawable = SPICE_CONTAINEROF(now, Drawable, tree_item);
             ring_item = now->siblings_link.prev;
-            red_pipes_remove_drawable(drawable);
+            drawable_remove_from_pipes(drawable);
             current_remove_drawable(display, drawable);
         } else {
             Container *container = (Container *)now;
@@ -477,7 +491,7 @@ static int current_add_equal(DisplayChannel *display, DrawItem *item, TreeItem *
         } else {
             pipes_add_drawable(display, drawable);
         }
-        red_pipes_remove_drawable(other_drawable);
+        drawable_remove_from_pipes(other_drawable);
         display_channel_drawable_unref(display, other_drawable);
         return TRUE;
     }
@@ -519,7 +533,7 @@ static int current_add_equal(DisplayChannel *display, DrawItem *item, TreeItem *
                 }
             }
             /* not sending other_drawable where possible */
-            red_pipes_remove_drawable(other_drawable);
+            drawable_remove_from_pipes(other_drawable);
 
             display_channel_drawable_unref(display, other_drawable);
             return TRUE;
@@ -528,7 +542,7 @@ static int current_add_equal(DisplayChannel *display, DrawItem *item, TreeItem *
     case QXL_EFFECT_OPAQUE_BRUSH:
         if (is_same_geometry(drawable, other_drawable)) {
             current_add_drawable(display, drawable, &other->siblings_link);
-            red_pipes_remove_drawable(other_drawable);
+            drawable_remove_from_pipes(other_drawable);
             current_remove_drawable(display, other_drawable);
             pipes_add_drawable(display, drawable);
             return TRUE;
diff --git a/server/display-channel.h b/server/display-channel.h
index b3ebc2e..5b562ec 100644
--- a/server/display-channel.h
+++ b/server/display-channel.h
@@ -445,6 +445,4 @@ static inline void draw_depend_on_me(DisplayChannel *display, uint32_t surface_i
     }
 }
 
-void red_pipes_remove_drawable(Drawable *drawable);
-
 #endif /* DISPLAY_CHANNEL_H_ */
diff --git a/server/red_worker.c b/server/red_worker.c
index c0e4a5f..c71294a 100644
--- a/server/red_worker.c
+++ b/server/red_worker.c
@@ -188,20 +188,6 @@ static PipeItem *dcc_get_tail(DisplayChannelClient *dcc)
     return (PipeItem*)ring_get_tail(&RED_CHANNEL_CLIENT(dcc)->pipe);
 }
 
-void red_pipes_remove_drawable(Drawable *drawable)
-{
-    DrawablePipeItem *dpi;
-    RingItem *item, *next;
-
-    RING_FOREACH_SAFE(item, next, &drawable->pipes) {
-        dpi = SPICE_CONTAINEROF(item, DrawablePipeItem, base);
-        if (pipe_item_is_linked(&dpi->dpi_pipe_item)) {
-            red_channel_client_pipe_remove_and_release(RED_CHANNEL_CLIENT(dpi->dcc),
-                                                       &dpi->dpi_pipe_item);
-        }
-    }
-}
-
 static uint8_t *common_alloc_recv_buf(RedChannelClient *rcc, uint16_t type, uint32_t size)
 {
     CommonChannel *common = SPICE_CONTAINEROF(rcc->channel, CommonChannel, base);


More information about the Spice-commits mailing list