| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "config.h" | 5 #include "config.h" |
| 6 | 6 |
| 7 #include "core/inspector/InspectorAnimationAgent.h" | 7 #include "core/inspector/InspectorAnimationAgent.h" |
| 8 | 8 |
| 9 #include "core/animation/Animation.h" | 9 #include "core/animation/Animation.h" |
| 10 #include "core/animation/AnimationEffect.h" | 10 #include "core/animation/AnimationEffect.h" |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 // Refer to CSSAnimations::calculateTransitionUpdateForProperty() for th
e structure of transitions. | 215 // Refer to CSSAnimations::calculateTransitionUpdateForProperty() for th
e structure of transitions. |
| 216 const KeyframeVector& frames = oldModel->getFrames(); | 216 const KeyframeVector& frames = oldModel->getFrames(); |
| 217 ASSERT(frames.size() == 3); | 217 ASSERT(frames.size() == 3); |
| 218 KeyframeVector newFrames; | 218 KeyframeVector newFrames; |
| 219 for (int i = 0; i < 3; i++) | 219 for (int i = 0; i < 3; i++) |
| 220 newFrames.append(toAnimatableValueKeyframe(frames[i]->clone().get())
); | 220 newFrames.append(toAnimatableValueKeyframe(frames[i]->clone().get())
); |
| 221 // Update delay, represented by the distance between the first two keyfr
ames. | 221 // Update delay, represented by the distance between the first two keyfr
ames. |
| 222 newFrames[1]->setOffset(delay / (delay + duration)); | 222 newFrames[1]->setOffset(delay / (delay + duration)); |
| 223 model->setFrames(newFrames); | 223 model->setFrames(newFrames); |
| 224 | 224 |
| 225 RefPtrWillBeRawPtr<AnimationEffectTiming> timing = animation->effect()->
timing(); | 225 AnimationEffectTiming* timing = animation->effect()->timing(); |
| 226 UnrestrictedDoubleOrString unrestrictedDuration; | 226 UnrestrictedDoubleOrString unrestrictedDuration; |
| 227 unrestrictedDuration.setUnrestrictedDouble(duration + delay); | 227 unrestrictedDuration.setUnrestrictedDouble(duration + delay); |
| 228 timing->setDuration(unrestrictedDuration); | 228 timing->setDuration(unrestrictedDuration); |
| 229 } else if (type == AnimationType::WebAnimation) { | 229 } else if (type == AnimationType::WebAnimation) { |
| 230 RefPtrWillBeRawPtr<AnimationEffectTiming> timing = animation->effect()->
timing(); | 230 AnimationEffectTiming* timing = animation->effect()->timing(); |
| 231 UnrestrictedDoubleOrString unrestrictedDuration; | 231 UnrestrictedDoubleOrString unrestrictedDuration; |
| 232 unrestrictedDuration.setUnrestrictedDouble(duration); | 232 unrestrictedDuration.setUnrestrictedDouble(duration); |
| 233 timing->setDuration(unrestrictedDuration); | 233 timing->setDuration(unrestrictedDuration); |
| 234 timing->setDelay(delay); | 234 timing->setDelay(delay); |
| 235 } | 235 } |
| 236 } | 236 } |
| 237 | 237 |
| 238 void InspectorAnimationAgent::didCreateAnimation(Animation* animation) | 238 void InspectorAnimationAgent::didCreateAnimation(Animation* animation) |
| 239 { | 239 { |
| 240 const String& animationId = String::number(animation->sequenceNumber()); | 240 const String& animationId = String::number(animation->sequenceNumber()); |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 295 #if ENABLE(OILPAN) | 295 #if ENABLE(OILPAN) |
| 296 visitor->trace(m_pageAgent); | 296 visitor->trace(m_pageAgent); |
| 297 visitor->trace(m_domAgent); | 297 visitor->trace(m_domAgent); |
| 298 visitor->trace(m_idToAnimation); | 298 visitor->trace(m_idToAnimation); |
| 299 visitor->trace(m_idToAnimationType); | 299 visitor->trace(m_idToAnimationType); |
| 300 #endif | 300 #endif |
| 301 InspectorBaseAgent::trace(visitor); | 301 InspectorBaseAgent::trace(visitor); |
| 302 } | 302 } |
| 303 | 303 |
| 304 } | 304 } |
| OLD | NEW |