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>
{
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);