| 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 18 matching lines...) Expand all Loading... |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #include "config.h" | 31 #include "config.h" |
| 32 #include "core/animation/KeyframeEffectModel.h" | 32 #include "core/animation/KeyframeEffectModel.h" |
| 33 | 33 |
| 34 #include "core/animation/TimedItem.h" | 34 #include "core/animation/TimedItem.h" |
| 35 #include "wtf/text/StringHash.h" | 35 #include "wtf/text/StringHash.h" |
| 36 | 36 |
| 37 namespace WebCore { | 37 namespace WebCore { |
| 38 | 38 |
| 39 bool Keyframe::compareOffsets(const RefPtrWillBeRawPtr<Keyframe>& a, const RefPt
rWillBeRawPtr<Keyframe>& b) | 39 bool Keyframe::compareOffsets(const RefPtrWillBeMember<Keyframe>& a, const RefPt
rWillBeMember<Keyframe>& b) |
| 40 { | 40 { |
| 41 return a->offset() < b->offset(); | 41 return a->offset() < b->offset(); |
| 42 } | 42 } |
| 43 | 43 |
| 44 PropertySet KeyframeEffectModelBase::properties() const | 44 PropertySet KeyframeEffectModelBase::properties() const |
| 45 { | 45 { |
| 46 PropertySet result; | 46 PropertySet result; |
| 47 if (!m_keyframes.size()) { | 47 if (!m_keyframes.size()) { |
| 48 return result; | 48 return result; |
| 49 } | 49 } |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 #endif | 207 #endif |
| 208 } | 208 } |
| 209 | 209 |
| 210 Keyframe::PropertySpecificKeyframe::PropertySpecificKeyframe(double offset, Pass
RefPtr<TimingFunction> easing, AnimationEffect::CompositeOperation composite) | 210 Keyframe::PropertySpecificKeyframe::PropertySpecificKeyframe(double offset, Pass
RefPtr<TimingFunction> easing, AnimationEffect::CompositeOperation composite) |
| 211 : m_offset(offset) | 211 : m_offset(offset) |
| 212 , m_easing(easing) | 212 , m_easing(easing) |
| 213 , m_composite(composite) | 213 , m_composite(composite) |
| 214 { | 214 { |
| 215 } | 215 } |
| 216 | 216 |
| 217 void KeyframeEffectModelBase::PropertySpecificKeyframeGroup::appendKeyframe(Pass
OwnPtr<PropertySpecificKeyframe> keyframe) | 217 void KeyframeEffectModelBase::PropertySpecificKeyframeGroup::appendKeyframe(Pass
OwnPtrWillBeRawPtr<Keyframe::PropertySpecificKeyframe> keyframe) |
| 218 { | 218 { |
| 219 ASSERT(m_keyframes.isEmpty() || m_keyframes.last()->offset() <= keyframe->of
fset()); | 219 ASSERT(m_keyframes.isEmpty() || m_keyframes.last()->offset() <= keyframe->of
fset()); |
| 220 m_keyframes.append(keyframe); | 220 m_keyframes.append(keyframe); |
| 221 } | 221 } |
| 222 | 222 |
| 223 void KeyframeEffectModelBase::PropertySpecificKeyframeGroup::removeRedundantKeyf
rames() | 223 void KeyframeEffectModelBase::PropertySpecificKeyframeGroup::removeRedundantKeyf
rames() |
| 224 { | 224 { |
| 225 // As an optimization, removes keyframes in the following categories, as | 225 // As an optimization, removes keyframes in the following categories, as |
| 226 // they will never be used by sample(). | 226 // they will never be used by sample(). |
| 227 // - End keyframes with the same offset as their neighbor | 227 // - End keyframes with the same offset as their neighbor |
| (...skipping 27 matching lines...) Expand all Loading... |
| 255 #endif | 255 #endif |
| 256 } | 256 } |
| 257 | 257 |
| 258 template <> | 258 template <> |
| 259 bool KeyframeEffectModel<AnimatableValueKeyframe>::isAnimatableValueKeyframeEffe
ctModel() const { return true; } | 259 bool KeyframeEffectModel<AnimatableValueKeyframe>::isAnimatableValueKeyframeEffe
ctModel() const { return true; } |
| 260 | 260 |
| 261 template <> | 261 template <> |
| 262 bool KeyframeEffectModel<StringKeyframe>::isStringKeyframeEffectModel() const {
return true; } | 262 bool KeyframeEffectModel<StringKeyframe>::isStringKeyframeEffectModel() const {
return true; } |
| 263 | 263 |
| 264 } // namespace | 264 } // namespace |
| OLD | NEW |