diff options
| author | UjinT34 <41110182+UjinT34@users.noreply.github.com> | 2026-03-07 13:27:47 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-03-07 10:27:47 +0000 |
| commit | 32e75e3e320fb66ab517a378df645f3d29b3a209 (patch) | |
| tree | 4212f4cf197fc961161de7a9e57b85735257184a /src/render/pass/TexPassElement.cpp | |
| parent | 36b19075f3a644a4095352d778e6d03e103bb334 (diff) | |
renderer: refactor render elements (#13438)
Part 2 of renderer refactors
Diffstat (limited to 'src/render/pass/TexPassElement.cpp')
| -rw-r--r-- | src/render/pass/TexPassElement.cpp | 46 |
1 files changed, 1 insertions, 45 deletions
diff --git a/src/render/pass/TexPassElement.cpp b/src/render/pass/TexPassElement.cpp index 39853a64..ad132226 100644 --- a/src/render/pass/TexPassElement.cpp +++ b/src/render/pass/TexPassElement.cpp @@ -1,8 +1,5 @@ #include "TexPassElement.hpp" -#include "../OpenGL.hpp" - -#include <hyprutils/utils/ScopeGuard.hpp> -using namespace Hyprutils::Utils; +#include "../Renderer.hpp" CTexPassElement::CTexPassElement(const SRenderData& data) : m_data(data) { ; @@ -12,47 +9,6 @@ CTexPassElement::CTexPassElement(CTexPassElement::SRenderData&& data) : m_data(s ; } -void CTexPassElement::draw(const CRegion& damage) { - g_pHyprOpenGL->pushMonitorTransformEnabled(m_data.flipEndFrame); - - CScopeGuard x = {[this]() { - // - g_pHyprOpenGL->popMonitorTransformEnabled(); - 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()) - g_pHyprOpenGL->m_renderData.clipBox = m_data.clipBox; - - if (m_data.replaceProjection) - g_pHyprOpenGL->m_renderData.monitorProjection = *m_data.replaceProjection; - - 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->renderTexture(m_data.tex, m_data.box, - { - .a = m_data.a, - .blur = true, - .blurA = m_data.blurA, - .overallA = 1.F, - .round = m_data.round, - .roundingPower = m_data.roundingPower, - .blockBlurOptimization = m_data.blockBlurOptimization.value_or(false), - }); - } else { - g_pHyprOpenGL->renderTexture(m_data.tex, m_data.box, - {.damage = m_data.damage.empty() ? &damage : &m_data.damage, .a = m_data.a, .round = m_data.round, .roundingPower = m_data.roundingPower}); - } -} - bool CTexPassElement::needsLiveBlur() { return false; // TODO? } |
