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 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 } | 261 } |
262 } | 262 } |
263 | 263 |
264 // Add synthetic keyframes. | 264 // Add synthetic keyframes. |
265 for (KeyframeGroupMap::iterator iter = m_keyframeGroups->begin(); iter != m_
keyframeGroups->end(); ++iter) { | 265 for (KeyframeGroupMap::iterator iter = m_keyframeGroups->begin(); iter != m_
keyframeGroups->end(); ++iter) { |
266 iter->value->addSyntheticKeyframeIfRequired(); | 266 iter->value->addSyntheticKeyframeIfRequired(); |
267 iter->value->removeRedundantKeyframes(); | 267 iter->value->removeRedundantKeyframes(); |
268 } | 268 } |
269 } | 269 } |
270 | 270 |
| 271 bool KeyframeEffectModel::isReplaceOnly() |
| 272 { |
| 273 ensureKeyframeGroups(); |
| 274 for (KeyframeGroupMap::iterator iter = m_keyframeGroups->begin(); iter != m_
keyframeGroups->end(); ++iter) { |
| 275 const PropertySpecificKeyframeVector& keyframeVector = iter->value->keyf
rames(); |
| 276 for (size_t i = 0; i < keyframeVector.size(); ++i) { |
| 277 if (keyframeVector[i]->value()->dependsOnUnderlyingValue()) { |
| 278 return false; |
| 279 } |
| 280 } |
| 281 } |
| 282 return true; |
| 283 } |
271 | 284 |
272 KeyframeEffectModel::PropertySpecificKeyframe::PropertySpecificKeyframe(double o
ffset, PassRefPtr<TimingFunction> easing, const AnimatableValue* value, Composit
eOperation composite) | 285 KeyframeEffectModel::PropertySpecificKeyframe::PropertySpecificKeyframe(double o
ffset, PassRefPtr<TimingFunction> easing, const AnimatableValue* value, Composit
eOperation composite) |
273 : m_offset(offset) | 286 : m_offset(offset) |
274 , m_easing(easing) | 287 , m_easing(easing) |
275 , m_value(composite == AnimationEffect::CompositeReplace ? | 288 , m_value(composite == AnimationEffect::CompositeReplace ? |
276 AnimatableValue::takeConstRef(value) : | 289 AnimatableValue::takeConstRef(value) : |
277 static_cast<PassRefPtr<CompositableValue> >(AddCompositableValue::create
(value))) | 290 static_cast<PassRefPtr<CompositableValue> >(AddCompositableValue::create
(value))) |
278 { | 291 { |
279 } | 292 } |
280 | 293 |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
388 fraction = timingFunction->evaluate(fraction, accuracyForKeyframeEasing)
; | 401 fraction = timingFunction->evaluate(fraction, accuracyForKeyframeEasing)
; |
389 return BlendedCompositableValue::create((*before)->value(), (*after)->value(
), fraction); | 402 return BlendedCompositableValue::create((*before)->value(), (*after)->value(
), fraction); |
390 } | 403 } |
391 | 404 |
392 void KeyframeEffectModel::trace(Visitor* visitor) | 405 void KeyframeEffectModel::trace(Visitor* visitor) |
393 { | 406 { |
394 visitor->trace(m_keyframes); | 407 visitor->trace(m_keyframes); |
395 } | 408 } |
396 | 409 |
397 } // namespace | 410 } // namespace |
OLD | NEW |