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

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

Issue 1336813002: cc: Don't recreate lost OutputSurface when hidden (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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
« no previous file with comments | « no previous file | cc/scheduler/scheduler_state_machine_unittest.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_state_machine.h" 5 #include "cc/scheduler/scheduler_state_machine.h"
6 6
7 #include "base/format_macros.h" 7 #include "base/format_macros.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 #include "base/trace_event/trace_event.h" 10 #include "base/trace_event/trace_event.h"
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 // prematurely causing RequiresHighResToDraw flag to be reset. In all cases, 284 // prematurely causing RequiresHighResToDraw flag to be reset. In all cases,
285 // we can simply activate on becoming invisible since we don't need to draw 285 // we can simply activate on becoming invisible since we don't need to draw
286 // the active tree when we're in this state. 286 // the active tree when we're in this state.
287 if (!visible_) 287 if (!visible_)
288 return true; 288 return true;
289 289
290 return false; 290 return false;
291 } 291 }
292 292
293 bool SchedulerStateMachine::ShouldBeginOutputSurfaceCreation() const { 293 bool SchedulerStateMachine::ShouldBeginOutputSurfaceCreation() const {
294 if (!visible_)
295 return false;
296
294 // Don't try to initialize too early. 297 // Don't try to initialize too early.
295 if (!can_start_) 298 if (!can_start_)
296 return false; 299 return false;
297 300
298 // We only want to start output surface initialization after the 301 // We only want to start output surface initialization after the
299 // previous commit is complete. 302 // previous commit is complete.
300 if (begin_main_frame_state_ != BEGIN_MAIN_FRAME_STATE_IDLE) 303 if (begin_main_frame_state_ != BEGIN_MAIN_FRAME_STATE_IDLE)
301 return false; 304 return false;
302 305
303 // Make sure the BeginImplFrame from any previous OutputSurfaces 306 // Make sure the BeginImplFrame from any previous OutputSurfaces
(...skipping 804 matching lines...) Expand 10 before | Expand all | Expand 10 after
1108 case OUTPUT_SURFACE_ACTIVE: 1111 case OUTPUT_SURFACE_ACTIVE:
1109 case OUTPUT_SURFACE_WAITING_FOR_FIRST_COMMIT: 1112 case OUTPUT_SURFACE_WAITING_FOR_FIRST_COMMIT:
1110 case OUTPUT_SURFACE_WAITING_FOR_FIRST_ACTIVATION: 1113 case OUTPUT_SURFACE_WAITING_FOR_FIRST_ACTIVATION:
1111 return true; 1114 return true;
1112 } 1115 }
1113 NOTREACHED(); 1116 NOTREACHED();
1114 return false; 1117 return false;
1115 } 1118 }
1116 1119
1117 } // namespace cc 1120 } // namespace cc
OLDNEW
« 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