diff options
author | Gunnar Sletta <gunnar.sletta@digia.com> | 2013-10-17 14:53:33 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-10-30 08:29:49 +0100 |
commit | 906d5c5c40183468f9521277c6244a6c46730de6 (patch) | |
tree | 0eb46a8f88d59993ab659e2dc07970d1ce2f0d73 /src/quick/scenegraph/qsgdefaultdistancefieldglyphcache.cpp | |
parent | c084d32d92b2df55532fa1599e590c29bf2b5bfb (diff) |
Use one render loop per QQuickWindow
See the task for the full reasoning behind this patch.
The threaded renderloop has been refactored to have one window per
thread. This is mostly a simplification of the current code path where
for loops over multiple windows are turned into if (window).
The QSGContext has been split into two classes, QSGRenderContext
for which there is one per OpenGLContext.
The rest of the patch is name changes and a couple of cleanups
in the hopes of simplifying this change.
Task-number: QTBUG-33993
Change-Id: I31c81f9694d7da7474a72333169be38de62613c4
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src/quick/scenegraph/qsgdefaultdistancefieldglyphcache.cpp')
-rw-r--r-- | src/quick/scenegraph/qsgdefaultdistancefieldglyphcache.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/quick/scenegraph/qsgdefaultdistancefieldglyphcache.cpp b/src/quick/scenegraph/qsgdefaultdistancefieldglyphcache.cpp index bc09ed83d7..635f07f2ea 100644 --- a/src/quick/scenegraph/qsgdefaultdistancefieldglyphcache.cpp +++ b/src/quick/scenegraph/qsgdefaultdistancefieldglyphcache.cpp @@ -52,8 +52,8 @@ QT_BEGIN_NAMESPACE DEFINE_BOOL_CONFIG_OPTION(qmlUseGlyphCacheWorkaround, QML_USE_GLYPHCACHE_WORKAROUND) -QSGDefaultDistanceFieldGlyphCache::QSGDefaultDistanceFieldGlyphCache(QSGDistanceFieldGlyphCacheManager *man, QOpenGLContext *c, const QRawFont &font) - : QSGDistanceFieldGlyphCache(man, c, font) +QSGDefaultDistanceFieldGlyphCache::QSGDefaultDistanceFieldGlyphCache(QSGDistanceFieldGlyphCacheManager *man, const QRawFont &font) + : QSGDistanceFieldGlyphCache(man, font) , m_maxTextureSize(0) , m_maxTextureCount(3) , m_blitProgram(0) @@ -239,6 +239,9 @@ static void freeFramebufferFunc(QOpenGLFunctions *funcs, GLuint id) void QSGDefaultDistanceFieldGlyphCache::resizeTexture(TextureInfo *texInfo, int width, int height) { + QOpenGLContext *ctx = QOpenGLContext::currentContext(); + Q_ASSERT(ctx); + int oldWidth = texInfo->size.width(); int oldHeight = texInfo->size.height(); if (width == oldWidth && height == oldHeight) @@ -361,7 +364,7 @@ bool QSGDefaultDistanceFieldGlyphCache::useWorkaround() const static bool set = false; static bool useWorkaround = false; if (!set) { - QOpenGLContextPrivate *ctx_p = static_cast<QOpenGLContextPrivate *>(QOpenGLContextPrivate::get(ctx)); + QOpenGLContextPrivate *ctx_p = static_cast<QOpenGLContextPrivate *>(QOpenGLContextPrivate::get(QOpenGLContext::currentContext())); useWorkaround = ctx_p->workaround_brokenFBOReadBack || qmlUseGlyphCacheWorkaround(); // on some hardware the workaround is faster (see QTBUG-29264) set = true; |