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.5
Change-Id: I7a5653863a72f8a0df98da66290f6d17e548b0a8
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 522d9fcfe40a107779f6e21d83195fafa67fb064)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Laszlo Agocs 2023-10-27 11:16:21 +02:00 committed by Qt Cherry-pick Bot
parent 6f22ed4b55
commit b808b7004c

View File

@ -67,7 +67,7 @@ void QRasterBackingStore::beginPaint(const QRegion &region)
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);
}