From 99804e0233cbb1054b1b1f5148dc5c7a6833a709 Mon Sep 17 00:00:00 2001 From: Vlad Zagorodniy Date: Thu, 9 Aug 2018 21:29:30 +0300 Subject: [PATCH] [effects/mousemark] Properly use GL_LINE_SMOOTH Summary: We need to enable GL_BLEND for line smoothing to work. CCBUG: 337044 Test Plan: Before: {F6184072, layout=center, size=full} After: {F6184074, layout=center, size=full} Reviewers: #kwin, davidedmundson Reviewed By: #kwin, davidedmundson Subscribers: davidedmundson, kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D14714 --- effects/mousemark/mousemark.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/effects/mousemark/mousemark.cpp b/effects/mousemark/mousemark.cpp index f18d42f99c..25ddc0f9ad 100644 --- a/effects/mousemark/mousemark.cpp +++ b/effects/mousemark/mousemark.cpp @@ -119,7 +119,11 @@ void MouseMarkEffect::paintScreen(int mask, QRegion region, ScreenPaintData& dat return; if ( effects->isOpenGLCompositing()) { if (!GLPlatform::instance()->isGLES()) { + glEnable(GL_BLEND); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glEnable(GL_LINE_SMOOTH); + glHint(GL_LINE_SMOOTH_HINT, GL_NICEST); } glLineWidth(width); GLVertexBuffer *vbo = GLVertexBuffer::streamingBuffer(); @@ -150,6 +154,7 @@ void MouseMarkEffect::paintScreen(int mask, QRegion region, ScreenPaintData& dat glLineWidth(1.0); if (!GLPlatform::instance()->isGLES()) { glDisable(GL_LINE_SMOOTH); + glDisable(GL_BLEND); } } #ifdef KWIN_HAVE_XRENDER_COMPOSITING