Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(706)

Unified Diff: third_party/WebKit/Source/core/page/PageAnimator.cpp

Issue 1364063007: Throttle rendering pipeline for invisible frames (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Early-out for intersection update walk. Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 93b0e21b80b05b9b7dfee899b61685aae28cf4b0..915150a9865084637564ecb8d1501b697f8172a0 100644
--- a/third_party/WebKit/Source/core/page/PageAnimator.cpp
+++ b/third_party/WebKit/Source/core/page/PageAnimator.cpp
@@ -44,7 +44,10 @@ void PageAnimator::serviceScriptedAnimations(double monotonicAnimationStartTime)
}
for (auto& document : documents) {
+ DocumentAnimations::updateAnimationTimingForAnimationFrame(*document, monotonicAnimationStartTime);
if (document->view()) {
+ if (document->view()->shouldThrottleRendering())
+ continue;
document->view()->scrollableArea()->serviceScrollAnimations(monotonicAnimationStartTime);
if (const FrameView::ScrollableAreaSet* animatingScrollableAreas = document->view()->animatingScrollableAreas()) {
@@ -56,7 +59,7 @@ void PageAnimator::serviceScriptedAnimations(double monotonicAnimationStartTime)
scrollableArea->serviceScrollAnimations(monotonicAnimationStartTime);
}
}
- DocumentAnimations::updateAnimationTimingForAnimationFrame(*document, monotonicAnimationStartTime);
+ // TODO(skyostil): Find out if these functions need to be run for documents without views.
SVGDocumentExtensions::serviceOnAnimationFrame(*document, monotonicAnimationStartTime);
document->serviceScriptedAnimations(monotonicAnimationStartTime);
}
@@ -91,7 +94,7 @@ void PageAnimator::updateLayoutAndStyleForPainting(LocalFrame* rootFrame)
// setFrameRect may have the side-effect of causing existing page layout to
// be invalidated, so layout needs to be called last.
- view->updateAllLifecyclePhases();
+ view->updateAllLifecyclePhases(DocumentLifecycle::ThrottlingMode::Allow);
esprehn 2015/10/14 22:09:46 DocumentLifecycle::ThrottleAllowedScope on the sta
Sami 2015/10/16 16:48:09 Done.
}
}

Powered by Google App Engine
This is Rietveld 408576698