Ejemplo n.º 1
0
 bool onAnimate(const SkAnimTimer& timer) override {
     fAnimRadius = timer.pingPong(kRadiusPingPoingPeriod, kRadiusPingPoingShift, kMinRadius,
                                  kMaxRadius);
     fAnimBlurRadius = timer.pingPong(kBlurRadiusPingPoingPeriod, kBlurRadiusPingPoingShift,
                                      kMinBlurRadius, kMaxBlurRadius);
     return true;
 }
Ejemplo n.º 2
0
 bool onAnimate(const SkAnimTimer& timer) override {
     if (timer.isStopped()) {
         fRY = 0;
     } else {
         fRY = timer.scaled(90, 360);
     }
     return true;
 }
 bool onAnimate(const SkAnimTimer& timer) override {
     if (timer.isStopped()) {
         this->resetBounce();
     } else if (timer.isRunning()) {
         this->bounceMe();
     }
     return true;
 }
    bool onAnimate(const SkAnimTimer& timer) override {
        fCurrTime = timer.secs() - fResetTime;
        if (fCurrTime > kDuration) {
            this->initChars();
            fResetTime = timer.secs();
            fCurrTime = 0;
        }

        return true;
    }
Ejemplo n.º 5
0
    bool onAnimate(const SkAnimTimer& timer) final {
        fBackgroundAnimationTask.wait();
        this->swapAnimationBuffers();

        const double tsec = timer.secs();
        const double dt = fLastTick ? (timer.secs() - fLastTick) : 0;
        fBackgroundAnimationTask.add(std::bind(&MovingPathText::runAnimationTask, this, tsec,
                                               dt, this->width(), this->height()));
        fLastTick = timer.secs();
        return true;
    }
Ejemplo n.º 6
0
 bool onAnimate(const SkAnimTimer& timer) override {
     fTime = timer.msec();
     for (int i = 0; i < N; ++i) {
         fArray[i].fDrawable->setTime(fTime);
     }
     return true;
 }
Ejemplo n.º 7
0
    bool onAnimate(const SkAnimTimer& timer) override {
        SkScalar dt = (timer.msec() - fLastTick) * fTimeScale;
        fLastTick = timer.msec();

        fPaddle0.posTick(dt);
        fPaddle1.posTick(dt);
        fBall.posTick(dt);

        this->enforceConstraints();

        fPaddle0.updateDom();
        fPaddle1.updateDom();
        fBall.updateDom();

        return true;
    }
Ejemplo n.º 8
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.º 9
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;
    }
 bool onAnimate(const SkAnimTimer& timer) override {
     fCurrTime = timer.msec();
     return true;
 }
Ejemplo n.º 11
0
 bool onAnimate(const SkAnimTimer& timer) override {
     fRotate = timer.scaled(1, 360);
     return true;
 }
Ejemplo n.º 12
0
 bool onAnimate(const SkAnimTimer& timer) override {
     fPhase = timer.scaled(40);
     return true;
 }
Ejemplo n.º 13
0
 bool onAnimate(const SkAnimTimer& timer) override {
     fAngle = timer.scaled(60, 360);
     return true;
 }
Ejemplo n.º 14
0
 bool onAnimate(const SkAnimTimer& timer) override {
     fBlurSigma = get_anim_sin(timer.secs(), 100, 4, 5);
     fCircleRadius = 3 + get_anim_sin(timer.secs(), 150, 25, 3);
     return true;
 }