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

Side by Side Diff: cc/scheduler/scheduler.cc

Issue 22354007: cc: Add queue of BeginFrames to support long deadlines. (Closed) Base URL: http://git.chromium.org/chromium/src.git@deferredCommit
Patch Set: Created 7 years, 4 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 unified diff | Download patch
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 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 "cc/scheduler/scheduler.h" 5 #include "cc/scheduler/scheduler.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include "base/auto_reset.h" 8 #include "base/auto_reset.h"
9 #include "base/debug/trace_event.h" 9 #include "base/debug/trace_event.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 // We are ready to draw a new active tree immediately. 188 // We are ready to draw a new active tree immediately.
189 PostBeginFrameDeadline(base::TimeTicks()); 189 PostBeginFrameDeadline(base::TimeTicks());
190 } else if (state_machine_.needs_redraw()) { 190 } else if (state_machine_.needs_redraw()) {
191 // We have an animation or fast input path on the impl thread that wants 191 // We have an animation or fast input path on the impl thread that wants
192 // to draw, so don't wait too long for a new active tree. 192 // to draw, so don't wait too long for a new active tree.
193 PostBeginFrameDeadline(last_begin_frame_args_.deadline); 193 PostBeginFrameDeadline(last_begin_frame_args_.deadline);
194 } else { 194 } else {
195 // The impl thread doesn't have anything it wants to draw and we are just 195 // The impl thread doesn't have anything it wants to draw and we are just
196 // waiting for a new active tree, so post the deadline for the next 196 // waiting for a new active tree, so post the deadline for the next
197 // expected BeginFrame start. 197 // expected BeginFrame start.
198 PostBeginFrameDeadline(last_begin_frame_args_.frame_time + 198 //PostBeginFrameDeadline(last_begin_frame_args_.frame_time + last_begin_fram e_args_.interval);
199 last_begin_frame_args_.interval); 199 PostBeginFrameDeadline(last_begin_frame_args_.deadline);
200 } 200 }
201 } 201 }
202 202
203 void Scheduler::PostBeginFrameDeadline(base::TimeTicks deadline) { 203 void Scheduler::PostBeginFrameDeadline(base::TimeTicks deadline) {
204 begin_frame_deadline_closure_.Cancel(); 204 begin_frame_deadline_closure_.Cancel();
205 begin_frame_deadline_closure_.Reset( 205 begin_frame_deadline_closure_.Reset(
206 base::Bind(&Scheduler::OnBeginFrameDeadline, weak_factory_.GetWeakPtr())); 206 base::Bind(&Scheduler::OnBeginFrameDeadline, weak_factory_.GetWeakPtr()));
207 client_->PostBeginFrameDeadline( 207 client_->PostBeginFrameDeadline(
208 begin_frame_deadline_closure_.callback(), deadline); 208 begin_frame_deadline_closure_.callback(), deadline);
209 } 209 }
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 state_machine_.AdvanceBeginFrameStateWhenNoActionsRemain(); 286 state_machine_.AdvanceBeginFrameStateWhenNoActionsRemain();
287 SetupNextBeginFrameIfNeeded(); 287 SetupNextBeginFrameIfNeeded();
288 client_->DidAnticipatedDrawTimeChange(AnticipatedDrawTime()); 288 client_->DidAnticipatedDrawTimeChange(AnticipatedDrawTime());
289 } 289 }
290 290
291 bool Scheduler::WillDrawIfNeeded() const { 291 bool Scheduler::WillDrawIfNeeded() const {
292 return !state_machine_.DrawSuspendedUntilCommit(); 292 return !state_machine_.DrawSuspendedUntilCommit();
293 } 293 }
294 294
295 } // namespace cc 295 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698