diff options
author | Alexander Larsson <alexl@redhat.com> | 2010-02-17 21:33:23 +0100 |
---|---|---|
committer | Alexander Larsson <alexl@redhat.com> | 2010-02-23 22:52:06 +0100 |
commit | 98dde80ed3c01f6ac08bcd14d34d6643da9f8418 (patch) | |
tree | a872eb82b7012195c4dd08dc7d2115f0cfac7e71 /client/application.cpp | |
parent | 8f912e49179803fa640b3bddf75b62e81b2f7178 (diff) | |
download | spice-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/application.cpp')
-rw-r--r-- | client/application.cpp | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/client/application.cpp b/client/application.cpp index cca7d434..0fa25b4f 100644 --- a/client/application.cpp +++ b/client/application.cpp @@ -171,13 +171,23 @@ InfoLayer::InfoLayer() void InfoLayer::draw_info(const QRegion& dest_region, RedDrawable& dest) { - for (int i = 0; i < (int)dest_region.num_rects; i++) { - SpiceRect* r = &dest_region.rects[i]; + pixman_box32_t *rects; + int num_rects; + + 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; + /* is rect inside sticky region or info region? */ - if (_sticky_on && rect_intersects(*r, _sticky_rect)) { - dest.blend_pixels(_sticky_pixmap, r->left - _sticky_pos.x, r->top - _sticky_pos.y, *r); + if (_sticky_on && rect_intersects(r, _sticky_rect)) { + dest.blend_pixels(_sticky_pixmap, r.left - _sticky_pos.x, r.top - _sticky_pos.y, r); } else { - dest.blend_pixels(_info_pixmap, r->left - _info_pos.x, r->top - _info_pos.y, *r); + dest.blend_pixels(_info_pixmap, r.left - _info_pos.x, r.top - _info_pos.y, r); } } } |