From a7e1118103b367e4e5738104afdc7885536c7a1b Mon Sep 17 00:00:00 2001 From: Paul Lemire Date: Fri, 10 Feb 2023 06:52:03 +0100 Subject: [PATCH] QPaintedTextureImage: fill image with transparency by default Avoids having junk in the texture on the first paint call if not filling a rectangle with a QPainter. Change-Id: Icb65b6f994a9edea5132a2c54406fa0dd817bcb2 Reviewed-by: Mike Krus (cherry picked from commit 20d36f07fa7815fb7a05018c93602932e600397b) Reviewed-by: Qt Cherry-pick Bot Reviewed-by: Paul Lemire --- src/render/texture/qpaintedtextureimage.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/render/texture/qpaintedtextureimage.cpp b/src/render/texture/qpaintedtextureimage.cpp index c035888867..3c64b3bb41 100644 --- a/src/render/texture/qpaintedtextureimage.cpp +++ b/src/render/texture/qpaintedtextureimage.cpp @@ -87,6 +87,7 @@ void QPaintedTextureImagePrivate::repaint() { m_image.reset(new QImage(m_imageSize, QImage::Format_RGBA8888)); m_image->setDevicePixelRatio(m_devicePixelRatio); + m_image->fill(Qt::transparent); } QPainter painter(m_image.data()); -- GitLab