From 7ca521460272f95f76c75bb2155e28093cd6292d Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Mon, 17 Mar 2014 13:45:59 +0100 Subject: Try to simplify the threaded render loop. This beast has grown and grown for some time so it was time to take step back and look at a few of the problems again. 1. show/hide vs exposed/obscured. There is really no reason why we should even bother with show. It only adds the window to a list, we can do that in handleExposure and simplify things a bit. 2. Expose, polish, repaint, sync stuff was growing increasingly complex with multiple waits and several events and states interacting. So I merged the expose into the sync and passed that information along to the render thread. The render thread now knows if the sync is for a normal state-sync or an expose. For a normal sync it will wake GUI right away. For an expose, it waits until after the renderpass has completed and the frame is swapped. Change-Id: I0b9e5135215662a43fb4ff2a51438e33c845c4a7 Reviewed-by: Michael Brasser --- src/quick/scenegraph/qsgthreadedrenderloop_p.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/quick/scenegraph/qsgthreadedrenderloop_p.h') diff --git a/src/quick/scenegraph/qsgthreadedrenderloop_p.h b/src/quick/scenegraph/qsgthreadedrenderloop_p.h index e142f7f2c8..c347190e2b 100644 --- a/src/quick/scenegraph/qsgthreadedrenderloop_p.h +++ b/src/quick/scenegraph/qsgthreadedrenderloop_p.h @@ -58,8 +58,8 @@ class QSGThreadedRenderLoop : public QSGRenderLoop public: QSGThreadedRenderLoop(); - void show(QQuickWindow *window); - void hide(QQuickWindow *window); + void show(QQuickWindow *) {} + void hide(QQuickWindow *); void windowDestroyed(QQuickWindow *window); void exposureChanged(QQuickWindow *window); @@ -73,7 +73,7 @@ public: QAnimationDriver *animationDriver() const; - void releaseResources(QQuickWindow *window) { releaseResources(window, false); } + void releaseResources(QQuickWindow *window); bool event(QEvent *); @@ -93,7 +93,7 @@ private: friend class QSGRenderThread; - void releaseResources(QQuickWindow *window, bool inDestructor); + void releaseResources(Window *window, bool inDestructor); bool checkAndResetForceUpdate(QQuickWindow *window); bool anyoneShowing() const; @@ -102,10 +102,10 @@ private: void startOrStopAnimationTimer(); void maybePostPolishRequest(Window *w); void waitForReleaseComplete(); - bool polishAndSync(Window *w); + void polishAndSync(Window *w, bool inExpose = false); void maybeUpdate(Window *window); - void handleExposure(Window *w); + void handleExposure(QQuickWindow *w); void handleObscurity(Window *w); @@ -116,7 +116,7 @@ private: int m_animation_timer; int m_exhaust_delay; - bool m_locked; + bool m_lockedForSync; }; -- cgit v1.2.3