summaryrefslogtreecommitdiffstats
path: root/src/opengl
diff options
context:
space:
mode:
authoraavit <qt-info@nokia.com>2010-11-02 14:33:17 (GMT)
committeraavit <qt-info@nokia.com>2010-11-02 15:04:38 (GMT)
commitc553a275dda3cf84da43abc63030483d9bac5e47 (patch)
tree25b16419efa5d33ed533182b3a46ccfb63b43df9 /src/opengl
parent57ac6015ab50d96a180a82676e9e1c3b702c0678 (diff)
parent8e0034b4091e0ad08e16aba194c53d6582710550 (diff)
downloadQt-c553a275dda3cf84da43abc63030483d9bac5e47.zip
Qt-c553a275dda3cf84da43abc63030483d9bac5e47.tar.gz
Qt-c553a275dda3cf84da43abc63030483d9bac5e47.tar.bz2
Merge branch 'lancelot'
First iteration of the Lancelot graphics regression autotest system. Reviewed-by: Trond Reviewed-by: aavit
Diffstat (limited to 'src/opengl')
-rw-r--r--src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp3
-rw-r--r--src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp12
-rw-r--r--src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h4
3 files changed, 11 insertions, 8 deletions
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
index b90709f..66895dd 100644
--- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
+++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
@@ -1506,9 +1506,10 @@ void QGL2PaintEngineExPrivate::drawCachedGlyphs(QFontEngineGlyphCache::Type glyp
void *cacheKey = const_cast<QGLContext *>(QGLContextPrivate::contextGroup(ctx)->context());
QGLTextureGlyphCache *cache =
(QGLTextureGlyphCache *) staticTextItem->fontEngine->glyphCache(cacheKey, glyphType, QTransform());
- if (!cache || cache->cacheType() != glyphType) {
+ if (!cache || cache->cacheType() != glyphType || cache->context() == 0) {
cache = new QGLTextureGlyphCache(ctx, glyphType, QTransform());
staticTextItem->fontEngine->setGlyphCache(cacheKey, cache);
+ cache->insert(ctx, cache);
}
bool recreateVertexArrays = false;
diff --git a/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp b/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp
index 66c9ba8..7954d77 100644
--- a/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp
+++ b/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp
@@ -54,11 +54,11 @@ extern Q_GUI_EXPORT bool qt_cleartype_enabled;
#endif
QGLTextureGlyphCache::QGLTextureGlyphCache(const QGLContext *context, QFontEngineGlyphCache::Type type, const QTransform &matrix)
- : QImageTextureGlyphCache(type, matrix)
+ : QImageTextureGlyphCache(type, matrix), QGLContextGroupResourceBase()
, ctx(context)
, pex(0)
- , m_filterMode(Nearest)
, m_blitProgram(0)
+ , m_filterMode(Nearest)
{
#ifdef QT_GL_TEXTURE_GLYPH_CACHE_DEBUG
qDebug(" -> QGLTextureGlyphCache() %p for context %p.", this, ctx);
@@ -208,8 +208,8 @@ void QGLTextureGlyphCache::resizeTextureData(int width, int height)
{
QString source;
- source.append(qglslMainWithTexCoordsVertexShader);
- source.append(qglslUntransformedPositionVertexShader);
+ source.append(QLatin1String(qglslMainWithTexCoordsVertexShader));
+ source.append(QLatin1String(qglslUntransformedPositionVertexShader));
QGLShader *vertexShader = new QGLShader(QGLShader::Vertex, m_blitProgram);
vertexShader->compileSourceCode(source);
@@ -219,8 +219,8 @@ void QGLTextureGlyphCache::resizeTextureData(int width, int height)
{
QString source;
- source.append(qglslMainFragmentShader);
- source.append(qglslImageSrcFragmentShader);
+ source.append(QLatin1String(qglslMainFragmentShader));
+ source.append(QLatin1String(qglslImageSrcFragmentShader));
QGLShader *fragmentShader = new QGLShader(QGLShader::Fragment, m_blitProgram);
fragmentShader->compileSourceCode(source);
diff --git a/src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h b/src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h
index f75cf68..572da82 100644
--- a/src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h
+++ b/src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h
@@ -98,7 +98,7 @@ struct QGLGlyphTexture
int m_height;
};
-class Q_OPENGL_EXPORT QGLTextureGlyphCache : public QImageTextureGlyphCache
+class Q_OPENGL_EXPORT QGLTextureGlyphCache : public QImageTextureGlyphCache, public QGLContextGroupResourceBase
{
public:
QGLTextureGlyphCache(const QGLContext *context, QFontEngineGlyphCache::Type type, const QTransform &matrix);
@@ -140,6 +140,8 @@ public:
FilterMode filterMode() const { return m_filterMode; }
void setFilterMode(FilterMode m) { m_filterMode = m; }
+ void freeResource(void *) { ctx = 0; }
+
private:
QGLContextGroupResource<QGLGlyphTexture> m_textureResource;