use ShaderTrait for zoom cursor

fixes opengl cursor painting in zoom mode

REVIEW: 122468
This commit is contained in:
Thomas Lübking 2015-02-07 22:11:20 +01:00
parent 8d2cd20c19
commit 0927c506f6

View file

@ -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);
}