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

Side by Side Diff: Source/core/animation/KeyframeEffectModel.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
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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 PropertySet KeyframeEffectModelBase::properties() const 42 PropertySet KeyframeEffectModelBase::properties() const
43 { 43 {
44 PropertySet result; 44 PropertySet result;
45 for (const auto& keyframe : m_keyframes) { 45 for (const auto& keyframe : m_keyframes) {
46 for (const auto& property : keyframe->properties()) 46 for (const auto& property : keyframe->properties())
47 result.add(property); 47 result.add(property);
48 } 48 }
49 return result; 49 return result;
50 } 50 }
51 51
52 PassOwnPtrWillBeRawPtr<WillBeHeapVector<RefPtrWillBeMember<Interpolation>>> Keyf rameEffectModelBase::sample(int iteration, double fraction, double iterationDura tion) const 52 void KeyframeEffectModelBase::sample(int iteration, double fraction, double iter ationDuration, OwnPtrWillBeRawPtr<WillBeHeapVector<RefPtrWillBeMember<Interpolat ion>>>& result) const
53 { 53 {
54 ASSERT(iteration >= 0); 54 ASSERT(iteration >= 0);
55 ASSERT(!isNull(fraction)); 55 ASSERT(!isNull(fraction));
56 ensureKeyframeGroups(); 56 ensureKeyframeGroups();
57 ensureInterpolationEffect(); 57 ensureInterpolationEffect();
58 58
59 return m_interpolationEffect->getActiveInterpolations(fraction, iterationDur ation); 59 return m_interpolationEffect->getActiveInterpolations(fraction, iterationDur ation, result);
60 } 60 }
61 61
62 KeyframeEffectModelBase::KeyframeVector KeyframeEffectModelBase::normalizedKeyfr ames(const KeyframeVector& keyframes) 62 KeyframeEffectModelBase::KeyframeVector KeyframeEffectModelBase::normalizedKeyfr ames(const KeyframeVector& keyframes)
63 { 63 {
64 double lastOffset = 0; 64 double lastOffset = 0;
65 KeyframeVector result; 65 KeyframeVector result;
66 result.reserveCapacity(keyframes.size()); 66 result.reserveCapacity(keyframes.size());
67 67
68 for (const auto& keyframe : keyframes) { 68 for (const auto& keyframe : keyframes) {
69 double offset = keyframe->offset(); 69 double offset = keyframe->offset();
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 } 214 }
215 215
216 void KeyframeEffectModelBase::PropertySpecificKeyframeGroup::trace(Visitor* visi tor) 216 void KeyframeEffectModelBase::PropertySpecificKeyframeGroup::trace(Visitor* visi tor)
217 { 217 {
218 #if ENABLE(OILPAN) 218 #if ENABLE(OILPAN)
219 visitor->trace(m_keyframes); 219 visitor->trace(m_keyframes);
220 #endif 220 #endif
221 } 221 }
222 222
223 } // namespace 223 } // namespace
OLDNEW
« no previous file with comments | « Source/core/animation/KeyframeEffectModel.h ('k') | Source/core/animation/KeyframeEffectModelTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698