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

Side by Side Diff: third_party/WebKit/Source/core/animation/KeyframeEffectModel.cpp

Issue 1701813002: Make Keyframe::PropertySpecificKeyframes RefCounted (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: InvalidatableInterpolation RefPtrs Created 4 years, 10 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
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 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 } 228 }
229 } 229 }
230 return true; 230 return true;
231 } 231 }
232 232
233 Keyframe::PropertySpecificKeyframe::PropertySpecificKeyframe(double offset, Pass RefPtr<TimingFunction> easing, EffectModel::CompositeOperation composite) 233 Keyframe::PropertySpecificKeyframe::PropertySpecificKeyframe(double offset, Pass RefPtr<TimingFunction> easing, EffectModel::CompositeOperation composite)
234 : m_offset(offset) 234 : m_offset(offset)
235 , m_easing(easing) 235 , m_easing(easing)
236 , m_composite(composite) 236 , m_composite(composite)
237 { 237 {
238 ASSERT(!isNull(offset));
238 } 239 }
239 240
240 void KeyframeEffectModelBase::PropertySpecificKeyframeGroup::appendKeyframe(Pass OwnPtr<Keyframe::PropertySpecificKeyframe> keyframe) 241 void KeyframeEffectModelBase::PropertySpecificKeyframeGroup::appendKeyframe(Pass RefPtr<Keyframe::PropertySpecificKeyframe> keyframe)
241 { 242 {
242 ASSERT(m_keyframes.isEmpty() || m_keyframes.last()->offset() <= keyframe->of fset()); 243 ASSERT(m_keyframes.isEmpty() || m_keyframes.last()->offset() <= keyframe->of fset());
243 m_keyframes.append(std::move(keyframe)); 244 m_keyframes.append(keyframe);
244 } 245 }
245 246
246 void KeyframeEffectModelBase::PropertySpecificKeyframeGroup::removeRedundantKeyf rames() 247 void KeyframeEffectModelBase::PropertySpecificKeyframeGroup::removeRedundantKeyf rames()
247 { 248 {
248 // As an optimization, removes keyframes in the following categories, as 249 // As an optimization, removes keyframes in the following categories, as
249 // they will never be used by sample(). 250 // they will never be used by sample().
250 // - End keyframes with the same offset as their neighbor 251 // - End keyframes with the same offset as their neighbor
251 // - Interior keyframes with the same offset as both their neighbors 252 // - Interior keyframes with the same offset as both their neighbors
252 // Note that synthetic keyframes must be added before this method is 253 // Note that synthetic keyframes must be added before this method is
253 // called. 254 // called.
(...skipping 20 matching lines...) Expand all
274 } 275 }
275 if (m_keyframes.last()->offset() != 1.0) { 276 if (m_keyframes.last()->offset() != 1.0) {
276 appendKeyframe(m_keyframes.last()->neutralKeyframe(1, nullptr)); 277 appendKeyframe(m_keyframes.last()->neutralKeyframe(1, nullptr));
277 addedSyntheticKeyframe = true; 278 addedSyntheticKeyframe = true;
278 } 279 }
279 280
280 return addedSyntheticKeyframe; 281 return addedSyntheticKeyframe;
281 } 282 }
282 283
283 } // namespace blink 284 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698