diff options
author | Gunnar Sletta <gunnar.sletta@jollamobile.com> | 2014-08-15 09:26:16 +0200 |
---|---|---|
committer | Gunnar Sletta <gunnar.sletta@jollamobile.com> | 2014-08-23 08:00:43 +0200 |
commit | 8d0e307bc7f9f4458e6ea2d2fc0d6cd25be4fda9 (patch) | |
tree | f12a065df95d54699e3266702aa7b62f707fdc33 /src/quick/scenegraph/qsgcontext.cpp | |
parent | 15ee12508ec8663ae09ebfc61cc4f0725311bdec (diff) |
Downscale textures which exceed the GL texture limit
This way they will at least render.
[ChangeLog][QtQuick] Images exceeding GL_MAX_TEXTURE_SIZE will be
downscaled to fit so they will still show.
Change-Id: I169ecac768036812b8e14265ec1a0a8902655666
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Diffstat (limited to 'src/quick/scenegraph/qsgcontext.cpp')
-rw-r--r-- | src/quick/scenegraph/qsgcontext.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/quick/scenegraph/qsgcontext.cpp b/src/quick/scenegraph/qsgcontext.cpp index 6ebc479ec5..4e768574c4 100644 --- a/src/quick/scenegraph/qsgcontext.cpp +++ b/src/quick/scenegraph/qsgcontext.cpp @@ -253,6 +253,7 @@ void QSGContext::renderContextInitialized(QSGRenderContext *renderContext) QSet<QByteArray> exts = renderContext->openglContext()->extensions(); QByteArray all; foreach (const QByteArray &e, exts) all += ' ' + e; qCDebug(QSG_LOG_INFO) << "GL_EXTENSIONS: " << all.constData(); + qCDebug(QSG_LOG_INFO) << "Max Texture Size: " << renderContext->maxTextureSize(); } d->mutex.unlock(); @@ -392,6 +393,7 @@ QSGRenderContext::QSGRenderContext(QSGContext *context) , m_atlasManager(0) , m_depthStencilManager(0) , m_distanceFieldCacheManager(0) + , m_maxTextureSize(0) , m_brokenIBOs(false) , m_serializedRender(false) , m_attachToGLContext(true) @@ -493,6 +495,9 @@ void QSGRenderContext::registerFontengineForCleanup(QFontEngine *engine) */ void QSGRenderContext::initialize(QOpenGLContext *context) { + QOpenGLFunctions *funcs = QOpenGLContext::currentContext()->functions(); + funcs->glGetIntegerv(GL_MAX_TEXTURE_SIZE, &m_maxTextureSize); + // Sanity check the surface format, in case it was overridden by the application QSurfaceFormat requested = m_sg->defaultSurfaceFormat(); QSurfaceFormat actual = context->format(); @@ -513,7 +518,6 @@ void QSGRenderContext::initialize(QOpenGLContext *context) m_sg->renderContextInitialized(this); #ifdef Q_OS_LINUX - QOpenGLFunctions *funcs = QOpenGLContext::currentContext()->functions(); const char *vendor = (const char *) funcs->glGetString(GL_VENDOR); if (strstr(vendor, "nouveau")) m_brokenIBOs = true; |