aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/context2d/qquickcontext2d_p.h
diff options
context:
space:
mode:
authorCharles Yin <yinyunqiao@gmail.com>2012-06-06 07:09:07 +1000
committerQt by Nokia <qt-info@nokia.com>2012-07-31 07:44:12 +0200
commit4236e7f7ee1d78c5adfebe719afb8b8a6dcd094b (patch)
tree9889d51119657f74951ad7642dc6a89c8c0d068b /src/quick/items/context2d/qquickcontext2d_p.h
parent9b671727010ccc45cc51840630b159cd34dd983d (diff)
Refactor context2d thread logic
1. Use QQuickContext2DRenderThread for Threaded rendering 2. Make FBO target works with all render strategies 3. Remove some unnessary locks, call texture methods by invoking meta calls 4. Run existing tests with all render targets and strategies (except Cooperative) Change-Id: I0db5c91d848b86bcc1536c30d7a5804b66a817f1 Reviewed-by: Yunqiao Yin <charles.yin@nokia.com>
Diffstat (limited to 'src/quick/items/context2d/qquickcontext2d_p.h')
-rw-r--r--src/quick/items/context2d/qquickcontext2d_p.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/quick/items/context2d/qquickcontext2d_p.h b/src/quick/items/context2d/qquickcontext2d_p.h
index e2952ca580..295be051ba 100644
--- a/src/quick/items/context2d/qquickcontext2d_p.h
+++ b/src/quick/items/context2d/qquickcontext2d_p.h
@@ -53,7 +53,7 @@
#include <QtCore/qstack.h>
#include <QtCore/qqueue.h>
#include <private/qv8engine_p.h>
-
+#include <QtCore/QWaitCondition>
//#define QQUICKCONTEXT2D_DEBUG //enable this for just DEBUG purpose!
@@ -172,6 +172,7 @@ public:
void prepare(const QSize& canvasSize, const QSize& tileSize, const QRect& canvasWindow, const QRect& dirtyRect, bool smooth);
void flush();
void sync();
+ QThread *thread() const {return m_thread;}
QSGDynamicTexture *texture() const;
QImage toImage(const QRectF& bounds);
@@ -228,6 +229,7 @@ public:
QOpenGLContext *glContext() { return m_glContext; }
QSurface *surface() { return m_surface; }
+ void setGrabbedImage(const QImage& grab);
State state;
QStack<QQuickContext2D::State> m_stateStack;
@@ -246,7 +248,11 @@ public:
QQuickCanvasItem::RenderTarget m_renderTarget;
QQuickCanvasItem::RenderStrategy m_renderStrategy;
QQueue<QQuickContext2DCommandBuffer*> m_bufferQueue;
- QMutex m_bufferMutex;
+ QThread *m_thread;
+ QImage m_grabbedImage;
+ bool m_grabbed:1;
+
+ QMutex m_mutex;
};