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

Unified 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: Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/svg/animation/SMILTimeContainer.cpp
diff --git a/third_party/WebKit/Source/core/svg/animation/SMILTimeContainer.cpp b/third_party/WebKit/Source/core/svg/animation/SMILTimeContainer.cpp
index 2d3d2d3c6140763cd1bbebf5a2f1ebfc18ec43eb..55cf1c8b2e857a67c7d8ce0373ab5373d6d7b1f9 100644
--- a/third_party/WebKit/Source/core/svg/animation/SMILTimeContainer.cpp
+++ b/third_party/WebKit/Source/core/svg/animation/SMILTimeContainer.cpp
@@ -30,6 +30,7 @@
#include "core/dom/ElementTraversal.h"
#include "core/frame/FrameView.h"
#include "core/frame/Settings.h"
+#include "core/frame/UseCounter.h"
#include "core/svg/SVGSVGElement.h"
#include "core/svg/animation/SVGSMILElement.h"
#include <algorithm>
@@ -47,6 +48,7 @@ SMILTimeContainer::SMILTimeContainer(SVGSVGElement& owner)
, m_presetStartTime(0)
, m_frameSchedulingState(Idle)
, m_documentOrderIndexesDirty(false)
+ , m_hasUpdatedAnimation(false)
, m_wakeupTimer(this, &SMILTimeContainer::wakeupTimerFired)
, m_animationPolicyOnceTimer(this, &SMILTimeContainer::animationPolicyTimerFired)
, m_ownerSVGElement(&owner)
@@ -512,6 +514,11 @@ SMILTime SMILTimeContainer::updateAnimations(SMILTime elapsed, bool seekToTime)
return earliestFireTime;
}
+ if (!m_hasUpdatedAnimation) {
+ m_hasUpdatedAnimation = true;
+ UseCounter::count(&document(), UseCounter::SVGSMILAnimationAppliedEffect);
fs 2016/07/21 10:17:33 You could ditch the m_hasUpdatedAnimation - once t
suzyh_UTC10 (ex-contributor) 2016/07/25 03:16:00 Done.
+ }
+
// Apply results to target elements.
for (unsigned i = 0; i < animationsToApplySize; ++i)
animationsToApply[i]->applyResultsToTarget();

Powered by Google App Engine
This is Rietveld 408576698