| 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 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 327 allOffsetsEqual = false; | 327 allOffsetsEqual = false; |
| 328 break; | 328 break; |
| 329 } | 329 } |
| 330 } | 330 } |
| 331 if (!allOffsetsEqual) | 331 if (!allOffsetsEqual) |
| 332 return; | 332 return; |
| 333 | 333 |
| 334 if (!offset) | 334 if (!offset) |
| 335 appendKeyframe(m_keyframes.first()->cloneWithOffset(1.0)); | 335 appendKeyframe(m_keyframes.first()->cloneWithOffset(1.0)); |
| 336 else | 336 else |
| 337 m_keyframes.insert(0, adoptPtr(new PropertySpecificKeyframe(0.0, 0, Anim
atableValue::neutralValue(), CompositeAdd))); | 337 m_keyframes.insert(0, adoptPtr(new PropertySpecificKeyframe(0.0, nullptr
, AnimatableValue::neutralValue(), CompositeAdd))); |
| 338 } | 338 } |
| 339 | 339 |
| 340 PassRefPtr<AnimationEffect::CompositableValue> KeyframeEffectModel::PropertySpec
ificKeyframeGroup::sample(int iteration, double offset) const | 340 PassRefPtr<AnimationEffect::CompositableValue> KeyframeEffectModel::PropertySpec
ificKeyframeGroup::sample(int iteration, double offset) const |
| 341 { | 341 { |
| 342 // FIXME: Implement accumulation. | 342 // FIXME: Implement accumulation. |
| 343 ASSERT_UNUSED(iteration, iteration >= 0); | 343 ASSERT_UNUSED(iteration, iteration >= 0); |
| 344 ASSERT(!isNull(offset)); | 344 ASSERT(!isNull(offset)); |
| 345 | 345 |
| 346 // Bail if offset is null, as this can lead to buffer overflow below. | 346 // Bail if offset is null, as this can lead to buffer overflow below. |
| 347 if (isNull(offset)) | 347 if (isNull(offset)) |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 383 if ((*after)->offset() == offset) | 383 if ((*after)->offset() == offset) |
| 384 return const_cast<CompositableValue*>((*after)->value()); | 384 return const_cast<CompositableValue*>((*after)->value()); |
| 385 | 385 |
| 386 double fraction = (offset - (*before)->offset()) / ((*after)->offset() - (*b
efore)->offset()); | 386 double fraction = (offset - (*before)->offset()) / ((*after)->offset() - (*b
efore)->offset()); |
| 387 if (const TimingFunction* timingFunction = (*before)->easing()) | 387 if (const TimingFunction* timingFunction = (*before)->easing()) |
| 388 fraction = timingFunction->evaluate(fraction, accuracyForKeyframeEasing)
; | 388 fraction = timingFunction->evaluate(fraction, accuracyForKeyframeEasing)
; |
| 389 return BlendedCompositableValue::create((*before)->value(), (*after)->value(
), fraction); | 389 return BlendedCompositableValue::create((*before)->value(), (*after)->value(
), fraction); |
| 390 } | 390 } |
| 391 | 391 |
| 392 } // namespace | 392 } // namespace |
| OLD | NEW |