summaryrefslogtreecommitdiff
path: root/client/cursor_channel.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/cursor_channel.cpp
parent8f912e49179803fa640b3bddf75b62e81b2f7178 (diff)
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/cursor_channel.cpp')
-rw-r--r--client/cursor_channel.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/client/cursor_channel.cpp b/client/cursor_channel.cpp
index 30c52d9..0909f5c 100644
--- a/client/cursor_channel.cpp
+++ b/client/cursor_channel.cpp
@@ -434,16 +434,26 @@ void CursorChannel::remove_cursor()
void CursorChannel::copy_pixels(const QRegion& dest_region, RedDrawable& dest_dc)
{
+ pixman_box32_t *rects;
+ int num_rects;
+
Lock lock(_update_lock);
if (!_cursor_visible) {
return;
}
- for (int i = 0; i < (int)dest_region.num_rects; i++) {
+ rects = pixman_region32_rectangles((pixman_region32_t *)&dest_region, &num_rects);
+ for (int i = 0; i < num_rects; i++) {
+ SpiceRect r;
+
+ r.left = rects[i].x1;
+ r.top = rects[i].y1;
+ r.right = rects[i].x2;
+ r.bottom = rects[i].y2;
ASSERT(_cursor && _cursor->get_opaque());
((NaitivCursor*)_cursor->get_opaque())->draw(dest_dc, _cursor_rect.left, _cursor_rect.top,
- dest_region.rects[i]);
+ r);
}
}