diff options
author | Gunnar Sletta <gunnar.sletta@nokia.com> | 2011-09-11 08:54:05 +0200 |
---|---|---|
committer | Yoann Lopes <yoann.lopes@nokia.com> | 2011-09-12 11:19:22 +0200 |
commit | 4f73ff97486f89b8e7aca1ed7d55cf42a644d68b (patch) | |
tree | 2ec0e757a93f406038a78a226ed0b11de96cb53e /src | |
parent | 1983d69339faefb781aad92df7d2a915785e2677 (diff) |
orient the fbo rendering the same way as other fbo rendering and enable multisampling
Change-Id: Ibfb3bd9577efc50ca7654019638d22b9077df6bb
Reviewed-on: http://codereview.qt-project.org/4627
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Yoann Lopes <yoann.lopes@nokia.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/declarative/scenegraph/util/qsgpainternode.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/declarative/scenegraph/util/qsgpainternode.cpp b/src/declarative/scenegraph/util/qsgpainternode.cpp index 90d66c094e..5d548792c6 100644 --- a/src/declarative/scenegraph/util/qsgpainternode.cpp +++ b/src/declarative/scenegraph/util/qsgpainternode.cpp @@ -43,6 +43,7 @@ #include "qsgpainteditem.h" #include <private/qsgcontext_p.h> +#include <private/qopenglextensions_p.h> #include <qopenglframebufferobject.h> #include <qopenglfunctions.h> #include <qopenglpaintdevice.h> @@ -148,8 +149,10 @@ void QSGPainterNode::paint() if (m_actualRenderTarget == QSGPaintedItem::Image) painter.begin(&m_image); else { - if (!m_gl_device) + if (!m_gl_device) { m_gl_device = new QOpenGLPaintDevice(m_fboSize); + m_gl_device->setPaintFlipped(true); + } if (m_multisampledFbo) m_multisampledFbo->bind(); @@ -230,7 +233,7 @@ void QSGPainterNode::updateGeometry() if (m_actualRenderTarget == QSGPaintedItem::Image) source = QRectF(0, 0, 1, 1); else - source = QRectF(0, 1, qreal(m_size.width()) / m_fboSize.width(), qreal(-m_size.height()) / m_fboSize.height()); + source = QRectF(0, 0, qreal(m_size.width()) / m_fboSize.width(), qreal(m_size.height()) / m_fboSize.height()); QSGGeometry::updateTexturedRectGeometry(&m_geometry, QRectF(0, 0, m_size.width(), m_size.height()), source); @@ -280,7 +283,7 @@ void QSGPainterNode::updateRenderTarget() { QOpenGLFramebufferObjectFormat format; format.setAttachment(QOpenGLFramebufferObject::CombinedDepthStencil); - format.setSamples(ctx->format().samples()); + format.setSamples(8); m_multisampledFbo = new QOpenGLFramebufferObject(m_fboSize, format); } { |