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

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

Issue 27030009: Revert "Make compositingState explicit (re-land #2 with bogus ASSERT removed)" (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: fix build error 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
« no previous file with comments | « Source/core/frame/FrameView.cpp ('k') | Source/core/frame/animation/ImplicitAnimation.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 537 matching lines...) Expand 10 before | Expand all | Expand 10 after
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->compositingStat e() is NotComposited, because of style change. 558 // It is possible that m_isAccelerated is true and m_object->isComposited() is false, because of style change.
559 // So, both conditions need to be checked. 559 if (m_object && m_object->isComposited() && isAccelerated())
560 if (m_object && m_object->compositingState() == PaintsIntoOwnBacking && isAc celerated())
561 toRenderBoxModelObject(m_object)->suspendAnimations(m_pauseTime); 560 toRenderBoxModelObject(m_object)->suspendAnimations(m_pauseTime);
562 } 561 }
563 562
564 double AnimationBase::beginAnimationUpdateTime() const 563 double AnimationBase::beginAnimationUpdateTime() const
565 { 564 {
566 if (!m_compAnim) 565 if (!m_compAnim)
567 return 0; 566 return 0;
568 567
569 return m_compAnim->animationController()->beginAnimationUpdateTime(); 568 return m_compAnim->animationController()->beginAnimationUpdateTime();
570 } 569 }
571 570
572 double AnimationBase::getElapsedTime() const 571 double AnimationBase::getElapsedTime() const
573 { 572 {
574 ASSERT(!postActive()); 573 ASSERT(!postActive());
575 if (paused()) 574 if (paused())
576 return m_pauseTime - m_startTime; 575 return m_pauseTime - m_startTime;
577 if (m_startTime <= 0) 576 if (m_startTime <= 0)
578 return 0; 577 return 0;
579 578
580 double elapsedTime = beginAnimationUpdateTime() - m_startTime; 579 double elapsedTime = beginAnimationUpdateTime() - m_startTime;
581 // It's possible for the start time to be ahead of the last update time 580 // It's possible for the start time to be ahead of the last update time
582 // if the compositor has just sent notification for the start of an 581 // if the compositor has just sent notification for the start of an
583 // accelerated animation. 582 // accelerated animation.
584 return max(elapsedTime, 0.0); 583 return max(elapsedTime, 0.0);
585 } 584 }
586 585
587 } // namespace WebCore 586 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/frame/FrameView.cpp ('k') | Source/core/frame/animation/ImplicitAnimation.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698