From 423cd29afadbabc6d91d1c7a2a1c3e5335e848a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20H=C3=B6glund?= Date: Tue, 15 Feb 2011 17:47:31 +0100 Subject: [PATCH] kwin: Simplify the code for updating the texture filter --- scene_opengl.cpp | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/scene_opengl.cpp b/scene_opengl.cpp index ff95298f26..92a6c2ead6 100644 --- a/scene_opengl.cpp +++ b/scene_opengl.cpp @@ -438,25 +438,23 @@ void SceneOpenGL::Window::performPaint(int mask, QRegion region, WindowPaintData return; if (!bindTexture()) return; - // set texture filter - if (options->glSmoothScale != 0) { // default to yes - if (mask & PAINT_WINDOW_TRANSFORMED) - filter = ImageFilterGood; - else if (mask & PAINT_SCREEN_TRANSFORMED) - filter = ImageFilterGood; - else - filter = ImageFilterFast; - } else - filter = ImageFilterFast; - if (filter == ImageFilterGood) - texture.setFilter(GL_LINEAR); + + // Update the texture filter + if (options->glSmoothScale != 0 && + (mask & (PAINT_WINDOW_TRANSFORMED | PAINT_SCREEN_TRANSFORMED))) + filter = ImageFilterGood; else - texture.setFilter(GL_NEAREST); + filter = ImageFilterFast; + + texture.setFilter(filter == ImageFilterGood ? GL_LINEAR : GL_NEAREST); + // do required transformations int x = toplevel->x(); int y = toplevel->y(); double z = 0.0; + bool sceneShader = false; + if (!data.shader && ShaderManager::instance()->isValid()) { // set the shader for uniform initialising in paint decoration if ((mask & PAINT_WINDOW_TRANSFORMED) || (mask & PAINT_SCREEN_TRANSFORMED)) {