Clear dirty set before sending frame callback.
authorPaul Olav Tvete <paul.tvete@nokia.com>
Tue, 3 Jan 2012 08:58:43 +0000 (09:58 +0100)
committerJørgen Lind <jorgen.lind@nokia.com>
Thu, 5 Jan 2012 14:30:19 +0000 (15:30 +0100)
Previously, markSurfaceAsDirty() would have no effect when triggered
by the frame callback function.

Change-Id: Ife7c40757f1cba10e8cdbfab3d514a1dcdac76db
Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
src/compositor/wayland_wrapper/wlcompositor.cpp

index b998c91..56ac056 100644 (file)
@@ -172,12 +172,13 @@ Compositor::~Compositor()
 void Compositor::frameFinished(Surface *surface)
 {
     if (surface && m_dirty_surfaces.contains(surface)) {
+        m_dirty_surfaces.remove(surface);
         surface->sendFrameCallback();
-       m_dirty_surfaces.remove(surface);
     } else if (!surface) {
-       foreach (Surface *surface, m_dirty_surfaces)
+        QSet<Surface *> dirty = m_dirty_surfaces;
+        m_dirty_surfaces.clear();
+        foreach (Surface *surface, dirty)
             surface->sendFrameCallback();
-       m_dirty_surfaces.clear();
     }
 }