OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |