summaryrefslogtreecommitdiffstats
path: root/src/opengl/gl2paintengineex
diff options
context:
space:
mode:
authorRhys Weatherley <rhys.weatherley@nokia.com>2009-11-05 00:25:12 (GMT)
committerRhys Weatherley <rhys.weatherley@nokia.com>2009-11-05 06:46:05 (GMT)
commitb91f1a2f749586014e8b28c6766015ff6ba62ee7 (patch)
treeb7c4eebcd52754645f463b363a425ce163f643a9 /src/opengl/gl2paintengineex
parent23572588c4b0c759c14a6c1687e5bd86461e31e8 (diff)
downloadQt-b91f1a2f749586014e8b28c6766015ff6ba62ee7.zip
Qt-b91f1a2f749586014e8b28c6766015ff6ba62ee7.tar.gz
Qt-b91f1a2f749586014e8b28c6766015ff6ba62ee7.tar.bz2
Modify QGLShader and QGLShaderProgram in response to API review
Reviewed-by: Sarah Smith
Diffstat (limited to 'src/opengl/gl2paintengineex')
-rw-r--r--src/opengl/gl2paintengineex/qglengineshadermanager.cpp26
-rw-r--r--src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp4
2 files changed, 15 insertions, 15 deletions
diff --git a/src/opengl/gl2paintengineex/qglengineshadermanager.cpp b/src/opengl/gl2paintengineex/qglengineshadermanager.cpp
index 40a6241..8a8f483 100644
--- a/src/opengl/gl2paintengineex/qglengineshadermanager.cpp
+++ b/src/opengl/gl2paintengineex/qglengineshadermanager.cpp
@@ -169,14 +169,14 @@ QGLEngineSharedShaders::QGLEngineSharedShaders(const QGLContext* context)
source.clear();
source.append(qShaderSnippets[MainVertexShader]);
source.append(qShaderSnippets[PositionOnlyVertexShader]);
- vertexShader = new QGLShader(QGLShader::VertexShader, context, this);
- vertexShader->compile(source);
+ vertexShader = new QGLShader(QGLShader::Vertex, context, this);
+ vertexShader->compileSourceCode(source);
source.clear();
source.append(qShaderSnippets[MainFragmentShader]);
source.append(qShaderSnippets[ShockingPinkSrcFragmentShader]);
- fragShader = new QGLShader(QGLShader::FragmentShader, context, this);
- fragShader->compile(source);
+ fragShader = new QGLShader(QGLShader::Fragment, context, this);
+ fragShader->compileSourceCode(source);
simpleShaderProg = new QGLShaderProgram(context, this);
simpleShaderProg->addShader(vertexShader);
@@ -192,14 +192,14 @@ QGLEngineSharedShaders::QGLEngineSharedShaders(const QGLContext* context)
source.clear();
source.append(qShaderSnippets[MainWithTexCoordsVertexShader]);
source.append(qShaderSnippets[UntransformedPositionVertexShader]);
- vertexShader = new QGLShader(QGLShader::VertexShader, context, this);
- vertexShader->compile(source);
+ vertexShader = new QGLShader(QGLShader::Vertex, context, this);
+ vertexShader->compileSourceCode(source);
source.clear();
source.append(qShaderSnippets[MainFragmentShader]);
source.append(qShaderSnippets[ImageSrcFragmentShader]);
- fragShader = new QGLShader(QGLShader::FragmentShader, context, this);
- fragShader->compile(source);
+ fragShader = new QGLShader(QGLShader::Fragment, context, this);
+ fragShader->compileSourceCode(source);
blitShaderProg = new QGLShaderProgram(context, this);
blitShaderProg->addShader(vertexShader);
@@ -243,14 +243,14 @@ QGLEngineShaderProg *QGLEngineSharedShaders::findProgramInCache(const QGLEngineS
source.append(qShaderSnippets[prog.compositionFragShader]);
if (prog.maskFragShader)
source.append(qShaderSnippets[prog.maskFragShader]);
- QGLShader* fragShader = new QGLShader(QGLShader::FragmentShader, ctxGuard.context(), this);
- fragShader->compile(source);
+ QGLShader* fragShader = new QGLShader(QGLShader::Fragment, ctxGuard.context(), this);
+ fragShader->compileSourceCode(source);
source.clear();
source.append(qShaderSnippets[prog.mainVertexShader]);
source.append(qShaderSnippets[prog.positionVertexShader]);
- QGLShader* vertexShader = new QGLShader(QGLShader::VertexShader, ctxGuard.context(), this);
- vertexShader->compile(source);
+ QGLShader* vertexShader = new QGLShader(QGLShader::Vertex, ctxGuard.context(), this);
+ vertexShader->compileSourceCode(source);
#if defined(QT_DEBUG)
// Name the shaders for easier debugging
@@ -673,7 +673,7 @@ bool QGLEngineShaderManager::useCorrectShaderProg()
currentShaderProg = sharedShaders->findProgramInCache(requiredProgram);
if (currentShaderProg) {
- currentShaderProg->program->enable();
+ currentShaderProg->program->bind();
if (useCustomSrc)
customSrcStage->setUniforms(currentShaderProg->program);
}
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
index a9744b3..d20700f 100644
--- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
+++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
@@ -246,7 +246,7 @@ void QGLTextureGlyphCache::resizeTextureData(int width, int height)
glVertexAttribPointer(QT_VERTEX_COORDS_ATTR, 2, GL_FLOAT, GL_FALSE, 0, vertexCoordinateArray);
glVertexAttribPointer(QT_TEXTURE_COORDS_ATTR, 2, GL_FLOAT, GL_FALSE, 0, textureCoordinateArray);
- pex->shaderManager->blitProgram()->enable();
+ pex->shaderManager->blitProgram()->bind();
pex->shaderManager->blitProgram()->setUniformValue("imageTexture", QT_IMAGE_TEXTURE_UNIT);
pex->shaderManager->setDirty();
@@ -395,7 +395,7 @@ void QGL2PaintEngineExPrivate::setBrush(const QBrush* brush)
void QGL2PaintEngineExPrivate::useSimpleShader()
{
- shaderManager->simpleProgram()->enable();
+ shaderManager->simpleProgram()->bind();
shaderManager->setDirty();
if (matrixDirty)