aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/util/qquickanimatorcontroller_p.h
diff options
context:
space:
mode:
authorGunnar Sletta <gunnar@sletta.org>2016-10-18 13:55:58 +0200
committerJ-P Nurmi <jpnurmi@qt.io>2016-10-20 20:05:22 +0000
commite48f83b57aeee90fe63926a95f98e3e5d77654f8 (patch)
treec5bba747a88512c6feb7d9522e95d1df5dbcc7ef /src/quick/util/qquickanimatorcontroller_p.h
parent2369fab86c545af8fb7a86dbb05fd32f1388a510 (diff)
Revert "Revert "Redo animator internals""
This reverts commit ac765c4eca202e60f3e28d731f7ba3a77401fef5. Fix for problem in next commit. Change-Id: Ie6b0cb09e38e5063d943662be51952dc6da9a533 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Diffstat (limited to 'src/quick/util/qquickanimatorcontroller_p.h')
-rw-r--r--src/quick/util/qquickanimatorcontroller_p.h44
1 files changed, 14 insertions, 30 deletions
diff --git a/src/quick/util/qquickanimatorcontroller_p.h b/src/quick/util/qquickanimatorcontroller_p.h
index b63518abad..1ec44ccc9d 100644
--- a/src/quick/util/qquickanimatorcontroller_p.h
+++ b/src/quick/util/qquickanimatorcontroller_p.h
@@ -1,6 +1,7 @@
/****************************************************************************
**
** 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.
@@ -60,8 +61,6 @@
QT_BEGIN_NAMESPACE
-class QQuickAnimatorControllerGuiThreadEntity;
-
class QQuickAnimatorController : public QObject, public QAnimationJobChangeListener
{
Q_OBJECT
@@ -80,50 +79,35 @@ public:
void requestSync();
// These are called from the GUI thread (the proxy)
- void startJob(QQuickAnimatorProxyJob *proxy, QAbstractAnimationJob *job);
- void stopJob(QQuickAnimatorProxyJob *proxy, QAbstractAnimationJob *job);
- void deleteJob(QAbstractAnimationJob *job);
+ 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 lock() { m_mutex.lock(); }
void unlock() { m_mutex.unlock(); }
-
void proxyWasDestroyed(QQuickAnimatorProxyJob *proxy);
void stopProxyJobs();
void windowNodesDestroyed();
-public Q_SLOTS:
- void itemDestroyed(QObject *);
+ QQuickWindow *window() const { return m_window; }
+
+private:
+ void start_helper(QAbstractAnimationJob *job);
+ void cancel_helper(QAbstractAnimationJob *job);
public:
- // 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;
+ QSet<QQuickAnimatorJob * > m_runningAnimators;
+ QHash<QAbstractAnimationJob *, QSharedPointer<QAbstractAnimationJob> > m_animationRoots;
+ QSet<QSharedPointer<QAbstractAnimationJob> > m_rootsPendingStop;
+ QSet<QSharedPointer<QAbstractAnimationJob> > m_rootsPendingStart;
+
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