render: refactor class member vars (#10292)
* render: refactor class member vars * render: fix clang format
This commit is contained in:
parent
c7eb141098
commit
997fefbc11
63 changed files with 1307 additions and 1321 deletions
|
|
@ -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<CBox> 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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue