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

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

Issue 2657443005: Migrate WTF::HashSet::add() to ::insert() [part 1 of N] (Closed)
Patch Set: 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) 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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 for (size_t i = 0; i < styleKeyframes.size(); ++i) { 93 for (size_t i = 0; i < styleKeyframes.size(); ++i) {
94 const StyleRuleKeyframe* styleKeyframe = styleKeyframes[i].get(); 94 const StyleRuleKeyframe* styleKeyframe = styleKeyframes[i].get();
95 RefPtr<StringKeyframe> keyframe = StringKeyframe::create(); 95 RefPtr<StringKeyframe> keyframe = StringKeyframe::create();
96 const Vector<double>& offsets = styleKeyframe->keys(); 96 const Vector<double>& offsets = styleKeyframe->keys();
97 DCHECK(!offsets.isEmpty()); 97 DCHECK(!offsets.isEmpty());
98 keyframe->setOffset(offsets[0]); 98 keyframe->setOffset(offsets[0]);
99 keyframe->setEasing(defaultTimingFunction); 99 keyframe->setEasing(defaultTimingFunction);
100 const StylePropertySet& properties = styleKeyframe->properties(); 100 const StylePropertySet& properties = styleKeyframe->properties();
101 for (unsigned j = 0; j < properties.propertyCount(); j++) { 101 for (unsigned j = 0; j < properties.propertyCount(); j++) {
102 CSSPropertyID property = properties.propertyAt(j).id(); 102 CSSPropertyID property = properties.propertyAt(j).id();
103 specifiedPropertiesForUseCounter.add(property); 103 specifiedPropertiesForUseCounter.insert(property);
104 if (property == CSSPropertyAnimationTimingFunction) { 104 if (property == CSSPropertyAnimationTimingFunction) {
105 const CSSValue& value = properties.propertyAt(j).value(); 105 const CSSValue& value = properties.propertyAt(j).value();
106 RefPtr<TimingFunction> timingFunction; 106 RefPtr<TimingFunction> timingFunction;
107 if (value.isInheritedValue() && parentStyle->animations()) { 107 if (value.isInheritedValue() && parentStyle->animations()) {
108 timingFunction = parentStyle->animations()->timingFunctionList()[0]; 108 timingFunction = parentStyle->animations()->timingFunctionList()[0];
109 } else if (value.isValueList()) { 109 } else if (value.isValueList()) {
110 timingFunction = CSSToStyleMap::mapAnimationTimingFunction( 110 timingFunction = CSSToStyleMap::mapAnimationTimingFunction(
111 toCSSValueList(value).item(0)); 111 toCSSValueList(value).item(0));
112 } else { 112 } else {
113 DCHECK(value.isCSSWideKeyword()); 113 DCHECK(value.isCSSWideKeyword());
(...skipping 758 matching lines...) Expand 10 before | Expand all | Expand 10 after
872 for (const auto& entry : update.newTransitions()) 872 for (const auto& entry : update.newTransitions())
873 newTransitions.push_back(entry.value.effect.get()); 873 newTransitions.push_back(entry.value.effect.get());
874 874
875 HeapHashSet<Member<const Animation>> cancelledAnimations; 875 HeapHashSet<Member<const Animation>> cancelledAnimations;
876 if (!update.cancelledTransitions().isEmpty()) { 876 if (!update.cancelledTransitions().isEmpty()) {
877 DCHECK(elementAnimations); 877 DCHECK(elementAnimations);
878 const TransitionMap& transitionMap = 878 const TransitionMap& transitionMap =
879 elementAnimations->cssAnimations().m_transitions; 879 elementAnimations->cssAnimations().m_transitions;
880 for (CSSPropertyID id : update.cancelledTransitions()) { 880 for (CSSPropertyID id : update.cancelledTransitions()) {
881 DCHECK(transitionMap.contains(id)); 881 DCHECK(transitionMap.contains(id));
882 cancelledAnimations.add(transitionMap.get(id).animation.get()); 882 cancelledAnimations.insert(transitionMap.get(id).animation.get());
883 } 883 }
884 } 884 }
885 885
886 activeInterpolationsForTransitions = EffectStack::activeInterpolations( 886 activeInterpolationsForTransitions = EffectStack::activeInterpolations(
887 effectStack, &newTransitions, &cancelledAnimations, 887 effectStack, &newTransitions, &cancelledAnimations,
888 KeyframeEffectReadOnly::TransitionPriority, isStylePropertyHandle); 888 KeyframeEffectReadOnly::TransitionPriority, isStylePropertyHandle);
889 } 889 }
890 890
891 // Properties being animated by animations don't get values from transitions 891 // Properties being animated by animations don't get values from transitions
892 // applied. 892 // applied.
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
1068 isCustomPropertyHandle); 1068 isCustomPropertyHandle);
1069 } 1069 }
1070 1070
1071 DEFINE_TRACE(CSSAnimations) { 1071 DEFINE_TRACE(CSSAnimations) {
1072 visitor->trace(m_transitions); 1072 visitor->trace(m_transitions);
1073 visitor->trace(m_pendingUpdate); 1073 visitor->trace(m_pendingUpdate);
1074 visitor->trace(m_runningAnimations); 1074 visitor->trace(m_runningAnimations);
1075 } 1075 }
1076 1076
1077 } // namespace blink 1077 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698