diff options
author | Gunnar Sletta <gunnar.sletta@nokia.com> | 2011-07-01 08:19:52 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-07-01 08:21:15 +0200 |
commit | 890648a91b266a889ac5c4d20acad2fe8ecb11e3 (patch) | |
tree | e2bd20c0c87dce5dd870b13465b166fbb968868c /src/declarative/scenegraph | |
parent | 3296449d5cd9491b56914a23a78d2f78982a6856 (diff) |
Support setting an FBO as the render target for a canvas
Change-Id: I8049580f1d2b27d6ebc4d595712939338c01b711
Reviewed-on: http://codereview.qt.nokia.com/986
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
Diffstat (limited to 'src/declarative/scenegraph')
-rw-r--r-- | src/declarative/scenegraph/qsgcontext.cpp | 10 | ||||
-rw-r--r-- | src/declarative/scenegraph/qsgcontext_p.h | 3 |
2 files changed, 10 insertions, 3 deletions
diff --git a/src/declarative/scenegraph/qsgcontext.cpp b/src/declarative/scenegraph/qsgcontext.cpp index 682b514b9c..f5a082ba06 100644 --- a/src/declarative/scenegraph/qsgcontext.cpp +++ b/src/declarative/scenegraph/qsgcontext.cpp @@ -246,14 +246,20 @@ bool QSGContext::isReady() const } -void QSGContext::renderNextFrame() +void QSGContext::renderNextFrame(QGLFramebufferObject *fbo) { Q_D(QSGContext); emit d->engine.beforeRendering(); cleanupTextures(); - d->renderer->renderScene(); + + if (fbo) { + BindableFbo bindable(fbo); + d->renderer->renderScene(bindable); + } else { + d->renderer->renderScene(); + } emit d->engine.afterRendering(); diff --git a/src/declarative/scenegraph/qsgcontext_p.h b/src/declarative/scenegraph/qsgcontext_p.h index 1344ac705d..5ce2e9e80b 100644 --- a/src/declarative/scenegraph/qsgcontext_p.h +++ b/src/declarative/scenegraph/qsgcontext_p.h @@ -65,6 +65,7 @@ class QSGMaterialShader; class QSGEngine; class QGLContext; +class QGLFramebufferObject; class Q_DECLARATIVE_EXPORT QSGContext : public QObject { @@ -89,7 +90,7 @@ public: QSGMaterialShader *prepareMaterial(QSGMaterial *material); - virtual void renderNextFrame(); + virtual void renderNextFrame(QGLFramebufferObject *fbo = 0); virtual QSGRectangleNode *createRectangleNode(); virtual QSGImageNode *createImageNode(); |