Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(564)

Side by Side Diff: Source/core/page/animation/AnimationBase.cpp

Issue 24921002: Make compositingState explicit (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: ready for review Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 546 matching lines...) Expand 10 before | Expand all | Expand 10 after
557 m_animState = AnimationStateStartWaitResponse; 557 m_animState = AnimationStateStartWaitResponse;
558 onAnimationStartResponse(beginAnimationUpdateTime()); 558 onAnimationStartResponse(beginAnimationUpdateTime());
559 } 559 }
560 560
561 ASSERT(m_startTime); // if m_startTime is zero, we haven't started ye t, so we'll get a bad pause time. 561 ASSERT(m_startTime); // if m_startTime is zero, we haven't started ye t, so we'll get a bad pause time.
562 if (t <= m_animation->delay()) 562 if (t <= m_animation->delay())
563 m_pauseTime = m_startTime; 563 m_pauseTime = m_startTime;
564 else 564 else
565 m_pauseTime = m_startTime + t - m_animation->delay(); 565 m_pauseTime = m_startTime + t - m_animation->delay();
566 566
567 if (m_object && m_object->isComposited()) 567 if (m_object && m_object->compositingState() == PaintsIntoOwnBacking)
568 toRenderBoxModelObject(m_object)->suspendAnimations(m_pauseTime); 568 toRenderBoxModelObject(m_object)->suspendAnimations(m_pauseTime);
569 } 569 }
570 570
571 double AnimationBase::beginAnimationUpdateTime() const 571 double AnimationBase::beginAnimationUpdateTime() const
572 { 572 {
573 if (!m_compAnim) 573 if (!m_compAnim)
574 return 0; 574 return 0;
575 575
576 return m_compAnim->animationController()->beginAnimationUpdateTime(); 576 return m_compAnim->animationController()->beginAnimationUpdateTime();
577 } 577 }
578 578
579 double AnimationBase::getElapsedTime() const 579 double AnimationBase::getElapsedTime() const
580 { 580 {
581 ASSERT(!postActive()); 581 ASSERT(!postActive());
582 if (paused()) 582 if (paused())
583 return m_pauseTime - m_startTime; 583 return m_pauseTime - m_startTime;
584 if (m_startTime <= 0) 584 if (m_startTime <= 0)
585 return 0; 585 return 0;
586 586
587 double elapsedTime = beginAnimationUpdateTime() - m_startTime; 587 double elapsedTime = beginAnimationUpdateTime() - m_startTime;
588 // It's possible for the start time to be ahead of the last update time 588 // It's possible for the start time to be ahead of the last update time
589 // if the compositor has just sent notification for the start of an 589 // if the compositor has just sent notification for the start of an
590 // accelerated animation. 590 // accelerated animation.
591 return max(elapsedTime, 0.0); 591 return max(elapsedTime, 0.0);
592 } 592 }
593 593
594 } // namespace WebCore 594 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698