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>
This commit is contained in:
Laszlo Agocs 2023-10-27 11:16:21 +02:00
parent d53c0d721f
commit 522d9fcfe4

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);
}