use ShaderTrait for zoom cursor
fixes opengl cursor painting in zoom mode REVIEW: 122468icc-effect-5.14.5
parent
8d2cd20c19
commit
0927c506f6
|
@ -282,9 +282,6 @@ void ZoomEffect::prePaintScreen(ScreenPrePaintData& data, int time)
|
||||||
|
|
||||||
if (zoom == 1.0) {
|
if (zoom == 1.0) {
|
||||||
showCursor();
|
showCursor();
|
||||||
// reset the generic shader to avoid artifacts in plenty other effects
|
|
||||||
if (altered && effects->isOpenGLCompositing())
|
|
||||||
ShaderBinder binder(ShaderManager::GenericShader, true);
|
|
||||||
} else {
|
} else {
|
||||||
hideCursor();
|
hideCursor();
|
||||||
data.mask |= PAINT_SCREEN_TRANSFORMED;
|
data.mask |= PAINT_SCREEN_TRANSFORMED;
|
||||||
|
@ -373,7 +370,14 @@ void ZoomEffect::paintScreen(int mask, QRegion region, ScreenPaintData& data)
|
||||||
texture->bind();
|
texture->bind();
|
||||||
glEnable(GL_BLEND);
|
glEnable(GL_BLEND);
|
||||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
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);
|
texture->render(region, rect);
|
||||||
|
ShaderManager::instance()->popShader();
|
||||||
texture->unbind();
|
texture->unbind();
|
||||||
glDisable(GL_BLEND);
|
glDisable(GL_BLEND);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue