Fix for QTBUG-23862 - Blank screen in Viewport
authorChristopher Ham <christopher.ham@nokia.com>
Wed, 25 Jan 2012 00:50:13 +0000 (10:50 +1000)
committerQt by Nokia <qt-info@nokia.com>
Fri, 10 Feb 2012 06:24:29 +0000 (07:24 +0100)
This patch fixes an issue that causes Qt3D's Viewport to be blank
when its renderMode property is set to BufferedRender.
(QSGPainterNode's RenderTarget is set to FramebufferObject)
Task-number: QTBUG-23862
Change-Id: Ic7a333f79ecf1aa153ef42e213644a17243a3580
Reviewed-by: Sarah Jane Smith <sarah.j.smith@nokia.com>
Reviewed-by: Yoann Lopes <yoann.lopes@nokia.com>
src/quick/scenegraph/util/qsgpainternode.cpp

index d1a1acc..d4a810c 100644 (file)
@@ -154,13 +154,12 @@ void QSGPainterNode::paint()
 {
     QRect dirtyRect = m_dirtyRect.isNull() ? QRect(0, 0, m_size.width(), m_size.height()) : m_dirtyRect;
 
-    if (m_image.isNull())
-        return;
-
     QPainter painter;
-    if (m_actualRenderTarget == QQuickPaintedItem::Image)
+    if (m_actualRenderTarget == QQuickPaintedItem::Image) {
+        if (m_image.isNull())
+            return;
         painter.begin(&m_image);
-    else {
+    else {
         if (!m_gl_device) {
             m_gl_device = new QOpenGLPaintDevice(m_fboSize);
             m_gl_device->setPaintFlipped(true);