[Spice-devel] [PATCH RFC 12/14] Use directly surface instead of id

Frediano Ziglio fziglio at redhat.com
Thu Sep 29 08:44:11 UTC 2016


Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
---
 server/dcc.c | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/server/dcc.c b/server/dcc.c
index a800aaa..eeb2867 100644
--- a/server/dcc.c
+++ b/server/dcc.c
@@ -243,28 +243,28 @@ static void add_drawable_surface_images(DisplayChannelClient *dcc, Drawable *dra
 {
     DisplayChannel *display = DCC_TO_DC(dcc);
     int x;
+    RedSurface *surface;
 
     for (x = 0; x < 3; ++x) {
-        int surface_id;
-
-        if (drawable->surface_deps[x] != NULL) {
-            surface_id = drawable->surface_deps[x]->id;
-            if (dcc->priv->surface_client_created[surface_id] == TRUE) {
+        surface = drawable->surface_deps[x];
+        if (surface) {
+            if (dcc->priv->surface_client_created[surface->id] == TRUE) {
                 continue;
             }
-            dcc_create_surface(dcc, drawable->surface_deps[x]);
-            display_channel_current_flush(display, drawable->surface_deps[x]);
-            dcc_push_surface_image(dcc, drawable->surface_deps[x]);
+            dcc_create_surface(dcc, surface);
+            display_channel_current_flush(display, surface);
+            dcc_push_surface_image(dcc, surface);
         }
     }
 
-    if (dcc->priv->surface_client_created[drawable->surface->id] == TRUE) {
+    surface = drawable->surface;
+    if (dcc->priv->surface_client_created[surface->id] == TRUE) {
         return;
     }
 
-    dcc_create_surface(dcc, drawable->surface);
-    display_channel_current_flush(display, drawable->surface);
-    dcc_push_surface_image(dcc, drawable->surface);
+    dcc_create_surface(dcc, surface);
+    display_channel_current_flush(display, surface);
+    dcc_push_surface_image(dcc, surface);
 }
 
 static void red_drawable_pipe_item_free(RedPipeItem *item)
-- 
2.7.4



More information about the Spice-devel mailing list