From 0927c506f69659b820cca0c19a5028d4bd76948a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20L=C3=BCbking?= Date: Sat, 7 Feb 2015 22:11:20 +0100 Subject: [PATCH] use ShaderTrait for zoom cursor fixes opengl cursor painting in zoom mode REVIEW: 122468 --- effects/zoom/zoom.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/effects/zoom/zoom.cpp b/effects/zoom/zoom.cpp index 82f12f3b7f..8ac531c26c 100644 --- a/effects/zoom/zoom.cpp +++ b/effects/zoom/zoom.cpp @@ -282,9 +282,6 @@ void ZoomEffect::prePaintScreen(ScreenPrePaintData& data, int time) if (zoom == 1.0) { showCursor(); - // reset the generic shader to avoid artifacts in plenty other effects - if (altered && effects->isOpenGLCompositing()) - ShaderBinder binder(ShaderManager::GenericShader, true); } else { hideCursor(); data.mask |= PAINT_SCREEN_TRANSFORMED; @@ -373,7 +370,14 @@ void ZoomEffect::paintScreen(int mask, QRegion region, ScreenPaintData& data) texture->bind(); glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + auto s = ShaderManager::instance()->pushShader(ShaderTrait::MapTexture); + QMatrix4x4 mvp; + const QSize size = effects->virtualScreenSize(); + mvp.ortho(0, size.width(), size.height(), 0, 0, 65535); + mvp.translate(rect.x(), rect.y()); + s->setUniform(GLShader::ModelViewProjectionMatrix, mvp); texture->render(region, rect); + ShaderManager::instance()->popShader(); texture->unbind(); glDisable(GL_BLEND); }