From b808b7004cc968c1613cf7c32a0af394495b812b Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Fri, 27 Oct 2023 11:16:21 +0200 Subject: [PATCH] QRasterBackingStore: check format alpha presence in a more generic way MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ...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.5 Change-Id: I7a5653863a72f8a0df98da66290f6d17e548b0a8 Reviewed-by: Tor Arne Vestbø (cherry picked from commit 522d9fcfe40a107779f6e21d83195fafa67fb064) Reviewed-by: Qt Cherry-pick Bot --- src/gui/painting/qrasterbackingstore.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/painting/qrasterbackingstore.cpp b/src/gui/painting/qrasterbackingstore.cpp index c0df8088d40..3b3ef2fd2ea 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); }