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

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

Issue 18939003: Webview fixes for Use BeginFrameArgs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | cc/scheduler/scheduler_state_machine.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 state_machine_.OnBeginFrame(last_begin_frame_args_); 177 state_machine_.OnBeginFrame(last_begin_frame_args_);
178 ProcessScheduledActions(); 178 ProcessScheduledActions();
179 179
180 if (state_machine_.ShouldTriggerBeginFrameDeadlineEarly()) 180 if (state_machine_.ShouldTriggerBeginFrameDeadlineEarly())
181 PostBeginFrameDeadline(base::TimeTicks()); 181 PostBeginFrameDeadline(base::TimeTicks());
182 else 182 else
183 PostBeginFrameDeadline(last_begin_frame_args_.deadline); 183 PostBeginFrameDeadline(last_begin_frame_args_.deadline);
184 } 184 }
185 185
186 void Scheduler::PostBeginFrameDeadline(base::TimeTicks deadline) { 186 void Scheduler::PostBeginFrameDeadline(base::TimeTicks deadline) {
187 if (settings_.using_synchronous_renderer_compositor) {
188 OnBeginFrameDeadline();
189 return;
190 }
191
187 begin_frame_deadline_closure_.Cancel(); 192 begin_frame_deadline_closure_.Cancel();
188 begin_frame_deadline_closure_.Reset( 193 begin_frame_deadline_closure_.Reset(
189 base::Bind(&Scheduler::OnBeginFrameDeadline, weak_factory_.GetWeakPtr())); 194 base::Bind(&Scheduler::OnBeginFrameDeadline, weak_factory_.GetWeakPtr()));
190 client_->PostBeginFrameDeadline( 195 client_->PostBeginFrameDeadline(
191 begin_frame_deadline_closure_.callback(), deadline); 196 begin_frame_deadline_closure_.callback(), deadline);
192 } 197 }
193 198
194 void Scheduler::OnBeginFrameDeadline() { 199 void Scheduler::OnBeginFrameDeadline() {
195 TRACE_EVENT0("cc", "Scheduler::OnBeginFrameDeadline"); 200 TRACE_EVENT0("cc", "Scheduler::OnBeginFrameDeadline");
196 begin_frame_deadline_closure_.Cancel(); 201 begin_frame_deadline_closure_.Cancel();
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 265
261 SetupNextBeginFrameIfNeeded(); 266 SetupNextBeginFrameIfNeeded();
262 client_->DidAnticipatedDrawTimeChange(AnticipatedDrawTime()); 267 client_->DidAnticipatedDrawTimeChange(AnticipatedDrawTime());
263 } 268 }
264 269
265 bool Scheduler::WillDrawIfNeeded() const { 270 bool Scheduler::WillDrawIfNeeded() const {
266 return !state_machine_.DrawSuspendedUntilCommit(); 271 return !state_machine_.DrawSuspendedUntilCommit();
267 } 272 }
268 273
269 } // namespace cc 274 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/scheduler/scheduler_state_machine.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698