summaryrefslogtreecommitdiffstats
path: root/customcontext/context.cpp
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@live.com>2013-03-26 11:48:18 -0500
committerGunnar Sletta <gunnar.sletta@digia.com>2013-04-02 10:25:32 +0200
commit7a29e57ea8c466c16fd75af059fb22adb6ab72f5 (patch)
tree51510d16909a7c62e4a6d81a266dbb541bd991ef /customcontext/context.cpp
parent2e8c125a9e72fe2cba5328fe8cd4f22548d26444 (diff)
Allow nonpreservedrtexture and atlastexture to be used together.
Small images will be atlased; large ones will not be preserved. Change-Id: Ia521e849e22068fef42ad3d0db7f57c22953818a Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
Diffstat (limited to 'customcontext/context.cpp')
-rw-r--r--customcontext/context.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/customcontext/context.cpp b/customcontext/context.cpp
index f349213..27a6a81 100644
--- a/customcontext/context.cpp
+++ b/customcontext/context.cpp
@@ -278,8 +278,11 @@ QSurfaceFormat Context::defaultSurfaceFormat() const
QSGTexture *Context::createTexture(const QImage &image) const
{
#ifdef CUSTOMCONTEXT_ATLASTEXTURE
- if (m_atlasTexture)
- return const_cast<Context *>(this)->m_atlasManager.create(image);
+ if (m_atlasTexture) {
+ QSGTexture *t = const_cast<Context *>(this)->m_atlasManager.create(image);
+ if (t)
+ return t;
+ }
#endif
#ifdef CUSTOMCONTEXT_MACTEXTURE
@@ -330,7 +333,7 @@ QQuickTextureFactory *Context::createTextureFactory(const QImage &image)
#ifdef CUSTOMCONTEXT_NONPRESERVEDTEXTURE
if (m_nonPreservedTexture)
- return new NonPreservedTextureFactory(image);
+ return new NonPreservedTextureFactory(image, this);
#endif
return 0;