summaryrefslogtreecommitdiff
path: root/src/render/pass/TexPassElement.cpp
diff options
context:
space:
mode:
authorVaxry <43317083+vaxerski@users.noreply.github.com>2025-05-10 18:31:26 +0100
committerGitHub <noreply@github.com>2025-05-10 19:31:26 +0200
commitf58bb72d3a300dc482e9dc934101790c8707667d (patch)
tree8d05540c2dfa630241e016978437bf62023a7eee /src/render/pass/TexPassElement.cpp
parent60cd5b7a48af4a23717201d70395161a3bb4ab24 (diff)
renderer: render blur on fade out (#10356)
Diffstat (limited to 'src/render/pass/TexPassElement.cpp')
-rw-r--r--src/render/pass/TexPassElement.cpp19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/render/pass/TexPassElement.cpp b/src/render/pass/TexPassElement.cpp
index b27f1032..e6f4d052 100644
--- a/src/render/pass/TexPassElement.cpp
+++ b/src/render/pass/TexPassElement.cpp
@@ -11,10 +11,14 @@ CTexPassElement::CTexPassElement(const CTexPassElement::SRenderData& data_) : m_
void CTexPassElement::draw(const CRegion& damage) {
g_pHyprOpenGL->m_endFrame = m_data.flipEndFrame;
- CScopeGuard x = {[]() {
+ CScopeGuard x = {[this]() {
//
g_pHyprOpenGL->m_endFrame = false;
g_pHyprOpenGL->m_renderData.clipBox = {};
+ if (m_data.replaceProjection)
+ g_pHyprOpenGL->m_renderData.monitorProjection = g_pHyprOpenGL->m_renderData.pMonitor->m_projMatrix;
+ if (m_data.ignoreAlpha.has_value())
+ g_pHyprOpenGL->m_renderData.discardMode = 0;
}};
if (!m_data.clipBox.empty())
@@ -22,9 +26,16 @@ void CTexPassElement::draw(const CRegion& damage) {
if (m_data.replaceProjection)
g_pHyprOpenGL->m_renderData.monitorProjection = *m_data.replaceProjection;
- g_pHyprOpenGL->renderTextureInternalWithDamage(m_data.tex, m_data.box, m_data.a, m_data.damage.empty() ? damage : m_data.damage, m_data.round, m_data.roundingPower);
- if (m_data.replaceProjection)
- g_pHyprOpenGL->m_renderData.monitorProjection = g_pHyprOpenGL->m_renderData.pMonitor->m_projMatrix;
+
+ if (m_data.ignoreAlpha.has_value()) {
+ g_pHyprOpenGL->m_renderData.discardMode = DISCARD_ALPHA;
+ g_pHyprOpenGL->m_renderData.discardOpacity = *m_data.ignoreAlpha;
+ }
+
+ if (m_data.blur)
+ g_pHyprOpenGL->renderTextureWithBlur(m_data.tex, m_data.box, m_data.a, nullptr, m_data.round, m_data.roundingPower, false, m_data.blurA, 1.F);
+ else
+ g_pHyprOpenGL->renderTextureInternalWithDamage(m_data.tex, m_data.box, m_data.a, m_data.damage.empty() ? damage : m_data.damage, m_data.round, m_data.roundingPower);
}
bool CTexPassElement::needsLiveBlur() {