aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquickcanvas.cpp
diff options
context:
space:
mode:
authorGunnar Sletta <gunnar.sletta@nokia.com>2012-05-16 20:16:07 +0200
committerQt by Nokia <qt-info@nokia.com>2012-05-22 20:04:28 +0200
commit6a942251044d1e74d6ae94914ee0383d7ef763e5 (patch)
tree6bb77e2e890bd081a818cf9208b8d511159037fe /src/quick/items/qquickcanvas.cpp
parent250bc562d389fa00306719e420282aa3dbb36d9b (diff)
Add QQuickCanvas::update()
We would like to make a distinction between QQuickItem::update() which triggers updatePaintNode() to synchronize the scene graph and requesting the toplevel QQuickCanvas to be repainted. If we have this distinction in place it is possible for the scene graph to detect that the scene is unchanged and avoid rendering unless the user has explicitely asked for the canvas to be repainted, which is often the case when hooking into QQuickCanvas::beforeRender(). Change-Id: Ibe77f58423593deb217ef9f8082fa12009f45daf Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Diffstat (limited to 'src/quick/items/qquickcanvas.cpp')
-rw-r--r--src/quick/items/qquickcanvas.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/quick/items/qquickcanvas.cpp b/src/quick/items/qquickcanvas.cpp
index 4fd3bf0e87..c3aecce372 100644
--- a/src/quick/items/qquickcanvas.cpp
+++ b/src/quick/items/qquickcanvas.cpp
@@ -255,6 +255,19 @@ void QQuickCanvasPrivate::setRenderWithoutShowing(bool render)
}
+/*!
+ * 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)