From a016bed95fbd410ac3c646a3dd0cf9ffe50d1285 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Wed, 6 Dec 2017 10:56:30 +0100 Subject: xcb: port away from last QRegion::rects() Use begin()/end() instead. In QXcbShmImage::flushPixmap(), instead of gettings different rects(), depending on a bool parameter, just call yourself again with the modified QRegion, which we can then just iterate over. Change-Id: I6d4f7c6e4e5d2a24520716847ca9331bf39337c8 Reviewed-by: Lars Knoll --- src/plugins/platforms/xcb/qxcbbackingstore.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/plugins/platforms/xcb/qxcbbackingstore.cpp b/src/plugins/platforms/xcb/qxcbbackingstore.cpp index 979c8142f7..1cf45c96d1 100644 --- a/src/plugins/platforms/xcb/qxcbbackingstore.cpp +++ b/src/plugins/platforms/xcb/qxcbbackingstore.cpp @@ -445,12 +445,11 @@ void QXcbShmImage::shmPutImage(xcb_drawable_t drawable, const QRegion ®ion, c void QXcbShmImage::flushPixmap(const QRegion ®ion, bool fullRegion) { - QVector rects; if (!fullRegion) { - rects = m_pendingFlush.intersected(region).rects(); + auto actualRegion = m_pendingFlush.intersected(region); m_pendingFlush -= region; - } else { - rects = region.rects(); + flushPixmap(actualRegion, true); + return; } xcb_image_t xcb_subimage; @@ -467,7 +466,7 @@ void QXcbShmImage::flushPixmap(const QRegion ®ion, bool fullRegion) const bool needsByteSwap = xcb_subimage.byte_order != m_xcb_image->byte_order; - for (const QRect &rect : qAsConst(rects)) { + for (const QRect &rect : region) { // We must make sure that each request is not larger than max_req_size. // Each request takes req_size + m_xcb_image->stride * height bytes. static const uint32_t req_size = sizeof(xcb_put_image_request_t); -- cgit v1.2.3