| 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 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 322 else | 322 else |
| 323 player->pause(); | 323 player->pause(); |
| 324 if (player->outdated()) | 324 if (player->outdated()) |
| 325 player->update(TimingUpdateOnDemand); | 325 player->update(TimingUpdateOnDemand); |
| 326 } | 326 } |
| 327 | 327 |
| 328 for (WillBeHeapVector<CSSAnimationUpdate::NewAnimation>::const_iterator iter
= update->newAnimations().begin(); iter != update->newAnimations().end(); ++ite
r) { | 328 for (WillBeHeapVector<CSSAnimationUpdate::NewAnimation>::const_iterator iter
= update->newAnimations().begin(); iter != update->newAnimations().end(); ++ite
r) { |
| 329 const InertAnimation* inertAnimation = iter->animation.get(); | 329 const InertAnimation* inertAnimation = iter->animation.get(); |
| 330 OwnPtrWillBeRawPtr<AnimationEventDelegate> eventDelegate = adoptPtrWillB
eNoop(new AnimationEventDelegate(element, iter->name)); | 330 OwnPtrWillBeRawPtr<AnimationEventDelegate> eventDelegate = adoptPtrWillB
eNoop(new AnimationEventDelegate(element, iter->name)); |
| 331 RefPtrWillBeRawPtr<Animation> animation = Animation::create(element, ine
rtAnimation->effect(), inertAnimation->specifiedTiming(), Animation::DefaultPrio
rity, eventDelegate.release()); | 331 RefPtrWillBeRawPtr<Animation> animation = Animation::create(element, ine
rtAnimation->effect(), inertAnimation->specifiedTiming(), Animation::DefaultPrio
rity, eventDelegate.release()); |
| 332 animation->setName(inertAnimation->name()); |
| 332 RefPtrWillBeRawPtr<AnimationPlayer> player = element->document().timelin
e().createAnimationPlayer(animation.get()); | 333 RefPtrWillBeRawPtr<AnimationPlayer> player = element->document().timelin
e().createAnimationPlayer(animation.get()); |
| 333 if (inertAnimation->paused()) | 334 if (inertAnimation->paused()) |
| 334 player->pause(); | 335 player->pause(); |
| 335 player->update(TimingUpdateOnDemand); | 336 player->update(TimingUpdateOnDemand); |
| 336 m_animations.set(iter->name, player.get()); | 337 m_animations.set(iter->name, player.get()); |
| 337 } | 338 } |
| 338 | 339 |
| 339 // Transitions that are run on the compositor only update main-thread state | 340 // Transitions that are run on the compositor only update main-thread state |
| 340 // lazily. However, we need the new state to know what the from state shoud | 341 // lazily. However, we need the new state to know what the from state shoud |
| 341 // be when transitions are retargeted. Instead of triggering complete style | 342 // be when transitions are retargeted. Instead of triggering complete style |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 383 newFrames[0]->clearPropertyValue(id); | 384 newFrames[0]->clearPropertyValue(id); |
| 384 RefPtrWillBeRawPtr<InertAnimation> inertAnimationForSampling = Inert
Animation::create(oldAnimation->effect(), oldAnimation->specifiedTiming(), false
); | 385 RefPtrWillBeRawPtr<InertAnimation> inertAnimationForSampling = Inert
Animation::create(oldAnimation->effect(), oldAnimation->specifiedTiming(), false
); |
| 385 OwnPtrWillBeRawPtr<WillBeHeapVector<RefPtrWillBeMember<Interpolation
> > > sample = inertAnimationForSampling->sample(inheritedTime); | 386 OwnPtrWillBeRawPtr<WillBeHeapVector<RefPtrWillBeMember<Interpolation
> > > sample = inertAnimationForSampling->sample(inheritedTime); |
| 386 ASSERT(sample->size() == 1); | 387 ASSERT(sample->size() == 1); |
| 387 newFrames[0]->setPropertyValue(id, toLegacyStyleInterpolation(sample
->at(0).get())->currentValue()); | 388 newFrames[0]->setPropertyValue(id, toLegacyStyleInterpolation(sample
->at(0).get())->currentValue()); |
| 388 | 389 |
| 389 effect = AnimatableValueKeyframeEffectModel::create(newFrames); | 390 effect = AnimatableValueKeyframeEffectModel::create(newFrames); |
| 390 } | 391 } |
| 391 | 392 |
| 392 RefPtrWillBeRawPtr<Animation> transition = Animation::create(element, ef
fect, inertAnimation->specifiedTiming(), Animation::TransitionPriority, eventDel
egate.release()); | 393 RefPtrWillBeRawPtr<Animation> transition = Animation::create(element, ef
fect, inertAnimation->specifiedTiming(), Animation::TransitionPriority, eventDel
egate.release()); |
| 394 transition->setName(inertAnimation->name()); |
| 393 RefPtrWillBeRawPtr<AnimationPlayer> player = element->document().timelin
e().createAnimationPlayer(transition.get()); | 395 RefPtrWillBeRawPtr<AnimationPlayer> player = element->document().timelin
e().createAnimationPlayer(transition.get()); |
| 394 player->update(TimingUpdateOnDemand); | 396 player->update(TimingUpdateOnDemand); |
| 395 runningTransition.player = player; | 397 runningTransition.player = player; |
| 396 m_transitions.set(id, runningTransition); | 398 m_transitions.set(id, runningTransition); |
| 397 ASSERT(id != CSSPropertyInvalid); | 399 ASSERT(id != CSSPropertyInvalid); |
| 398 blink::Platform::current()->histogramSparse("WebCore.Animation.CSSProper
ties", UseCounter::mapCSSPropertyIdToCSSSampleIdForHistogram(id)); | 400 blink::Platform::current()->histogramSparse("WebCore.Animation.CSSProper
ties", UseCounter::mapCSSPropertyIdToCSSSampleIdForHistogram(id)); |
| 399 } | 401 } |
| 400 } | 402 } |
| 401 | 403 |
| 402 void CSSAnimations::calculateTransitionUpdateForProperty(CSSPropertyID id, CSSPr
opertyID eventId, const CSSTransitionData& transitionData, size_t transitionInde
x, const RenderStyle& oldStyle, const RenderStyle& style, const TransitionMap* a
ctiveTransitions, CSSAnimationUpdate* update, const Element* element) | 404 void CSSAnimations::calculateTransitionUpdateForProperty(CSSPropertyID id, CSSPr
opertyID eventId, const CSSTransitionData& transitionData, size_t transitionInde
x, const RenderStyle& oldStyle, const RenderStyle& style, const TransitionMap* a
ctiveTransitions, CSSAnimationUpdate* update, const Element* element) |
| (...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 728 #if ENABLE(OILPAN) | 730 #if ENABLE(OILPAN) |
| 729 visitor->trace(m_newTransitions); | 731 visitor->trace(m_newTransitions); |
| 730 visitor->trace(m_activeInterpolationsForAnimations); | 732 visitor->trace(m_activeInterpolationsForAnimations); |
| 731 visitor->trace(m_activeInterpolationsForTransitions); | 733 visitor->trace(m_activeInterpolationsForTransitions); |
| 732 visitor->trace(m_newAnimations); | 734 visitor->trace(m_newAnimations); |
| 733 visitor->trace(m_cancelledAnimationPlayers); | 735 visitor->trace(m_cancelledAnimationPlayers); |
| 734 #endif | 736 #endif |
| 735 } | 737 } |
| 736 | 738 |
| 737 } // namespace blink | 739 } // namespace blink |
| OLD | NEW |