summaryrefslogtreecommitdiff
path: root/src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h')
-rw-r--r--src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h b/src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h
index e22146dc5a..aaef3508cf 100644
--- a/src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h
+++ b/src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h
@@ -90,6 +90,9 @@ public:
FilterMode filterMode() const { return m_filterMode; }
void setFilterMode(FilterMode m) { m_filterMode = m; }
+ void setContext(QGLContext *context);
+ QGLContext *context() const { return ctx; }
+
public Q_SLOTS:
void contextDestroyed(const QGLContext *context) {
if (context == ctx) {
@@ -98,10 +101,20 @@ public Q_SLOTS:
// the context may not be current, so we cannot directly
// destroy the fbo and texture here, but since the context
// is about to be destroyed, the GL server will do the
- // clean up for us anyway
+ // clean up for us anyway. We reset everything, so that the
+ // glyph cache object can be reused later by setting a new
+ // context on it.
m_fbo = 0;
m_texture = 0;
ctx = 0;
+ m_width = 0;
+ m_height = 0;
+ m_w = 0;
+ m_h = 0;
+ m_cx = 0;
+ m_cy = 0;
+ m_currentRowHeight = 0;
+ coords.clear();
} else {
// since the context holding the texture is shared, and
// about to be destroyed, we have to transfer ownership
@@ -111,6 +124,8 @@ public Q_SLOTS:
}
}
+ void clear();
+
private:
QGLContext *ctx;