From 7a29e57ea8c466c16fd75af059fb22adb6ab72f5 Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Tue, 26 Mar 2013 11:48:18 -0500 Subject: 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 --- customcontext/context.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'customcontext/context.cpp') 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(this)->m_atlasManager.create(image); + if (m_atlasTexture) { + QSGTexture *t = const_cast(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; -- cgit v1.2.3