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

Side by Side Diff: sky/engine/core/animation/AnimationTimeline.cpp

Issue 772673002: Fix Animations, Remove Compostior Animations. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: cleanup Created 6 years 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 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 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 bool isNull; 185 bool isNull;
186 return currentTimeInternal(isNull); 186 return currentTimeInternal(isNull);
187 } 187 }
188 188
189 double AnimationTimeline::effectiveTime() 189 double AnimationTimeline::effectiveTime()
190 { 190 {
191 double time = currentTimeInternal(); 191 double time = currentTimeInternal();
192 return std::isnan(time) ? 0 : time; 192 return std::isnan(time) ? 0 : time;
193 } 193 }
194 194
195 void AnimationTimeline::pauseAnimationsForTesting(double pauseTime)
196 {
197 for (HashSet<RefPtr<AnimationPlayer> >::iterator it = m_playersNeedingUpdate .begin(); it != m_playersNeedingUpdate.end(); ++it)
198 (*it)->pauseForTesting(pauseTime);
199 serviceAnimations(TimingUpdateOnDemand);
200 }
201
202 bool AnimationTimeline::hasOutdatedAnimationPlayer() const 195 bool AnimationTimeline::hasOutdatedAnimationPlayer() const
203 { 196 {
204 for (HashSet<RefPtr<AnimationPlayer> >::iterator it = m_playersNeedingUpdate .begin(); it != m_playersNeedingUpdate.end(); ++it) { 197 for (HashSet<RefPtr<AnimationPlayer> >::iterator it = m_playersNeedingUpdate .begin(); it != m_playersNeedingUpdate.end(); ++it) {
205 if ((*it)->outdated()) 198 if ((*it)->outdated())
206 return true; 199 return true;
207 } 200 }
208 return false; 201 return false;
209 } 202 }
210 203
211 void AnimationTimeline::setOutdatedAnimationPlayer(AnimationPlayer* player) 204 void AnimationTimeline::setOutdatedAnimationPlayer(AnimationPlayer* player)
212 { 205 {
213 ASSERT(player->outdated()); 206 ASSERT(player->outdated());
214 m_playersNeedingUpdate.add(player); 207 m_playersNeedingUpdate.add(player);
215 if (m_document && m_document->page() && !m_document->page()->animator().isSe rvicingAnimations()) 208 if (m_document && m_document->page() && !m_document->page()->animator().isSe rvicingAnimations())
216 m_timing->serviceOnNextFrame(); 209 m_timing->serviceOnNextFrame();
217 } 210 }
218 211
219 #if !ENABLE(OILPAN) 212 #if !ENABLE(OILPAN)
220 void AnimationTimeline::detachFromDocument() 213 void AnimationTimeline::detachFromDocument()
221 { 214 {
222 // FIXME: AnimationTimeline should keep Document alive. 215 // FIXME: AnimationTimeline should keep Document alive.
223 m_document = nullptr; 216 m_document = nullptr;
224 } 217 }
225 #endif 218 #endif
226 219
227 } // namespace 220 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698