OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007, 2008, 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008, 2009 Apple 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 | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
548 m_animState = AnimationStateStartWaitResponse; | 548 m_animState = AnimationStateStartWaitResponse; |
549 onAnimationStartResponse(beginAnimationUpdateTime()); | 549 onAnimationStartResponse(beginAnimationUpdateTime()); |
550 } | 550 } |
551 | 551 |
552 ASSERT(m_startTime); // if m_startTime is zero, we haven't started ye
t, so we'll get a bad pause time. | 552 ASSERT(m_startTime); // if m_startTime is zero, we haven't started ye
t, so we'll get a bad pause time. |
553 if (t <= m_animation->delay()) | 553 if (t <= m_animation->delay()) |
554 m_pauseTime = m_startTime; | 554 m_pauseTime = m_startTime; |
555 else | 555 else |
556 m_pauseTime = m_startTime + t - m_animation->delay(); | 556 m_pauseTime = m_startTime + t - m_animation->delay(); |
557 | 557 |
558 // It is possible that m_isAccelerated is true and m_object->isComposited()
is false, because of style change. | 558 // It is possible that m_isAccelerated is true and m_object->compositingStat
e() is NotComposited, because of style change. |
559 if (m_object && m_object->isComposited() && isAccelerated()) | 559 // So, both conditions need to be checked. |
| 560 if (m_object && m_object->compositingState() == PaintsIntoOwnBacking && isAc
celerated()) |
560 toRenderBoxModelObject(m_object)->suspendAnimations(m_pauseTime); | 561 toRenderBoxModelObject(m_object)->suspendAnimations(m_pauseTime); |
561 } | 562 } |
562 | 563 |
563 double AnimationBase::beginAnimationUpdateTime() const | 564 double AnimationBase::beginAnimationUpdateTime() const |
564 { | 565 { |
565 if (!m_compAnim) | 566 if (!m_compAnim) |
566 return 0; | 567 return 0; |
567 | 568 |
568 return m_compAnim->animationController()->beginAnimationUpdateTime(); | 569 return m_compAnim->animationController()->beginAnimationUpdateTime(); |
569 } | 570 } |
570 | 571 |
571 double AnimationBase::getElapsedTime() const | 572 double AnimationBase::getElapsedTime() const |
572 { | 573 { |
573 ASSERT(!postActive()); | 574 ASSERT(!postActive()); |
574 if (paused()) | 575 if (paused()) |
575 return m_pauseTime - m_startTime; | 576 return m_pauseTime - m_startTime; |
576 if (m_startTime <= 0) | 577 if (m_startTime <= 0) |
577 return 0; | 578 return 0; |
578 | 579 |
579 double elapsedTime = beginAnimationUpdateTime() - m_startTime; | 580 double elapsedTime = beginAnimationUpdateTime() - m_startTime; |
580 // It's possible for the start time to be ahead of the last update time | 581 // It's possible for the start time to be ahead of the last update time |
581 // if the compositor has just sent notification for the start of an | 582 // if the compositor has just sent notification for the start of an |
582 // accelerated animation. | 583 // accelerated animation. |
583 return max(elapsedTime, 0.0); | 584 return max(elapsedTime, 0.0); |
584 } | 585 } |
585 | 586 |
586 } // namespace WebCore | 587 } // namespace WebCore |
OLD | NEW |