Support new translate for textures

This commit is contained in:
Martin Gräßlin 2010-12-05 10:51:51 +01:00 committed by Martin Gräßlin
parent e5932ff214
commit d12c4e58fd
2 changed files with 5 additions and 2 deletions

View file

@ -525,7 +525,10 @@ void GLTexture::render( QRegion region, const QRect& rect, bool useShader )
m_vbo->setData( 4, 2, verts, texcoords );
}
if (useShader) {
// TODO: set shader translation.
GLint currentProgram;
glGetIntegerv( GL_CURRENT_PROGRAM, &currentProgram );
GLint location = glGetUniformLocation(currentProgram, "geometry");
glUniform4f(location, rect.x(), rect.y(), 0.0f, 0.0f);
} else {
#ifndef KWIN_HAVE_OPENGLES
glTranslatef( rect.x(), rect.y(), 0.0f );

View file

@ -1362,7 +1362,7 @@ void SceneOpenGL::EffectFrame::render( QRegion region, double opacity, double fr
m_unstyledTexture->bind();
const QPoint pt = m_effectFrame->geometry().topLeft();
if (sceneShader) {
// TODO: move geometry
shader->setUniform("geometry", QVector4D(pt.x(), pt.y(), 0.0f, 0.0f));
} else {
#ifndef KWIN_HAVE_OPENGLES
glTranslatef( pt.x(), pt.y(), 0.0f );