Ejemplo n.º 1
0
 bool onAnimate(const SkAnimTimer& timer) override {
     if (timer.isStopped()) {
         fRY = 0;
     } else {
         fRY = timer.scaled(90, 360);
     }
     return true;
 }
Ejemplo n.º 2
0
    bool onAnimate(const SkAnimTimer& timer) override {
        SkScalar currSecs = timer.scaled(100);
        SkScalar delta = currSecs - fPrevSecs;
        fPrevSecs = currSecs;

        fStroke += fDStroke * delta;
        if (fStroke > fMaxStroke || fStroke < fMinStroke) {
            fDStroke = -fDStroke;
        }
        return true;
    }
Ejemplo n.º 3
0
    bool onAnimate(const SkAnimTimer& timer) override {
        constexpr SkScalar kDesiredDurationSecs = 3.0f;

        // Make the animation ping-pong back and forth but start in the fully drawn state
        SkScalar fraction = 1.0f - timer.scaled(2.0f/kDesiredDurationSecs, 2.0f);
        if (fraction <= 0.0f) {
            fraction = -fraction;
        }

        SkASSERT(fraction >= 0.0f && fraction <= 1.0f);

        fNumSteps = (int) (fraction * kMaxNumSteps);
        return true;
    }
Ejemplo n.º 4
0
 bool onAnimate(const SkAnimTimer& timer) override {
     fRotate = timer.scaled(1, 360);
     return true;
 }
Ejemplo n.º 5
0
 bool onAnimate(const SkAnimTimer& timer) override {
     fPhase = timer.scaled(40);
     return true;
 }
Ejemplo n.º 6
0
 bool onAnimate(const SkAnimTimer& timer) override {
     fAngle = timer.scaled(60, 360);
     return true;
 }