| 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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 } | 107 } |
| 108 keyframes.append(keyframe); | 108 keyframes.append(keyframe); |
| 109 // The last keyframe specified at a given offset is used. | 109 // The last keyframe specified at a given offset is used. |
| 110 for (size_t j = 1; j < offsets.size(); ++j) { | 110 for (size_t j = 1; j < offsets.size(); ++j) { |
| 111 keyframes.append(toStringKeyframe(keyframe->cloneWithOffset(offsets[
j]).get())); | 111 keyframes.append(toStringKeyframe(keyframe->cloneWithOffset(offsets[
j]).get())); |
| 112 } | 112 } |
| 113 } | 113 } |
| 114 | 114 |
| 115 for (CSSPropertyID property : specifiedPropertiesForUseCounter) { | 115 for (CSSPropertyID property : specifiedPropertiesForUseCounter) { |
| 116 ASSERT(property != CSSPropertyInvalid); | 116 ASSERT(property != CSSPropertyInvalid); |
| 117 blink::Platform::current()->histogramSparse("WebCore.Animation.CSSProper
ties", UseCounter::mapCSSPropertyIdToCSSSampleIdForHistogram(property)); | 117 Platform::current()->histogramSparse("WebCore.Animation.CSSProperties",
UseCounter::mapCSSPropertyIdToCSSSampleIdForHistogram(property)); |
| 118 } | 118 } |
| 119 | 119 |
| 120 // Merge duplicate keyframes. | 120 // Merge duplicate keyframes. |
| 121 std::stable_sort(keyframes.begin(), keyframes.end(), Keyframe::compareOffset
s); | 121 std::stable_sort(keyframes.begin(), keyframes.end(), Keyframe::compareOffset
s); |
| 122 size_t targetIndex = 0; | 122 size_t targetIndex = 0; |
| 123 for (size_t i = 1; i < keyframes.size(); i++) { | 123 for (size_t i = 1; i < keyframes.size(); i++) { |
| 124 if (keyframes[i]->offset() == keyframes[targetIndex]->offset()) { | 124 if (keyframes[i]->offset() == keyframes[targetIndex]->offset()) { |
| 125 for (const auto& property : keyframes[i]->properties()) | 125 for (const auto& property : keyframes[i]->properties()) |
| 126 keyframes[targetIndex]->setPropertyValue(property.cssProperty(),
keyframes[i]->cssPropertyValue(property.cssProperty())); | 126 keyframes[targetIndex]->setPropertyValue(property.cssProperty(),
keyframes[i]->cssPropertyValue(property.cssProperty())); |
| 127 } else { | 127 } else { |
| (...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 440 } | 440 } |
| 441 } | 441 } |
| 442 | 442 |
| 443 RefPtrWillBeRawPtr<Animation> transition = Animation::create(element, ef
fect, inertAnimation->specifiedTiming(), Animation::TransitionPriority, eventDel
egate.release()); | 443 RefPtrWillBeRawPtr<Animation> transition = Animation::create(element, ef
fect, inertAnimation->specifiedTiming(), Animation::TransitionPriority, eventDel
egate.release()); |
| 444 transition->setName(inertAnimation->name()); | 444 transition->setName(inertAnimation->name()); |
| 445 RefPtrWillBeRawPtr<AnimationPlayer> player = element->document().timelin
e().play(transition.get()); | 445 RefPtrWillBeRawPtr<AnimationPlayer> player = element->document().timelin
e().play(transition.get()); |
| 446 player->update(TimingUpdateOnDemand); | 446 player->update(TimingUpdateOnDemand); |
| 447 runningTransition.player = player; | 447 runningTransition.player = player; |
| 448 m_transitions.set(id, runningTransition); | 448 m_transitions.set(id, runningTransition); |
| 449 ASSERT(id != CSSPropertyInvalid); | 449 ASSERT(id != CSSPropertyInvalid); |
| 450 blink::Platform::current()->histogramSparse("WebCore.Animation.CSSProper
ties", UseCounter::mapCSSPropertyIdToCSSSampleIdForHistogram(id)); | 450 Platform::current()->histogramSparse("WebCore.Animation.CSSProperties",
UseCounter::mapCSSPropertyIdToCSSSampleIdForHistogram(id)); |
| 451 } | 451 } |
| 452 } | 452 } |
| 453 | 453 |
| 454 void CSSAnimations::calculateTransitionUpdateForProperty(CSSPropertyID id, CSSPr
opertyID eventId, const CSSTransitionData& transitionData, size_t transitionInde
x, const ComputedStyle& oldStyle, const ComputedStyle& style, const TransitionMa
p* activeTransitions, CSSAnimationUpdate* update, const Element* element) | 454 void CSSAnimations::calculateTransitionUpdateForProperty(CSSPropertyID id, CSSPr
opertyID eventId, const CSSTransitionData& transitionData, size_t transitionInde
x, const ComputedStyle& oldStyle, const ComputedStyle& style, const TransitionMa
p* activeTransitions, CSSAnimationUpdate* update, const Element* element) |
| 455 { | 455 { |
| 456 RefPtrWillBeRawPtr<AnimatableValue> to = nullptr; | 456 RefPtrWillBeRawPtr<AnimatableValue> to = nullptr; |
| 457 if (activeTransitions) { | 457 if (activeTransitions) { |
| 458 TransitionMap::const_iterator activeTransitionIter = activeTransitions->
find(id); | 458 TransitionMap::const_iterator activeTransitionIter = activeTransitions->
find(id); |
| 459 if (activeTransitionIter != activeTransitions->end()) { | 459 if (activeTransitionIter != activeTransitions->end()) { |
| 460 to = CSSAnimatableValueFactory::create(id, style); | 460 to = CSSAnimatableValueFactory::create(id, style); |
| (...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 804 visitor->trace(m_activeInterpolationsForAnimations); | 804 visitor->trace(m_activeInterpolationsForAnimations); |
| 805 visitor->trace(m_activeInterpolationsForTransitions); | 805 visitor->trace(m_activeInterpolationsForTransitions); |
| 806 visitor->trace(m_newAnimations); | 806 visitor->trace(m_newAnimations); |
| 807 visitor->trace(m_suppressedAnimationPlayers); | 807 visitor->trace(m_suppressedAnimationPlayers); |
| 808 visitor->trace(m_animationsWithUpdates); | 808 visitor->trace(m_animationsWithUpdates); |
| 809 visitor->trace(m_animationsWithStyleUpdates); | 809 visitor->trace(m_animationsWithStyleUpdates); |
| 810 #endif | 810 #endif |
| 811 } | 811 } |
| 812 | 812 |
| 813 } // namespace blink | 813 } // namespace blink |
| OLD | NEW |