From 98dde80ed3c01f6ac08bcd14d34d6643da9f8418 Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Wed, 17 Feb 2010 21:33:23 +0100 Subject: Replace custom region implementation with pixman_region32_t pixman_region32_t is an efficient well tested region implementation (its the one used in X) that we already depend on via pixman and use in some places. No need to have a custom region implementation. --- client/screen_layer.cpp | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'client/screen_layer.cpp') diff --git a/client/screen_layer.cpp b/client/screen_layer.cpp index af25211e..ef5ef95e 100644 --- a/client/screen_layer.cpp +++ b/client/screen_layer.cpp @@ -93,13 +93,26 @@ uint64_t ScreenLayer::invalidate(const SpiceRect& r, bool urgent) void ScreenLayer::invalidate(const QRegion& region) { + pixman_box32_t *rects, *end; + int num_rects; + if (!_screen) { return; } - SpiceRect *r = region.rects; - SpiceRect *end = r + region.num_rects; - while (r != end) { - invalidate_rect(*r++, false); + + rects = pixman_region32_rectangles((pixman_region32_t *)®ion, &num_rects); + end = rects + num_rects; + + while (rects != end) { + SpiceRect r; + + r.left = rects->x1; + r.top = rects->y1; + r.right = rects->x2; + r.bottom = rects->y2; + rects++; + + invalidate_rect(r, false); } } -- cgit