OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2011, Google Inc. All rights reserved. | 2 * Copyright (c) 2011, Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
430 animationWillStart(); | 430 animationWillStart(); |
431 animationTimerFired(); | 431 animationTimerFired(); |
432 } | 432 } |
433 return needToScroll; | 433 return needToScroll; |
434 } | 434 } |
435 | 435 |
436 void ScrollAnimatorNone::scrollToOffsetWithoutAnimation(const FloatPoint& offset
) | 436 void ScrollAnimatorNone::scrollToOffsetWithoutAnimation(const FloatPoint& offset
) |
437 { | 437 { |
438 stopAnimationTimerIfNeeded(); | 438 stopAnimationTimerIfNeeded(); |
439 | 439 |
440 FloatSize delta = FloatSize(offset.x() - *m_horizontalData.m_currentPosition
, offset.y() - *m_verticalData.m_currentPosition); | |
441 | |
442 m_horizontalData.reset(); | 440 m_horizontalData.reset(); |
443 *m_horizontalData.m_currentPosition = offset.x(); | 441 *m_horizontalData.m_currentPosition = offset.x(); |
444 m_horizontalData.m_desiredPosition = offset.x(); | 442 m_horizontalData.m_desiredPosition = offset.x(); |
| 443 m_currentPosX = offset.x(); |
445 | 444 |
446 m_verticalData.reset(); | 445 m_verticalData.reset(); |
447 *m_verticalData.m_currentPosition = offset.y(); | 446 *m_verticalData.m_currentPosition = offset.y(); |
448 m_verticalData.m_desiredPosition = offset.y(); | 447 m_verticalData.m_desiredPosition = offset.y(); |
| 448 m_currentPosY = offset.y(); |
449 | 449 |
450 notifyPositionChanged(delta); | 450 notifyPositionChanged(); |
451 } | 451 } |
452 | 452 |
453 void ScrollAnimatorNone::cancelAnimations() | 453 void ScrollAnimatorNone::cancelAnimations() |
454 { | 454 { |
455 m_animationActive = false; | 455 m_animationActive = false; |
456 } | 456 } |
457 | 457 |
458 void ScrollAnimatorNone::serviceScrollAnimations() | 458 void ScrollAnimatorNone::serviceScrollAnimations() |
459 { | 459 { |
460 if (m_animationActive) | 460 if (m_animationActive) |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
493 continueAnimation = true; | 493 continueAnimation = true; |
494 if (m_verticalData.m_startTime && m_verticalData.animateScroll(currentTime)) | 494 if (m_verticalData.m_startTime && m_verticalData.animateScroll(currentTime)) |
495 continueAnimation = true; | 495 continueAnimation = true; |
496 | 496 |
497 if (continueAnimation) | 497 if (continueAnimation) |
498 startNextTimer(); | 498 startNextTimer(); |
499 else | 499 else |
500 m_animationActive = false; | 500 m_animationActive = false; |
501 | 501 |
502 TRACE_EVENT0("webkit", "ScrollAnimatorNone::notifyPositionChanged"); | 502 TRACE_EVENT0("webkit", "ScrollAnimatorNone::notifyPositionChanged"); |
503 notifyPositionChanged(FloatSize()); | 503 notifyPositionChanged(); |
504 | 504 |
505 if (!continueAnimation) | 505 if (!continueAnimation) |
506 animationDidFinish(); | 506 animationDidFinish(); |
507 } | 507 } |
508 | 508 |
509 void ScrollAnimatorNone::startNextTimer() | 509 void ScrollAnimatorNone::startNextTimer() |
510 { | 510 { |
511 if (scrollableArea()->scheduleAnimation()) | 511 if (scrollableArea()->scheduleAnimation()) |
512 m_animationActive = true; | 512 m_animationActive = true; |
513 } | 513 } |
514 | 514 |
515 bool ScrollAnimatorNone::animationTimerActive() | 515 bool ScrollAnimatorNone::animationTimerActive() |
516 { | 516 { |
517 return m_animationActive; | 517 return m_animationActive; |
518 } | 518 } |
519 | 519 |
520 void ScrollAnimatorNone::stopAnimationTimerIfNeeded() | 520 void ScrollAnimatorNone::stopAnimationTimerIfNeeded() |
521 { | 521 { |
522 if (animationTimerActive()) | 522 if (animationTimerActive()) |
523 m_animationActive = false; | 523 m_animationActive = false; |
524 } | 524 } |
525 | 525 |
526 } // namespace WebCore | 526 } // namespace WebCore |
OLD | NEW |