summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathon Jongsma <jjongsma@redhat.com>2015-11-13 18:03:53 +0100
committerFabiano FidĂȘncio <fidencio@redhat.com>2015-11-13 18:31:15 +0100
commitdb1428e58ff382f31225020253741c63a9673dc5 (patch)
treee8877a71d1c7dce6719f242d2ddc9d43a677aa51
parenta408bb3e2551baa8cd1fe309fca7c73160135ed7 (diff)
downloadspice-db1428e58ff382f31225020253741c63a9673dc5.zip
spice-db1428e58ff382f31225020253741c63a9673dc5.tar.gz
spice-db1428e58ff382f31225020253741c63a9673dc5.tar.xz
Move some more drawable functions to display channel
-rw-r--r--server/display-channel.h26
-rw-r--r--server/red_worker.c30
2 files changed, 28 insertions, 28 deletions
diff --git a/server/display-channel.h b/server/display-channel.h
index d33f72c..40a3dc6 100644
--- a/server/display-channel.h
+++ b/server/display-channel.h
@@ -446,6 +446,23 @@ static inline int is_same_drawable(Drawable *d1, Drawable *d2)
}
}
+static inline int is_drawable_independent_from_surfaces(Drawable *drawable)
+{
+ int x;
+
+ for (x = 0; x < 3; ++x) {
+ if (drawable->surface_deps[x] != -1) {
+ return FALSE;
+ }
+ }
+ return TRUE;
+}
+
+static inline int has_shadow(RedDrawable *drawable)
+{
+ return drawable->type == QXL_COPY_BITS;
+}
+
static inline int is_primary_surface(DisplayChannel *display, uint32_t surface_id)
{
if (surface_id == 0) {
@@ -454,4 +471,13 @@ static inline int is_primary_surface(DisplayChannel *display, uint32_t surface_i
return FALSE;
}
+static inline void region_add_clip_rects(QRegion *rgn, SpiceClipRects *data)
+{
+ int i;
+
+ for (i = 0; i < data->num_rects; i++) {
+ region_add(rgn, data->rects + i);
+ }
+}
+
#endif /* DISPLAY_CHANNEL_H_ */
diff --git a/server/red_worker.c b/server/red_worker.c
index fcddf1d..3ed3ffe 100644
--- a/server/red_worker.c
+++ b/server/red_worker.c
@@ -2017,18 +2017,6 @@ static void display_channel_stream_maintenance(DisplayChannel *display,
}
}
-static inline int is_drawable_independent_from_surfaces(Drawable *drawable)
-{
- int x;
-
- for (x = 0; x < 3; ++x) {
- if (drawable->surface_deps[x] != -1) {
- return FALSE;
- }
- }
- return TRUE;
-}
-
static inline int red_current_add_equal(RedWorker *worker, DrawItem *item, TreeItem *other)
{
DisplayChannel *display = worker->display_channel;
@@ -2299,15 +2287,6 @@ static inline int current_add(RedWorker *worker, Ring *ring, Drawable *drawable)
return TRUE;
}
-static void add_clip_rects(QRegion *rgn, SpiceClipRects *data)
-{
- int i;
-
- for (i = 0; i < data->num_rects; i++) {
- region_add(rgn, data->rects + i);
- }
-}
-
static inline int current_add_with_shadow(RedWorker *worker, Ring *ring, Drawable *item)
{
DisplayChannel *display = worker->display_channel;
@@ -2352,11 +2331,6 @@ static inline int current_add_with_shadow(RedWorker *worker, Ring *ring, Drawabl
return TRUE;
}
-static inline int has_shadow(RedDrawable *drawable)
-{
- return drawable->type == QXL_COPY_BITS;
-}
-
static void drawable_update_streamable(DisplayChannel *display, Drawable *drawable)
{
RedDrawable *red_drawable = drawable->red_drawable;
@@ -2714,7 +2688,7 @@ static inline void red_process_draw(RedWorker *worker, RedDrawable *red_drawable
QRegion rgn;
region_init(&rgn);
- add_clip_rects(&rgn, red_drawable->clip.rects);
+ region_add_clip_rects(&rgn, red_drawable->clip.rects);
region_and(&drawable->tree_item.base.rgn, &rgn);
region_destroy(&rgn);
}
@@ -5153,7 +5127,7 @@ static void surface_lossy_region_update(RedWorker *worker, DisplayChannelClient
region_init(&clip_rgn);
region_init(&draw_region);
region_add(&draw_region, &drawable->bbox);
- add_clip_rects(&clip_rgn, drawable->clip.rects);
+ region_add_clip_rects(&clip_rgn, drawable->clip.rects);
region_and(&draw_region, &clip_rgn);
if (lossy) {
region_or(surface_lossy_region, &draw_region);