opengl: improve render fn arg clarity (#11286)
This commit is contained in:
parent
3e35797b18
commit
a907ecd4ff
11 changed files with 269 additions and 168 deletions
|
|
@ -7,9 +7,13 @@ CBorderPassElement::CBorderPassElement(const CBorderPassElement::SBorderData& da
|
|||
|
||||
void CBorderPassElement::draw(const CRegion& damage) {
|
||||
if (m_data.hasGrad2)
|
||||
g_pHyprOpenGL->renderBorder(m_data.box, m_data.grad1, m_data.grad2, m_data.lerp, m_data.round, m_data.roundingPower, m_data.borderSize, m_data.a, m_data.outerRound);
|
||||
g_pHyprOpenGL->renderBorder(
|
||||
m_data.box, m_data.grad1, m_data.grad2, m_data.lerp,
|
||||
{.round = m_data.round, .roundingPower = m_data.roundingPower, .borderSize = m_data.borderSize, .a = m_data.a, .outerRound = m_data.outerRound});
|
||||
else
|
||||
g_pHyprOpenGL->renderBorder(m_data.box, m_data.grad1, m_data.round, m_data.roundingPower, m_data.borderSize, m_data.a, m_data.outerRound);
|
||||
g_pHyprOpenGL->renderBorder(
|
||||
m_data.box, m_data.grad1,
|
||||
{.round = m_data.round, .roundingPower = m_data.roundingPower, .borderSize = m_data.borderSize, .a = m_data.a, .outerRound = m_data.outerRound});
|
||||
}
|
||||
|
||||
bool CBorderPassElement::needsLiveBlur() {
|
||||
|
|
|
|||
|
|
@ -199,9 +199,9 @@ CRegion CRenderPass::render(const CRegion& damage_) {
|
|||
void CRenderPass::renderDebugData() {
|
||||
CBox box = {{}, g_pHyprOpenGL->m_renderData.pMonitor->m_transformedSize};
|
||||
for (const auto& rg : m_occludedRegions) {
|
||||
g_pHyprOpenGL->renderRectWithDamage(box, Colors::RED.modifyA(0.1F), rg);
|
||||
g_pHyprOpenGL->renderRect(box, Colors::RED.modifyA(0.1F), {.damage = &rg});
|
||||
}
|
||||
g_pHyprOpenGL->renderRectWithDamage(box, Colors::GREEN.modifyA(0.1F), m_totalLiveBlurRegion);
|
||||
g_pHyprOpenGL->renderRect(box, Colors::GREEN.modifyA(0.1F), {.damage = &m_totalLiveBlurRegion});
|
||||
|
||||
std::unordered_map<CWLSurfaceResource*, float> offsets;
|
||||
|
||||
|
|
@ -224,7 +224,9 @@ void CRenderPass::renderDebugData() {
|
|||
if (box.intersection(CBox{{}, g_pHyprOpenGL->m_renderData.pMonitor->m_size}).empty())
|
||||
return;
|
||||
|
||||
g_pHyprOpenGL->renderRectWithDamage(box, color, CRegion{0, 0, INT32_MAX, INT32_MAX});
|
||||
static const auto FULL_REGION = CRegion{0, 0, INT32_MAX, INT32_MAX};
|
||||
|
||||
g_pHyprOpenGL->renderRect(box, color, {.damage = &FULL_REGION});
|
||||
|
||||
if (offsets.contains(surface.get()))
|
||||
box.translate(Vector2D{0.F, offsets[surface.get()]});
|
||||
|
|
@ -232,8 +234,8 @@ void CRenderPass::renderDebugData() {
|
|||
offsets[surface.get()] = 0;
|
||||
|
||||
box = {box.pos(), texture->m_size};
|
||||
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->renderRect(box, CHyprColor{0.F, 0.F, 0.F, 0.2F}, {.damage = &FULL_REGION, .round = std::min(5.0, box.size().y)});
|
||||
g_pHyprOpenGL->renderTexture(texture, box, {});
|
||||
|
||||
offsets[surface.get()] += texture->m_size.y;
|
||||
};
|
||||
|
|
@ -253,7 +255,7 @@ void CRenderPass::renderDebugData() {
|
|||
auto region = g_pSeatManager->m_state.pointerFocus->m_current.input.copy()
|
||||
.scale(g_pHyprOpenGL->m_renderData.pMonitor->m_scale)
|
||||
.translate(BOX->pos() - g_pHyprOpenGL->m_renderData.pMonitor->m_position);
|
||||
g_pHyprOpenGL->renderRectWithDamage(box, CHyprColor{0.8F, 0.8F, 0.2F, 0.4F}, region);
|
||||
g_pHyprOpenGL->renderRect(box, CHyprColor{0.8F, 0.8F, 0.2F, 0.4F}, {.damage = ®ion});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -266,7 +268,7 @@ void CRenderPass::renderDebugData() {
|
|||
|
||||
if (tex) {
|
||||
box = CBox{{0.F, g_pHyprOpenGL->m_renderData.pMonitor->m_size.y - tex->m_size.y}, tex->m_size}.scale(g_pHyprOpenGL->m_renderData.pMonitor->m_scale);
|
||||
g_pHyprOpenGL->renderTexture(tex, box, 1.F);
|
||||
g_pHyprOpenGL->renderTexture(tex, box, {});
|
||||
}
|
||||
|
||||
std::string passStructure;
|
||||
|
|
@ -284,7 +286,7 @@ void CRenderPass::renderDebugData() {
|
|||
if (tex) {
|
||||
box = CBox{{g_pHyprOpenGL->m_renderData.pMonitor->m_size.x - tex->m_size.x, g_pHyprOpenGL->m_renderData.pMonitor->m_size.y - tex->m_size.y}, tex->m_size}.scale(
|
||||
g_pHyprOpenGL->m_renderData.pMonitor->m_scale);
|
||||
g_pHyprOpenGL->renderTexture(tex, box, 1.F);
|
||||
g_pHyprOpenGL->renderTexture(tex, box, {});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -13,9 +13,10 @@ void CRectPassElement::draw(const CRegion& damage) {
|
|||
g_pHyprOpenGL->m_renderData.clipBox = m_data.clipBox;
|
||||
|
||||
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);
|
||||
g_pHyprOpenGL->renderRect(m_data.box, m_data.color, {.damage = &damage, .round = m_data.round, .roundingPower = m_data.roundingPower});
|
||||
else
|
||||
g_pHyprOpenGL->renderRectWithBlur(m_data.box, m_data.color, m_data.round, m_data.roundingPower, m_data.blurA, m_data.xray);
|
||||
g_pHyprOpenGL->renderRect(m_data.box, m_data.color,
|
||||
{.round = m_data.round, .roundingPower = m_data.roundingPower, .blur = true, .blurA = m_data.blurA, .xray = m_data.xray});
|
||||
|
||||
g_pHyprOpenGL->m_renderData.clipBox = {};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -116,14 +116,38 @@ void CSurfacePassElement::draw(const CRegion& damage) {
|
|||
// to what we do for misaligned surfaces (blur the entire thing and then render shit without blur)
|
||||
if (m_data.surfaceCounter == 0 && !m_data.popup) {
|
||||
if (BLUR)
|
||||
g_pHyprOpenGL->renderTextureWithBlur(TEXTURE, windowBox, ALPHA, m_data.surface, rounding, roundingPower, m_data.blockBlurOptimization, m_data.fadeAlpha, OVERALL_ALPHA);
|
||||
g_pHyprOpenGL->renderTexture(TEXTURE, windowBox,
|
||||
{
|
||||
.surface = m_data.surface,
|
||||
.a = ALPHA,
|
||||
.blur = true,
|
||||
.blurA = m_data.fadeAlpha,
|
||||
.overallA = OVERALL_ALPHA,
|
||||
.round = rounding,
|
||||
.roundingPower = roundingPower,
|
||||
.allowCustomUV = true,
|
||||
.blockBlurOptimization = m_data.blockBlurOptimization,
|
||||
});
|
||||
else
|
||||
g_pHyprOpenGL->renderTexture(TEXTURE, windowBox, ALPHA * OVERALL_ALPHA, rounding, roundingPower, false, true);
|
||||
g_pHyprOpenGL->renderTexture(TEXTURE, windowBox,
|
||||
{.a = ALPHA * OVERALL_ALPHA, .round = rounding, .roundingPower = roundingPower, .discardActive = false, .allowCustomUV = true});
|
||||
} else {
|
||||
if (BLUR && m_data.popup)
|
||||
g_pHyprOpenGL->renderTextureWithBlur(TEXTURE, windowBox, ALPHA, m_data.surface, rounding, roundingPower, true, m_data.fadeAlpha, OVERALL_ALPHA);
|
||||
g_pHyprOpenGL->renderTexture(TEXTURE, windowBox,
|
||||
{
|
||||
.surface = m_data.surface,
|
||||
.a = ALPHA,
|
||||
.blur = true,
|
||||
.blurA = m_data.fadeAlpha,
|
||||
.overallA = OVERALL_ALPHA,
|
||||
.round = rounding,
|
||||
.roundingPower = roundingPower,
|
||||
.allowCustomUV = true,
|
||||
.blockBlurOptimization = true,
|
||||
});
|
||||
else
|
||||
g_pHyprOpenGL->renderTexture(TEXTURE, windowBox, ALPHA * OVERALL_ALPHA, rounding, roundingPower, false, true);
|
||||
g_pHyprOpenGL->renderTexture(TEXTURE, windowBox,
|
||||
{.a = ALPHA * OVERALL_ALPHA, .round = rounding, .roundingPower = roundingPower, .discardActive = false, .allowCustomUV = true});
|
||||
}
|
||||
|
||||
if (!g_pHyprRenderer->m_bBlockSurfaceFeedback)
|
||||
|
|
|
|||
|
|
@ -37,9 +37,12 @@ void CTexPassElement::draw(const CRegion& damage) {
|
|||
}
|
||||
|
||||
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);
|
||||
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 = false});
|
||||
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);
|
||||
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() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue