| 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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 void KeyframeEffectModelBase::forceConversionsToAnimatableValues(Element& elemen
t, const ComputedStyle* baseStyle) | 76 void KeyframeEffectModelBase::forceConversionsToAnimatableValues(Element& elemen
t, const ComputedStyle* baseStyle) |
| 77 { | 77 { |
| 78 ensureKeyframeGroups(); | 78 ensureKeyframeGroups(); |
| 79 snapshotCompositableProperties(element, baseStyle); | 79 snapshotCompositableProperties(element, baseStyle); |
| 80 ensureInterpolationEffect(&element, baseStyle); | 80 ensureInterpolationEffect(&element, baseStyle); |
| 81 } | 81 } |
| 82 | 82 |
| 83 void KeyframeEffectModelBase::snapshotCompositableProperties(Element& element, c
onst ComputedStyle* baseStyle) | 83 void KeyframeEffectModelBase::snapshotCompositableProperties(Element& element, c
onst ComputedStyle* baseStyle) |
| 84 { | 84 { |
| 85 ensureKeyframeGroups(); | 85 ensureKeyframeGroups(); |
| 86 for (CSSPropertyID id : CompositorAnimations::CompositableProperties) { | 86 for (CSSPropertyID id : CompositorAnimations::compositableProperties) { |
| 87 PropertyHandle property = PropertyHandle(id); | 87 PropertyHandle property = PropertyHandle(id); |
| 88 if (!affects(property)) | 88 if (!affects(property)) |
| 89 continue; | 89 continue; |
| 90 for (auto& keyframe : m_keyframeGroups->get(property)->m_keyframes) | 90 for (auto& keyframe : m_keyframeGroups->get(property)->m_keyframes) |
| 91 keyframe->populateAnimatableValue(id, element, baseStyle); | 91 keyframe->populateAnimatableValue(id, element, baseStyle); |
| 92 } | 92 } |
| 93 } | 93 } |
| 94 | 94 |
| 95 bool KeyframeEffectModelBase::updateNeutralKeyframeAnimatableValues(CSSPropertyI
D property, PassRefPtrWillBeRawPtr<AnimatableValue> value) | 95 bool KeyframeEffectModelBase::updateNeutralKeyframeAnimatableValues(CSSPropertyI
D property, PassRefPtrWillBeRawPtr<AnimatableValue> value) |
| 96 { | 96 { |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 for (size_t j = 1; j < i - lastIndex; ++j) | 147 for (size_t j = 1; j < i - lastIndex; ++j) |
| 148 result[lastIndex + j]->setOffset(lastOffset + (offset - lastOffs
et) * j / (i - lastIndex)); | 148 result[lastIndex + j]->setOffset(lastOffset + (offset - lastOffs
et) * j / (i - lastIndex)); |
| 149 lastIndex = i; | 149 lastIndex = i; |
| 150 lastOffset = offset; | 150 lastOffset = offset; |
| 151 } | 151 } |
| 152 } | 152 } |
| 153 | 153 |
| 154 return result; | 154 return result; |
| 155 } | 155 } |
| 156 | 156 |
| 157 bool KeyframeEffectModelBase::isTransformRelatedEffect() const |
| 158 { |
| 159 return affects(PropertyHandle(CSSPropertyTransform)) |
| 160 || affects(PropertyHandle(CSSPropertyRotate)) |
| 161 || affects(PropertyHandle(CSSPropertyScale)) |
| 162 || affects(PropertyHandle(CSSPropertyTranslate)); |
| 163 } |
| 157 | 164 |
| 158 void KeyframeEffectModelBase::ensureKeyframeGroups() const | 165 void KeyframeEffectModelBase::ensureKeyframeGroups() const |
| 159 { | 166 { |
| 160 if (m_keyframeGroups) | 167 if (m_keyframeGroups) |
| 161 return; | 168 return; |
| 162 | 169 |
| 163 m_keyframeGroups = adoptPtrWillBeNoop(new KeyframeGroupMap); | 170 m_keyframeGroups = adoptPtrWillBeNoop(new KeyframeGroupMap); |
| 164 for (const auto& keyframe : normalizedKeyframes(getFrames())) { | 171 for (const auto& keyframe : normalizedKeyframes(getFrames())) { |
| 165 for (const PropertyHandle& property : keyframe->properties()) { | 172 for (const PropertyHandle& property : keyframe->properties()) { |
| 166 if (property.isCSSProperty()) | 173 if (property.isCSSProperty()) |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 278 } | 285 } |
| 279 | 286 |
| 280 DEFINE_TRACE(KeyframeEffectModelBase::PropertySpecificKeyframeGroup) | 287 DEFINE_TRACE(KeyframeEffectModelBase::PropertySpecificKeyframeGroup) |
| 281 { | 288 { |
| 282 #if ENABLE(OILPAN) | 289 #if ENABLE(OILPAN) |
| 283 visitor->trace(m_keyframes); | 290 visitor->trace(m_keyframes); |
| 284 #endif | 291 #endif |
| 285 } | 292 } |
| 286 | 293 |
| 287 } // namespace | 294 } // namespace |
| OLD | NEW |