From e9fd57285f31392d0081862122334997d226a918 Mon Sep 17 00:00:00 2001 From: Vlad Zagorodniy Date: Thu, 4 Oct 2018 20:20:55 +0300 Subject: [PATCH] [effects/zoom] Set wrap mode for cursor texture Summary: With the Oxygen cursor theme, a visual glitch can appear in the bottom-left corner of the cursor when the screen is zoomed in. The reason for that is we're using GL_REPEAT for GL_TEXTURE_WRAP_S and GL_TEXTURE_WRAP_T. So, when the linear filter samples neighboring texels in the bottom, it can sample some texels from the top (because of GL_REPEAT). To fix that, we have to set the wrap mode to GL_CLAMP_TO_EDGE. BUG: 338254 FIXED-IN: 5.14.0 Test Plan: Before: {F6303912} After: {F6303913} Tried other cursor themes(Breeze and Adwaita), everything looks okay. Reviewers: #kwin, davidedmundson Reviewed By: #kwin, davidedmundson Subscribers: davidedmundson, kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D15949 --- effects/zoom/zoom.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/effects/zoom/zoom.cpp b/effects/zoom/zoom.cpp index 1868c6bbef..efdec578a0 100644 --- a/effects/zoom/zoom.cpp +++ b/effects/zoom/zoom.cpp @@ -192,8 +192,10 @@ void ZoomEffect::recreateTexture() imageWidth = cursor.image().width(); imageHeight = cursor.image().height(); cursorHotSpot = cursor.hotSpot(); - if (effects->isOpenGLCompositing()) + if (effects->isOpenGLCompositing()) { texture.reset(new GLTexture(cursor.image())); + texture->setWrapMode(GL_CLAMP_TO_EDGE); + } #ifdef KWIN_HAVE_XRENDER_COMPOSITING if (effects->compositingType() == XRenderCompositing) xrenderPicture.reset(new XRenderPicture(cursor.image()));