summaryrefslogtreecommitdiffstats
path: root/src/gui/painting/qtextureglyphcache.cpp
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2011-03-23 10:54:44 +0100
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2011-03-23 12:27:11 +0100
commit1e6e5fdd02757b9f8b5abf23973cbdc76ae67333 (patch)
treedf87bd8fe7d8aef36024e89218906494c02cfb8c /src/gui/painting/qtextureglyphcache.cpp
parent8582d3b1ad7d879dcb55124933d0d93edb47b66b (diff)
Reset GL glyph cache when texture limit is reached
This is a port of 72f161739b270b01807f97cd853030440f0fd430 which was reverted in integration to master, since it was incompatible with the refactored glyph cache. When the GL glyph cache reached its texture limit, we have to reset it and start over. Added a new cleanup() function in QGLContextGroupResourceBase which deletes the resource for a given context and removes itself from that context group. Task-number: QTBUG-13784 Reviewed-by: Samuel
Diffstat (limited to 'src/gui/painting/qtextureglyphcache.cpp')
-rw-r--r--src/gui/painting/qtextureglyphcache.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/gui/painting/qtextureglyphcache.cpp b/src/gui/painting/qtextureglyphcache.cpp
index b83dbc057f..eab02e1d25 100644
--- a/src/gui/painting/qtextureglyphcache.cpp
+++ b/src/gui/painting/qtextureglyphcache.cpp
@@ -238,6 +238,11 @@ bool QTextureGlyphCache::populate(QFontEngine *fontEngine, int numGlyphs, const
}
}
+ if (maxTextureHeight() > 0 && m_cy + c.h > maxTextureHeight()) {
+ // We can't make a cache of the required size, so we bail out
+ return false;
+ }
+
c.x = m_cx;
c.y = m_cy;