}
+/*!
+ * Schedules the canvas to render another frame.
+ *
+ * Calling QQuickCanvas::update() differs from QQuickItem::update() in that
+ * it always triggers a repaint, regardless of changes in the underlying
+ * scene graph or not.
+ */
+void QQuickCanvas::update()
+{
+ Q_D(QQuickCanvas);
+ d->windowManager->update(this);
+}
+
void forceUpdate(QQuickItem *item)
{
if (item->flags() & QQuickItem::ItemHasContents)
The main thread is blocked while this function is executed so it is safe to read
values from the QQuickItem instance and other objects in the main thread.
+ If no call to QQuickItem::updatePaintNode() result in actual scene graph
+ changes, like QSGNode::markDirty() or adding and removing nodes, then
+ the underlying implementation may decide to not render the scene again as
+ the visual outcome is identical.
+
\warning It is crucial that OpenGL operations and interaction with
the scene graph happens exclusively on the rendering thread,
primarily during the QQuickItem::updatePaintNode() call. The best
the QQuickItem::updatePaintNode() function.
\sa QSGMaterial, QSGSimpleMaterial, QSGGeometryNode, QSGGeometry,
- QSGFlatColorMaterial, QSGTextureMaterial
+ QSGFlatColorMaterial, QSGTextureMaterial, QSGNode::markDirty()
*/
QSGNode *QQuickItem::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *)
emit baselineOffsetChanged(offset);
}
+
+/*!
+ * Schedules a call to updatePaintNode() for this item.
+ *
+ * The call to QQuickItem::updatePaintNode() will always happen if the
+ * item is showing in a QQuickCanvas.
+ *
+ * Only items which specifies QQuickItem::ItemHasContents are allowed
+ * to call QQuickItem::update().
+ */
void QQuickItem::update()
{
Q_D(QQuickItem);
void resize(QQuickCanvas *canvas, const QSize &size);
void handleDeferredUpdate();
void maybeUpdate(QQuickCanvas *canvas);
+ void update(QQuickCanvas *canvas) { maybeUpdate(canvas); } // identical for this implementation
void wakeup();
void startRendering();
void wakeup();
void maybeUpdate(QQuickCanvas *canvas);
+ void update(QQuickCanvas *canvas) { maybeUpdate(canvas); } // identical for this implementation.
void releaseResources() { }
virtual QImage grab(QQuickCanvas *canvas) = 0;
virtual void resize(QQuickCanvas *canvas, const QSize &size) = 0;
+ virtual void update(QQuickCanvas *canvas) = 0;
virtual void maybeUpdate(QQuickCanvas *canvas) = 0;
virtual void wakeup() = 0;