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 "core/inspector/InspectorAnimationAgent.h" | 5 #include "core/inspector/InspectorAnimationAgent.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include "bindings/core/v8/V8BindingForCore.h" | 8 #include "bindings/core/v8/V8BindingForCore.h" |
9 #include "core/animation/Animation.h" | 9 #include "core/animation/Animation.h" |
10 #include "core/animation/AnimationEffectReadOnly.h" | 10 #include "core/animation/AnimationEffectReadOnly.h" |
(...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
541 } | 541 } |
542 | 542 |
543 Response InspectorAnimationAgent::AssertAnimation(const String& id, | 543 Response InspectorAnimationAgent::AssertAnimation(const String& id, |
544 blink::Animation*& result) { | 544 blink::Animation*& result) { |
545 result = id_to_animation_.at(id); | 545 result = id_to_animation_.at(id); |
546 if (!result) | 546 if (!result) |
547 return Response::Error("Could not find animation with given id"); | 547 return Response::Error("Could not find animation with given id"); |
548 return Response::OK(); | 548 return Response::OK(); |
549 } | 549 } |
550 | 550 |
551 AnimationTimeline& InspectorAnimationAgent::ReferenceTimeline() { | 551 DocumentTimeline& InspectorAnimationAgent::ReferenceTimeline() { |
552 return inspected_frames_->Root()->GetDocument()->Timeline(); | 552 return inspected_frames_->Root()->GetDocument()->Timeline(); |
553 } | 553 } |
554 | 554 |
555 double InspectorAnimationAgent::NormalizedStartTime( | 555 double InspectorAnimationAgent::NormalizedStartTime( |
556 blink::Animation& animation) { | 556 blink::Animation& animation) { |
557 if (ReferenceTimeline().PlaybackRate() == 0) { | 557 if (ReferenceTimeline().PlaybackRate() == 0) { |
558 return animation.startTime() + ReferenceTimeline().currentTime() - | 558 return animation.startTime() + ReferenceTimeline().currentTime() - |
559 animation.TimelineInternal()->currentTime(); | 559 animation.TimelineInternal()->currentTime(); |
560 } | 560 } |
561 return animation.startTime() + (animation.TimelineInternal()->ZeroTime() - | 561 return animation.startTime() + (animation.TimelineInternal()->ZeroTime() - |
562 ReferenceTimeline().ZeroTime()) * | 562 ReferenceTimeline().ZeroTime()) * |
563 1000 * ReferenceTimeline().PlaybackRate(); | 563 1000 * ReferenceTimeline().PlaybackRate(); |
564 } | 564 } |
565 | 565 |
566 DEFINE_TRACE(InspectorAnimationAgent) { | 566 DEFINE_TRACE(InspectorAnimationAgent) { |
567 visitor->Trace(inspected_frames_); | 567 visitor->Trace(inspected_frames_); |
568 visitor->Trace(css_agent_); | 568 visitor->Trace(css_agent_); |
569 visitor->Trace(id_to_animation_); | 569 visitor->Trace(id_to_animation_); |
570 visitor->Trace(id_to_animation_clone_); | 570 visitor->Trace(id_to_animation_clone_); |
571 InspectorBaseAgent::Trace(visitor); | 571 InspectorBaseAgent::Trace(visitor); |
572 } | 572 } |
573 | 573 |
574 } // namespace blink | 574 } // namespace blink |
OLD | NEW |