diff options
| author | Vaxry <43317083+vaxerski@users.noreply.github.com> | 2025-12-08 15:04:40 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-12-08 15:04:40 +0000 |
| commit | 920353370bba555010506a1c0b204675c60362fe (patch) | |
| tree | 87ba1036ecad6294a9c86dfc828ed2a356c810bd /src/render/pass | |
| parent | 834f019bab5df85b912a7aab7054fc8306f7c52a (diff) | |
desktop: cleanup, unify desktop elements as views (#12563)
Diffstat (limited to 'src/render/pass')
| -rw-r--r-- | src/render/pass/Pass.cpp | 8 | ||||
| -rw-r--r-- | src/render/pass/SurfacePassElement.cpp | 20 |
2 files changed, 14 insertions, 14 deletions
diff --git a/src/render/pass/Pass.cpp b/src/render/pass/Pass.cpp index 8970e2af..3910e6a7 100644 --- a/src/render/pass/Pass.cpp +++ b/src/render/pass/Pass.cpp @@ -4,7 +4,7 @@ #include <ranges> #include "../../Compositor.hpp" #include "../../config/ConfigValue.hpp" -#include "../../desktop/WLSurface.hpp" +#include "../../desktop/view/WLSurface.hpp" #include "../../managers/SeatManager.hpp" #include "../../managers/eventLoop/EventLoopManager.hpp" #include "../../render/Renderer.hpp" @@ -211,7 +211,7 @@ void CRenderPass::renderDebugData() { if (!surface || !texture) return; - auto hlSurface = CWLSurface::fromResource(surface); + auto hlSurface = Desktop::View::CWLSurface::fromResource(surface); if (!hlSurface) return; @@ -244,12 +244,12 @@ void CRenderPass::renderDebugData() { renderHLSurface(m_debugData.keyboardFocusText, g_pSeatManager->m_state.keyboardFocus.lock(), Colors::PURPLE.modifyA(0.1F)); renderHLSurface(m_debugData.pointerFocusText, g_pSeatManager->m_state.pointerFocus.lock(), Colors::ORANGE.modifyA(0.1F)); if (Desktop::focusState()->window()) - renderHLSurface(m_debugData.lastWindowText, Desktop::focusState()->window()->m_wlSurface->resource(), Colors::LIGHT_BLUE.modifyA(0.1F)); + renderHLSurface(m_debugData.lastWindowText, Desktop::focusState()->window()->wlSurface()->resource(), Colors::LIGHT_BLUE.modifyA(0.1F)); if (g_pSeatManager->m_state.pointerFocus) { if (g_pSeatManager->m_state.pointerFocus->m_current.input.intersect(CBox{{}, g_pSeatManager->m_state.pointerFocus->m_current.size}).getExtents().size() != g_pSeatManager->m_state.pointerFocus->m_current.size) { - auto hlSurface = CWLSurface::fromResource(g_pSeatManager->m_state.pointerFocus.lock()); + auto hlSurface = Desktop::View::CWLSurface::fromResource(g_pSeatManager->m_state.pointerFocus.lock()); if (hlSurface) { auto BOX = hlSurface->getSurfaceBoxGlobal(); if (BOX) { diff --git a/src/render/pass/SurfacePassElement.cpp b/src/render/pass/SurfacePassElement.cpp index 36b9e5f9..b5c42310 100644 --- a/src/render/pass/SurfacePassElement.cpp +++ b/src/render/pass/SurfacePassElement.cpp @@ -1,7 +1,7 @@ #include "SurfacePassElement.hpp" #include "../OpenGL.hpp" -#include "../../desktop/WLSurface.hpp" -#include "../../desktop/Window.hpp" +#include "../../desktop/view/WLSurface.hpp" +#include "../../desktop/view/Window.hpp" #include "../../protocols/core/Compositor.hpp" #include "../../protocols/DRMSyncobj.hpp" #include "../../managers/input/InputManager.hpp" @@ -54,7 +54,7 @@ void CSurfacePassElement::draw(const CRegion& damage) { const auto INTERACTIVERESIZEINPROGRESS = m_data.pWindow && g_pInputManager->m_currentlyDraggedWindow && g_pInputManager->m_dragMode == MBIND_RESIZE; TRACY_GPU_ZONE("RenderSurface"); - auto PSURFACE = CWLSurface::fromResource(m_data.surface); + auto PSURFACE = Desktop::View::CWLSurface::fromResource(m_data.surface); const float ALPHA = m_data.alpha * m_data.fadeAlpha * (PSURFACE ? PSURFACE->m_alphaModifier : 1.F); const float OVERALL_ALPHA = PSURFACE ? PSURFACE->m_overallOpacity : 1.F; @@ -102,7 +102,7 @@ void CSurfacePassElement::draw(const CRegion& damage) { roundingPower = 2.0f; } - const bool WINDOWOPAQUE = m_data.pWindow && m_data.pWindow->m_wlSurface->resource() == m_data.surface ? m_data.pWindow->opaque() : false; + const bool WINDOWOPAQUE = m_data.pWindow && m_data.pWindow->wlSurface()->resource() == m_data.surface ? m_data.pWindow->opaque() : false; const bool CANDISABLEBLEND = ALPHA >= 1.f && OVERALL_ALPHA >= 1.f && rounding == 0 && WINDOWOPAQUE; if (CANDISABLEBLEND) @@ -164,14 +164,14 @@ CBox CSurfacePassElement::getTexBox() { const double outputX = -m_data.pMonitor->m_position.x, outputY = -m_data.pMonitor->m_position.y; const auto INTERACTIVERESIZEINPROGRESS = m_data.pWindow && g_pInputManager->m_currentlyDraggedWindow && g_pInputManager->m_dragMode == MBIND_RESIZE; - auto PSURFACE = CWLSurface::fromResource(m_data.surface); + auto PSURFACE = Desktop::View::CWLSurface::fromResource(m_data.surface); CBox windowBox; if (m_data.surface && m_data.mainSurface) { windowBox = {sc<int>(outputX) + m_data.pos.x + m_data.localPos.x, sc<int>(outputY) + m_data.pos.y + m_data.localPos.y, m_data.w, m_data.h}; // however, if surface buffer w / h < box, we need to adjust them - const auto PWINDOW = PSURFACE ? PSURFACE->getWindow() : nullptr; + const auto PWINDOW = PSURFACE ? Desktop::View::CWindow::fromView(PSURFACE->view()) : nullptr; // center the surface if it's smaller than the viewport we assign it if (PSURFACE && !PSURFACE->m_fillIgnoreSmall && PSURFACE->small() /* guarantees PWINDOW */) { @@ -216,7 +216,7 @@ CBox CSurfacePassElement::getTexBox() { } bool CSurfacePassElement::needsLiveBlur() { - auto PSURFACE = CWLSurface::fromResource(m_data.surface); + auto PSURFACE = Desktop::View::CWLSurface::fromResource(m_data.surface); const float ALPHA = m_data.alpha * m_data.fadeAlpha * (PSURFACE ? PSURFACE->m_alphaModifier * PSURFACE->m_overallOpacity : 1.F); const bool BLUR = m_data.blur && (!m_data.texture || !m_data.texture->m_opaque || ALPHA < 1.F); @@ -233,7 +233,7 @@ bool CSurfacePassElement::needsLiveBlur() { } bool CSurfacePassElement::needsPrecomputeBlur() { - auto PSURFACE = CWLSurface::fromResource(m_data.surface); + auto PSURFACE = Desktop::View::CWLSurface::fromResource(m_data.surface); const float ALPHA = m_data.alpha * m_data.fadeAlpha * (PSURFACE ? PSURFACE->m_alphaModifier * PSURFACE->m_overallOpacity : 1.F); const bool BLUR = m_data.blur && (!m_data.texture || !m_data.texture->m_opaque || ALPHA < 1.F); @@ -254,7 +254,7 @@ std::optional<CBox> CSurfacePassElement::boundingBox() { } CRegion CSurfacePassElement::opaqueRegion() { - auto PSURFACE = CWLSurface::fromResource(m_data.surface); + auto PSURFACE = Desktop::View::CWLSurface::fromResource(m_data.surface); const float ALPHA = m_data.alpha * m_data.fadeAlpha * (PSURFACE ? PSURFACE->m_alphaModifier * PSURFACE->m_overallOpacity : 1.F); @@ -272,7 +272,7 @@ CRegion CSurfacePassElement::opaqueRegion() { } CRegion CSurfacePassElement::visibleRegion(bool& cancel) { - auto PSURFACE = CWLSurface::fromResource(m_data.surface); + auto PSURFACE = Desktop::View::CWLSurface::fromResource(m_data.surface); if (!PSURFACE) return {}; |
