aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/context2d/qquickcontext2dtexture_p.h
diff options
context:
space:
mode:
authorGunnar Sletta <gunnar.sletta@jollamobile.com>2014-07-30 17:11:02 +0200
committerGunnar Sletta <gunnar.sletta@jollamobile.com>2014-07-31 19:39:58 +0200
commit54d32ff902292148bffa84b7fc94116d32d5d02b (patch)
tree89940c8fbdfee72c8bef7084357485d41c0f93bd /src/quick/items/context2d/qquickcontext2dtexture_p.h
parent9fe218ddf604a9a31e25b55445b03ea47edc0b96 (diff)
Make canvas cleanup work propertly...
Depending on which mode we are in, we need to run cleanup on the right thread and in the right way. Image canvas doesn't contain any GL resources and can be nuked right away. The actual QSGTexture is managed by the node, so we don't need to worry about it. For FBO it is a bit more complicated. - Threaded: We create a cleanup handler that runs makeCurrent deleteTexture and doneCurrent and then release the surface on the GUI thread. - Immediate: Same as threaded, just right away - Cooperative: Schedule the texture to be deleted on the next sync. The Context doesn't have its own GL context in this case, so don't worry about it. Change-Id: I2d0ae7acfa05561faa52f3cacd767eb18cabaf02 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Diffstat (limited to 'src/quick/items/context2d/qquickcontext2dtexture_p.h')
-rw-r--r--src/quick/items/context2d/qquickcontext2dtexture_p.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/quick/items/context2d/qquickcontext2dtexture_p.h b/src/quick/items/context2d/qquickcontext2dtexture_p.h
index cf0e8e3fa9..186863c1aa 100644
--- a/src/quick/items/context2d/qquickcontext2dtexture_p.h
+++ b/src/quick/items/context2d/qquickcontext2dtexture_p.h
@@ -107,6 +107,7 @@ public:
bool setDirtyRect(const QRect &dirtyRect);
bool canvasDestroyed();
void setOnCustomThread(bool is) { m_onCustomThread = is; }
+ bool isOnCustomThread() const { return m_onCustomThread; }
// Called during sync() on the scene graph thread while GUI is blocked.
virtual QSGTexture *textureForNextFrame(QSGTexture *lastFrame) = 0;