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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
66 } | 66 } |
67 SVGDocumentExtensions::serviceOnAnimationFrame(*document); | 67 SVGDocumentExtensions::serviceOnAnimationFrame(*document); |
68 } | 68 } |
69 // TODO(skyostil): This function should not run for documents without views. | 69 // TODO(skyostil): This function should not run for documents without views. |
70 DocumentLifecycle::DisallowThrottlingScope noThrottlingScope( | 70 DocumentLifecycle::DisallowThrottlingScope noThrottlingScope( |
71 document->lifecycle()); | 71 document->lifecycle()); |
72 document->serviceScriptedAnimations(monotonicAnimationStartTime); | 72 document->serviceScriptedAnimations(monotonicAnimationStartTime); |
73 } | 73 } |
74 } | 74 } |
75 | 75 |
76 void PageAnimator::setSuppressFrameRequestsWorkaroundFor704763Only( | |
77 bool suppressFrameRequests) { | |
78 // If we are enabling the suppression and it was already enabled then we must | |
79 // have missed disabling it at the end of a previous frame. | |
80 DCHECK(!m_suppressFrameRequestsWorkaroundFor704763Only || | |
esprehn
2017/04/05 08:33:02
This could be != Instead of the or I think?
alancutter (OOO until 2018)
2017/04/05 10:04:18
It used to be but some tests call UpdateVisualStat
| |
81 !suppressFrameRequests); | |
82 m_suppressFrameRequestsWorkaroundFor704763Only = suppressFrameRequests; | |
83 } | |
84 | |
76 DISABLE_CFI_PERF | 85 DISABLE_CFI_PERF |
77 void PageAnimator::scheduleVisualUpdate(LocalFrame* frame) { | 86 void PageAnimator::scheduleVisualUpdate(LocalFrame* frame) { |
78 if (m_servicingAnimations || m_updatingLayoutAndStyleForPainting) | 87 if (m_servicingAnimations || m_updatingLayoutAndStyleForPainting || |
88 m_suppressFrameRequestsWorkaroundFor704763Only) { | |
79 return; | 89 return; |
90 } | |
80 m_page->chromeClient().scheduleAnimation(frame->view()); | 91 m_page->chromeClient().scheduleAnimation(frame->view()); |
81 } | 92 } |
82 | 93 |
83 void PageAnimator::updateAllLifecyclePhases(LocalFrame& rootFrame) { | 94 void PageAnimator::updateAllLifecyclePhases(LocalFrame& rootFrame) { |
84 FrameView* view = rootFrame.view(); | 95 FrameView* view = rootFrame.view(); |
85 AutoReset<bool> servicing(&m_updatingLayoutAndStyleForPainting, true); | 96 AutoReset<bool> servicing(&m_updatingLayoutAndStyleForPainting, true); |
86 view->updateAllLifecyclePhases(); | 97 view->updateAllLifecyclePhases(); |
87 } | 98 } |
88 | 99 |
89 } // namespace blink | 100 } // namespace blink |
OLD | NEW |