diff options
author | Gunnar Sletta <gunnar.sletta@nokia.com> | 2012-01-26 11:17:37 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-02-02 17:27:12 +0100 |
commit | 20d641a4eb1a3ffe1cff41491b64b6b857982847 (patch) | |
tree | 31d1fbcdb81db90bd47de839ba3b070a499e7c59 /src/quick/items/qquickcanvas.cpp | |
parent | fd39d7eeec32fb29541decc11115608f9b759c86 (diff) |
Started implementation of offscreen canvas FBO rendering API
Change-Id: I15b1799982d20d16c9c5e08eee7095cf087b49e1
Reviewed-by: Kim M. Kalland <kim.kalland@nokia.com>
Diffstat (limited to 'src/quick/items/qquickcanvas.cpp')
-rw-r--r-- | src/quick/items/qquickcanvas.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/quick/items/qquickcanvas.cpp b/src/quick/items/qquickcanvas.cpp index ac7928f286..72300f9ce5 100644 --- a/src/quick/items/qquickcanvas.cpp +++ b/src/quick/items/qquickcanvas.cpp @@ -204,6 +204,30 @@ void QQuickCanvasPrivate::polishItems() updateFocusItemTransform(); } +/** + * This parameter enables that this canvas can be rendered without + * being shown on screen. This feature is very limited in what it supports. + * + * There needs to be another window actually showing that we can make current + * to get a surface to make current AND for this feature to be useful + * one needs to hook into beforeRender() and set the render tareget. + * + */ +void QQuickCanvasPrivate::setRenderWithoutShowing(bool render) +{ + if (render == renderWithoutShowing) + return; + + Q_Q(QQuickCanvas); + renderWithoutShowing = render; + + if (render) + windowManager->show(q); + else + windowManager->hide(q); +} + + void forceUpdate(QQuickItem *item) { if (item->flags() & QQuickItem::ItemHasContents) @@ -253,6 +277,7 @@ QQuickCanvasPrivate::QQuickCanvasPrivate() : rootItem(0) , activeFocusItem(0) , mouseGrabberItem(0) + , renderWithoutShowing(false) , dirtyItemList(0) , context(0) , renderer(0) |