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

Side by Side Diff: third_party/WebKit/Source/core/svg/animation/SMILTimeContainer.cpp

Issue 2617783002: Migrate WTF::Vector::append() to ::push_back() [part 12 of N] (Closed)
Patch Set: rebase Created 3 years, 11 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2008 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 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after
454 454
455 AnimationsVector sandwich; 455 AnimationsVector sandwich;
456 for (const auto& itAnimation : scheduledAnimationsInSameGroup) { 456 for (const auto& itAnimation : scheduledAnimationsInSameGroup) {
457 SVGSMILElement* animation = itAnimation.get(); 457 SVGSMILElement* animation = itAnimation.get();
458 DCHECK_EQ(animation->timeContainer(), this); 458 DCHECK_EQ(animation->timeContainer(), this);
459 DCHECK(animation->hasValidTarget()); 459 DCHECK(animation->hasValidTarget());
460 460
461 // This will calculate the contribution from the animation and update 461 // This will calculate the contribution from the animation and update
462 // timing. 462 // timing.
463 if (animation->progress(elapsed, seekToTime)) { 463 if (animation->progress(elapsed, seekToTime)) {
464 sandwich.append(animation); 464 sandwich.push_back(animation);
465 } else { 465 } else {
466 animation->clearAnimatedType(); 466 animation->clearAnimatedType();
467 } 467 }
468 468
469 SMILTime nextFireTime = animation->nextProgressTime(); 469 SMILTime nextFireTime = animation->nextProgressTime();
470 if (nextFireTime.isFinite()) 470 if (nextFireTime.isFinite())
471 earliestFireTime = std::min(nextFireTime, earliestFireTime); 471 earliestFireTime = std::min(nextFireTime, earliestFireTime);
472 } 472 }
473 473
474 if (!sandwich.isEmpty()) { 474 if (!sandwich.isEmpty()) {
475 // Results are accumulated to the first animation that animates and 475 // Results are accumulated to the first animation that animates and
476 // contributes to a particular element/attribute pair. 476 // contributes to a particular element/attribute pair.
477 // Only reset the animated type to the base value once for 477 // Only reset the animated type to the base value once for
478 // the lowest priority animation that animates and 478 // the lowest priority animation that animates and
479 // contributes to a particular element/attribute pair. 479 // contributes to a particular element/attribute pair.
480 SVGSMILElement* resultElement = sandwich.front(); 480 SVGSMILElement* resultElement = sandwich.front();
481 resultElement->resetAnimatedType(); 481 resultElement->resetAnimatedType();
482 482
483 // Go through the sandwich from lowest prio to highest and generate 483 // Go through the sandwich from lowest prio to highest and generate
484 // the animated value (if any.) 484 // the animated value (if any.)
485 for (const auto& animation : sandwich) 485 for (const auto& animation : sandwich)
486 animation->updateAnimatedValue(resultElement); 486 animation->updateAnimatedValue(resultElement);
487 487
488 animationsToApply.append(resultElement); 488 animationsToApply.push_back(resultElement);
489 } 489 }
490 } 490 }
491 m_scheduledAnimations.removeAll(invalidKeys); 491 m_scheduledAnimations.removeAll(invalidKeys);
492 492
493 if (animationsToApply.isEmpty()) { 493 if (animationsToApply.isEmpty()) {
494 #if ENABLE(ASSERT) 494 #if ENABLE(ASSERT)
495 m_preventScheduledAnimationsChanges = false; 495 m_preventScheduledAnimationsChanges = false;
496 #endif 496 #endif
497 return earliestFireTime; 497 return earliestFireTime;
498 } 498 }
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
530 void SMILTimeContainer::advanceFrameForTesting() { 530 void SMILTimeContainer::advanceFrameForTesting() {
531 setElapsed(elapsed() + initialFrameDelay); 531 setElapsed(elapsed() + initialFrameDelay);
532 } 532 }
533 533
534 DEFINE_TRACE(SMILTimeContainer) { 534 DEFINE_TRACE(SMILTimeContainer) {
535 visitor->trace(m_scheduledAnimations); 535 visitor->trace(m_scheduledAnimations);
536 visitor->trace(m_ownerSVGElement); 536 visitor->trace(m_ownerSVGElement);
537 } 537 }
538 538
539 } // namespace blink 539 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698