diff options
author | Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com> | 2016-10-17 11:01:24 +0000 |
---|---|---|
committer | Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com> | 2016-10-17 14:00:51 +0000 |
commit | ac765c4eca202e60f3e28d731f7ba3a77401fef5 (patch) | |
tree | ab1a0c87f6a345c1b556439b5a731fde6bfdff85 /src/quick/util/qquickanimatorcontroller_p.h | |
parent | 3ea8faca3a3533ab7bf1a23452e2527e880f2659 (diff) |
Revert "Redo animator internals"
The change broke qt/qtquickcontrols2.
This reverts commit ae80962806f44fc9f58de14d62229771b836cb93.
Change-Id: I2313413d7b145594d434bfabf7426b79aaa98f14
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Diffstat (limited to 'src/quick/util/qquickanimatorcontroller_p.h')
-rw-r--r-- | src/quick/util/qquickanimatorcontroller_p.h | 44 |
1 files changed, 30 insertions, 14 deletions
diff --git a/src/quick/util/qquickanimatorcontroller_p.h b/src/quick/util/qquickanimatorcontroller_p.h index 1ec44ccc9d..b63518abad 100644 --- a/src/quick/util/qquickanimatorcontroller_p.h +++ b/src/quick/util/qquickanimatorcontroller_p.h @@ -1,7 +1,6 @@ /**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. -** Copyright (C) 2016 Gunnar Sletta <gunnar@sletta.org> ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtQuick module of the Qt Toolkit. @@ -61,6 +60,8 @@ QT_BEGIN_NAMESPACE +class QQuickAnimatorControllerGuiThreadEntity; + class QQuickAnimatorController : public QObject, public QAnimationJobChangeListener { Q_OBJECT @@ -79,35 +80,50 @@ public: void requestSync(); // These are called from the GUI thread (the proxy) - void start(const QSharedPointer<QAbstractAnimationJob> &job); - void cancel(const QSharedPointer<QAbstractAnimationJob> &job); - bool isPendingStart(const QSharedPointer<QAbstractAnimationJob> &job) const { return m_rootsPendingStart.contains(job); } + void startJob(QQuickAnimatorProxyJob *proxy, QAbstractAnimationJob *job); + void stopJob(QQuickAnimatorProxyJob *proxy, QAbstractAnimationJob *job); + void deleteJob(QAbstractAnimationJob *job); void lock() { m_mutex.lock(); } void unlock() { m_mutex.unlock(); } + void proxyWasDestroyed(QQuickAnimatorProxyJob *proxy); void stopProxyJobs(); void windowNodesDestroyed(); - QQuickWindow *window() const { return m_window; } - -private: - void start_helper(QAbstractAnimationJob *job); - void cancel_helper(QAbstractAnimationJob *job); +public Q_SLOTS: + void itemDestroyed(QObject *); public: - QSet<QQuickAnimatorJob * > m_runningAnimators; - QHash<QAbstractAnimationJob *, QSharedPointer<QAbstractAnimationJob> > m_animationRoots; - QSet<QSharedPointer<QAbstractAnimationJob> > m_rootsPendingStop; - QSet<QSharedPointer<QAbstractAnimationJob> > m_rootsPendingStart; - + // These are manipulated from the GUI thread and should only + // be updated during the sync() phase. + QHash<QAbstractAnimationJob *, QQuickAnimatorProxyJob *> m_starting; + QHash<QAbstractAnimationJob *, QQuickAnimatorProxyJob *> m_stopping; + QSet<QAbstractAnimationJob *> m_deleting; + + QHash<QAbstractAnimationJob *, QQuickAnimatorProxyJob *> m_animatorRoots; + QSet<QQuickAnimatorJob *> m_activeLeafAnimations; + QHash<QQuickItem *, QQuickTransformAnimatorJob::Helper *> m_transforms; + QSet<QQuickItem *> m_deletedSinceLastFrame; QQuickWindow *m_window; + QQuickAnimatorControllerGuiThreadEntity *m_guiEntity; + QSet<QQuickAnimatorProxyJob *> m_proxiesToStop; QMutex m_mutex; bool m_nodesAreInvalid; }; +class QQuickAnimatorControllerGuiThreadEntity : public QObject +{ + Q_OBJECT +public: + QPointer<QQuickAnimatorController> controller; + +public Q_SLOTS: + void frameSwapped(); +}; + QT_END_NAMESPACE |