diff options
author | Gunnar Sletta <gunnar.sletta@digia.com> | 2013-10-17 14:53:33 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-10-30 08:29:49 +0100 |
commit | 906d5c5c40183468f9521277c6244a6c46730de6 (patch) | |
tree | 0eb46a8f88d59993ab659e2dc07970d1ce2f0d73 /src/quick/scenegraph/qsgthreadedrenderloop_p.h | |
parent | c084d32d92b2df55532fa1599e590c29bf2b5bfb (diff) |
Use one render loop per QQuickWindow
See the task for the full reasoning behind this patch.
The threaded renderloop has been refactored to have one window per
thread. This is mostly a simplification of the current code path where
for loops over multiple windows are turned into if (window).
The QSGContext has been split into two classes, QSGRenderContext
for which there is one per OpenGLContext.
The rest of the patch is name changes and a couple of cleanups
in the hopes of simplifying this change.
Task-number: QTBUG-33993
Change-Id: I31c81f9694d7da7474a72333169be38de62613c4
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src/quick/scenegraph/qsgthreadedrenderloop_p.h')
-rw-r--r-- | src/quick/scenegraph/qsgthreadedrenderloop_p.h | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/src/quick/scenegraph/qsgthreadedrenderloop_p.h b/src/quick/scenegraph/qsgthreadedrenderloop_p.h index b943739a0d..5943d0bd08 100644 --- a/src/quick/scenegraph/qsgthreadedrenderloop_p.h +++ b/src/quick/scenegraph/qsgthreadedrenderloop_p.h @@ -64,14 +64,12 @@ public: void windowDestroyed(QQuickWindow *window); void exposureChanged(QQuickWindow *window); - void handleExposure(QQuickWindow *window); - void handleObscurity(QQuickWindow *window); - QImage grab(QQuickWindow *); void update(QQuickWindow *window); void maybeUpdate(QQuickWindow *window); QSGContext *sceneGraphContext() const; + QSGRenderContext *createRenderContext(QSGContext *) const; QAnimationDriver *animationDriver() const; @@ -86,6 +84,13 @@ public Q_SLOTS: void animationStopped(); private: + struct Window { + QQuickWindow *window; + QSGRenderThread *thread; + int timerId; + uint updateDuringSync : 1; + }; + friend class QSGRenderThread; void releaseResources(QQuickWindow *window, bool inDestructor); @@ -94,25 +99,24 @@ private: bool anyoneShowing() const; void initialize(); - void maybePostPolishRequest(); - + void startOrStopAnimationTimer(); + void maybePostPolishRequest(Window *w); void waitForReleaseComplete(); + void polishAndSync(Window *w); + void maybeUpdate(Window *window); - void polishAndSync(); + void handleExposure(Window *w); + void handleObscurity(Window *w); - struct Window { - QQuickWindow *window; - }; - QSGRenderThread *m_thread; + QSGContext *sg; QAnimationDriver *m_animation_driver; QList<Window> m_windows; int m_animation_timer; - int m_update_timer; int m_exhaust_delay; - bool m_sync_triggered_update; + bool m_locked; }; |