aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorVaxry <[email protected]>2023-11-04 19:35:49 +0000
committerVaxry <[email protected]>2023-11-04 19:35:49 +0000
commit66a3719b8613a69890f7e6cb0ebdb107703e42e0 (patch)
tree3d868916b2178dae90bd5e7bff5d3f56d2a33abb
parent64a084477ea8df67cbb35b22826a1f6a0845e123 (diff)
downloadHyprland-66a3719b8613a69890f7e6cb0ebdb107703e42e0.tar.gz
Hyprland-66a3719b8613a69890f7e6cb0ebdb107703e42e0.zip
renderer: allow transform enabling from outside opengl
-rw-r--r--src/render/OpenGL.cpp4
-rw-r--r--src/render/OpenGL.hpp6
-rw-r--r--src/render/decorations/CHyprDropShadowDecoration.cpp6
3 files changed, 10 insertions, 6 deletions
diff --git a/src/render/OpenGL.cpp b/src/render/OpenGL.cpp
index 8c691b35..b8028c3f 100644
--- a/src/render/OpenGL.cpp
+++ b/src/render/OpenGL.cpp
@@ -1994,3 +1994,7 @@ void CHyprOpenGLImpl::bindBackOnMain() {
m_RenderData.pCurrentMonData->primaryFB.bind();
m_RenderData.currentFB = &m_RenderData.pCurrentMonData->primaryFB;
}
+
+void CHyprOpenGLImpl::setMonitorTransformEnabled(bool enabled) {
+ m_bEndFrame = !enabled;
+}
diff --git a/src/render/OpenGL.hpp b/src/render/OpenGL.hpp
index fea967e5..7e3e4e7c 100644
--- a/src/render/OpenGL.hpp
+++ b/src/render/OpenGL.hpp
@@ -97,7 +97,6 @@ struct SCurrentRenderData {
};
class CGradientValueData;
-class CHyprDropShadowDecoration;
class CHyprOpenGLImpl {
public:
@@ -115,6 +114,9 @@ class CHyprOpenGLImpl {
void renderTextureWithBlur(const CTexture&, CBox*, float a, wlr_surface* pSurface, int round = 0, bool blockBlurOptimization = false, float blurA = 1.f);
void renderRoundedShadow(CBox*, int round, int range, float a = 1.0);
void renderBorder(CBox*, const CGradientValueData&, int round, int borderSize, float a = 1.0, int outerRound = -1 /* use round */);
+ void renderTextureMatte(const CTexture& tex, CBox* pBox, CFramebuffer& matte);
+
+ void setMonitorTransformEnabled(bool enabled);
void saveMatrix();
void setMatrixScaleTranslate(const Vector2D& translate, const float& scale);
@@ -192,7 +194,6 @@ class CHyprOpenGLImpl {
void renderTextureInternalWithDamage(const CTexture&, CBox* pBox, float a, CRegion* damage, int round = 0, bool discardOpaque = false, bool noAA = false,
bool allowCustomUV = false, bool allowDim = false);
void renderTexturePrimitive(const CTexture& tex, CBox* pBox);
- void renderTextureMatte(const CTexture& tex, CBox* pBox, CFramebuffer& matte);
void renderSplash(cairo_t* const, cairo_surface_t* const, double);
void preBlurForCurrentMonitor();
@@ -200,7 +201,6 @@ class CHyprOpenGLImpl {
bool shouldUseNewBlurOptimizations(SLayerSurface* pLayer, CWindow* pWindow);
friend class CHyprRenderer;
- friend class CHyprDropShadowDecoration;
};
inline std::unique_ptr<CHyprOpenGLImpl> g_pHyprOpenGL;
diff --git a/src/render/decorations/CHyprDropShadowDecoration.cpp b/src/render/decorations/CHyprDropShadowDecoration.cpp
index 74f14e0c..eb1ed8ca 100644
--- a/src/render/decorations/CHyprDropShadowDecoration.cpp
+++ b/src/render/decorations/CHyprDropShadowDecoration.cpp
@@ -154,10 +154,10 @@ void CHyprDropShadowDecoration::draw(CMonitor* pMonitor, float a, const Vector2D
LASTFB->bind();
- CBox monbox = {0, 0, pMonitor->vecTransformedSize.x, pMonitor->vecTransformedSize.y};
- g_pHyprOpenGL->m_bEndFrame = true;
+ CBox monbox = {0, 0, pMonitor->vecTransformedSize.x, pMonitor->vecTransformedSize.y};
+ g_pHyprOpenGL->setMonitorTransformEnabled(false);
g_pHyprOpenGL->renderTextureMatte(alphaSwapFB.m_cTex, &monbox, alphaFB);
- g_pHyprOpenGL->m_bEndFrame = false;
+ g_pHyprOpenGL->setMonitorTransformEnabled(true);
} else {
g_pHyprOpenGL->renderRoundedShadow(&fullBox, ROUNDING * pMonitor->scale, *PSHADOWSIZE * pMonitor->scale, a);
}