diff options
author | Yoann Lopes <yoann.lopes@nokia.com> | 2011-05-13 15:57:51 +0200 |
---|---|---|
committer | Yoann Lopes <yoann.lopes@nokia.com> | 2011-05-13 16:00:29 +0200 |
commit | 367a4fb872c1836f08b2b272b58396114040165d (patch) | |
tree | eab2a4780aecd2f1a98ea9f10e1d83501101053f /src/declarative/scenegraph/util/qsgpainternode.cpp | |
parent | 30327650798ba63281c7b9344c9d824d00dce82a (diff) |
Call QSGPaintedItem::paint() when the scene graph is synced.
At that moment the GUI thread is blocked and it is therefore safe to
call paint() from the scenegraph thread.
Diffstat (limited to 'src/declarative/scenegraph/util/qsgpainternode.cpp')
-rw-r--r-- | src/declarative/scenegraph/util/qsgpainternode.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/declarative/scenegraph/util/qsgpainternode.cpp b/src/declarative/scenegraph/util/qsgpainternode.cpp index d3dae11202..bcf63ab51f 100644 --- a/src/declarative/scenegraph/util/qsgpainternode.cpp +++ b/src/declarative/scenegraph/util/qsgpainternode.cpp @@ -127,7 +127,6 @@ QSGPainterNode::QSGPainterNode(QSGPaintedItem *item) setMaterial(&m_materialO); setOpaqueMaterial(&m_material); setGeometry(&m_geometry); - setFlag(UsePreprocess); } QSGPainterNode::~QSGPainterNode() @@ -137,11 +136,8 @@ QSGPainterNode::~QSGPainterNode() delete m_multisampledFbo; } -void QSGPainterNode::preprocess() +void QSGPainterNode::paint() { - if (!m_dirtyContents) - return; - QRect dirtyRect = m_dirtyRect.isNull() ? QRect(0, 0, m_size.width(), m_size.height()) : m_dirtyRect; QPainter painter; @@ -181,7 +177,6 @@ void QSGPainterNode::preprocess() QGLFramebufferObject::blitFramebuffer(m_fbo, dirtyRect, m_multisampledFbo, dirtyRect); } - m_dirtyContents = false; m_dirtyRect = QRect(); } @@ -194,9 +189,13 @@ void QSGPainterNode::update() if (m_dirtyTexture) updateTexture(); + if (m_dirtyContents) + paint(); + m_dirtyGeometry = false; m_dirtyRenderTarget = false; m_dirtyTexture = false; + m_dirtyContents = false; } void QSGPainterNode::updateTexture() |