add toImage() function to QSGPainterNode

This commit is contained in:
Charles Yin 2011-05-16 10:14:34 +10:00
parent 6f2c2b5dbe
commit 166829bbde
2 changed files with 8 additions and 0 deletions

View File

@ -407,5 +407,12 @@ void QSGPainterNode::setContentsScale(qreal s)
markDirty(DirtyMaterial);
}
QImage QSGPainterNode::toImage() const
{
if (m_actualRenderTarget == QSGPaintedItem::Image)
return m_image;
else
return m_fbo->toImage();
}
QT_END_NAMESPACE

View File

@ -99,6 +99,7 @@ public:
void setContentsScale(qreal s);
qreal contentsScale() const { return m_contentsScale; }
QImage toImage() const;
void update();
void paint();