diff options
author | Michael Brasser <michael.brasser@live.com> | 2013-03-26 11:48:18 -0500 |
---|---|---|
committer | Gunnar Sletta <gunnar.sletta@digia.com> | 2013-04-02 10:25:32 +0200 |
commit | 7a29e57ea8c466c16fd75af059fb22adb6ab72f5 (patch) | |
tree | 51510d16909a7c62e4a6d81a266dbb541bd991ef /customcontext/context.cpp | |
parent | 2e8c125a9e72fe2cba5328fe8cd4f22548d26444 (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.cpp | 9 |
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; |