summaryrefslogtreecommitdiff
path: root/src/render/decorations/CHyprDropShadowDecoration.cpp
diff options
context:
space:
mode:
authorVaxry <43317083+vaxerski@users.noreply.github.com>2024-12-22 17:12:09 +0100
committerGitHub <noreply@github.com>2024-12-22 17:12:09 +0100
commite536b02248f370971716b744968776f6880528be (patch)
tree5e5755b7894eb44f9259cfe0e1d97899148a8a60 /src/render/decorations/CHyprDropShadowDecoration.cpp
parent1cc1a46c2e154a27750b81307040d3bf7ff0f64f (diff)
Renderer: rewrite render scheduling (#8683)
This rewrites renderer scheduling. Occlusion is now unified in a new Pass type.
Diffstat (limited to 'src/render/decorations/CHyprDropShadowDecoration.cpp')
-rw-r--r--src/render/decorations/CHyprDropShadowDecoration.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/render/decorations/CHyprDropShadowDecoration.cpp b/src/render/decorations/CHyprDropShadowDecoration.cpp
index 38ced9af..21242b57 100644
--- a/src/render/decorations/CHyprDropShadowDecoration.cpp
+++ b/src/render/decorations/CHyprDropShadowDecoration.cpp
@@ -2,6 +2,7 @@
#include "../../Compositor.hpp"
#include "../../config/ConfigValue.hpp"
+#include "../pass/ShadowPassElement.hpp"
CHyprDropShadowDecoration::CHyprDropShadowDecoration(PHLWINDOW pWindow) : IHyprWindowDecoration(pWindow), m_pWindow(pWindow) {
;
@@ -87,7 +88,13 @@ void CHyprDropShadowDecoration::updateWindow(PHLWINDOW pWindow) {
}
void CHyprDropShadowDecoration::draw(PHLMONITOR pMonitor, float const& a) {
+ CShadowPassElement::SShadowData data;
+ data.deco = this;
+ data.a = a;
+ g_pHyprRenderer->m_sRenderPass.add(makeShared<CShadowPassElement>(data));
+}
+void CHyprDropShadowDecoration::render(PHLMONITOR pMonitor, float const& a) {
const auto PWINDOW = m_pWindow.lock();
if (!validMapped(PWINDOW))
@@ -141,6 +148,7 @@ void CHyprDropShadowDecoration::draw(PHLMONITOR pMonitor, float const& a) {
return; // don't draw invisible shadows
g_pHyprOpenGL->scissor((CBox*)nullptr);
+ g_pHyprOpenGL->m_RenderData.currentWindow = m_pWindow;
// we'll take the liberty of using this as it should not be used rn
CFramebuffer& alphaFB = g_pHyprOpenGL->m_RenderData.pCurrentMonData->mirrorFB;
@@ -197,6 +205,7 @@ void CHyprDropShadowDecoration::draw(PHLMONITOR pMonitor, float const& a) {
LASTFB->bind();
CBox monbox = {0, 0, pMonitor->vecTransformedSize.x, pMonitor->vecTransformedSize.y};
+
g_pHyprOpenGL->setMonitorTransformEnabled(true);
g_pHyprOpenGL->setRenderModifEnabled(false);
g_pHyprOpenGL->renderTextureMatte(alphaSwapFB.getTexture(), &monbox, alphaFB);
@@ -209,6 +218,8 @@ void CHyprDropShadowDecoration::draw(PHLMONITOR pMonitor, float const& a) {
if (m_seExtents != m_seReportedExtents)
g_pDecorationPositioner->repositionDeco(this);
+
+ g_pHyprOpenGL->m_RenderData.currentWindow.reset();
}
eDecorationLayer CHyprDropShadowDecoration::getDecorationLayer() {