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/red_gl_canvas.cpp | |
parent | 8f912e49179803fa640b3bddf75b62e81b2f7178 (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/red_gl_canvas.cpp')
-rw-r--r-- | client/red_gl_canvas.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/client/red_gl_canvas.cpp b/client/red_gl_canvas.cpp index 43bf424..6598425 100644 --- a/client/red_gl_canvas.cpp +++ b/client/red_gl_canvas.cpp @@ -69,9 +69,19 @@ void GCanvas::create_pixmap(int width, int height, RedWindow *win, void GCanvas::copy_pixels(const QRegion& region, RedDrawable& dest_dc) { - for (int i = 0; i < (int)region.num_rects; i++) { - SpiceRect* r = ®ion.rects[i]; - dest_dc.copy_pixels(*_pixmap, r->left, r->top, *r); + pixman_box32_t *rects; + int num_rects; + + rects = pixman_region32_rectangles((pixman_region32_t *)®ion, &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; + + dest_dc.copy_pixels(*_pixmap, r.left, r.top, r); } } |