diff --git a/effects/logout/logout.cpp b/effects/logout/logout.cpp index 28ae121fad..59c078becc 100644 --- a/effects/logout/logout.cpp +++ b/effects/logout/logout.cpp @@ -357,6 +357,7 @@ void LogoutEffect::renderBlurTexture() glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); blurTexture->bind(); + blurTexture->generateMipmaps(); blurTexture->render(infiniteRegion(), effects->virtualScreenGeometry()); blurTexture->unbind(); glDisable(GL_BLEND); diff --git a/effects/lookingglass/lookingglass.cpp b/effects/lookingglass/lookingglass.cpp index d30aa7f008..784b303a66 100644 --- a/effects/lookingglass/lookingglass.cpp +++ b/effects/lookingglass/lookingglass.cpp @@ -239,6 +239,7 @@ void LookingGlassEffect::postPaintScreen() assert(target == m_fbo); Q_UNUSED(target); m_texture->bind(); + m_texture->generateMipmaps(); // Use the shader ShaderBinder binder(m_shader); diff --git a/libkwineffects/kwingltexture.cpp b/libkwineffects/kwingltexture.cpp index 03e09be066..6a56474f0a 100644 --- a/libkwineffects/kwingltexture.cpp +++ b/libkwineffects/kwingltexture.cpp @@ -283,7 +283,6 @@ void GLTexture::update(const QImage &image, const QPoint &offset, const QRect &s } unbind(); - setDirty(); if (useUnpack) { glPixelStorei(GL_UNPACK_ROW_LENGTH, 0); @@ -312,7 +311,6 @@ void GLTexture::bind() if (d->s_supportsFramebufferObjects && d->m_canUseMipmaps) { glTexParameteri(d->m_target, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR); glTexParameteri(d->m_target, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - glGenerateMipmap(d->m_target); } else { // can't use trilinear, so use bilinear d->m_filter = GL_LINEAR; @@ -337,6 +335,14 @@ void GLTexture::bind() } } +void GLTexture::generateMipmaps() +{ + Q_D(GLTexture); + + if (d->m_canUseMipmaps && d->s_supportsFramebufferObjects) + glGenerateMipmap(d->m_target); +} + void GLTexture::unbind() { Q_D(GLTexture); @@ -460,9 +466,7 @@ void GLTexture::setWrapMode(GLenum mode) void GLTexturePrivate::onDamage() { - if (m_filter == GL_LINEAR_MIPMAP_LINEAR && !m_filterChanged) { - glGenerateMipmap(m_target); - } + // No-op } void GLTexture::setDirty() diff --git a/libkwineffects/kwingltexture.h b/libkwineffects/kwingltexture.h index 34fd8844c2..d559ab0bbe 100644 --- a/libkwineffects/kwingltexture.h +++ b/libkwineffects/kwingltexture.h @@ -101,6 +101,8 @@ public: void setWrapMode(GLenum mode); void setDirty(); + void generateMipmaps(); + static bool framebufferObjectSupported(); protected: