diff options
author | Trond Kjernåsen <trond.kjernasen@nokia.com> | 2010-06-22 11:12:13 (GMT) |
---|---|---|
committer | Trond Kjernåsen <trond.kjernasen@nokia.com> | 2010-07-02 10:25:05 (GMT) |
commit | 83abd5b9c8cf2b069c6b065ad37c93afe59d5d03 (patch) | |
tree | 53ccfcec921ff41ae39b0f73021ce80015fb0063 /src/opengl/gl2paintengineex | |
parent | 80a2ebd93346f885d904e4e1020e112cc635dbaf (diff) | |
download | Qt-83abd5b9c8cf2b069c6b065ad37c93afe59d5d03.zip Qt-83abd5b9c8cf2b069c6b065ad37c93afe59d5d03.tar.gz Qt-83abd5b9c8cf2b069c6b065ad37c93afe59d5d03.tar.bz2 |
Make the GL texture cache share textures between shared contexts.
Up until now the GL 2 engine texture cache did not share glyph textures
between sharing contexts, which is bad. Fix this by using the context
group's context as the cache key.
Diffstat (limited to 'src/opengl/gl2paintengineex')
-rw-r--r-- | src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp index 260e797..fe0d6c9 100644 --- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp +++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp @@ -1453,12 +1453,13 @@ void QGL2PaintEngineExPrivate::drawCachedGlyphs(QFontEngineGlyphCache::Type glyp QOpenGL2PaintEngineState *s = q->state(); + void *cacheKey = const_cast<QGLContext *>(QGLContextPrivate::contextGroup(ctx)->context()); QGLTextureGlyphCache *cache = - (QGLTextureGlyphCache *) staticTextItem->fontEngine->glyphCache(ctx, glyphType, QTransform()); + (QGLTextureGlyphCache *) staticTextItem->fontEngine->glyphCache(cacheKey, glyphType, QTransform()); if (!cache || cache->cacheType() != glyphType) { cache = new QGLTextureGlyphCache(ctx, glyphType, QTransform()); cache->insert(ctx, cache); - staticTextItem->fontEngine->setGlyphCache(ctx, cache); + staticTextItem->fontEngine->setGlyphCache(cacheKey, cache); } cache->setPaintEnginePrivate(this); |