summaryrefslogtreecommitdiffstats
path: root/client/screen_layer.cpp
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2010-02-17 21:33:23 +0100
committerAlexander Larsson <alexl@redhat.com>2010-02-23 22:52:06 +0100
commit98dde80ed3c01f6ac08bcd14d34d6643da9f8418 (patch)
treea872eb82b7012195c4dd08dc7d2115f0cfac7e71 /client/screen_layer.cpp
parent8f912e49179803fa640b3bddf75b62e81b2f7178 (diff)
downloadspice-98dde80ed3c01f6ac08bcd14d34d6643da9f8418.tar.gz
spice-98dde80ed3c01f6ac08bcd14d34d6643da9f8418.tar.xz
spice-98dde80ed3c01f6ac08bcd14d34d6643da9f8418.zip
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.
Diffstat (limited to 'client/screen_layer.cpp')
-rw-r--r--client/screen_layer.cpp21
1 files changed, 17 insertions, 4 deletions
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 *)&region, &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);
}
}