Commit 51e403bb authored by jamesr@chromium.org's avatar jamesr@chromium.org

Use floor time to limit requestAnimationFrame in compositing mode if there are no swaps pending

BUG=114914
TEST=load a page that triggers the compositor and uses rAF but doesn't
cause damage. the callback rate should still be ~60fps


Review URL: http://codereview.chromium.org/9567038

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@124731 0039d316-1c4b-4281-b951-d872f2087c98
parent eda4b2b2
...@@ -738,7 +738,11 @@ void RenderWidget::AnimateIfNeeded() { ...@@ -738,7 +738,11 @@ void RenderWidget::AnimateIfNeeded() {
base::TimeDelta::FromMilliseconds(16) : base::TimeDelta(); base::TimeDelta::FromMilliseconds(16) : base::TimeDelta();
base::Time now = base::Time::Now(); 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") TRACE_EVENT0("renderer", "RenderWidget::AnimateIfNeeded")
animation_floor_time_ = now + animationInterval; animation_floor_time_ = now + animationInterval;
// Set a timer to call us back after animationInterval before // Set a timer to call us back after animationInterval before
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment