| Index: third_party/WebKit/Source/core/page/PageAnimator.cpp
|
| diff --git a/third_party/WebKit/Source/core/page/PageAnimator.cpp b/third_party/WebKit/Source/core/page/PageAnimator.cpp
|
| index b1a1f1daa2ffbed00cf4c0e51f36a9a9e80897b8..e94db670320d88a2b39b702d4d17be859eac3891 100644
|
| --- a/third_party/WebKit/Source/core/page/PageAnimator.cpp
|
| +++ b/third_party/WebKit/Source/core/page/PageAnimator.cpp
|
| @@ -15,10 +15,7 @@
|
|
|
| namespace blink {
|
|
|
| -PageAnimator::PageAnimator(Page& page)
|
| - : m_page(page),
|
| - m_servicingAnimations(false),
|
| - m_updatingLayoutAndStyleForPainting(false) {}
|
| +PageAnimator::PageAnimator(Page& page) : m_page(page) {}
|
|
|
| PageAnimator* PageAnimator::create(Page& page) {
|
| return new PageAnimator(page);
|
| @@ -31,6 +28,8 @@ DEFINE_TRACE(PageAnimator) {
|
| void PageAnimator::serviceScriptedAnimations(
|
| double monotonicAnimationStartTime) {
|
| AutoReset<bool> servicing(&m_servicingAnimations, true);
|
| + FrameRequestSuppressionScope suppressFrameRequests(this);
|
| +
|
| clock().updateTime(monotonicAnimationStartTime);
|
|
|
| HeapVector<Member<Document>, 32> documents;
|
| @@ -75,15 +74,31 @@ void PageAnimator::serviceScriptedAnimations(
|
|
|
| DISABLE_CFI_PERF
|
| void PageAnimator::scheduleVisualUpdate(LocalFrame* frame) {
|
| - if (m_servicingAnimations || m_updatingLayoutAndStyleForPainting)
|
| + if (m_frameRequestSuppressionDepth > 0) {
|
| return;
|
| + }
|
| m_page->chromeClient().scheduleAnimation(frame->view());
|
| }
|
|
|
| void PageAnimator::updateAllLifecyclePhases(LocalFrame& rootFrame) {
|
| FrameView* view = rootFrame.view();
|
| - AutoReset<bool> servicing(&m_updatingLayoutAndStyleForPainting, true);
|
| + FrameRequestSuppressionScope suppressFrameRequests(this);
|
| +
|
| view->updateAllLifecyclePhases();
|
| }
|
|
|
| +PageAnimator::FrameRequestSuppressionScope::FrameRequestSuppressionScope(
|
| + PageAnimator* pageAnimator)
|
| + : m_pageAnimator(pageAnimator) {
|
| + if (m_pageAnimator) {
|
| + m_pageAnimator->m_frameRequestSuppressionDepth++;
|
| + }
|
| +}
|
| +
|
| +PageAnimator::FrameRequestSuppressionScope::~FrameRequestSuppressionScope() {
|
| + if (m_pageAnimator) {
|
| + m_pageAnimator->m_frameRequestSuppressionDepth--;
|
| + }
|
| +}
|
| +
|
| } // namespace blink
|
|
|