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

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

Issue 25494009: cc: Fix disabled vsync state freezing (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Now with test, and formatted Created 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | cc/scheduler/scheduler_state_machine.h » ('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 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 150
151 if (should_call_set_needs_begin_frame) { 151 if (should_call_set_needs_begin_frame) {
152 client_->SetNeedsBeginFrameOnImplThread(needs_begin_frame); 152 client_->SetNeedsBeginFrameOnImplThread(needs_begin_frame);
153 last_set_needs_begin_frame_ = needs_begin_frame; 153 last_set_needs_begin_frame_ = needs_begin_frame;
154 } 154 }
155 155
156 // Setup PollForAnticipatedDrawTriggers if we need to monitor state but 156 // Setup PollForAnticipatedDrawTriggers if we need to monitor state but
157 // aren't expecting any more BeginFrames. This should only be needed by the 157 // aren't expecting any more BeginFrames. This should only be needed by the
158 // synchronous compositor when BeginFrameNeededByImplThread is false. 158 // synchronous compositor when BeginFrameNeededByImplThread is false.
159 if (state_machine_.ShouldPollForAnticipatedDrawTriggers()) { 159 if (state_machine_.ShouldPollForAnticipatedDrawTriggers()) {
160 DCHECK(settings_.using_synchronous_renderer_compositor); 160 DCHECK(!state_machine_.SupportsProactiveBeginFrame());
161 DCHECK(!needs_begin_frame); 161 DCHECK(!needs_begin_frame);
162 if (poll_for_draw_triggers_closure_.IsCancelled()) { 162 if (poll_for_draw_triggers_closure_.IsCancelled()) {
163 poll_for_draw_triggers_closure_.Reset( 163 poll_for_draw_triggers_closure_.Reset(
164 base::Bind(&Scheduler::PollForAnticipatedDrawTriggers, 164 base::Bind(&Scheduler::PollForAnticipatedDrawTriggers,
165 weak_factory_.GetWeakPtr())); 165 weak_factory_.GetWeakPtr()));
166 base::MessageLoop::current()->PostDelayedTask( 166 base::MessageLoop::current()->PostDelayedTask(
167 FROM_HERE, 167 FROM_HERE,
168 poll_for_draw_triggers_closure_.callback(), 168 poll_for_draw_triggers_closure_.callback(),
169 last_begin_frame_args_.interval); 169 last_begin_frame_args_.interval);
170 } 170 }
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
330 330
331 SetupNextBeginFrameIfNeeded(); 331 SetupNextBeginFrameIfNeeded();
332 client_->DidAnticipatedDrawTimeChange(AnticipatedDrawTime()); 332 client_->DidAnticipatedDrawTimeChange(AnticipatedDrawTime());
333 } 333 }
334 334
335 bool Scheduler::WillDrawIfNeeded() const { 335 bool Scheduler::WillDrawIfNeeded() const {
336 return !state_machine_.PendingDrawsShouldBeAborted(); 336 return !state_machine_.PendingDrawsShouldBeAborted();
337 } 337 }
338 338
339 } // namespace cc 339 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/scheduler/scheduler_state_machine.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698