diff options
| author | UjinT34 <41110182+UjinT34@users.noreply.github.com> | 2026-03-07 21:21:23 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-03-07 18:21:23 +0000 |
| commit | 02f30ea15b349d1ed98b608ed06ec88c834592dd (patch) | |
| tree | 5148a3935c43b64f209f2b13e2a0b1bbe987444b /src/render/pass/Pass.cpp | |
| parent | b227efc8492468cc925014a6c8446a3d044b01e8 (diff) | |
renderer: refactor gl renderer (#13488)
Diffstat (limited to 'src/render/pass/Pass.cpp')
| -rw-r--r-- | src/render/pass/Pass.cpp | 44 |
1 files changed, 35 insertions, 9 deletions
diff --git a/src/render/pass/Pass.cpp b/src/render/pass/Pass.cpp index 901b4770..b7923a66 100644 --- a/src/render/pass/Pass.cpp +++ b/src/render/pass/Pass.cpp @@ -213,9 +213,15 @@ void CRenderPass::renderDebugData() { const auto pMonitor = g_pHyprRenderer->m_renderData.pMonitor; CBox box = {{}, pMonitor->m_transformedSize}; for (const auto& rg : m_occludedRegions) { - g_pHyprOpenGL->renderRect(box, Colors::RED.modifyA(0.1F), {.damage = &rg}); + CRectPassElement::SRectData data; + data.box = box; + data.color = Colors::RED.modifyA(0.1F); + g_pHyprRenderer->draw(makeUnique<CRectPassElement>(data), rg); } - g_pHyprOpenGL->renderRect(box, Colors::GREEN.modifyA(0.1F), {.damage = &m_totalLiveBlurRegion}); + CRectPassElement::SRectData data; + data.box = box; + data.color = Colors::GREEN.modifyA(0.1F); + g_pHyprRenderer->draw(makeUnique<CRectPassElement>(data), m_totalLiveBlurRegion); std::unordered_map<CWLSurfaceResource*, float> offsets; @@ -238,9 +244,12 @@ void CRenderPass::renderDebugData() { if (box.intersection(CBox{{}, pMonitor->m_size}).empty()) return; - static const auto FULL_REGION = 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}); + CRectPassElement::SRectData data; + data.box = box; + data.color = color; + g_pHyprRenderer->draw(makeUnique<CRectPassElement>(data), FULL_REGION); if (offsets.contains(surface.get())) box.translate(Vector2D{0.F, offsets[surface.get()]}); @@ -248,8 +257,16 @@ void CRenderPass::renderDebugData() { offsets[surface.get()] = 0; box = {box.pos(), texture->m_size}; - 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, {}); + CRectPassElement::SRectData data2; + data.box = box; + data.color = color; + data.round = std::min(5.0, box.size().y); + g_pHyprRenderer->draw(makeUnique<CRectPassElement>(data2), FULL_REGION); + + CTexPassElement::SRenderData texData; + texData.tex = texture; + texData.box = box; + g_pHyprRenderer->draw(makeUnique<CTexPassElement>(texData), {}); offsets[surface.get()] += texture->m_size.y; }; @@ -267,7 +284,10 @@ void CRenderPass::renderDebugData() { auto BOX = hlSurface->getSurfaceBoxGlobal(); if (BOX) { auto region = g_pSeatManager->m_state.pointerFocus->m_current.input.copy().scale(pMonitor->m_scale).translate(BOX->pos() - pMonitor->m_position); - g_pHyprOpenGL->renderRect(box, CHyprColor{0.8F, 0.8F, 0.2F, 0.4F}, {.damage = ®ion}); + CRectPassElement::SRectData data; + data.box = box; + data.color = CHyprColor{0.8F, 0.8F, 0.2F, 0.4F}; + g_pHyprRenderer->draw(makeUnique<CRectPassElement>(data), region); } } } @@ -280,7 +300,10 @@ void CRenderPass::renderDebugData() { if (tex) { box = CBox{{0.F, pMonitor->m_size.y - tex->m_size.y}, tex->m_size}.scale(pMonitor->m_scale); - g_pHyprOpenGL->renderTexture(tex, box, {}); + CTexPassElement::SRenderData texData; + texData.tex = tex; + texData.box = box; + g_pHyprRenderer->draw(makeUnique<CTexPassElement>(texData), {}); } std::string passStructure; @@ -297,7 +320,10 @@ void CRenderPass::renderDebugData() { tex = g_pHyprRenderer->renderText(passStructure, Colors::WHITE, 12); if (tex) { box = CBox{{pMonitor->m_size.x - tex->m_size.x, pMonitor->m_size.y - tex->m_size.y}, tex->m_size}.scale(pMonitor->m_scale); - g_pHyprOpenGL->renderTexture(tex, box, {}); + CTexPassElement::SRenderData texData; + texData.tex = tex; + texData.box = box; + g_pHyprRenderer->draw(makeUnique<CTexPassElement>(texData), {}); } } |
