Skip to content

Commit

Permalink
Fix a-parhom#140: apply same changes as upstream kwin blur effect
Browse files Browse the repository at this point in the history
  • Loading branch information
AldanTanneo committed Jun 20, 2024
1 parent b159684 commit 3ff2d2f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/blur/blur.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ bool BlurEffect::enabledByDefault()

bool BlurEffect::supported()
{
return effects->isOpenGLCompositing() && GLFramebuffer::supported() && GLFramebuffer::blitSupported();
return effects->openglContext() && effects->openglContext()->checkSupported() && effects->openglContext()->supportsBlits();
}

bool BlurEffect::decorationSupportsBlurBehind(const EffectWindow *w) const
Expand Down Expand Up @@ -780,7 +780,7 @@ void BlurEffect::blur(const RenderTarget &renderTarget, const RenderViewport &vi
GLFramebuffer::popFramebuffer();
const auto &read = renderInfo.framebuffers[1];

projectionMatrix = data.projectionMatrix();
projectionMatrix = viewport.projectionMatrix();
projectionMatrix.translate(deviceBackgroundRect.x(), deviceBackgroundRect.y());
m_upsamplePass.shader->setUniform(m_upsamplePass.mvpMatrixLocation, projectionMatrix);

Expand Down Expand Up @@ -822,7 +822,7 @@ void BlurEffect::blur(const RenderTarget &renderTarget, const RenderViewport &vi
if (GLTexture *noiseTexture = ensureNoiseTexture()) {
ShaderManager::instance()->pushShader(m_noisePass.shader.get());

QMatrix4x4 projectionMatrix = data.projectionMatrix();
QMatrix4x4 projectionMatrix = viewport.projectionMatrix();
projectionMatrix.translate(deviceBackgroundRect.x(), deviceBackgroundRect.y());

m_noisePass.shader->setUniform(m_noisePass.mvpMatrixLocation, projectionMatrix);
Expand Down
1 change: 1 addition & 0 deletions src/blur/blur.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

#include "effect/effect.h"
#include "opengl/glutils.h"
#include "opengl/openglcontext.h"

#include <QList>

Expand Down
3 changes: 2 additions & 1 deletion src/lightlyshaders/lightlyshaders.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include <QStandardPaths>
#include <QWindow>
#include <opengl/glutils.h>
#include <opengl/openglcontext.h>
#include <effect/effect.h>
#include <core/renderviewport.h>
#include <QMatrix4x4>
Expand Down Expand Up @@ -354,7 +355,7 @@ LightlyShadersEffect::enabledByDefault()
bool
LightlyShadersEffect::supported()
{
return effects->isOpenGLCompositing() && GLFramebuffer::supported();
return effects->openglContext() && effects->openglContext()->checkSupported() && effects->openglContext()->supportsBlits();
}

} // namespace KWin
Expand Down

0 comments on commit 3ff2d2f

Please sign in to comment.