mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-06 07:01:57 -07:00
renderer: render blur on fade out (#10356)
This commit is contained in:
@@ -1813,13 +1813,16 @@ void CHyprOpenGLImpl::renderTextureMatte(SP<CTexture> tex, const CBox& box, CFra
|
||||
//
|
||||
// Dual (or more) kawase blur
|
||||
CFramebuffer* CHyprOpenGLImpl::blurMainFramebufferWithDamage(float a, CRegion* originalDamage) {
|
||||
|
||||
if (!m_renderData.currentFB->getTexture()) {
|
||||
Debug::log(ERR, "BUG THIS: null fb texture while attempting to blur main fb?! (introspection off?!)");
|
||||
return &m_renderData.pCurrentMonData->mirrorFB; // return something to sample from at least
|
||||
}
|
||||
|
||||
TRACY_GPU_ZONE("RenderBlurMainFramebufferWithDamage");
|
||||
return blurFramebufferWithDamage(a, originalDamage, *m_renderData.currentFB);
|
||||
}
|
||||
|
||||
CFramebuffer* CHyprOpenGLImpl::blurFramebufferWithDamage(float a, CRegion* originalDamage, CFramebuffer& source) {
|
||||
TRACY_GPU_ZONE("RenderBlurFramebufferWithDamage");
|
||||
|
||||
const auto BLENDBEFORE = m_blend;
|
||||
blend(false);
|
||||
@@ -1859,7 +1862,7 @@ CFramebuffer* CHyprOpenGLImpl::blurMainFramebufferWithDamage(float a, CRegion* o
|
||||
|
||||
glActiveTexture(GL_TEXTURE0);
|
||||
|
||||
auto currentTex = m_renderData.currentFB->getTexture();
|
||||
auto currentTex = source.getTexture();
|
||||
|
||||
glBindTexture(currentTex->m_target, currentTex->m_texID);
|
||||
|
||||
@@ -2226,7 +2229,7 @@ void CHyprOpenGLImpl::renderTextureWithBlur(SP<CTexture> tex, const CBox& box, f
|
||||
|
||||
// amazing hack: the surface has an opaque region!
|
||||
CRegion inverseOpaque;
|
||||
if (a >= 1.f && std::round(pSurface->m_current.size.x * m_renderData.pMonitor->m_scale) == box.w &&
|
||||
if (a >= 1.f && pSurface && std::round(pSurface->m_current.size.x * m_renderData.pMonitor->m_scale) == box.w &&
|
||||
std::round(pSurface->m_current.size.y * m_renderData.pMonitor->m_scale) == box.h) {
|
||||
pixman_box32_t surfbox = {0, 0, pSurface->m_current.size.x * pSurface->m_current.scale, pSurface->m_current.size.y * pSurface->m_current.scale};
|
||||
inverseOpaque = pSurface->m_current.opaque;
|
||||
@@ -2249,7 +2252,6 @@ void CHyprOpenGLImpl::renderTextureWithBlur(SP<CTexture> tex, const CBox& box, f
|
||||
inverseOpaque.translate(box.pos());
|
||||
m_renderData.renderModif.applyToRegion(inverseOpaque);
|
||||
inverseOpaque.intersect(texDamage);
|
||||
|
||||
POUTFB = blurMainFramebufferWithDamage(a, &inverseOpaque);
|
||||
} else
|
||||
POUTFB = &m_renderData.pCurrentMonData->blurFB;
|
||||
|
Reference in New Issue
Block a user