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

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

Issue 15836005: cc: Emulate BeginFrame in OutputSurfaces that don't support it natively (Closed) Base URL: http://git.chromium.org/chromium/src.git@nofrc
Patch Set: Created 7 years, 6 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_state_machine.h" 5 #include "cc/scheduler/scheduler_state_machine.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/stringprintf.h" 8 #include "base/stringprintf.h"
9 9
10 namespace cc { 10 namespace cc {
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after
325 } 325 }
326 } 326 }
327 327
328 void SchedulerStateMachine::SetMainThreadNeedsLayerTextures() { 328 void SchedulerStateMachine::SetMainThreadNeedsLayerTextures() {
329 DCHECK(!main_thread_needs_layer_textures_); 329 DCHECK(!main_thread_needs_layer_textures_);
330 DCHECK_NE(texture_state_, LAYER_TEXTURE_STATE_ACQUIRED_BY_MAIN_THREAD); 330 DCHECK_NE(texture_state_, LAYER_TEXTURE_STATE_ACQUIRED_BY_MAIN_THREAD);
331 main_thread_needs_layer_textures_ = true; 331 main_thread_needs_layer_textures_ = true;
332 } 332 }
333 333
334 bool SchedulerStateMachine::BeginFrameNeededByImplThread() const { 334 bool SchedulerStateMachine::BeginFrameNeededByImplThread() const {
335 // We should proactively request a BeginFrame if a commit is pending.
brianderson 2013/06/01 04:30:29 I would get hangs without this.
336 if (commit_state_ != COMMIT_STATE_IDLE)
337 return true;
338
335 // If we have a pending tree, need to keep getting notifications until 339 // If we have a pending tree, need to keep getting notifications until
336 // the tree is ready to be swapped. 340 // the tree is ready to be swapped.
337 if (has_pending_tree_) 341 if (has_pending_tree_)
338 return true; 342 return true;
339 343
340 // If we can't draw, don't tick until we are notified that we can draw again. 344 // If we can't draw, don't tick until we are notified that we can draw again.
341 if (!can_draw_) 345 if (!can_draw_)
342 return false; 346 return false;
343 347
344 if (needs_forced_redraw_) 348 if (needs_forced_redraw_)
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
448 bool SchedulerStateMachine::HasInitializedOutputSurface() const { 452 bool SchedulerStateMachine::HasInitializedOutputSurface() const {
449 return output_surface_state_ == OUTPUT_SURFACE_ACTIVE; 453 return output_surface_state_ == OUTPUT_SURFACE_ACTIVE;
450 } 454 }
451 455
452 void SchedulerStateMachine::SetMaximumNumberOfFailedDrawsBeforeDrawIsForced( 456 void SchedulerStateMachine::SetMaximumNumberOfFailedDrawsBeforeDrawIsForced(
453 int num_draws) { 457 int num_draws) {
454 maximum_number_of_failed_draws_before_draw_is_forced_ = num_draws; 458 maximum_number_of_failed_draws_before_draw_is_forced_ = num_draws;
455 } 459 }
456 460
457 } // namespace cc 461 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698