summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/client/qwaylandcursor.cpp2
-rw-r--r--src/client/qwaylandshmbackingstore.cpp8
-rw-r--r--src/hardwareintegration/compositor/shm-emulation-server/shmserverbufferintegration.cpp2
-rw-r--r--tests/auto/compositor/compositor/mockclient.cpp2
4 files changed, 7 insertions, 7 deletions
diff --git a/src/client/qwaylandcursor.cpp b/src/client/qwaylandcursor.cpp
index 6ce2b7bbc..bd820e28e 100644
--- a/src/client/qwaylandcursor.cpp
+++ b/src/client/qwaylandcursor.cpp
@@ -119,7 +119,7 @@ QSharedPointer<QWaylandBuffer> QWaylandCursor::cursorBitmapImage(const QCursor *
const QImage &img = cursor->pixmap().toImage();
QSharedPointer<QWaylandShmBuffer> 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/client/qwaylandshmbackingstore.cpp b/src/client/qwaylandshmbackingstore.cpp
index a7bc24165..a9883c5c6 100644
--- a/src/client/qwaylandshmbackingstore.cpp
+++ b/src/client/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
diff --git a/src/hardwareintegration/compositor/shm-emulation-server/shmserverbufferintegration.cpp b/src/hardwareintegration/compositor/shm-emulation-server/shmserverbufferintegration.cpp
index 7a86785b0..de2288e51 100644
--- a/src/hardwareintegration/compositor/shm-emulation-server/shmserverbufferintegration.cpp
+++ b/src/hardwareintegration/compositor/shm-emulation-server/shmserverbufferintegration.cpp
@@ -70,7 +70,7 @@ ShmServerBuffer::ShmServerBuffer(ShmServerBufferIntegration *integration, const
QString key = "qt_shm_emulation_" + QString::number(qimage.cacheKey());
m_shm = new QSharedMemory(key);
- int shm_size = qimage.byteCount();
+ qssize_t shm_size = qimage.sizeInBytes();
bool ok = m_shm->create(shm_size) && m_shm->lock();
if (ok) {
memcpy(m_shm->data(), qimage.constBits(), shm_size);
diff --git a/tests/auto/compositor/compositor/mockclient.cpp b/tests/auto/compositor/compositor/mockclient.cpp
index 3b3bfa756..970890a65 100644
--- a/tests/auto/compositor/compositor/mockclient.cpp
+++ b/tests/auto/compositor/compositor/mockclient.cpp
@@ -249,7 +249,7 @@ ShmBuffer::ShmBuffer(const QSize &size, wl_shm *shm)
ShmBuffer::~ShmBuffer()
{
- munmap(image.bits(), image.byteCount());
+ munmap(image.bits(), image.sizeInBytes());
wl_buffer_destroy(handle);
wl_shm_pool_destroy(shm_pool);
}