mirror of
https://github.com/hyprwm/Hyprland
synced 2024-12-02 02:05:58 +01:00
renderer: allow transform enabling from outside opengl
This commit is contained in:
parent
64a084477e
commit
66a3719b86
3 changed files with 10 additions and 6 deletions
|
@ -1994,3 +1994,7 @@ void CHyprOpenGLImpl::bindBackOnMain() {
|
||||||
m_RenderData.pCurrentMonData->primaryFB.bind();
|
m_RenderData.pCurrentMonData->primaryFB.bind();
|
||||||
m_RenderData.currentFB = &m_RenderData.pCurrentMonData->primaryFB;
|
m_RenderData.currentFB = &m_RenderData.pCurrentMonData->primaryFB;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CHyprOpenGLImpl::setMonitorTransformEnabled(bool enabled) {
|
||||||
|
m_bEndFrame = !enabled;
|
||||||
|
}
|
||||||
|
|
|
@ -97,7 +97,6 @@ struct SCurrentRenderData {
|
||||||
};
|
};
|
||||||
|
|
||||||
class CGradientValueData;
|
class CGradientValueData;
|
||||||
class CHyprDropShadowDecoration;
|
|
||||||
|
|
||||||
class CHyprOpenGLImpl {
|
class CHyprOpenGLImpl {
|
||||||
public:
|
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 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 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 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 saveMatrix();
|
||||||
void setMatrixScaleTranslate(const Vector2D& translate, const float& scale);
|
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,
|
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);
|
bool allowCustomUV = false, bool allowDim = false);
|
||||||
void renderTexturePrimitive(const CTexture& tex, CBox* pBox);
|
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 renderSplash(cairo_t* const, cairo_surface_t* const, double);
|
||||||
|
|
||||||
void preBlurForCurrentMonitor();
|
void preBlurForCurrentMonitor();
|
||||||
|
@ -200,7 +201,6 @@ class CHyprOpenGLImpl {
|
||||||
bool shouldUseNewBlurOptimizations(SLayerSurface* pLayer, CWindow* pWindow);
|
bool shouldUseNewBlurOptimizations(SLayerSurface* pLayer, CWindow* pWindow);
|
||||||
|
|
||||||
friend class CHyprRenderer;
|
friend class CHyprRenderer;
|
||||||
friend class CHyprDropShadowDecoration;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
inline std::unique_ptr<CHyprOpenGLImpl> g_pHyprOpenGL;
|
inline std::unique_ptr<CHyprOpenGLImpl> g_pHyprOpenGL;
|
||||||
|
|
|
@ -155,9 +155,9 @@ void CHyprDropShadowDecoration::draw(CMonitor* pMonitor, float a, const Vector2D
|
||||||
LASTFB->bind();
|
LASTFB->bind();
|
||||||
|
|
||||||
CBox monbox = {0, 0, pMonitor->vecTransformedSize.x, pMonitor->vecTransformedSize.y};
|
CBox monbox = {0, 0, pMonitor->vecTransformedSize.x, pMonitor->vecTransformedSize.y};
|
||||||
g_pHyprOpenGL->m_bEndFrame = true;
|
g_pHyprOpenGL->setMonitorTransformEnabled(false);
|
||||||
g_pHyprOpenGL->renderTextureMatte(alphaSwapFB.m_cTex, &monbox, alphaFB);
|
g_pHyprOpenGL->renderTextureMatte(alphaSwapFB.m_cTex, &monbox, alphaFB);
|
||||||
g_pHyprOpenGL->m_bEndFrame = false;
|
g_pHyprOpenGL->setMonitorTransformEnabled(true);
|
||||||
} else {
|
} else {
|
||||||
g_pHyprOpenGL->renderRoundedShadow(&fullBox, ROUNDING * pMonitor->scale, *PSHADOWSIZE * pMonitor->scale, a);
|
g_pHyprOpenGL->renderRoundedShadow(&fullBox, ROUNDING * pMonitor->scale, *PSHADOWSIZE * pMonitor->scale, a);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue