diff options
author | Gunnar Sletta <gunnar.sletta@nokia.com> | 2010-12-22 12:09:49 +0100 |
---|---|---|
committer | Gunnar Sletta <gunnar.sletta@nokia.com> | 2010-12-22 12:09:49 +0100 |
commit | 072ab09a0af8386ce0294450efb0c92dd91756f5 (patch) | |
tree | c44b2574258535ad78b1a2e4002a1f9347037537 | |
parent | 9b8f945858e553a1b13e5b5cfbdfb8d0e05070aa (diff) |
allow switching between different texture managers
-rw-r--r-- | TODO | 6 | ||||
-rw-r--r-- | src/scenegraph/coreapi/qsgcontext.cpp | 28 |
2 files changed, 22 insertions, 12 deletions
@@ -75,7 +75,13 @@ - signal based? - ShaderEffectItem - Use source to grab static image of subtree for later use + - Be able to feed the texture output into an Image element - Feed arbitrary texture values into shader effects? + - Change ShaderEffectSource to be more of a TextureAbstraction and + add things like grab(), texture id, etc to it so that it more + easily can be passed around and used for stuff... ShaderEffectItem + then becomes just one of several places where it can be used... + - Make effects using same source code use the same ShaderProgram - Adaptation layer plugin infrastructure? - Outstanding bugs: - Vsync driver never pauses diff --git a/src/scenegraph/coreapi/qsgcontext.cpp b/src/scenegraph/coreapi/qsgcontext.cpp index d13c374..89c123f 100644 --- a/src/scenegraph/coreapi/qsgcontext.cpp +++ b/src/scenegraph/coreapi/qsgcontext.cpp @@ -9,6 +9,7 @@ #include "qsgtexturemanager.h" #include "qsgpartialuploadtexturemanager.h" +#include "qsgthreadedtexturemanager.h" #include <QApplication> @@ -146,7 +147,7 @@ void QSGContext::renderNextFrame() */ RectangleNodeInterface *QSGContext::createRectangleNode() { - return new DefaultRectangleNode(DefaultRectangleNode::PreferVertexColorMaterial, this); + return new DefaultRectangleNode(DefaultRectangleNode::PreferTextureMaterial, this); } /*! @@ -185,18 +186,21 @@ QSGTextureManager *QSGContext::createTextureManager() QSGTextureManager *manager; -// if (args.contains("--partial-texture-manager")) { -// printf("QSGContext: Using partial upload texture manager\n"); + if (args.contains("--partial-texture-manager")) { + printf("QSGContext: Using partial upload texture manager\n"); manager = new QSGPartialUploadTextureManager; -// } else { -// printf("QSGContext: Using basic texture manager\n"); -// manager = new QSGTextureManager; -// } - - // } else if (args.contains("--threaded-texture-manager")) { -// printf("QSGContext: Using threaded texture manager\n"); -// return new QSGThreadedTextureManager; -// } + + } else if (args.contains("--basic-texture-manager")) { + printf("QSGContext: Using basic texture manager\n"); + manager = new QSGTextureManager; + + } else if (args.contains("--threaded-texture-manager")) { + printf("QSGContext: Using threaded texture manager\n"); + manager = new QSGThreadedTextureManager; + + } else { + manager = new QSGPartialUploadTextureManager; + } //#if defined (Q_WS_MAC) // printf("QSGContext:: Using Mac Texture manager\n"); |