~ubuntu-branches/ubuntu/wily/qtdeclarative-opensource-src/wily-proposed

« back to all changes in this revision

Viewing changes to src/quick/util/qquicktimeline.cpp

  • Committer: Package Import Robot
  • Author(s): Ricardo Salveti de Araujo, Ricardo Salveti de Araujo, Timo Jyrinki
  • Date: 2014-06-19 02:39:21 UTC
  • mfrom: (0.1.18 experimental)
  • Revision ID: package-import@ubuntu.com-20140619023921-yb2oasnuetz9b0fc
Tags: 5.3.0-3ubuntu4
[ Ricardo Salveti de Araujo ]
* debian/control:
  - Updating dependencies as we now also have libqt5quickwidgets5-gles
* libqt5quickwidgets5.symbols: updating to allow gles variant

[ Timo Jyrinki ]
* Update libqt5quickparticles5.symbols from build logs

Show diffs side-by-side

added added

removed removed

Lines of Context:
81
81
            Execute
82
82
        };
83
83
        Op() {}
84
 
        Op(Type t, int l, qreal v, qreal v2, int o, 
 
84
        Op(Type t, int l, qreal v, qreal v2, int o,
85
85
           const QQuickTimeLineCallback &ev = QQuickTimeLineCallback(), const QEasingCurve &es = QEasingCurve())
86
86
            : type(t), length(l), value(v), value2(v2), order(o), event(ev),
87
87
              easing(es) {}
89
89
            : type(o.type), length(o.length), value(o.value), value2(o.value2),
90
90
              order(o.order), event(o.event), easing(o.easing) {}
91
91
        Op &operator=(const Op &o) {
92
 
            type = o.type; length = o.length; value = o.value; 
93
 
            value2 = o.value2; order = o.order; event = o.event; 
 
92
            type = o.type; length = o.length; value = o.value;
 
93
            value2 = o.value2; order = o.order; event = o.event;
94
94
            easing = o.easing;
95
95
            return *this;
96
96
        }
396
396
        acceleration = acceleration * -1.0f;
397
397
 
398
398
    int time = static_cast<int>(-1000 * velocity / acceleration);
 
399
    if (time <= 0) return -1;
399
400
 
400
401
    QQuickTimeLinePrivate::Op op(QQuickTimeLinePrivate::Op::Accel, time, velocity, acceleration, d->order++);
401
402
    d->add(timeLineValue, op);
428
429
        acceleration = acceleration * -1.0f;
429
430
 
430
431
    int time = static_cast<int>(-1000 * velocity / acceleration);
 
432
    if (time <= 0) return -1;
431
433
 
432
434
    QQuickTimeLinePrivate::Op op(QQuickTimeLinePrivate::Op::Accel, time, velocity, acceleration, d->order++);
433
435
    d->add(timeLineValue, op);
450
452
    Q_ASSERT((distance >= 0.0f) == (velocity >= 0.0f));
451
453
 
452
454
    int time = static_cast<int>(1000 * (2.0f * distance) / velocity);
 
455
    if (time <= 0) return -1;
453
456
 
454
457
    QQuickTimeLinePrivate::Op op(QQuickTimeLinePrivate::Op::AccelDistance, time, velocity, distance, d->order++);
455
458
    d->add(timeLineValue, op);
604
607
    d->syncPoint = d->length;
605
608
}*/
606
609
 
607
 
/*! 
608
 
    \internal 
 
610
/*!
 
611
    \internal
609
612
 
610
613
    Temporary hack.
611
614
 */
614
617
    d->syncPoint = sp;
615
618
}
616
619
 
617
 
/*! 
618
 
    \internal 
619
 
 
 
620
/*!
 
621
    \internal
 
622
 
620
623
    Temporary hack.
621
624
 */
622
625
int QQuickTimeLine::syncPoint() const
720
723
    }
721
724
}
722
725
 
 
726
void QQuickTimeLine::debugAnimation(QDebug d) const
 
727
{
 
728
    d << "QuickTimeLine(" << hex << (void *) this << dec << ")";
 
729
}
 
730
 
723
731
bool operator<(const QPair<int, Update> &lhs,
724
732
               const QPair<int, Update> &rhs)
725
733
{
739
747
            TimeLine &tl = *iter;
740
748
            Op &op = tl.ops.first();
741
749
            int length = op.length - tl.consumedOpLength;
742
 
                
 
750
 
743
751
            if (length < advanceTime) {
744
752
                advanceTime = length;
745
753
                if (advanceTime == 0)
748
756
        }
749
757
        t -= advanceTime;
750
758
 
751
 
        // Process until then.  A zero length advance time will only process 
 
759
        // Process until then.  A zero length advance time will only process
752
760
        // sets.
753
761
        QList<QPair<int, Update> > updates;
754
762
 
762
770
                if (advanceTime == 0 && op.length != 0)
763
771
                    continue;
764
772
 
765
 
                if (tl.consumedOpLength == 0 && 
766
 
                   op.type != Op::Pause && 
 
773
                if (tl.consumedOpLength == 0 &&
 
774
                   op.type != Op::Pause &&
767
775
                   op.type != Op::Execute)
768
776
                    tl.base = v->value();
769
777