summaryrefslogtreecommitdiffstats
path: root/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-03-16 13:19:07 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-03-16 13:19:07 (GMT)
commitb83172f8cfb4439f17c96886f0c6046a885370f6 (patch)
treef2af4115a1c949bb17cf5ef6a13d86a24fe17512 /src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
parentfdcb62d5d6a3e295273042555d2551eb491a5b2d (diff)
parenta31aa886f29ab49bb0aa757ce2253aa4e8ef3632 (diff)
downloadQt-b83172f8cfb4439f17c96886f0c6046a885370f6.zip
Qt-b83172f8cfb4439f17c96886f0c6046a885370f6.tar.gz
Qt-b83172f8cfb4439f17c96886f0c6046a885370f6.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2: Compile Implement a special case, simplified vertex shader for complex geometry Revert "small cleanup regarding delayed layout in itemviews" Make sure the delete and backspace keys are ignored when keyb-searching Fix a crash in QSortFilterProxyModel when deleting a row small cleanup regarding delayed layout in itemviews Fixed wasted space in the texture cache. Get debug code compiling since function signature changes --warn; That file was forgotten when adding SSE support under mingw
Diffstat (limited to 'src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp')
-rw-r--r--src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
index d68a268..b90f0c2 100644
--- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
+++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
@@ -395,6 +395,7 @@ void QGL2PaintEngineExPrivate::updateMatrix()
qreal(0.0001));
matrixDirty = false;
+ matrixUniformDirty = true;
// Set the PMV matrix attribute. As we use an attributes rather than uniforms, we only
// need to do this once for every matrix change and persists across all shader programs.
@@ -594,6 +595,9 @@ void QGL2PaintEngineExPrivate::transferMode(EngineMode newMode)
if (newMode == TextDrawingMode) {
setVertexAttributePointer(QT_VERTEX_COORDS_ATTR, (GLfloat*)vertexCoordinateArray.data());
setVertexAttributePointer(QT_TEXTURE_COORDS_ATTR, (GLfloat*)textureCoordinateArray.data());
+ shaderManager->setHasComplexGeometry(true);
+ } else {
+ shaderManager->setHasComplexGeometry(false);
}
if (newMode == ImageDrawingMode) {
@@ -1045,6 +1049,7 @@ bool QGL2PaintEngineExPrivate::prepareForDraw(bool srcPixelsAreOpaque)
// The shader program has changed so mark all uniforms as dirty:
brushUniformsDirty = true;
opacityUniformDirty = true;
+ matrixUniformDirty = true;
}
if (brushUniformsDirty && mode != ImageDrawingMode && mode != ImageArrayDrawingMode)
@@ -1055,6 +1060,12 @@ bool QGL2PaintEngineExPrivate::prepareForDraw(bool srcPixelsAreOpaque)
opacityUniformDirty = false;
}
+ if (matrixUniformDirty && shaderManager->hasComplexGeometry()) {
+ shaderManager->currentProgram()->setUniformValue(location(QGLEngineShaderManager::Matrix),
+ pmvMatrix);
+ matrixUniformDirty = false;
+ }
+
return changed;
}
@@ -1631,7 +1642,6 @@ void QGL2PaintEngineExPrivate::drawCachedGlyphs(QFontEngineGlyphCache::Type glyp
lastMaskTextureUsed = cache->texture();
}
updateTextureFilter(GL_TEXTURE_2D, GL_REPEAT, false);
-
shaderManager->currentProgram()->setUniformValue(location(QGLEngineShaderManager::MaskTexture), QT_MASK_TEXTURE_UNIT);
#if defined(QT_OPENGL_DRAWCACHEDGLYPHS_INDEX_ARRAY_VBO)
@@ -1776,6 +1786,7 @@ bool QGL2PaintEngineEx::begin(QPaintDevice *pdev)
d->mode = BrushDrawingMode;
d->brushTextureDirty = true;
d->brushUniformsDirty = true;
+ d->matrixUniformDirty = true;
d->matrixDirty = true;
d->compositionModeDirty = true;
d->opacityUniformDirty = true;