summaryrefslogtreecommitdiffstats
path: root/src/client
diff options
context:
space:
mode:
authorJohan Klokkhammer Helsing <johan.helsing@qt.io>2017-10-04 10:39:36 +0200
committerJohan Helsing <johan.helsing@qt.io>2017-10-19 06:57:09 +0000
commit88be2bcd67ba3588ae09e5a8c452543a3495d303 (patch)
tree75c731815060f943cbdb2159a9f57f0ffb9b3e76 /src/client
parent2355bf6344f4fd72ce62b0664682670af4c5079f (diff)
Use QImage::sizeInBytes() instead of deprecated QImage::byteCount()
Change-Id: If3f21fc43d0118c1819d354c8ef43f1b79617c7b Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src/client')
-rw-r--r--src/client/qwaylandcursor.cpp2
-rw-r--r--src/client/qwaylandshmbackingstore.cpp8
2 files changed, 5 insertions, 5 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