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 #include "core/page/PageAnimator.h" | 6 #include "core/page/PageAnimator.h" |
7 | 7 |
8 #include "core/animation/DocumentAnimations.h" | 8 #include "core/animation/DocumentAnimations.h" |
9 #include "core/dom/Document.h" | 9 #include "core/dom/Document.h" |
10 #include "core/frame/FrameView.h" | 10 #include "core/frame/FrameView.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 } | 23 } |
24 | 24 |
25 void PageAnimator::serviceScriptedAnimations(double monotonicAnimationStartTime) | 25 void PageAnimator::serviceScriptedAnimations(double monotonicAnimationStartTime) |
26 { | 26 { |
27 m_animationFramePending = false; | 27 m_animationFramePending = false; |
28 TemporaryChange<bool> servicing(m_servicingAnimations, true); | 28 TemporaryChange<bool> servicing(m_servicingAnimations, true); |
29 | 29 |
30 for (RefPtr<LocalFrame> frame = m_page->mainFrame(); frame; frame = frame->t
ree().traverseNext()) { | 30 for (RefPtr<LocalFrame> frame = m_page->mainFrame(); frame; frame = frame->t
ree().traverseNext()) { |
31 frame->view()->serviceScrollAnimations(); | 31 frame->view()->serviceScrollAnimations(); |
32 DocumentAnimations::updateAnimationTimingForAnimationFrame(*frame->docum
ent(), monotonicAnimationStartTime); | 32 DocumentAnimations::updateAnimationTimingForAnimationFrame(*frame->docum
ent(), monotonicAnimationStartTime); |
33 // FIXME: animation event dispatch should move to the ScriptedAnimationC
ontroller | |
34 DocumentAnimations::dispatchAnimationEvents(*frame->document()); | |
35 } | 33 } |
36 | 34 |
37 Vector<RefPtr<Document> > documents; | 35 Vector<RefPtr<Document> > documents; |
38 for (LocalFrame* frame = m_page->mainFrame(); frame; frame = frame->tree().t
raverseNext()) | 36 for (LocalFrame* frame = m_page->mainFrame(); frame; frame = frame->tree().t
raverseNext()) |
39 documents.append(frame->document()); | 37 documents.append(frame->document()); |
40 | 38 |
41 for (size_t i = 0; i < documents.size(); ++i) | 39 for (size_t i = 0; i < documents.size(); ++i) |
42 documents[i]->serviceScriptedAnimations(monotonicAnimationStartTime); | 40 documents[i]->serviceScriptedAnimations(monotonicAnimationStartTime); |
43 } | 41 } |
44 | 42 |
45 void PageAnimator::scheduleVisualUpdate() | 43 void PageAnimator::scheduleVisualUpdate() |
46 { | 44 { |
47 if (m_animationFramePending || m_servicingAnimations) | 45 if (m_animationFramePending || m_servicingAnimations) |
48 return; | 46 return; |
49 m_page->chrome().scheduleAnimation(); | 47 m_page->chrome().scheduleAnimation(); |
50 ASSERT(m_animationFramePending); | 48 ASSERT(m_animationFramePending); |
51 } | 49 } |
52 | 50 |
53 } | 51 } |
OLD | NEW |