aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquickanimation_p_p.h
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@nokia.com>2012-02-03 12:26:37 +1000
committerQt by Nokia <qt-info@nokia.com>2012-02-07 05:32:47 +0100
commitce3dee765c858a0b573d468ef8fee6b838e576d1 (patch)
treeb7026a061b0b58bac6af30eaab6e610c5ebeb504 /src/quick/items/qquickanimation_p_p.h
parent0ca9d3f0f720e1933379ef40bc5c29253e21cba0 (diff)
Add and use new animation backend.
The new backend improves performance, and allows us to create multiple running animation jobs from a single Transition. It is based off of the existing Qt animation framework. Change-Id: Id1d0162f6e5c65bf31267f3f9f2042c354375d57 Reviewed-by: Yunqiao Yin <charles.yin@nokia.com>
Diffstat (limited to 'src/quick/items/qquickanimation_p_p.h')
-rw-r--r--src/quick/items/qquickanimation_p_p.h39
1 files changed, 24 insertions, 15 deletions
diff --git a/src/quick/items/qquickanimation_p_p.h b/src/quick/items/qquickanimation_p_p.h
index 576abbac99..2e6157c140 100644
--- a/src/quick/items/qquickanimation_p_p.h
+++ b/src/quick/items/qquickanimation_p_p.h
@@ -65,18 +65,13 @@ class QQuickParentAnimationPrivate : public QDeclarativeAnimationGroupPrivate
{
Q_DECLARE_PUBLIC(QQuickParentAnimation)
public:
- QQuickParentAnimationPrivate()
- : QDeclarativeAnimationGroupPrivate(), target(0), newParent(0),
- via(0), topLevelGroup(0), startAction(0), endAction(0) {}
+ QQuickParentAnimationPrivate()
+ : QDeclarativeAnimationGroupPrivate(), target(0), newParent(0), via(0) {}
QQuickItem *target;
QQuickItem *newParent;
QQuickItem *via;
- QSequentialAnimationGroup *topLevelGroup;
- QActionAnimation *startAction;
- QActionAnimation *endAction;
-
QPointF computeTransformOrigin(QQuickItem::TransformOrigin origin, qreal width, qreal height) const;
};
@@ -84,12 +79,11 @@ class QQuickAnchorAnimationPrivate : public QDeclarativeAbstractAnimationPrivate
{
Q_DECLARE_PUBLIC(QQuickAnchorAnimation)
public:
- QQuickAnchorAnimationPrivate() : rangeIsSet(false), va(0),
- interpolator(QVariantAnimationPrivate::getInterpolator(QMetaType::QReal)) {}
+ QQuickAnchorAnimationPrivate() : interpolator(QVariantAnimationPrivate::getInterpolator(QMetaType::QReal)), duration(250) {}
- bool rangeIsSet;
- QDeclarativeBulkValueAnimator *va;
QVariantAnimation::Interpolator interpolator;
+ int duration;
+ QEasingCurve easing;
QList<QQuickItem*> targets;
};
@@ -102,7 +96,7 @@ public:
entryInterval(0), exitInterval(0) {}
~QQuickPathAnimationUpdater() {}
- void setValue(qreal v);
+ void setValue(qreal v);
QDeclarativePath *path;
@@ -129,22 +123,37 @@ public:
QDeclarativeNullableValue<qreal> startRotation;
};
+class QQuickPathAnimationPrivate;
+class QQuickPathAnimationAnimator : public QDeclarativeBulkValueAnimator
+{
+public:
+ QQuickPathAnimationAnimator(QQuickPathAnimationPrivate * = 0);
+ ~QQuickPathAnimationAnimator();
+
+ void clearTemplate() { animationTemplate = 0; }
+
+ QQuickPathAnimationUpdater *pathUpdater() { return static_cast<QQuickPathAnimationUpdater*>(getAnimValue()); }
+private:
+ QQuickPathAnimationPrivate *animationTemplate;
+};
+
class QQuickPathAnimationPrivate : public QDeclarativeAbstractAnimationPrivate
{
Q_DECLARE_PUBLIC(QQuickPathAnimation)
public:
QQuickPathAnimationPrivate() : path(0), target(0),
- rangeIsSet(false), orientation(QQuickPathAnimation::Fixed), entryDuration(0), exitDuration(0), pa(0) {}
+ orientation(QQuickPathAnimation::Fixed), entryDuration(0), exitDuration(0), duration(250) {}
QDeclarativePath *path;
QQuickItem *target;
- bool rangeIsSet;
QQuickPathAnimation::Orientation orientation;
QPointF anchorPoint;
qreal entryDuration;
qreal exitDuration;
QDeclarativeNullableValue<qreal> endRotation;
- QDeclarativeBulkValueAnimator *pa;
+ int duration;
+ QEasingCurve easingCurve;
+ QHash<QQuickItem*, QQuickPathAnimationAnimator* > activeAnimations;
};