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

Unified Diff: third_party/WebKit/Source/core/animation/KeyframeEffectModel.cpp

Issue 2620303002: Refactor how UseCounter::SyntheticKeyframesInCompositedCSSAnimation is counted (Closed)
Patch Set: g cl set-commit 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/animation/KeyframeEffectModel.cpp
diff --git a/third_party/WebKit/Source/core/animation/KeyframeEffectModel.cpp b/third_party/WebKit/Source/core/animation/KeyframeEffectModel.cpp
index 1c02f196f1637fb4220571063a9702f2c06971f9..7b531d4a43ab55d325af2871e6de0bb205e1f70d 100644
--- a/third_party/WebKit/Source/core/animation/KeyframeEffectModel.cpp
+++ b/third_party/WebKit/Source/core/animation/KeyframeEffectModel.cpp
@@ -36,6 +36,7 @@
#include "core/css/CSSPropertyEquality.h"
#include "core/css/resolver/StyleResolver.h"
#include "core/dom/Document.h"
+#include "core/frame/UseCounter.h"
#include "platform/animation/AnimationUtilities.h"
#include "platform/geometry/FloatBox.h"
#include "platform/transforms/TransformationMatrix.h"
@@ -110,15 +111,22 @@ bool KeyframeEffectModelBase::snapshotAllCompositorKeyframes(
const ComputedStyle* parentStyle) const {
m_needsCompositorKeyframesSnapshot = false;
bool updated = false;
+ bool hasNeutralCompositableKeyframe = false;
ensureKeyframeGroups();
for (CSSPropertyID property : CompositorAnimations::compositableProperties) {
PropertySpecificKeyframeGroup* keyframeGroup =
m_keyframeGroups->get(PropertyHandle(property));
if (!keyframeGroup)
continue;
- for (auto& keyframe : keyframeGroup->m_keyframes)
+ for (auto& keyframe : keyframeGroup->m_keyframes) {
updated |= keyframe->populateAnimatableValue(property, element, baseStyle,
parentStyle);
+ hasNeutralCompositableKeyframe |= keyframe->isNeutral();
+ }
+ }
+ if (updated && hasNeutralCompositableKeyframe) {
+ UseCounter::count(element.document(),
+ UseCounter::SyntheticKeyframesInCompositedCSSAnimation);
}
return updated;
}

Powered by Google App Engine
This is Rietveld 408576698