From cd314806a80b4e566a9c598b9ea9b0b7eedf3814 Mon Sep 17 00:00:00 2001 From: Brendan Fletcher Date: Tue, 25 Jun 2024 20:54:59 -0400 Subject: [PATCH] Fix blending issue on some systems --- gui/qt/lcdwidget.cpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/gui/qt/lcdwidget.cpp b/gui/qt/lcdwidget.cpp index d4911138d..cde9b1026 100644 --- a/gui/qt/lcdwidget.cpp +++ b/gui/qt/lcdwidget.cpp @@ -236,21 +236,20 @@ bool LCDWidget::draw() { c.fillRect(c.window(), QColor(0, 0, 0, (1.0f - backlight.factor) * 255.0f)); } if (m_responseMode) { - QPainter c; if (lcd.useDma && panel.params.GATECTRL.SM) { m_blendedFrame.reinterpretAsFormat(QImage::Format_RGBA8888_Premultiplied); - c.begin(&m_blendedFrame); - c.setCompositionMode(QPainter::CompositionMode_DestinationIn); - c.drawImage(QPoint(0, 0), m_interlaceAlpha); - c.setCompositionMode(QPainter::CompositionMode_DestinationOver); - c.drawImage(QPoint(0, 0), m_renderedFrame); - c.end(); + { + QPainter c(&m_blendedFrame); + c.setCompositionMode(QPainter::CompositionMode_DestinationIn); + c.drawImage(QPoint(0, 0), m_interlaceAlpha); + c.setCompositionMode(QPainter::CompositionMode_DestinationOver); + c.drawImage(QPoint(0, 0), m_renderedFrame); + } m_blendedFrame.reinterpretAsFormat(QImage::Format_RGBX8888); } else { - c.begin(&m_blendedFrame); + QPainter c(&m_blendedFrame); c.setOpacity(0.6); c.drawImage(QPoint(0, 0), m_renderedFrame); - c.end(); } m_currFrame = &m_blendedFrame; } else {