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

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

Issue 273683005: Web Animations API: Deferred computation of interpolated values (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add missing test file Created 6 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/animation/StringKeyframe.cpp ('k') | Source/core/core.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 18 matching lines...) Expand all
29 */ 29 */
30 30
31 #include "config.h" 31 #include "config.h"
32 #include "core/animation/css/CSSAnimations.h" 32 #include "core/animation/css/CSSAnimations.h"
33 33
34 #include "StylePropertyShorthand.h" 34 #include "StylePropertyShorthand.h"
35 #include "core/animation/ActiveAnimations.h" 35 #include "core/animation/ActiveAnimations.h"
36 #include "core/animation/CompositorAnimations.h" 36 #include "core/animation/CompositorAnimations.h"
37 #include "core/animation/DocumentTimeline.h" 37 #include "core/animation/DocumentTimeline.h"
38 #include "core/animation/KeyframeEffectModel.h" 38 #include "core/animation/KeyframeEffectModel.h"
39 #include "core/animation/LegacyStyleInterpolation.h"
39 #include "core/animation/css/CSSAnimatableValueFactory.h" 40 #include "core/animation/css/CSSAnimatableValueFactory.h"
40 #include "core/animation/css/CSSAnimationDataList.h" 41 #include "core/animation/css/CSSAnimationDataList.h"
41 #include "core/animation/css/CSSPropertyEquality.h" 42 #include "core/animation/css/CSSPropertyEquality.h"
42 #include "core/css/CSSKeyframeRule.h" 43 #include "core/css/CSSKeyframeRule.h"
43 #include "core/css/resolver/StyleResolver.h" 44 #include "core/css/resolver/StyleResolver.h"
44 #include "core/dom/Element.h" 45 #include "core/dom/Element.h"
45 #include "core/dom/PseudoElement.h" 46 #include "core/dom/PseudoElement.h"
46 #include "core/events/TransitionEvent.h" 47 #include "core/events/TransitionEvent.h"
47 #include "core/events/WebKitAnimationEvent.h" 48 #include "core/events/WebKitAnimationEvent.h"
48 #include "core/frame/UseCounter.h" 49 #include "core/frame/UseCounter.h"
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after
435 436
436 AnimatableValueKeyframeVector newFrames; 437 AnimatableValueKeyframeVector newFrames;
437 newFrames.append(toAnimatableValueKeyframe(frames[0]->clone().get()) ); 438 newFrames.append(toAnimatableValueKeyframe(frames[0]->clone().get()) );
438 newFrames.append(toAnimatableValueKeyframe(frames[1]->clone().get()) ); 439 newFrames.append(toAnimatableValueKeyframe(frames[1]->clone().get()) );
439 440
440 newFrames[0]->clearPropertyValue(id); 441 newFrames[0]->clearPropertyValue(id);
441 RefPtr<InertAnimation> inertAnimationForSampling = InertAnimation::c reate(oldAnimation->effect(), oldAnimation->specifiedTiming(), false); 442 RefPtr<InertAnimation> inertAnimationForSampling = InertAnimation::c reate(oldAnimation->effect(), oldAnimation->specifiedTiming(), false);
442 OwnPtrWillBeRawPtr<WillBeHeapVector<RefPtrWillBeMember<Interpolation > > > sample = inertAnimationForSampling->sample(inheritedTime); 443 OwnPtrWillBeRawPtr<WillBeHeapVector<RefPtrWillBeMember<Interpolation > > > sample = inertAnimationForSampling->sample(inheritedTime);
443 ASSERT(sample->size() == 1); 444 ASSERT(sample->size() == 1);
444 newFrames[0]->setPropertyValue(id, toLegacyStyleInterpolation(sample ->at(0).get())->currentValue()); 445 newFrames[0]->setPropertyValue(id, toLegacyStyleInterpolation(sample ->at(0).get())->currentValue());
446 ASSERT(newFrames[0]->propertyValue(id));
445 447
446 effect = AnimatableValueKeyframeEffectModel::create(newFrames); 448 effect = AnimatableValueKeyframeEffectModel::create(newFrames);
447 } 449 }
448 450
449 RefPtr<Animation> transition = Animation::create(element, effect, inertA nimation->specifiedTiming(), Animation::TransitionPriority, eventDelegate.releas e()); 451 RefPtr<Animation> transition = Animation::create(element, effect, inertA nimation->specifiedTiming(), Animation::TransitionPriority, eventDelegate.releas e());
450 RefPtr<AnimationPlayer> player = element->document().transitionTimeline( ).createAnimationPlayer(transition.get()); 452 RefPtr<AnimationPlayer> player = element->document().transitionTimeline( ).createAnimationPlayer(transition.get());
451 element->document().compositorPendingAnimations().add(player.get()); 453 element->document().compositorPendingAnimations().add(player.get());
452 player->update(TimingUpdateOnDemand); 454 player->update(TimingUpdateOnDemand);
453 runningTransition.player = player; 455 runningTransition.player = player;
454 m_transitions.set(id, runningTransition); 456 m_transitions.set(id, runningTransition);
(...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after
892 } 894 }
893 895
894 void CSSAnimationUpdate::trace(Visitor* visitor) 896 void CSSAnimationUpdate::trace(Visitor* visitor)
895 { 897 {
896 visitor->trace(m_newTransitions); 898 visitor->trace(m_newTransitions);
897 visitor->trace(m_activeInterpolationsForAnimations); 899 visitor->trace(m_activeInterpolationsForAnimations);
898 visitor->trace(m_activeInterpolationsForTransitions); 900 visitor->trace(m_activeInterpolationsForTransitions);
899 } 901 }
900 902
901 } // namespace WebCore 903 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/animation/StringKeyframe.cpp ('k') | Source/core/core.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698