From 8bc4fe03446ddcb63d4576c643499480f429804c Mon Sep 17 00:00:00 2001 From: Yonit Halperin Date: Tue, 31 Aug 2010 09:19:32 +0300 Subject: server: red_current_add_equal - don't push a drawable to the middle of the pipe if it depends on surfaces. 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 file changed, 13 insertions(+), 1 deletion(-) diff --git a/server/red_worker.c b/server/red_worker.c index a11f428c..36c27636 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) { -- cgit