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

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

Issue 2164233002: Use-count when SMIL animation renders a frame (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@smil-use-counters
Patch Set: Rebase again Created 4 years, 4 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 12 matching lines...) Expand all
23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 */ 24 */
25 25
26 #include "core/svg/animation/SMILTimeContainer.h" 26 #include "core/svg/animation/SMILTimeContainer.h"
27 27
28 #include "core/animation/AnimationClock.h" 28 #include "core/animation/AnimationClock.h"
29 #include "core/animation/AnimationTimeline.h" 29 #include "core/animation/AnimationTimeline.h"
30 #include "core/dom/ElementTraversal.h" 30 #include "core/dom/ElementTraversal.h"
31 #include "core/frame/FrameView.h" 31 #include "core/frame/FrameView.h"
32 #include "core/frame/Settings.h" 32 #include "core/frame/Settings.h"
33 #include "core/frame/UseCounter.h"
33 #include "core/svg/SVGSVGElement.h" 34 #include "core/svg/SVGSVGElement.h"
34 #include "core/svg/animation/SVGSMILElement.h" 35 #include "core/svg/animation/SVGSMILElement.h"
35 #include <algorithm> 36 #include <algorithm>
36 37
37 namespace blink { 38 namespace blink {
38 39
39 static const double initialFrameDelay = 0.025; 40 static const double initialFrameDelay = 0.025;
40 static const double animationPolicyOnceDuration = 3.000; 41 static const double animationPolicyOnceDuration = 3.000;
41 42
42 SMILTimeContainer::SMILTimeContainer(SVGSVGElement& owner) 43 SMILTimeContainer::SMILTimeContainer(SVGSVGElement& owner)
(...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after
505 std::sort(animationsToApply.begin(), animationsToApply.end(), PriorityCompar e(elapsed)); 506 std::sort(animationsToApply.begin(), animationsToApply.end(), PriorityCompar e(elapsed));
506 507
507 unsigned animationsToApplySize = animationsToApply.size(); 508 unsigned animationsToApplySize = animationsToApply.size();
508 if (!animationsToApplySize) { 509 if (!animationsToApplySize) {
509 #if ENABLE(ASSERT) 510 #if ENABLE(ASSERT)
510 m_preventScheduledAnimationsChanges = false; 511 m_preventScheduledAnimationsChanges = false;
511 #endif 512 #endif
512 return earliestFireTime; 513 return earliestFireTime;
513 } 514 }
514 515
516 UseCounter::count(&document(), UseCounter::SVGSMILAnimationAppliedEffect);
517
515 // Apply results to target elements. 518 // Apply results to target elements.
516 for (unsigned i = 0; i < animationsToApplySize; ++i) 519 for (unsigned i = 0; i < animationsToApplySize; ++i)
517 animationsToApply[i]->applyResultsToTarget(); 520 animationsToApply[i]->applyResultsToTarget();
518 521
519 #if ENABLE(ASSERT) 522 #if ENABLE(ASSERT)
520 m_preventScheduledAnimationsChanges = false; 523 m_preventScheduledAnimationsChanges = false;
521 #endif 524 #endif
522 525
523 for (unsigned i = 0; i < animationsToApplySize; ++i) { 526 for (unsigned i = 0; i < animationsToApplySize; ++i) {
524 if (animationsToApply[i]->isConnected() && animationsToApply[i]->isSVGDi scardElement()) { 527 if (animationsToApply[i]->isConnected() && animationsToApply[i]->isSVGDi scardElement()) {
(...skipping 18 matching lines...) Expand all
543 setElapsed(elapsed().value() + initialFrameDelay); 546 setElapsed(elapsed().value() + initialFrameDelay);
544 } 547 }
545 548
546 DEFINE_TRACE(SMILTimeContainer) 549 DEFINE_TRACE(SMILTimeContainer)
547 { 550 {
548 visitor->trace(m_scheduledAnimations); 551 visitor->trace(m_scheduledAnimations);
549 visitor->trace(m_ownerSVGElement); 552 visitor->trace(m_ownerSVGElement);
550 } 553 }
551 554
552 } // namespace blink 555 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/UseCounter.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698