diff --git a/src/plugins/platforms/wayland/qwaylandcursor.cpp b/src/plugins/platforms/wayland/qwaylandcursor.cpp index 6ce2b7bbca4..bd820e28e84 100644 --- a/src/plugins/platforms/wayland/qwaylandcursor.cpp +++ b/src/plugins/platforms/wayland/qwaylandcursor.cpp @@ -119,7 +119,7 @@ QSharedPointer QWaylandCursor::cursorBitmapImage(const QCursor * const QImage &img = cursor->pixmap().toImage(); QSharedPointer buffer(new QWaylandShmBuffer(mDisplay, img.size(), img.format())); - memcpy(buffer->image()->bits(), img.bits(), img.byteCount()); + memcpy(buffer->image()->bits(), img.bits(), img.sizeInBytes()); return buffer; } diff --git a/src/plugins/platforms/wayland/qwaylandshmbackingstore.cpp b/src/plugins/platforms/wayland/qwaylandshmbackingstore.cpp index a7bc241651a..a9883c5c642 100644 --- a/src/plugins/platforms/wayland/qwaylandshmbackingstore.cpp +++ b/src/plugins/platforms/wayland/qwaylandshmbackingstore.cpp @@ -125,7 +125,7 @@ QWaylandShmBuffer::~QWaylandShmBuffer(void) { delete mMarginsImage; if (mImage.constBits()) - munmap((void *) mImage.constBits(), mImage.byteCount()); + munmap((void *) mImage.constBits(), mImage.sizeInBytes()); if (mShmPool) wl_shm_pool_destroy(mShmPool); } @@ -287,10 +287,10 @@ void QWaylandShmBackingStore::resize(const QSize &size) buffer = getBuffer(sizeWithMargins); } - int oldSize = mBackBuffer ? mBackBuffer->image()->byteCount() : 0; + qssize_t oldSize = mBackBuffer ? mBackBuffer->image()->sizeInBytes() : 0; // mBackBuffer may have been deleted here but if so it means its size was different so we wouldn't copy it anyway - if (mBackBuffer != buffer && oldSize == buffer->image()->byteCount()) { - memcpy(buffer->image()->bits(), mBackBuffer->image()->constBits(), buffer->image()->byteCount()); + if (mBackBuffer != buffer && oldSize == buffer->image()->sizeInBytes()) { + memcpy(buffer->image()->bits(), mBackBuffer->image()->constBits(), buffer->image()->sizeInBytes()); } mBackBuffer = buffer; // ensure the new buffer is at the beginning of the list so next time getBuffer() will pick