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/frame/FrameView.h" | 9 #include "core/frame/FrameView.h" |
10 #include "core/frame/LocalFrame.h" | 10 #include "core/frame/LocalFrame.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 , m_servicingAnimations(false) | 21 , m_servicingAnimations(false) |
22 , m_updatingLayoutAndStyleForPainting(false) | 22 , m_updatingLayoutAndStyleForPainting(false) |
23 { | 23 { |
24 } | 24 } |
25 | 25 |
26 void PageAnimator::serviceScriptedAnimations(double monotonicAnimationStartTime) | 26 void PageAnimator::serviceScriptedAnimations(double monotonicAnimationStartTime) |
27 { | 27 { |
28 m_animationFramePending = false; | 28 m_animationFramePending = false; |
29 TemporaryChange<bool> servicing(m_servicingAnimations, true); | 29 TemporaryChange<bool> servicing(m_servicingAnimations, true); |
30 | 30 |
31 for (RefPtr<Frame> frame = m_page->mainFrame(); frame; frame = frame->tree()
.traverseNext()) { | |
32 if (frame->isLocalFrame()) { | |
33 RefPtr<LocalFrame> localFrame = toLocalFrame(frame.get()); | |
34 localFrame->view()->serviceScrollAnimations(monotonicAnimationStartT
ime); | |
35 | |
36 DocumentAnimations::updateAnimationTimingForAnimationFrame(*localFra
me->document(), monotonicAnimationStartTime); | |
37 SVGDocumentExtensions::serviceOnAnimationFrame(*localFrame->document
(), monotonicAnimationStartTime); | |
38 } | |
39 } | |
40 | |
41 WillBeHeapVector<RefPtrWillBeMember<Document> > documents; | 31 WillBeHeapVector<RefPtrWillBeMember<Document> > documents; |
42 for (Frame* frame = m_page->mainFrame(); frame; frame = frame->tree().traver
seNext()) { | 32 for (Frame* frame = m_page->mainFrame(); frame; frame = frame->tree().traver
seNext()) { |
43 if (frame->isLocalFrame()) | 33 if (frame->isLocalFrame()) |
44 documents.append(toLocalFrame(frame)->document()); | 34 documents.append(toLocalFrame(frame)->document()); |
45 } | 35 } |
46 | 36 |
| 37 for (size_t i = 0; i < documents.size(); ++i) { |
| 38 if (documents[i]->frame()) |
| 39 documents[i]->view()->serviceScrollAnimations(monotonicAnimationStar
tTime); |
| 40 } |
| 41 |
| 42 for (size_t i = 0; i < documents.size(); ++i) { |
| 43 DocumentAnimations::updateAnimationTimingForAnimationFrame(*documents[i]
, monotonicAnimationStartTime); |
| 44 SVGDocumentExtensions::serviceOnAnimationFrame(*documents[i], monotonicA
nimationStartTime); |
| 45 } |
| 46 |
47 for (size_t i = 0; i < documents.size(); ++i) | 47 for (size_t i = 0; i < documents.size(); ++i) |
48 documents[i]->serviceScriptedAnimations(monotonicAnimationStartTime); | 48 documents[i]->serviceScriptedAnimations(monotonicAnimationStartTime); |
49 } | 49 } |
50 | 50 |
51 void PageAnimator::scheduleVisualUpdate() | 51 void PageAnimator::scheduleVisualUpdate() |
52 { | 52 { |
53 // FIXME: also include m_animationFramePending here. It is currently not the
re due to crbug.com/353756. | 53 // FIXME: also include m_animationFramePending here. It is currently not the
re due to crbug.com/353756. |
54 if (m_servicingAnimations || m_updatingLayoutAndStyleForPainting) | 54 if (m_servicingAnimations || m_updatingLayoutAndStyleForPainting) |
55 return; | 55 return; |
56 m_page->chrome().scheduleAnimation(); | 56 m_page->chrome().scheduleAnimation(); |
(...skipping 12 matching lines...) Expand all Loading... |
69 // setFrameRect(). This will be a quick operation for most frames, but the | 69 // setFrameRect(). This will be a quick operation for most frames, but the |
70 // NativeWindowWidgets will update a proper clipping region. | 70 // NativeWindowWidgets will update a proper clipping region. |
71 view->setFrameRect(view->frameRect()); | 71 view->setFrameRect(view->frameRect()); |
72 | 72 |
73 // setFrameRect may have the side-effect of causing existing page layout to | 73 // setFrameRect may have the side-effect of causing existing page layout to |
74 // be invalidated, so layout needs to be called last. | 74 // be invalidated, so layout needs to be called last. |
75 view->updateLayoutAndStyleForPainting(); | 75 view->updateLayoutAndStyleForPainting(); |
76 } | 76 } |
77 | 77 |
78 } | 78 } |
OLD | NEW |