diff options
author | Yonit Halperin <yhalperi@redhat.com> | 2010-08-31 09:19:32 +0300 |
---|---|---|
committer | Yonit Halperin <yhalperi@redhat.com> | 2010-08-31 13:26:46 +0300 |
commit | 8bc4fe03446ddcb63d4576c643499480f429804c (patch) | |
tree | 032fb631334a6f1597894c6c1a4233aadce2bce8 /server/red_worker.c | |
parent | 5b441c9bc500faec08e3aa5400c909310fefceb9 (diff) | |
download | spice-8bc4fe03446ddcb63d4576c643499480f429804c.tar.gz spice-8bc4fe03446ddcb63d4576c643499480f429804c.tar.xz spice-8bc4fe03446ddcb63d4576c643499480f429804c.zip |
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.
Diffstat (limited to 'server/red_worker.c')
-rw-r--r-- | 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 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) { |