aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/util
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@theqtcompany.com>2016-04-07 10:56:42 +0200
committerLiang Qi <liang.qi@theqtcompany.com>2016-04-08 13:03:25 +0200
commit68ba8fe3ccf7abe8d24ba3614f8d7ceb3778de74 (patch)
tree8fdc2922aa5375203fef05746691e88632a92bbe /src/quick/util
parent0d8de448ef746aea7215f6f654660500dc9601d2 (diff)
parenta676e4e2dae945c02521691c7018f5a5534feff9 (diff)
Merge remote-tracking branch 'origin/5.6' into 5.7
This change also fixes the build of two benchmarks, tst_affectors and tst_emission. Conflicts: src/plugins/qmltooling/qmldbg_native/qmldbg_native.pro src/qml/qml/ftw/qhashfield_p.h tests/benchmarks/particles/affectors/tst_affectors.cpp tests/benchmarks/particles/emission/tst_emission.cpp tests/benchmarks/qml/pointers/pointers.pro tests/benchmarks/qml/pointers/tst_pointers.cpp tests/benchmarks/qml/qmltime/qmltime.pro tests/benchmarks/qml/qquickwindow/qquickwindow.pro Change-Id: I595309d1e183c18371cb9b07af6e4681059de3b2
Diffstat (limited to 'src/quick/util')
-rw-r--r--src/quick/util/qquickanimation.cpp4
-rw-r--r--src/quick/util/qquickanimatorjob.cpp17
-rw-r--r--src/quick/util/qquickanimatorjob_p.h2
-rw-r--r--src/quick/util/qquickpixmapcache.cpp1
4 files changed, 15 insertions, 9 deletions
diff --git a/src/quick/util/qquickanimation.cpp b/src/quick/util/qquickanimation.cpp
index 51212661c9..adf8f600a0 100644
--- a/src/quick/util/qquickanimation.cpp
+++ b/src/quick/util/qquickanimation.cpp
@@ -1441,7 +1441,7 @@ QQuickVector3dAnimation::~QQuickVector3dAnimation()
}
/*!
- \qmlproperty real QtQuick::Vector3dAnimation::from
+ \qmlproperty vector3d QtQuick::Vector3dAnimation::from
This property holds the starting value for the animation.
If the Vector3dAnimation is defined within a \l Transition or \l Behavior,
@@ -1463,7 +1463,7 @@ void QQuickVector3dAnimation::setFrom(QVector3D f)
}
/*!
- \qmlproperty real QtQuick::Vector3dAnimation::to
+ \qmlproperty vector3d QtQuick::Vector3dAnimation::to
This property holds the end value for the animation.
If the Vector3dAnimation is defined within a \l Transition or \l Behavior,
diff --git a/src/quick/util/qquickanimatorjob.cpp b/src/quick/util/qquickanimatorjob.cpp
index d7be237a39..8d5ecadab5 100644
--- a/src/quick/util/qquickanimatorjob.cpp
+++ b/src/quick/util/qquickanimatorjob.cpp
@@ -238,6 +238,10 @@ void QQuickAnimatorJob::debugAnimation(QDebug d) const
<< "target:" << m_target << "value:" << m_value;
}
+qreal QQuickAnimatorJob::progress(int time) const
+{
+ return m_easing.valueForProgress((m_duration == 0) ? qreal(1) : qreal(time) / qreal(m_duration));
+}
qreal QQuickAnimatorJob::value() const
{
qreal v;
@@ -388,7 +392,7 @@ void QQuickXAnimatorJob::updateCurrentTime(int time)
return;
Q_ASSERT(!m_controller->m_window->openglContext() || m_controller->m_window->openglContext()->thread() == QThread::currentThread());
- m_value = m_from + (m_to - m_from) * m_easing.valueForProgress(time / (qreal) m_duration);
+ m_value = m_from + (m_to - m_from) * progress(time);
m_helper->dx = m_value;
m_helper->wasChanged = true;
}
@@ -405,7 +409,7 @@ void QQuickYAnimatorJob::updateCurrentTime(int time)
return;
Q_ASSERT(!m_controller->m_window->openglContext() || m_controller->m_window->openglContext()->thread() == QThread::currentThread());
- m_value = m_from + (m_to - m_from) * m_easing.valueForProgress(time / (qreal) m_duration);
+ m_value = m_from + (m_to - m_from) * progress(time);
m_helper->dy = m_value;
m_helper->wasChanged = true;
}
@@ -475,7 +479,7 @@ void QQuickOpacityAnimatorJob::updateCurrentTime(int time)
return;
Q_ASSERT(!m_controller->m_window->openglContext() || m_controller->m_window->openglContext()->thread() == QThread::currentThread());
- m_value = m_from + (m_to - m_from) * m_easing.valueForProgress(time / (qreal) m_duration);
+ m_value = m_from + (m_to - m_from) * progress(time);
m_opacityNode->setOpacity(m_value);
}
@@ -491,7 +495,7 @@ void QQuickScaleAnimatorJob::updateCurrentTime(int time)
return;
Q_ASSERT(!m_controller->m_window->openglContext() || m_controller->m_window->openglContext()->thread() == QThread::currentThread());
- m_value = m_from + (m_to - m_from) * m_easing.valueForProgress(time / (qreal) m_duration);
+ m_value = m_from + (m_to - m_from) * progress(time);
m_helper->scale = m_value;
m_helper->wasChanged = true;
}
@@ -511,7 +515,8 @@ void QQuickRotationAnimatorJob::updateCurrentTime(int time)
return;
Q_ASSERT(!m_controller->m_window->openglContext() || m_controller->m_window->openglContext()->thread() == QThread::currentThread());
- float t = m_easing.valueForProgress(time / (qreal) m_duration);
+ float t = progress(time);
+
switch (m_direction) {
case QQuickRotationAnimator::Clockwise:
m_value = _q_interpolateClockwiseRotation(m_from, m_to, t).toFloat();
@@ -594,7 +599,7 @@ void QQuickUniformAnimatorJob::updateCurrentTime(int time)
if (!m_node || m_uniformIndex == -1 || m_uniformType == -1)
return;
- m_value = m_from + (m_to - m_from) * m_easing.valueForProgress(time / (qreal) m_duration);
+ m_value = m_from + (m_to - m_from) * progress(time);
QQuickShaderEffectMaterial *material =
static_cast<QQuickShaderEffectMaterial *>(m_node->material());
diff --git a/src/quick/util/qquickanimatorjob_p.h b/src/quick/util/qquickanimatorjob_p.h
index 71c1e93746..2b910d3737 100644
--- a/src/quick/util/qquickanimatorjob_p.h
+++ b/src/quick/util/qquickanimatorjob_p.h
@@ -158,6 +158,8 @@ protected:
QQuickAnimatorJob();
void debugAnimation(QDebug d) const Q_DECL_OVERRIDE;
+ qreal progress(int time) const;
+
QPointer<QQuickItem> m_target;
QQuickAnimatorController *m_controller;
diff --git a/src/quick/util/qquickpixmapcache.cpp b/src/quick/util/qquickpixmapcache.cpp
index 7d9997b9c8..6dee84b005 100644
--- a/src/quick/util/qquickpixmapcache.cpp
+++ b/src/quick/util/qquickpixmapcache.cpp
@@ -515,7 +515,6 @@ void QQuickPixmapReader::asyncResponseFinished(QQuickImageResponse *response)
QQuickTextureFactory *t = 0;
QQuickPixmapReply::ReadError error = QQuickPixmapReply::NoError;
QString errorString;
- QSize readSize;
if (!response->errorString().isEmpty()) {
error = QQuickPixmapReply::Loading;
errorString = response->errorString();