summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2017-12-06 10:56:30 +0100
committerMarc Mutz <marc.mutz@kdab.com>2017-12-06 18:31:00 +0000
commita016bed95fbd410ac3c646a3dd0cf9ffe50d1285 (patch)
treeabb5cfc0cb80b02a3e6406adbeb912c40a9ea0b2
parent9e187220868dedfa911da758881b85ffd0c64418 (diff)
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 <lars.knoll@qt.io>
-rw-r--r--src/plugins/platforms/xcb/qxcbbackingstore.cpp9
1 files 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 &region, c
void QXcbShmImage::flushPixmap(const QRegion &region, bool fullRegion)
{
- QVector<QRect> 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 &region, 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);