diff options
author | Laszlo Agocs <laszlo.agocs@qt.io> | 2023-10-27 11:16:21 +0200 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@qt.io> | 2023-10-31 20:20:11 +0200 |
commit | 522d9fcfe40a107779f6e21d83195fafa67fb064 (patch) | |
tree | 3bf8bea7d8bc7f30b3fe205a23d038a156059fe4 /src/gui/painting | |
parent | d53c0d721f111d53ea95eb8914ad88560a00feaa (diff) |
QRasterBackingStore: check format alpha presence in a more generic way
...instead of hardcoding a format such as ARGB32_Pre. A subclass may
override format() after all.
A few lines below there is the same check in fact, but this time
with hasAlphaChannel(). To be consistent, switch over to
hasAlphaChannel() in the first case as well.
Pick-to: 6.6 6.5
Change-Id: I7a5653863a72f8a0df98da66290f6d17e548b0a8
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src/gui/painting')
-rw-r--r-- | src/gui/painting/qrasterbackingstore.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/painting/qrasterbackingstore.cpp b/src/gui/painting/qrasterbackingstore.cpp index c0df8088d4..3b3ef2fd2e 100644 --- a/src/gui/painting/qrasterbackingstore.cpp +++ b/src/gui/painting/qrasterbackingstore.cpp @@ -67,7 +67,7 @@ void QRasterBackingStore::beginPaint(const QRegion ®ion) if (m_image.devicePixelRatio() != nativeWindowDevicePixelRatio || m_image.size() != effectiveBufferSize) { m_image = QImage(effectiveBufferSize, format()); m_image.setDevicePixelRatio(nativeWindowDevicePixelRatio); - if (m_image.format() == QImage::Format_ARGB32_Premultiplied) + if (m_image.hasAlphaChannel()) m_image.fill(Qt::transparent); } |