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

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

Issue 2709033003: Migrate WTF::HashMap::get() to ::at() (Closed)
Patch Set: rebase Created 3 years, 10 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) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 Element& element, 86 Element& element,
87 const ComputedStyle& oldStyle, 87 const ComputedStyle& oldStyle,
88 const ComputedStyle& newStyle, 88 const ComputedStyle& newStyle,
89 const ComputedStyle* parentStyle) const { 89 const ComputedStyle* parentStyle) const {
90 bool updated = false; 90 bool updated = false;
91 ensureKeyframeGroups(); 91 ensureKeyframeGroups();
92 for (CSSPropertyID property : CompositorAnimations::compositableProperties) { 92 for (CSSPropertyID property : CompositorAnimations::compositableProperties) {
93 if (CSSPropertyEquality::propertiesEqual(property, oldStyle, newStyle)) 93 if (CSSPropertyEquality::propertiesEqual(property, oldStyle, newStyle))
94 continue; 94 continue;
95 PropertySpecificKeyframeGroup* keyframeGroup = 95 PropertySpecificKeyframeGroup* keyframeGroup =
96 m_keyframeGroups->get(PropertyHandle(property)); 96 m_keyframeGroups->at(PropertyHandle(property));
97 if (!keyframeGroup) 97 if (!keyframeGroup)
98 continue; 98 continue;
99 for (auto& keyframe : keyframeGroup->m_keyframes) { 99 for (auto& keyframe : keyframeGroup->m_keyframes) {
100 if (keyframe->isNeutral()) 100 if (keyframe->isNeutral())
101 updated |= keyframe->populateAnimatableValue(property, element, 101 updated |= keyframe->populateAnimatableValue(property, element,
102 newStyle, parentStyle); 102 newStyle, parentStyle);
103 } 103 }
104 } 104 }
105 return updated; 105 return updated;
106 } 106 }
107 107
108 bool KeyframeEffectModelBase::snapshotAllCompositorKeyframes( 108 bool KeyframeEffectModelBase::snapshotAllCompositorKeyframes(
109 Element& element, 109 Element& element,
110 const ComputedStyle& baseStyle, 110 const ComputedStyle& baseStyle,
111 const ComputedStyle* parentStyle) const { 111 const ComputedStyle* parentStyle) const {
112 m_needsCompositorKeyframesSnapshot = false; 112 m_needsCompositorKeyframesSnapshot = false;
113 bool updated = false; 113 bool updated = false;
114 bool hasNeutralCompositableKeyframe = false; 114 bool hasNeutralCompositableKeyframe = false;
115 ensureKeyframeGroups(); 115 ensureKeyframeGroups();
116 for (CSSPropertyID property : CompositorAnimations::compositableProperties) { 116 for (CSSPropertyID property : CompositorAnimations::compositableProperties) {
117 PropertySpecificKeyframeGroup* keyframeGroup = 117 PropertySpecificKeyframeGroup* keyframeGroup =
118 m_keyframeGroups->get(PropertyHandle(property)); 118 m_keyframeGroups->at(PropertyHandle(property));
119 if (!keyframeGroup) 119 if (!keyframeGroup)
120 continue; 120 continue;
121 for (auto& keyframe : keyframeGroup->m_keyframes) { 121 for (auto& keyframe : keyframeGroup->m_keyframes) {
122 updated |= keyframe->populateAnimatableValue(property, element, baseStyle, 122 updated |= keyframe->populateAnimatableValue(property, element, baseStyle,
123 parentStyle); 123 parentStyle);
124 hasNeutralCompositableKeyframe |= keyframe->isNeutral(); 124 hasNeutralCompositableKeyframe |= keyframe->isNeutral();
125 } 125 }
126 } 126 }
127 if (updated && hasNeutralCompositableKeyframe) { 127 if (updated && hasNeutralCompositableKeyframe) {
128 UseCounter::count(element.document(), 128 UseCounter::count(element.document(),
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 } 317 }
318 if (m_keyframes.back()->offset() != 1.0) { 318 if (m_keyframes.back()->offset() != 1.0) {
319 appendKeyframe(m_keyframes.back()->neutralKeyframe(1, nullptr)); 319 appendKeyframe(m_keyframes.back()->neutralKeyframe(1, nullptr));
320 addedSyntheticKeyframe = true; 320 addedSyntheticKeyframe = true;
321 } 321 }
322 322
323 return addedSyntheticKeyframe; 323 return addedSyntheticKeyframe;
324 } 324 }
325 325
326 } // namespace blink 326 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698