From bd5f6420978a882d2b532faaee49512d98c300a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Tue, 2 Feb 2016 12:14:55 +0100 Subject: [PATCH] [effects] Check for LimitedNPOT Effects which require mipmaps need to check for LimitedNPOT and disable the functionality if only limited NPOT is available. Ideally the effects could also check whether the texture they operate on is a power of two, but that's a little overkill for the rather uncommon setup. REVIEW: 126966 --- effects/blur/blur.cpp | 3 ++- effects/logout/logout.cpp | 2 +- effects/lookingglass/lookingglass.cpp | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/effects/blur/blur.cpp b/effects/blur/blur.cpp index 93a2af0396..4723078af5 100644 --- a/effects/blur/blur.cpp +++ b/effects/blur/blur.cpp @@ -443,7 +443,8 @@ void BlurEffect::drawWindow(EffectWindow *w, int mask, QRegion region, WindowPai } if (!shape.isEmpty()) { - if (w->isFullScreen() && GLRenderTarget::blitSupported() && m_simpleShader->isValid() && shape.boundingRect() == w->geometry()) { + if (w->isFullScreen() && GLRenderTarget::blitSupported() && m_simpleShader->isValid() + && !GLPlatform::instance()->supports(LimitedNPOT) && shape.boundingRect() == w->geometry()) { doSimpleBlur(w, data.opacity(), data.screenProjectionMatrix()); } else if (m_shouldCache && !translated && !w->isDeleted()) { doCachedBlur(w, region, data.opacity(), data.screenProjectionMatrix()); diff --git a/effects/logout/logout.cpp b/effects/logout/logout.cpp index f521e2d99d..0a0df45661 100644 --- a/effects/logout/logout.cpp +++ b/effects/logout/logout.cpp @@ -117,7 +117,7 @@ void LogoutEffect::prePaintScreen(ScreenPrePaintData& data, int time) } else if (!blurTexture) { blurSupported = false; delete blurTarget; // catch as we just tested the texture ;-P - if (effects->isOpenGLCompositing() && GLRenderTarget::blitSupported() && useBlur) { + if (effects->isOpenGLCompositing() && GLRenderTarget::blitSupported() && !GLPlatform::instance()->supports(LimitedNPOT) && useBlur) { // TODO: It seems that it is not possible to create a GLRenderTarget that has // a different size than the display right now. Most likely a KWin core bug. // Create texture and render target diff --git a/effects/lookingglass/lookingglass.cpp b/effects/lookingglass/lookingglass.cpp index e68f3d7167..62ef1ba65d 100644 --- a/effects/lookingglass/lookingglass.cpp +++ b/effects/lookingglass/lookingglass.cpp @@ -83,7 +83,7 @@ LookingGlassEffect::~LookingGlassEffect() bool LookingGlassEffect::supported() { - return effects->compositingType() == OpenGL2Compositing; + return effects->compositingType() == OpenGL2Compositing && !GLPlatform::instance()->supports(LimitedNPOT); } void LookingGlassEffect::reconfigure(ReconfigureFlags)