| OLD | NEW |
| 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 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 return affects(PropertyHandle(CSSPropertyTransform)) || | 169 return affects(PropertyHandle(CSSPropertyTransform)) || |
| 170 affects(PropertyHandle(CSSPropertyRotate)) || | 170 affects(PropertyHandle(CSSPropertyRotate)) || |
| 171 affects(PropertyHandle(CSSPropertyScale)) || | 171 affects(PropertyHandle(CSSPropertyScale)) || |
| 172 affects(PropertyHandle(CSSPropertyTranslate)); | 172 affects(PropertyHandle(CSSPropertyTranslate)); |
| 173 } | 173 } |
| 174 | 174 |
| 175 void KeyframeEffectModelBase::ensureKeyframeGroups() const { | 175 void KeyframeEffectModelBase::ensureKeyframeGroups() const { |
| 176 if (m_keyframeGroups) | 176 if (m_keyframeGroups) |
| 177 return; | 177 return; |
| 178 | 178 |
| 179 m_keyframeGroups = wrapUnique(new KeyframeGroupMap); | 179 m_keyframeGroups = WTF::wrapUnique(new KeyframeGroupMap); |
| 180 RefPtr<TimingFunction> zeroOffsetEasing = m_defaultKeyframeEasing; | 180 RefPtr<TimingFunction> zeroOffsetEasing = m_defaultKeyframeEasing; |
| 181 for (const auto& keyframe : normalizedKeyframes(getFrames())) { | 181 for (const auto& keyframe : normalizedKeyframes(getFrames())) { |
| 182 if (keyframe->offset() == 0) | 182 if (keyframe->offset() == 0) |
| 183 zeroOffsetEasing = &keyframe->easing(); | 183 zeroOffsetEasing = &keyframe->easing(); |
| 184 | 184 |
| 185 for (const PropertyHandle& property : keyframe->properties()) { | 185 for (const PropertyHandle& property : keyframe->properties()) { |
| 186 KeyframeGroupMap::iterator groupIter = m_keyframeGroups->find(property); | 186 KeyframeGroupMap::iterator groupIter = m_keyframeGroups->find(property); |
| 187 PropertySpecificKeyframeGroup* group; | 187 PropertySpecificKeyframeGroup* group; |
| 188 if (groupIter == m_keyframeGroups->end()) | 188 if (groupIter == m_keyframeGroups->end()) { |
| 189 group = | 189 group = m_keyframeGroups |
| 190 m_keyframeGroups | 190 ->add(property, |
| 191 ->add(property, wrapUnique(new PropertySpecificKeyframeGroup)) | 191 WTF::wrapUnique(new PropertySpecificKeyframeGroup)) |
| 192 .storedValue->value.get(); | 192 .storedValue->value.get(); |
| 193 else | 193 } else { |
| 194 group = groupIter->value.get(); | 194 group = groupIter->value.get(); |
| 195 } |
| 195 | 196 |
| 196 group->appendKeyframe(keyframe->createPropertySpecificKeyframe(property)); | 197 group->appendKeyframe(keyframe->createPropertySpecificKeyframe(property)); |
| 197 } | 198 } |
| 198 } | 199 } |
| 199 | 200 |
| 200 // Add synthetic keyframes. | 201 // Add synthetic keyframes. |
| 201 m_hasSyntheticKeyframes = false; | 202 m_hasSyntheticKeyframes = false; |
| 202 for (const auto& entry : *m_keyframeGroups) { | 203 for (const auto& entry : *m_keyframeGroups) { |
| 203 if (entry.value->addSyntheticKeyframeIfRequired(zeroOffsetEasing)) | 204 if (entry.value->addSyntheticKeyframeIfRequired(zeroOffsetEasing)) |
| 204 m_hasSyntheticKeyframes = true; | 205 m_hasSyntheticKeyframes = true; |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 } | 309 } |
| 309 if (m_keyframes.back()->offset() != 1.0) { | 310 if (m_keyframes.back()->offset() != 1.0) { |
| 310 appendKeyframe(m_keyframes.back()->neutralKeyframe(1, nullptr)); | 311 appendKeyframe(m_keyframes.back()->neutralKeyframe(1, nullptr)); |
| 311 addedSyntheticKeyframe = true; | 312 addedSyntheticKeyframe = true; |
| 312 } | 313 } |
| 313 | 314 |
| 314 return addedSyntheticKeyframe; | 315 return addedSyntheticKeyframe; |
| 315 } | 316 } |
| 316 | 317 |
| 317 } // namespace blink | 318 } // namespace blink |
| OLD | NEW |