renderer/internal: stop using box pointers
in favor of const refs
This commit is contained in:
parent
16aeb24bc1
commit
e951011503
32 changed files with 252 additions and 264 deletions
|
|
@ -7,9 +7,9 @@ CBorderPassElement::CBorderPassElement(const CBorderPassElement::SBorderData& da
|
|||
|
||||
void CBorderPassElement::draw(const CRegion& damage) {
|
||||
if (data.hasGrad2)
|
||||
g_pHyprOpenGL->renderBorder(&data.box, data.grad1, data.grad2, data.lerp, data.round, data.roundingPower, data.borderSize, data.a, data.outerRound);
|
||||
g_pHyprOpenGL->renderBorder(data.box, data.grad1, data.grad2, data.lerp, data.round, data.roundingPower, data.borderSize, data.a, data.outerRound);
|
||||
else
|
||||
g_pHyprOpenGL->renderBorder(&data.box, data.grad1, data.round, data.roundingPower, data.borderSize, data.a, data.outerRound);
|
||||
g_pHyprOpenGL->renderBorder(data.box, data.grad1, data.round, data.roundingPower, data.borderSize, data.a, data.outerRound);
|
||||
}
|
||||
|
||||
bool CBorderPassElement::needsLiveBlur() {
|
||||
|
|
|
|||
|
|
@ -202,9 +202,9 @@ CRegion CRenderPass::render(const CRegion& damage_) {
|
|||
void CRenderPass::renderDebugData() {
|
||||
CBox box = {{}, g_pHyprOpenGL->m_RenderData.pMonitor->vecTransformedSize};
|
||||
for (const auto& rg : occludedRegions) {
|
||||
g_pHyprOpenGL->renderRectWithDamage(&box, Colors::RED.modifyA(0.1F), rg);
|
||||
g_pHyprOpenGL->renderRectWithDamage(box, Colors::RED.modifyA(0.1F), rg);
|
||||
}
|
||||
g_pHyprOpenGL->renderRectWithDamage(&box, Colors::GREEN.modifyA(0.1F), totalLiveBlurRegion);
|
||||
g_pHyprOpenGL->renderRectWithDamage(box, Colors::GREEN.modifyA(0.1F), totalLiveBlurRegion);
|
||||
|
||||
std::unordered_map<CWLSurfaceResource*, float> offsets;
|
||||
|
||||
|
|
@ -227,7 +227,7 @@ void CRenderPass::renderDebugData() {
|
|||
if (box.intersection(CBox{{}, g_pHyprOpenGL->m_RenderData.pMonitor->vecSize}).empty())
|
||||
return;
|
||||
|
||||
g_pHyprOpenGL->renderRectWithDamage(&box, color, CRegion{0, 0, INT32_MAX, INT32_MAX});
|
||||
g_pHyprOpenGL->renderRectWithDamage(box, color, CRegion{0, 0, INT32_MAX, INT32_MAX});
|
||||
|
||||
if (offsets.contains(surface.get()))
|
||||
box.translate(Vector2D{0.F, offsets[surface.get()]});
|
||||
|
|
@ -235,8 +235,8 @@ void CRenderPass::renderDebugData() {
|
|||
offsets[surface.get()] = 0;
|
||||
|
||||
box = {box.pos(), texture->m_vSize};
|
||||
g_pHyprOpenGL->renderRectWithDamage(&box, CHyprColor{0.F, 0.F, 0.F, 0.2F}, CRegion{0, 0, INT32_MAX, INT32_MAX}, std::min(5.0, box.size().y));
|
||||
g_pHyprOpenGL->renderTexture(texture, &box, 1.F);
|
||||
g_pHyprOpenGL->renderRectWithDamage(box, CHyprColor{0.F, 0.F, 0.F, 0.2F}, CRegion{0, 0, INT32_MAX, INT32_MAX}, std::min(5.0, box.size().y));
|
||||
g_pHyprOpenGL->renderTexture(texture, box, 1.F);
|
||||
|
||||
offsets[surface.get()] += texture->m_vSize.y;
|
||||
};
|
||||
|
|
@ -253,7 +253,7 @@ void CRenderPass::renderDebugData() {
|
|||
|
||||
if (tex) {
|
||||
box = CBox{{0.F, g_pHyprOpenGL->m_RenderData.pMonitor->vecSize.y - tex->m_vSize.y}, tex->m_vSize}.scale(g_pHyprOpenGL->m_RenderData.pMonitor->scale);
|
||||
g_pHyprOpenGL->renderTexture(tex, &box, 1.F);
|
||||
g_pHyprOpenGL->renderTexture(tex, box, 1.F);
|
||||
}
|
||||
|
||||
std::string passStructure;
|
||||
|
|
@ -271,7 +271,7 @@ void CRenderPass::renderDebugData() {
|
|||
if (tex) {
|
||||
box = CBox{{g_pHyprOpenGL->m_RenderData.pMonitor->vecSize.x - tex->m_vSize.x, g_pHyprOpenGL->m_RenderData.pMonitor->vecSize.y - tex->m_vSize.y}, tex->m_vSize}.scale(
|
||||
g_pHyprOpenGL->m_RenderData.pMonitor->scale);
|
||||
g_pHyprOpenGL->renderTexture(tex, &box, 1.F);
|
||||
g_pHyprOpenGL->renderTexture(tex, box, 1.F);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -10,9 +10,9 @@ void CRectPassElement::draw(const CRegion& damage) {
|
|||
return;
|
||||
|
||||
if (data.color.a == 1.F || !data.blur)
|
||||
g_pHyprOpenGL->renderRectWithDamage(&data.box, data.color, damage, data.round, data.roundingPower);
|
||||
g_pHyprOpenGL->renderRectWithDamage(data.box, data.color, damage, data.round, data.roundingPower);
|
||||
else
|
||||
g_pHyprOpenGL->renderRectWithBlur(&data.box, data.color, data.round, data.roundingPower, data.blurA, data.xray);
|
||||
g_pHyprOpenGL->renderRectWithBlur(data.box, data.color, data.round, data.roundingPower, data.blurA, data.xray);
|
||||
}
|
||||
|
||||
bool CRectPassElement::needsLiveBlur() {
|
||||
|
|
|
|||
|
|
@ -122,14 +122,14 @@ void CSurfacePassElement::draw(const CRegion& damage) {
|
|||
// to what we do for misaligned surfaces (blur the entire thing and then render shit without blur)
|
||||
if (data.surfaceCounter == 0 && !data.popup) {
|
||||
if (BLUR)
|
||||
g_pHyprOpenGL->renderTextureWithBlur(TEXTURE, &windowBox, ALPHA, data.surface, rounding, roundingPower, data.blockBlurOptimization, data.fadeAlpha, OVERALL_ALPHA);
|
||||
g_pHyprOpenGL->renderTextureWithBlur(TEXTURE, windowBox, ALPHA, data.surface, rounding, roundingPower, data.blockBlurOptimization, data.fadeAlpha, OVERALL_ALPHA);
|
||||
else
|
||||
g_pHyprOpenGL->renderTexture(TEXTURE, &windowBox, ALPHA * OVERALL_ALPHA, rounding, roundingPower, false, true);
|
||||
g_pHyprOpenGL->renderTexture(TEXTURE, windowBox, ALPHA * OVERALL_ALPHA, rounding, roundingPower, false, true);
|
||||
} else {
|
||||
if (BLUR && data.popup)
|
||||
g_pHyprOpenGL->renderTextureWithBlur(TEXTURE, &windowBox, ALPHA, data.surface, rounding, roundingPower, true, data.fadeAlpha, OVERALL_ALPHA);
|
||||
g_pHyprOpenGL->renderTextureWithBlur(TEXTURE, windowBox, ALPHA, data.surface, rounding, roundingPower, true, data.fadeAlpha, OVERALL_ALPHA);
|
||||
else
|
||||
g_pHyprOpenGL->renderTexture(TEXTURE, &windowBox, ALPHA * OVERALL_ALPHA, rounding, roundingPower, false, true);
|
||||
g_pHyprOpenGL->renderTexture(TEXTURE, windowBox, ALPHA * OVERALL_ALPHA, rounding, roundingPower, false, true);
|
||||
}
|
||||
|
||||
if (!g_pHyprRenderer->m_bBlockSurfaceFeedback)
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ void CTexPassElement::draw(const CRegion& damage) {
|
|||
|
||||
if (data.replaceProjection)
|
||||
g_pHyprOpenGL->m_RenderData.monitorProjection = *data.replaceProjection;
|
||||
g_pHyprOpenGL->renderTextureInternalWithDamage(data.tex, &data.box, data.a, data.damage.empty() ? damage : data.damage, data.round, data.roundingPower, data.syncTimeline,
|
||||
g_pHyprOpenGL->renderTextureInternalWithDamage(data.tex, data.box, data.a, data.damage.empty() ? damage : data.damage, data.round, data.roundingPower, data.syncTimeline,
|
||||
data.syncPoint);
|
||||
if (data.replaceProjection)
|
||||
g_pHyprOpenGL->m_RenderData.monitorProjection = g_pHyprOpenGL->m_RenderData.pMonitor->projMatrix;
|
||||
|
|
|
|||
|
|
@ -9,11 +9,11 @@ void CTextureMatteElement::draw(const CRegion& damage) {
|
|||
if (data.disableTransformAndModify) {
|
||||
g_pHyprOpenGL->setMonitorTransformEnabled(true);
|
||||
g_pHyprOpenGL->setRenderModifEnabled(false);
|
||||
g_pHyprOpenGL->renderTextureMatte(data.tex, &data.box, *data.fb);
|
||||
g_pHyprOpenGL->renderTextureMatte(data.tex, data.box, *data.fb);
|
||||
g_pHyprOpenGL->setRenderModifEnabled(true);
|
||||
g_pHyprOpenGL->setMonitorTransformEnabled(false);
|
||||
} else
|
||||
g_pHyprOpenGL->renderTextureMatte(data.tex, &data.box, *data.fb);
|
||||
g_pHyprOpenGL->renderTextureMatte(data.tex, data.box, *data.fb);
|
||||
}
|
||||
|
||||
bool CTextureMatteElement::needsLiveBlur() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue