summaryrefslogtreecommitdiffstats
path: root/src/scenegraph/coreapi/qsgtexturemanager.h
diff options
context:
space:
mode:
authorGunnar Sletta <gunnar.sletta@nokia.com>2010-12-08 09:04:06 +0100
committerGunnar Sletta <gunnar.sletta@nokia.com>2010-12-08 09:04:06 +0100
commit56bf92c816687942670cfd599b76f00705392d2e (patch)
tree4d0f21a3f414b0e7b853589ddb018cab48657dc0 /src/scenegraph/coreapi/qsgtexturemanager.h
parenta2e244eb4a958d3f8adc42d364def21ff8ea7f20 (diff)
Asynchronous texture loading on the rendering thread.
Split the textures up into 64x64 chunks and only process textures for a few ms prior to each frame...
Diffstat (limited to 'src/scenegraph/coreapi/qsgtexturemanager.h')
-rw-r--r--src/scenegraph/coreapi/qsgtexturemanager.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/scenegraph/coreapi/qsgtexturemanager.h b/src/scenegraph/coreapi/qsgtexturemanager.h
index ef0c910..46979a2 100644
--- a/src/scenegraph/coreapi/qsgtexturemanager.h
+++ b/src/scenegraph/coreapi/qsgtexturemanager.h
@@ -43,6 +43,7 @@
#define QSGTEXTUREMANAGER_H
#include "qmlscene_global.h"
+#include "qsgcontext.h"
#include <QObject>
#include <QImage>
@@ -159,15 +160,23 @@ private:
};
-class QT_SCENEGRAPH_EXPORT QSGTextureManager
+class QT_SCENEGRAPH_EXPORT QSGTextureManager : public QObject
{
+ Q_OBJECT
+
public:
QSGTextureManager();
+ virtual void setContext(QSGContext *context);
+ QSGContext *context() const;
+
virtual QSGTextureRef upload(const QImage &image);
virtual QSGTextureRef requestUpload(const QImage &image, const QObject *listener, const char *slot);
- static QImage swizzleBGGRAToRGBA(const QImage &image);
+ static void swizzleBGRAToRGBA(QImage *image);
+
+private slots:
+ void processAsyncTextures();
private:
QSGTextureManagerPrivate *d;