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

Unified Diff: content/renderer/render_widget.cc

Issue 9567038: Use floor time to limit requestAnimationFrame in compositing mode if there are no swaps pending (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 10 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_widget.cc
diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc
index ca73dfea0d4df883853532ce28e4b69d691cc631..2b1e8c5fdf65c154edba197b7848ffabedd4d6c6 100644
--- a/content/renderer/render_widget.cc
+++ b/content/renderer/render_widget.cc
@@ -724,7 +724,11 @@ void RenderWidget::AnimateIfNeeded() {
base::TimeDelta::FromMilliseconds(16) : base::TimeDelta();
base::Time now = base::Time::Now();
- if (now >= animation_floor_time_ || is_accelerated_compositing_active_) {
+
+ // animation_floor_time_ is the earliest time that we should animate when
+ // using the dead reckoning software scheduler. If we're using swapbuffers
+ // complete callbacks to rate limit, we can ignore this floor.
+ if (now >= animation_floor_time_ || num_swapbuffers_complete_pending_ > 0) {
TRACE_EVENT0("renderer", "RenderWidget::AnimateIfNeeded")
animation_floor_time_ = now + animationInterval;
// Set a timer to call us back after animationInterval before
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698