From 997fefbc1113323ed2bf5d782bdafc0d17532647 Mon Sep 17 00:00:00 2001 From: davc0n Date: Mon, 5 May 2025 23:44:49 +0200 Subject: render: refactor class member vars (#10292) * render: refactor class member vars * render: fix clang format --- src/render/pass/RectPassElement.cpp | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'src/render/pass/RectPassElement.cpp') diff --git a/src/render/pass/RectPassElement.cpp b/src/render/pass/RectPassElement.cpp index 1dab6a71..22f3bb11 100644 --- a/src/render/pass/RectPassElement.cpp +++ b/src/render/pass/RectPassElement.cpp @@ -1,45 +1,45 @@ #include "RectPassElement.hpp" #include "../OpenGL.hpp" -CRectPassElement::CRectPassElement(const CRectPassElement::SRectData& data_) : data(data_) { +CRectPassElement::CRectPassElement(const CRectPassElement::SRectData& data_) : m_data(data_) { ; } void CRectPassElement::draw(const CRegion& damage) { - if (data.box.w <= 0 || data.box.h <= 0) + if (m_data.box.w <= 0 || m_data.box.h <= 0) return; - if (!data.clipBox.empty()) - g_pHyprOpenGL->m_RenderData.clipBox = data.clipBox; + if (!m_data.clipBox.empty()) + g_pHyprOpenGL->m_renderData.clipBox = m_data.clipBox; - if (data.color.a == 1.F || !data.blur) - g_pHyprOpenGL->renderRectWithDamage(data.box, data.color, damage, data.round, data.roundingPower); + if (m_data.color.a == 1.F || !m_data.blur) + g_pHyprOpenGL->renderRectWithDamage(m_data.box, m_data.color, damage, m_data.round, m_data.roundingPower); else - g_pHyprOpenGL->renderRectWithBlur(data.box, data.color, data.round, data.roundingPower, data.blurA, data.xray); + g_pHyprOpenGL->renderRectWithBlur(m_data.box, m_data.color, m_data.round, m_data.roundingPower, m_data.blurA, m_data.xray); - g_pHyprOpenGL->m_RenderData.clipBox = {}; + g_pHyprOpenGL->m_renderData.clipBox = {}; } bool CRectPassElement::needsLiveBlur() { - return data.color.a < 1.F && !data.xray && data.blur; + return m_data.color.a < 1.F && !m_data.xray && m_data.blur; } bool CRectPassElement::needsPrecomputeBlur() { - return data.color.a < 1.F && data.xray && data.blur; + return m_data.color.a < 1.F && m_data.xray && m_data.blur; } std::optional CRectPassElement::boundingBox() { - return data.box.copy().scale(1.F / g_pHyprOpenGL->m_RenderData.pMonitor->m_scale).round(); + return m_data.box.copy().scale(1.F / g_pHyprOpenGL->m_renderData.pMonitor->m_scale).round(); } CRegion CRectPassElement::opaqueRegion() { - if (data.color.a < 1.F) + if (m_data.color.a < 1.F) return CRegion{}; - CRegion rg = boundingBox()->expand(-data.round); + CRegion rg = boundingBox()->expand(-m_data.round); - if (!data.clipBox.empty()) - rg.intersect(data.clipBox); + if (!m_data.clipBox.empty()) + rg.intersect(m_data.clipBox); return rg; } -- cgit v1.2.3