summaryrefslogtreecommitdiffstats
path: root/server/red_worker.c
diff options
context:
space:
mode:
Diffstat (limited to 'server/red_worker.c')
-rw-r--r--server/red_worker.c32
1 files changed, 4 insertions, 28 deletions
diff --git a/server/red_worker.c b/server/red_worker.c
index 11aa3f04..286bde47 100644
--- a/server/red_worker.c
+++ b/server/red_worker.c
@@ -974,30 +974,6 @@ static inline void remove_shadow(DrawItem *item)
free(shadow);
}
-static inline void current_remove_container(RedWorker *worker, Container *container)
-{
- spice_assert(ring_is_empty(&container->items));
- ring_remove(&container->base.siblings_link);
- region_destroy(&container->base.rgn);
- free(container);
-}
-
-static inline void container_cleanup(RedWorker *worker, Container *container)
-{
- while (container && container->items.next == container->items.prev) {
- Container *next = container->base.container;
- if (container->items.next != &container->items) {
- TreeItem *item = (TreeItem *)ring_get_head(&container->items);
- spice_assert(item);
- ring_remove(&item->siblings_link);
- ring_add_after(&item->siblings_link, &container->base.siblings_link);
- item->container = container->base.container;
- }
- current_remove_container(worker, container);
- container = next;
- }
-}
-
static void display_stream_trace_add_drawable(DisplayChannel *display, Drawable *item)
{
ItemTrace *trace;
@@ -1076,7 +1052,7 @@ static inline void current_remove(RedWorker *worker, TreeItem *item)
continue;
}
ring_item = now->siblings_link.prev;
- current_remove_container(worker, container);
+ container_free(container);
}
if (now == item) {
return;
@@ -2659,7 +2635,7 @@ static bool free_one_drawable(RedWorker *worker, int force_glz_free)
container = drawable->tree_item.base.container;
current_remove_drawable(worker, drawable);
- container_cleanup(worker, container);
+ container_cleanup(container);
return TRUE;
}
@@ -3157,7 +3133,7 @@ static void red_update_area_till(RedWorker *worker, const SpiceRect *area, int s
now->refs++;
container = now->tree_item.base.container;
current_remove_drawable(worker, now);
- container_cleanup(worker, container);
+ container_cleanup(container);
/* red_draw_drawable may call red_update_area for the surfaces 'now' depends on. Notice,
that it is valid to call red_update_area in this case and not red_update_area_till:
It is impossible that there was newer item then 'last' in one of the surfaces
@@ -3216,7 +3192,7 @@ static void red_update_area(RedWorker *worker, const SpiceRect *area, int surfac
now->refs++;
container = now->tree_item.base.container;
current_remove_drawable(worker, now);
- container_cleanup(worker, container);
+ container_cleanup(container);
red_draw_drawable(worker, now);
display_channel_drawable_unref(display, now);
} while (now != last);