[Spice-devel] [PATCH 1/2] worker: remove some useless counters

Frediano Ziglio fziglio at redhat.com
Fri Nov 6 05:58:12 PST 2015


From: Marc-André Lureau <marcandre.lureau at gmail.com>

---
 server/red_worker.c | 16 ----------------
 1 file changed, 16 deletions(-)

diff --git a/server/red_worker.c b/server/red_worker.c
index 20b72a3..8631d42 100644
--- a/server/red_worker.c
+++ b/server/red_worker.c
@@ -348,11 +348,6 @@ typedef struct RedWorker {
 
     uint32_t red_drawable_count;
     uint32_t glz_drawable_count;
-    uint32_t transparent_count;
-
-    uint32_t shadows_count;
-    uint32_t containers_count;
-
     uint32_t bits_unique;
 
     RedMemSlotInfo mem_slots;
@@ -1095,13 +1090,11 @@ static inline void remove_shadow(RedWorker *worker, DrawItem *item)
     region_destroy(&shadow->base.rgn);
     region_destroy(&shadow->on_hold);
     free(shadow);
-    worker->shadows_count--;
 }
 
 static inline void current_remove_container(RedWorker *worker, Container *container)
 {
     spice_assert(ring_is_empty(&container->items));
-    worker->containers_count--;
     ring_remove(&container->base.siblings_link);
     region_destroy(&container->base.rgn);
     free(container);
@@ -1165,10 +1158,6 @@ static inline void current_remove_drawable(RedWorker *worker, Drawable *item)
 {
     DisplayChannel *display = worker->display_channel;
 
-    if (item->tree_item.effect != QXL_EFFECT_OPAQUE) {
-        worker->transparent_count--;
-    }
-
     display_stream_trace_add_drawable(display, item);
     remove_shadow(worker, &item->tree_item);
     ring_remove(&item->tree_item.base.siblings_link);
@@ -2567,7 +2556,6 @@ static inline int red_current_add(RedWorker *worker, Ring *ring, Drawable *drawa
                         region_destroy(&exclude_rgn);
                         return FALSE;
                     }
-                    worker->containers_count++;
                     item->base.container = container;
                     ring = &container->items;
                 }
@@ -2633,7 +2621,6 @@ static inline int red_current_add_with_shadow(RedWorker *worker, Ring *ring, Dra
         stat_add(&worker->add_stat, start_time);
         return FALSE;
     }
-    worker->shadows_count++;
     // item and his shadow must initially be placed in the same container.
     // for now putting them on root.
 
@@ -3049,9 +3036,6 @@ static inline void red_process_draw(RedWorker *worker, RedDrawable *red_drawable
     }
 
     if (red_add_drawable(worker, drawable)) {
-        if (drawable->tree_item.effect != QXL_EFFECT_OPAQUE) {
-            worker->transparent_count++;
-        }
         red_pipes_add_drawable(worker, drawable);
     }
 cleanup:
-- 
2.4.3



More information about the Spice-devel mailing list