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>
This commit is contained in:
parent
9e18722086
commit
a016bed95f
@ -445,12 +445,11 @@ void QXcbShmImage::shmPutImage(xcb_drawable_t drawable, const QRegion ®ion, c
|
|||||||
|
|
||||||
void QXcbShmImage::flushPixmap(const QRegion ®ion, bool fullRegion)
|
void QXcbShmImage::flushPixmap(const QRegion ®ion, bool fullRegion)
|
||||||
{
|
{
|
||||||
QVector<QRect> rects;
|
|
||||||
if (!fullRegion) {
|
if (!fullRegion) {
|
||||||
rects = m_pendingFlush.intersected(region).rects();
|
auto actualRegion = m_pendingFlush.intersected(region);
|
||||||
m_pendingFlush -= region;
|
m_pendingFlush -= region;
|
||||||
} else {
|
flushPixmap(actualRegion, true);
|
||||||
rects = region.rects();
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
xcb_image_t xcb_subimage;
|
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;
|
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.
|
// 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.
|
// Each request takes req_size + m_xcb_image->stride * height bytes.
|
||||||
static const uint32_t req_size = sizeof(xcb_put_image_request_t);
|
static const uint32_t req_size = sizeof(xcb_put_image_request_t);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user