[Spice-devel] [PATCH] server: red_current_add_equal - don't push a drawable to the middle of the pipe if it depends on surfaces.

Yonit Halperin yhalperi at redhat.com
Tue Aug 31 00:29:13 PDT 2010


This will prevent: 1) rendering problems (commands sent to the client in the wrong order)
2) sending commands for surfaces that haven't been created yet on the client side.
---
 server/red_worker.c |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/server/red_worker.c b/server/red_worker.c
index a11f428..36c2763 100644
--- a/server/red_worker.c
+++ b/server/red_worker.c
@@ -2785,6 +2785,18 @@ static inline void red_stream_maintenance(RedWorker *worker, Drawable *candidate
     }
 }
 
+static inline int is_drawable_independent_from_surfaces(Drawable *drawable)
+{
+    int x;
+
+    for (x = 0; x < 3; ++x) {
+        if (drawable->surfaces_dest[x] != -1) {
+            return FALSE;
+        }
+    }
+    return TRUE;
+}
+
 static inline int red_current_add_equal(RedWorker *worker, DrawItem *item, TreeItem *other)
 {
     DrawItem *other_draw_item;
@@ -2804,7 +2816,7 @@ static inline int red_current_add_equal(RedWorker *worker, DrawItem *item, TreeI
     other_drawable = SPICE_CONTAINEROF(other_draw_item, Drawable, tree_item);
 
     if (item->effect == QXL_EFFECT_OPAQUE) {
-        int add_after = !!other_drawable->stream;
+        int add_after = !!other_drawable->stream && is_drawable_independent_from_surfaces(drawable);
         red_stream_maintenance(worker, drawable, other_drawable);
         __current_add_drawable(worker, drawable, &other->siblings_link);
         if (add_after) {
-- 
1.7.1.1



More information about the Spice-devel mailing list