summaryrefslogtreecommitdiffstats
path: root/src/opengl
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2011-03-28 21:42:03 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2011-03-28 21:42:03 (GMT)
commit53f16164661f8692aef9bd941b92697a047c0f4c (patch)
tree16912d8c0c5a58eb726493415b60f6b18fb831f0 /src/opengl
parent4da2ba2e788bb63a155e1d10ae559d4366eed875 (diff)
parent2e7af8c4e8ced21ced3e7f23590faeffffa1e0ff (diff)
downloadQt-53f16164661f8692aef9bd941b92697a047c0f4c.zip
Qt-53f16164661f8692aef9bd941b92697a047c0f4c.tar.gz
Qt-53f16164661f8692aef9bd941b92697a047c0f4c.tar.bz2
Merge branch 'master' of scm.dev.nokia.troll.no:qt/qt-fire-staging into master-integration
* 'master' of scm.dev.nokia.troll.no:qt/qt-fire-staging: Fix crash and infinite recursion caused by previous commits Fix remaining regressions in QWS Take Xft.hintstyle by default to match the behavior of GTK+ Fixed remaining issues in subpixel positioning with FreeType Fix QTransform debug output qFloor the decoration line width before painting Let QTextLine decide its own x position in QPainter Avoid repeatedly trying to load unloadable plugins, causing slowness Reset GL glyph cache when texture limit is reached unlockFace was put in the wrong place in previous patch Implement subpixel positioning with FreeType
Diffstat (limited to 'src/opengl')
-rw-r--r--src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp9
-rw-r--r--src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp15
-rw-r--r--src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h2
-rw-r--r--src/opengl/qgl.cpp15
-rw-r--r--src/opengl/qgl_p.h1
5 files changed, 40 insertions, 2 deletions
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
index ad77d7f..6678522 100644
--- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
+++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
@@ -1577,8 +1577,13 @@ void QGL2PaintEngineExPrivate::drawCachedGlyphs(QFontEngineGlyphCache::Type glyp
// cache so this text is performed before we test if the cache size has changed.
if (recreateVertexArrays) {
cache->setPaintEnginePrivate(this);
- cache->populate(staticTextItem->fontEngine(), staticTextItem->numGlyphs,
- staticTextItem->glyphs, staticTextItem->glyphPositions);
+ if (!cache->populate(staticTextItem->fontEngine(), staticTextItem->numGlyphs,
+ staticTextItem->glyphs, staticTextItem->glyphPositions)) {
+ // No space for glyphs in cache. We need to reset it and try again.
+ cache->clear();
+ cache->populate(staticTextItem->fontEngine(), staticTextItem->numGlyphs,
+ staticTextItem->glyphs, staticTextItem->glyphPositions);
+ }
cache->fillInPendingGlyphs();
}
diff --git a/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp b/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp
index 9e8e828..c867d60 100644
--- a/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp
+++ b/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp
@@ -378,4 +378,19 @@ int QGLTextureGlyphCache::maxTextureHeight() const
else
return ctx->d_ptr->maxTextureSize();
}
+
+void QGLTextureGlyphCache::clear()
+{
+ if (ctx != 0) {
+ m_textureResource.cleanup(ctx);
+
+ m_w = 0;
+ m_h = 0;
+ m_cx = 0;
+ m_cy = 0;
+ m_currentRowHeight = 0;
+ coords.clear();
+ }
+}
+
QT_END_NAMESPACE
diff --git a/src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h b/src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h
index cc6de28..133289e 100644
--- a/src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h
+++ b/src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h
@@ -142,6 +142,8 @@ public:
FilterMode filterMode() const { return m_filterMode; }
void setFilterMode(FilterMode m) { m_filterMode = m; }
+ void clear();
+
void freeResource(void *) { ctx = 0; }
private:
diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp
index 19858e7..4698a5c 100644
--- a/src/opengl/qgl.cpp
+++ b/src/opengl/qgl.cpp
@@ -5606,6 +5606,21 @@ void *QGLContextGroupResourceBase::value(const QGLContext *context)
return group->m_resources.value(this, 0);
}
+void QGLContextGroupResourceBase::cleanup(const QGLContext *ctx)
+{
+ void *resource = value(ctx);
+
+ if (resource != 0) {
+ QGLShareContextScope scope(ctx);
+ freeResource(resource);
+
+ QGLContextGroup *group = QGLContextPrivate::contextGroup(ctx);
+ group->m_resources.remove(this);
+ m_groups.removeOne(group);
+ active.deref();
+ }
+}
+
void QGLContextGroupResourceBase::cleanup(const QGLContext *ctx, void *value)
{
#ifdef QT_GL_CONTEXT_RESOURCE_DEBUG
diff --git a/src/opengl/qgl_p.h b/src/opengl/qgl_p.h
index 5a5e5cc..b2261a2 100644
--- a/src/opengl/qgl_p.h
+++ b/src/opengl/qgl_p.h
@@ -687,6 +687,7 @@ public:
virtual ~QGLContextGroupResourceBase();
void insert(const QGLContext *context, void *value);
void *value(const QGLContext *context);
+ void cleanup(const QGLContext *context);
void cleanup(const QGLContext *context, void *value);
virtual void freeResource(void *value) = 0;