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

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

Issue 732153003: Update a result vector when sampling animation effects. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 1 month 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
« no previous file with comments | « Source/core/animation/SampledEffect.h ('k') | no next file » | 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 371 matching lines...) Expand 10 before | Expand all | Expand 10 after
382 382
383 AnimatableValueKeyframeEffectModel* oldEffect = toAnimatableValueKey frameEffectModel(inertAnimation->effect()); 383 AnimatableValueKeyframeEffectModel* oldEffect = toAnimatableValueKey frameEffectModel(inertAnimation->effect());
384 const KeyframeVector& frames = oldEffect->getFrames(); 384 const KeyframeVector& frames = oldEffect->getFrames();
385 385
386 AnimatableValueKeyframeVector newFrames; 386 AnimatableValueKeyframeVector newFrames;
387 newFrames.append(toAnimatableValueKeyframe(frames[0]->clone().get()) ); 387 newFrames.append(toAnimatableValueKeyframe(frames[0]->clone().get()) );
388 newFrames.append(toAnimatableValueKeyframe(frames[1]->clone().get()) ); 388 newFrames.append(toAnimatableValueKeyframe(frames[1]->clone().get()) );
389 389
390 newFrames[0]->clearPropertyValue(id); 390 newFrames[0]->clearPropertyValue(id);
391 RefPtrWillBeRawPtr<InertAnimation> inertAnimationForSampling = Inert Animation::create(oldAnimation->effect(), oldAnimation->specifiedTiming(), false ); 391 RefPtrWillBeRawPtr<InertAnimation> inertAnimationForSampling = Inert Animation::create(oldAnimation->effect(), oldAnimation->specifiedTiming(), false );
392 OwnPtrWillBeRawPtr<WillBeHeapVector<RefPtrWillBeMember<Interpolation >>> sample = inertAnimationForSampling->sample(inheritedTime); 392 OwnPtrWillBeRawPtr<WillBeHeapVector<RefPtrWillBeMember<Interpolation >>> sample = nullptr;
393 ASSERT(sample->size() == 1); 393 inertAnimationForSampling->sample(inheritedTime, sample);
394 ASSERT(sample && sample->size() == 1);
394 newFrames[0]->setPropertyValue(id, toLegacyStyleInterpolation(sample ->at(0).get())->currentValue()); 395 newFrames[0]->setPropertyValue(id, toLegacyStyleInterpolation(sample ->at(0).get())->currentValue());
395 396
396 effect = AnimatableValueKeyframeEffectModel::create(newFrames); 397 effect = AnimatableValueKeyframeEffectModel::create(newFrames);
397 } 398 }
398 399
399 RefPtrWillBeRawPtr<Animation> transition = Animation::create(element, ef fect, inertAnimation->specifiedTiming(), Animation::TransitionPriority, eventDel egate.release()); 400 RefPtrWillBeRawPtr<Animation> transition = Animation::create(element, ef fect, inertAnimation->specifiedTiming(), Animation::TransitionPriority, eventDel egate.release());
400 transition->setName(inertAnimation->name()); 401 transition->setName(inertAnimation->name());
401 RefPtrWillBeRawPtr<AnimationPlayer> player = element->document().timelin e().createAnimationPlayer(transition.get()); 402 RefPtrWillBeRawPtr<AnimationPlayer> player = element->document().timelin e().createAnimationPlayer(transition.get());
402 player->update(TimingUpdateOnDemand); 403 player->update(TimingUpdateOnDemand);
403 runningTransition.player = player; 404 runningTransition.player = player;
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after
736 #if ENABLE(OILPAN) 737 #if ENABLE(OILPAN)
737 visitor->trace(m_newTransitions); 738 visitor->trace(m_newTransitions);
738 visitor->trace(m_activeInterpolationsForAnimations); 739 visitor->trace(m_activeInterpolationsForAnimations);
739 visitor->trace(m_activeInterpolationsForTransitions); 740 visitor->trace(m_activeInterpolationsForTransitions);
740 visitor->trace(m_newAnimations); 741 visitor->trace(m_newAnimations);
741 visitor->trace(m_cancelledAnimationPlayers); 742 visitor->trace(m_cancelledAnimationPlayers);
742 #endif 743 #endif
743 } 744 }
744 745
745 } // namespace blink 746 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/animation/SampledEffect.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698