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

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

Issue 14556022: Simplify animation testing API (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased Created 7 years, 7 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 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 RenderObject* renderer = it->key; 297 RenderObject* renderer = it->key;
298 if (renderer->document() == document) { 298 if (renderer->document() == document) {
299 CompositeAnimation* compAnim = it->value.get(); 299 CompositeAnimation* compAnim = it->value.get();
300 compAnim->resumeAnimations(); 300 compAnim->resumeAnimations();
301 } 301 }
302 } 302 }
303 303
304 updateAnimationTimer(); 304 updateAnimationTimer();
305 } 305 }
306 306
307 bool AnimationControllerPrivate::pauseAnimationAtTime(RenderObject* renderer, co nst AtomicString& name, double t) 307 void AnimationControllerPrivate::pauseAnimationsForTesting(double t)
308 { 308 {
309 if (!renderer) 309 RenderObjectAnimationMap::const_iterator animationsEnd = m_compositeAnimatio ns.end();
310 return false; 310 for (RenderObjectAnimationMap::const_iterator it = m_compositeAnimations.beg in(); it != animationsEnd; ++it) {
311 311 it->value->pauseAnimationsForTesting(t);
312 RefPtr<CompositeAnimation> compAnim = accessCompositeAnimation(renderer); 312 it->key->node()->setNeedsStyleRecalc(SyntheticStyleChange);
313 if (!compAnim)
314 return false;
315
316 if (compAnim->pauseAnimationAtTime(name, t)) {
317 renderer->node()->setNeedsStyleRecalc(SyntheticStyleChange);
318 startUpdateStyleIfNeededDispatcher();
319 return true;
320 } 313 }
321
322 return false;
323 }
324
325 bool AnimationControllerPrivate::pauseTransitionAtTime(RenderObject* renderer, c onst String& property, double t)
326 {
327 if (!renderer)
328 return false;
329
330 RefPtr<CompositeAnimation> compAnim = accessCompositeAnimation(renderer);
331 if (!compAnim)
332 return false;
333
334 if (compAnim->pauseTransitionAtTime(cssPropertyID(property), t)) {
335 renderer->node()->setNeedsStyleRecalc(SyntheticStyleChange);
336 startUpdateStyleIfNeededDispatcher();
337 return true;
338 }
339
340 return false;
341 } 314 }
342 315
343 double AnimationControllerPrivate::beginAnimationUpdateTime() 316 double AnimationControllerPrivate::beginAnimationUpdateTime()
344 { 317 {
345 if (m_beginAnimationUpdateTime == cBeginAnimationUpdateTimeNotSet) 318 if (m_beginAnimationUpdateTime == cBeginAnimationUpdateTimeNotSet)
346 m_beginAnimationUpdateTime = currentTime(); 319 m_beginAnimationUpdateTime = currentTime();
347 return m_beginAnimationUpdateTime; 320 return m_beginAnimationUpdateTime;
348 } 321 }
349 322
350 void AnimationControllerPrivate::endAnimationUpdate() 323 void AnimationControllerPrivate::endAnimationUpdate()
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
533 PassRefPtr<RenderStyle> AnimationController::getAnimatedStyleForRenderer(RenderO bject* renderer) 506 PassRefPtr<RenderStyle> AnimationController::getAnimatedStyleForRenderer(RenderO bject* renderer)
534 { 507 {
535 return m_data->getAnimatedStyleForRenderer(renderer); 508 return m_data->getAnimatedStyleForRenderer(renderer);
536 } 509 }
537 510
538 void AnimationController::notifyAnimationStarted(RenderObject*, double startTime ) 511 void AnimationController::notifyAnimationStarted(RenderObject*, double startTime )
539 { 512 {
540 m_data->receivedStartTimeResponse(startTime); 513 m_data->receivedStartTimeResponse(startTime);
541 } 514 }
542 515
543 bool AnimationController::pauseAnimationAtTime(RenderObject* renderer, const Ato micString& name, double t) 516 void AnimationController::pauseAnimationsForTesting(double t)
544 { 517 {
545 return m_data->pauseAnimationAtTime(renderer, name, t); 518 m_data->pauseAnimationsForTesting(t);
546 } 519 }
547 520
548 unsigned AnimationController::numberOfActiveAnimations(Document* document) const 521 unsigned AnimationController::numberOfActiveAnimations(Document* document) const
549 { 522 {
550 return m_data->numberOfActiveAnimations(document); 523 return m_data->numberOfActiveAnimations(document);
551 } 524 }
552 525
553 bool AnimationController::pauseTransitionAtTime(RenderObject* renderer, const St ring& property, double t)
554 {
555 return m_data->pauseTransitionAtTime(renderer, property, t);
556 }
557
558 bool AnimationController::isRunningAnimationOnRenderer(RenderObject* renderer, C SSPropertyID property, bool isRunningNow) const 526 bool AnimationController::isRunningAnimationOnRenderer(RenderObject* renderer, C SSPropertyID property, bool isRunningNow) const
559 { 527 {
560 return m_data->isRunningAnimationOnRenderer(renderer, property, isRunningNow ); 528 return m_data->isRunningAnimationOnRenderer(renderer, property, isRunningNow );
561 } 529 }
562 530
563 bool AnimationController::isRunningAcceleratedAnimationOnRenderer(RenderObject* renderer, CSSPropertyID property, bool isRunningNow) const 531 bool AnimationController::isRunningAcceleratedAnimationOnRenderer(RenderObject* renderer, CSSPropertyID property, bool isRunningNow) const
564 { 532 {
565 return m_data->isRunningAcceleratedAnimationOnRenderer(renderer, property, i sRunningNow); 533 return m_data->isRunningAcceleratedAnimationOnRenderer(renderer, property, i sRunningNow);
566 } 534 }
567 535
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
604 if (!m_beginAnimationUpdateCount) 572 if (!m_beginAnimationUpdateCount)
605 m_data->endAnimationUpdate(); 573 m_data->endAnimationUpdate();
606 } 574 }
607 575
608 bool AnimationController::supportsAcceleratedAnimationOfProperty(CSSPropertyID p roperty) 576 bool AnimationController::supportsAcceleratedAnimationOfProperty(CSSPropertyID p roperty)
609 { 577 {
610 return CSSPropertyAnimation::animationOfPropertyIsAccelerated(property); 578 return CSSPropertyAnimation::animationOfPropertyIsAccelerated(property);
611 } 579 }
612 580
613 } // namespace WebCore 581 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/page/animation/AnimationController.h ('k') | Source/core/page/animation/AnimationControllerPrivate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698