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/page/PageAnimator.h" | 5 #include "core/page/PageAnimator.h" |
6 | 6 |
7 #include "core/animation/DocumentAnimations.h" | 7 #include "core/animation/DocumentAnimations.h" |
8 #include "core/frame/FrameView.h" | 8 #include "core/frame/FrameView.h" |
9 #include "core/frame/LocalFrame.h" | 9 #include "core/frame/LocalFrame.h" |
10 #include "core/page/ChromeClient.h" | 10 #include "core/page/ChromeClient.h" |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 document->view()->getScrollableArea()->serviceScrollAnimations(monot
onicAnimationStartTime); | 50 document->view()->getScrollableArea()->serviceScrollAnimations(monot
onicAnimationStartTime); |
51 | 51 |
52 if (const FrameView::ScrollableAreaSet* animatingScrollableAreas = d
ocument->view()->animatingScrollableAreas()) { | 52 if (const FrameView::ScrollableAreaSet* animatingScrollableAreas = d
ocument->view()->animatingScrollableAreas()) { |
53 // Iterate over a copy, since ScrollableAreas may deregister | 53 // Iterate over a copy, since ScrollableAreas may deregister |
54 // themselves during the iteration. | 54 // themselves during the iteration. |
55 HeapVector<Member<ScrollableArea>> animatingScrollableAreasCopy; | 55 HeapVector<Member<ScrollableArea>> animatingScrollableAreasCopy; |
56 copyToVector(*animatingScrollableAreas, animatingScrollableAreas
Copy); | 56 copyToVector(*animatingScrollableAreas, animatingScrollableAreas
Copy); |
57 for (ScrollableArea* scrollableArea : animatingScrollableAreasCo
py) | 57 for (ScrollableArea* scrollableArea : animatingScrollableAreasCo
py) |
58 scrollableArea->serviceScrollAnimations(monotonicAnimationSt
artTime); | 58 scrollableArea->serviceScrollAnimations(monotonicAnimationSt
artTime); |
59 } | 59 } |
| 60 SVGDocumentExtensions::serviceOnAnimationFrame(*document); |
60 } | 61 } |
61 // TODO(skyostil): These functions should not run for documents without
views. | 62 // TODO(skyostil): This function should not run for documents without vi
ews. |
62 SVGDocumentExtensions::serviceOnAnimationFrame(*document, monotonicAnima
tionStartTime); | |
63 document->serviceScriptedAnimations(monotonicAnimationStartTime); | 63 document->serviceScriptedAnimations(monotonicAnimationStartTime); |
64 } | 64 } |
65 | 65 |
66 // Oilpan: This is performance optimization to promptly clear the backing | 66 // Oilpan: This is performance optimization to promptly clear the backing |
67 // storage of the vector and reuse it in the next PageAnimator::serviceScrip
tedAnimations. | 67 // storage of the vector and reuse it in the next PageAnimator::serviceScrip
tedAnimations. |
68 documents.clear(); | 68 documents.clear(); |
69 } | 69 } |
70 | 70 |
71 void PageAnimator::scheduleVisualUpdate(LocalFrame* frame) | 71 void PageAnimator::scheduleVisualUpdate(LocalFrame* frame) |
72 { | 72 { |
73 if (m_servicingAnimations || m_updatingLayoutAndStyleForPainting) | 73 if (m_servicingAnimations || m_updatingLayoutAndStyleForPainting) |
74 return; | 74 return; |
75 m_page->chromeClient().scheduleAnimation(frame->view()); | 75 m_page->chromeClient().scheduleAnimation(frame->view()); |
76 } | 76 } |
77 | 77 |
78 void PageAnimator::updateAllLifecyclePhases(LocalFrame& rootFrame) | 78 void PageAnimator::updateAllLifecyclePhases(LocalFrame& rootFrame) |
79 { | 79 { |
80 FrameView* view = rootFrame.view(); | 80 FrameView* view = rootFrame.view(); |
81 TemporaryChange<bool> servicing(m_updatingLayoutAndStyleForPainting, true); | 81 TemporaryChange<bool> servicing(m_updatingLayoutAndStyleForPainting, true); |
82 view->updateAllLifecyclePhases(); | 82 view->updateAllLifecyclePhases(); |
83 } | 83 } |
84 | 84 |
85 } // namespace blink | 85 } // namespace blink |
OLD | NEW |