aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/context2d/qquickcanvasitem_p.h
diff options
context:
space:
mode:
authorCharles Yin <yinyunqiao@gmail.com>2012-05-03 23:31:17 +1000
committerQt by Nokia <qt-info@nokia.com>2012-05-04 08:47:10 +0200
commit05f7732f81abaa2d50f595d155e827501fed8d95 (patch)
tree4d565e5e8323ba4aa868006943b17d1eae630199 /src/quick/items/context2d/qquickcanvasitem_p.h
parent186abc1e085e4fae7631e329f44e68a810bca38b (diff)
Implement QQuickContext2DRenderThread class for threaded context2d rendering
Change-Id: I221690c730fd412b23705c0d687d1abbac38974d Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
Diffstat (limited to 'src/quick/items/context2d/qquickcanvasitem_p.h')
-rw-r--r--src/quick/items/context2d/qquickcanvasitem_p.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/quick/items/context2d/qquickcanvasitem_p.h b/src/quick/items/context2d/qquickcanvasitem_p.h
index 5238fbcf6d..c7fce7299e 100644
--- a/src/quick/items/context2d/qquickcanvasitem_p.h
+++ b/src/quick/items/context2d/qquickcanvasitem_p.h
@@ -44,6 +44,7 @@
#include <QtQuick/qquickitem.h>
#include <private/qv8engine_p.h>
+#include <QtCore/QThread>
QT_BEGIN_HEADER
@@ -161,6 +162,22 @@ private:
bool isPaintConnected();
};
+class QQuickContext2DRenderThread : public QThread
+{
+ Q_OBJECT
+public:
+ QQuickContext2DRenderThread(QQmlEngine *eng);
+ ~QQuickContext2DRenderThread();
+
+ static QQuickContext2DRenderThread *instance(QQmlEngine *engine);
+
+private:
+ QQmlEngine *m_engine;
+ QObject *m_eventLoopQuitHack;
+ static QHash<QQmlEngine *,QQuickContext2DRenderThread*> renderThreads;
+ static QMutex renderThreadsMutex;
+};
+
QT_END_NAMESPACE
QML_DECLARE_TYPE(QQuickCanvasItem)