summaryrefslogtreecommitdiffstats
path: root/src/adaptationlayers/qsgthreadedtexturemanager.h
blob: 4d16f17ad17ae99f397ef61f5698d2135c7756ed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#ifndef QSGTHREADEDTEXTUREMANAGER_H
#define QSGTHREADEDTEXTUREMANAGER_H

#include "qsgtexturemanager.h"

class QSGThreadedTextureManagerThread;
class QSGThreadedTextureManagerPrivate;
class QSGThreadedTexture;

class QSGThreadedTextureManager : public QSGTextureManager
{
    Q_OBJECT
    Q_DECLARE_PRIVATE(QSGThreadedTextureManager);

public:
    QSGThreadedTextureManager();

    QSGTextureRef upload(const QImage &image);
    QSGTextureRef requestUpload(const QImage &image, const QObject *listener, const char *slot);

protected:
    virtual void createThreadContext();
    virtual void makeThreadContextCurrent();
    virtual void uploadInThread(const QImage &image, QSGTexture *texture);

private:
    friend class QSGThreadedTextureManagerThread;
    friend class QSGThreadedTexture;
};

#endif // QSGTHREADEDTEXTUREMANAGER_H