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

Unified Diff: cc/scheduler/scheduler_state_machine.cc

Issue 184063002: cc: Change texture locking check point (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add invariant condition of texture acquisition state Created 6 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | cc/scheduler/scheduler_state_machine_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/scheduler/scheduler_state_machine.cc
diff --git a/cc/scheduler/scheduler_state_machine.cc b/cc/scheduler/scheduler_state_machine.cc
index 1111ba36f13c0030b50d5eb5373e563ce955815f..ba049285e79ada8762f35654957592fd5298adb5 100644
--- a/cc/scheduler/scheduler_state_machine.cc
+++ b/cc/scheduler/scheduler_state_machine.cc
@@ -303,6 +303,11 @@ bool SchedulerStateMachine::PendingDrawsShouldBeAborted() const {
if (PendingActivationsShouldBeForced())
return true;
+ // Impl thread should not draw anymore when texture is acquired by main thread
+ // because texture is controlled under main thread.
+ if (texture_state_ == LAYER_TEXTURE_STATE_ACQUIRED_BY_MAIN_THREAD)
+ return true;
+
// Additional states where we should abort draws.
// Note: We don't force activation in these cases because doing so would
// result in checkerboarding on resize, becoming visible, etc.
@@ -317,11 +322,6 @@ bool SchedulerStateMachine::PendingActivationsShouldBeForced() const {
// These are all the cases where, if we do not force activations to make
// forward progress, we might deadlock with the main thread.
- // The impl thread cannot lock layer textures unless the pending
- // tree can be activated to unblock the commit.
- if (texture_state_ == LAYER_TEXTURE_STATE_ACQUIRED_BY_MAIN_THREAD)
- return true;
-
// There is no output surface to trigger our activations.
if (output_surface_state_ == OUTPUT_SURFACE_LOST)
return true;
@@ -561,6 +561,10 @@ void SchedulerStateMachine::CheckInvariants() {
// timeout simultaneously.
DCHECK(!(forced_redraw_state_ == FORCED_REDRAW_STATE_WAITING_FOR_DRAW &&
readback_state_ == READBACK_STATE_WAITING_FOR_DRAW_AND_READBACK));
+ // Main thread should never have the texture locked when there is a pending
brianderson 2014/03/06 17:56:25 nit: line break above comment.
simonhong 2014/03/06 21:04:48 Done.
+ // tree.
+ if (has_pending_tree_)
brianderson 2014/03/06 17:56:25 Can you change this to: if (has_pending_tree_ || a
simonhong 2014/03/06 21:04:48 Done.
+ DCHECK(texture_state_ != LAYER_TEXTURE_STATE_ACQUIRED_BY_MAIN_THREAD);
}
void SchedulerStateMachine::UpdateState(Action action) {
« no previous file with comments | « no previous file | cc/scheduler/scheduler_state_machine_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698