summaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@gmail.com>2013-09-26 13:18:52 +0200
committerFrediano Ziglio <fziglio@redhat.com>2015-11-23 14:01:48 +0000
commite624a6169b377dce98c43e5647933be334c87d59 (patch)
treeb8353a4cb9292ea1490709a85cbea18b7f41ebf8 /server
parent029b4beb735ccde680ff2599d750f1b3d61e07b8 (diff)
downloadspice-e624a6169b377dce98c43e5647933be334c87d59.zip
spice-e624a6169b377dce98c43e5647933be334c87d59.tar.gz
spice-e624a6169b377dce98c43e5647933be334c87d59.tar.xz
worker: generalize surface_dirty_region_to_rects
Acked-by: Fabiano Fidêncio <fabiano@fidencio.org>
Diffstat (limited to 'server')
-rw-r--r--server/red_worker.c26
1 files changed, 11 insertions, 15 deletions
diff --git a/server/red_worker.c b/server/red_worker.c
index 4dcad83..f49c253 100644
--- a/server/red_worker.c
+++ b/server/red_worker.c
@@ -5489,24 +5489,20 @@ static void red_connect_cursor(RedWorker *worker, RedClient *client, RedsStream
cursor_channel_init(channel, ccc);
}
-static void surface_dirty_region_to_rects(RedSurface *surface,
- QXLRect *qxl_dirty_rects,
- uint32_t num_dirty_rects)
+static void region_to_qxlrects(QRegion *region, QXLRect *qxl_rects, uint32_t num_rects)
{
- QRegion *surface_dirty_region;
- SpiceRect *dirty_rects;
+ SpiceRect *rects;
int i;
- surface_dirty_region = &surface->draw_dirty_region;
- dirty_rects = spice_new0(SpiceRect, num_dirty_rects);
- region_ret_rects(surface_dirty_region, dirty_rects, num_dirty_rects);
- for (i = 0; i < num_dirty_rects; i++) {
- qxl_dirty_rects[i].top = dirty_rects[i].top;
- qxl_dirty_rects[i].left = dirty_rects[i].left;
- qxl_dirty_rects[i].bottom = dirty_rects[i].bottom;
- qxl_dirty_rects[i].right = dirty_rects[i].right;
+ rects = spice_new0(SpiceRect, num_rects);
+ region_ret_rects(region, rects, num_rects);
+ for (i = 0; i < num_rects; i++) {
+ qxl_rects[i].top = rects[i].top;
+ qxl_rects[i].left = rects[i].left;
+ qxl_rects[i].bottom = rects[i].bottom;
+ qxl_rects[i].right = rects[i].right;
}
- free(dirty_rects);
+ free(rects);
}
void display_channel_update(DisplayChannel *display,
@@ -5527,7 +5523,7 @@ void display_channel_update(DisplayChannel *display,
*qxl_dirty_rects = spice_new0(QXLRect, *num_dirty_rects);
}
- surface_dirty_region_to_rects(surface, *qxl_dirty_rects, *num_dirty_rects);
+ region_to_qxlrects(&surface->draw_dirty_region, *qxl_dirty_rects, *num_dirty_rects);
if (clear_dirty)
region_clear(&surface->draw_dirty_region);
}