[Spice-commits] 3 commits - server/display-channel.c server/display-channel.h server/red_worker.c
Frediano Ziglio
fziglio at kemper.freedesktop.org
Thu Nov 26 05:31:15 PST 2015
server/display-channel.c | 51 +++++++++++++----------------------------------
server/display-channel.h | 2 -
server/red_worker.c | 5 +---
3 files changed, 18 insertions(+), 40 deletions(-)
New commits:
commit 19f92e9eb8cff87e374a94bf5bc49a5d58fe5b9b
Author: Marc-André Lureau <marcandre.lureau at gmail.com>
Date: Fri Sep 27 15:44:38 2013 +0200
display: reuse code in display_channel_draw_until
Acked-by: Fabiano Fidêncio <fidencio at redhat.com>
diff --git a/server/display-channel.c b/server/display-channel.c
index 1be3334..0d8f105 100644
--- a/server/display-channel.c
+++ b/server/display-channel.c
@@ -1305,20 +1305,18 @@ static void draw_until(DisplayChannel *display, RedSurface *surface, Drawable *l
} while (now != last);
}
-static Drawable* current_find_intersects_rect(Ring *current, const SpiceRect *area)
+static Drawable* current_find_intersects_rect(Ring *current, RingItem *from,
+ const SpiceRect *area)
{
- Ring *ring;
- RingItem *ring_item;
+ RingItem *it;
QRegion rgn;
Drawable *last = NULL;
- ring = current;
- ring_item = ring;
region_init(&rgn);
region_add(&rgn, area);
- while ((ring_item = ring_next(ring, ring_item))) {
- Drawable *now = SPICE_CONTAINEROF(ring_item, Drawable, surface_list_link);
+ for (it = from ? from : ring_next(current, current); it != NULL; it = ring_next(current, it)) {
+ Drawable *now = SPICE_CONTAINEROF(it, Drawable, surface_list_link);
if (region_intersects(&rgn, &now->tree_item.base.rgn)) {
last = now;
break;
@@ -1334,7 +1332,7 @@ static Drawable* current_find_intersects_rect(Ring *current, const SpiceRect *ar
* than 'last' (exclusive).
* FIXME: merge with display_channel_draw()?
*/
-void display_channel_draw_till(DisplayChannel *display, const SpiceRect *area, int surface_id,
+void display_channel_draw_until(DisplayChannel *display, const SpiceRect *area, int surface_id,
Drawable *last)
{
RedSurface *surface;
@@ -1342,7 +1340,6 @@ void display_channel_draw_till(DisplayChannel *display, const SpiceRect *area, i
Ring *ring;
RingItem *ring_item;
Drawable *now;
- QRegion rgn;
spice_return_if_fail(last);
spice_return_if_fail(ring_item_is_linked(&last->list_link));
@@ -1367,33 +1364,15 @@ void display_channel_draw_till(DisplayChannel *display, const SpiceRect *area, i
}
}
- if (!surface_last) {
+ if (!surface_last)
return;
- }
-
- ring = &surface->current_list;
- ring_item = &surface_last->surface_list_link;
-
- region_init(&rgn);
- region_add(&rgn, area);
-
- // find the first older drawable that intersects with the area
- do {
- now = SPICE_CONTAINEROF(ring_item, Drawable, surface_list_link);
- if (region_intersects(&rgn, &now->tree_item.base.rgn)) {
- surface_last = now;
- break;
- }
- } while ((ring_item = ring_next(ring, ring_item)));
- region_destroy(&rgn);
-
- if (!surface_last) {
+ last = current_find_intersects_rect(&surface->current_list,
+ &surface_last->surface_list_link, area);
+ if (!last)
return;
- }
-
- draw_until(display, surface, surface_last);
+ draw_until(display, surface, last);
surface_update_dest(surface, area);
}
@@ -1412,7 +1391,7 @@ void display_channel_draw(DisplayChannel *display, const SpiceRect *area, int su
surface = &display->surfaces[surface_id];
- last = current_find_intersects_rect(&surface->current_list, area);
+ last = current_find_intersects_rect(&surface->current_list, NULL, area);
if (last)
draw_until(display, surface, last);
diff --git a/server/display-channel.h b/server/display-channel.h
index 33caabe..0d79463 100644
--- a/server/display-channel.h
+++ b/server/display-channel.h
@@ -262,7 +262,7 @@ void display_channel_create_surface (DisplayCha
void display_channel_draw (DisplayChannel *display,
const SpiceRect *area,
int surface_id);
-void display_channel_draw_till (DisplayChannel *display,
+void display_channel_draw_until (DisplayChannel *display,
const SpiceRect *area,
int surface_id,
Drawable *last);
diff --git a/server/red_worker.c b/server/red_worker.c
index 678b581..6ea7cd5 100644
--- a/server/red_worker.c
+++ b/server/red_worker.c
@@ -405,7 +405,7 @@ static void dcc_detach_stream_gracefully(DisplayChannelClient *dcc,
stream_id, stream->current != NULL);
rect_debug(&upgrade_area);
if (update_area_limit) {
- display_channel_draw_till(DCC_TO_DC(dcc), &upgrade_area, 0, update_area_limit);
+ display_channel_draw_until(DCC_TO_DC(dcc), &upgrade_area, 0, update_area_limit);
} else {
display_channel_draw(DCC_TO_DC(dcc), &upgrade_area, 0);
}
@@ -1524,8 +1524,7 @@ static void red_add_lossless_drawable_dependencies(RedChannelClient *rcc,
} else {
sync_rendered = FALSE;
for (i = 0; i < num_deps; i++) {
- display_channel_draw_till(display, deps_areas[i],
- deps_surfaces_ids[i], item);
+ display_channel_draw_until(display, deps_areas[i], deps_surfaces_ids[i], item);
}
}
commit 180b9f27df6e51b04fb77fdc896c8ca84b6b0821
Author: Marc-André Lureau <marcandre.lureau at gmail.com>
Date: Mon Nov 23 16:44:33 2015 +0100
worker: use spice_return_if_fail() instead of spice_assert() in release_item
Acked-by: Frediano Ziglio <fziglio at redhat.com>
diff --git a/server/display-channel.c b/server/display-channel.c
index cffd6fa..1be3334 100644
--- a/server/display-channel.c
+++ b/server/display-channel.c
@@ -1662,7 +1662,7 @@ static void release_item(RedChannelClient *rcc, PipeItem *item, int item_pushed)
{
DisplayChannelClient *dcc = RCC_TO_DCC(rcc);
- spice_assert(item != NULL);
+ spice_return_if_fail(item != NULL);
dcc_release_item(dcc, item, item_pushed);
}
commit 7ae663ad69c9ce6e8802d766ad5396bf15fd6653
Author: Marc-André Lureau <marcandre.lureau at gmail.com>
Date: Fri Sep 27 15:06:57 2013 +0200
worker: changed some spice_assert in display_channel_draw_till
Reviewed-by: Jonathon Jongsma <jjongsma at redhat.com>
Acked-by: Frediano Ziglio <fziglio at redhat.com>
diff --git a/server/display-channel.c b/server/display-channel.c
index 1496f07..cffd6fa 100644
--- a/server/display-channel.c
+++ b/server/display-channel.c
@@ -1344,8 +1344,8 @@ void display_channel_draw_till(DisplayChannel *display, const SpiceRect *area, i
Drawable *now;
QRegion rgn;
- spice_assert(last);
- spice_assert(ring_item_is_linked(&last->list_link));
+ spice_return_if_fail(last);
+ spice_return_if_fail(ring_item_is_linked(&last->list_link));
surface = &display->surfaces[surface_id];
More information about the Spice-commits
mailing list