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 #ifndef CC_SCHEDULER_SCHEDULER_STATE_MACHINE_H_ | 5 #ifndef CC_SCHEDULER_SCHEDULER_STATE_MACHINE_H_ |
6 #define CC_SCHEDULER_SCHEDULER_STATE_MACHINE_H_ | 6 #define CC_SCHEDULER_SCHEDULER_STATE_MACHINE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 | 124 |
125 scoped_ptr<base::Value> AsValue() const; | 125 scoped_ptr<base::Value> AsValue() const; |
126 | 126 |
127 Action NextAction() const; | 127 Action NextAction() const; |
128 void UpdateState(Action action); | 128 void UpdateState(Action action); |
129 | 129 |
130 void CheckInvariants(); | 130 void CheckInvariants(); |
131 | 131 |
132 // Indicates whether the impl thread needs a BeginImplFrame callback in order | 132 // Indicates whether the impl thread needs a BeginImplFrame callback in order |
133 // to make progress. | 133 // to make progress. |
134 bool BeginImplFrameNeeded() const; | 134 bool BeginFrameNeeded() const; |
135 | 135 |
136 // Indicates that we need to independently poll for new state and actions | 136 // Indicates that we need to independently poll for new state and actions |
137 // because we can't expect a BeginImplFrame. This is mostly used to avoid | 137 // because we can't expect a BeginImplFrame. This is mostly used to avoid |
138 // drawing repeat frames with the synchronous compositor without dropping | 138 // drawing repeat frames with the synchronous compositor without dropping |
139 // necessary actions on the floor. | 139 // necessary actions on the floor. |
140 bool ShouldPollForAnticipatedDrawTriggers() const; | 140 bool ShouldPollForAnticipatedDrawTriggers() const; |
141 | 141 |
142 // Indicates that the system has entered and left a BeginImplFrame callback. | 142 // Indicates that the system has entered and left a BeginImplFrame callback. |
143 // The scheduler will not draw more than once in a given BeginImplFrame | 143 // The scheduler will not draw more than once in a given BeginImplFrame |
144 // callback nor send more than one BeginMainFrame message. | 144 // callback nor send more than one BeginMainFrame message. |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 } | 238 } |
239 | 239 |
240 void DidManageTiles(); | 240 void DidManageTiles(); |
241 void DidLoseOutputSurface(); | 241 void DidLoseOutputSurface(); |
242 void DidCreateAndInitializeOutputSurface(); | 242 void DidCreateAndInitializeOutputSurface(); |
243 bool HasInitializedOutputSurface() const; | 243 bool HasInitializedOutputSurface() const; |
244 | 244 |
245 // True if we need to abort draws to make forward progress. | 245 // True if we need to abort draws to make forward progress. |
246 bool PendingDrawsShouldBeAborted() const; | 246 bool PendingDrawsShouldBeAborted() const; |
247 | 247 |
248 bool SupportsProactiveBeginImplFrame() const; | 248 bool SupportsProactiveBeginFrame() const; |
249 | 249 |
250 void SetContinuousPainting(bool continuous_painting) { | 250 void SetContinuousPainting(bool continuous_painting) { |
251 continuous_painting_ = continuous_painting; | 251 continuous_painting_ = continuous_painting; |
252 } | 252 } |
253 | 253 |
254 protected: | 254 protected: |
255 bool BeginImplFrameNeededToDraw() const; | 255 bool BeginFrameNeededToDraw() const; |
256 bool ProactiveBeginImplFrameWanted() const; | 256 bool ProactiveBeginFrameWanted() const; |
257 | 257 |
258 // True if we need to force activations to make forward progress. | 258 // True if we need to force activations to make forward progress. |
259 bool PendingActivationsShouldBeForced() const; | 259 bool PendingActivationsShouldBeForced() const; |
260 | 260 |
261 bool ShouldBeginOutputSurfaceCreation() const; | 261 bool ShouldBeginOutputSurfaceCreation() const; |
262 bool ShouldDrawForced() const; | 262 bool ShouldDrawForced() const; |
263 bool ShouldDraw() const; | 263 bool ShouldDraw() const; |
264 bool ShouldActivatePendingTree() const; | 264 bool ShouldActivatePendingTree() const; |
265 bool ShouldAcquireLayerTexturesForMainThread() const; | 265 bool ShouldAcquireLayerTexturesForMainThread() const; |
266 bool ShouldUpdateVisibleTiles() const; | 266 bool ShouldUpdateVisibleTiles() const; |
(...skipping 14 matching lines...) Expand all Loading... |
281 | 281 |
282 const SchedulerSettings settings_; | 282 const SchedulerSettings settings_; |
283 | 283 |
284 OutputSurfaceState output_surface_state_; | 284 OutputSurfaceState output_surface_state_; |
285 BeginImplFrameState begin_impl_frame_state_; | 285 BeginImplFrameState begin_impl_frame_state_; |
286 CommitState commit_state_; | 286 CommitState commit_state_; |
287 TextureState texture_state_; | 287 TextureState texture_state_; |
288 ForcedRedrawOnTimeoutState forced_redraw_state_; | 288 ForcedRedrawOnTimeoutState forced_redraw_state_; |
289 SynchronousReadbackState readback_state_; | 289 SynchronousReadbackState readback_state_; |
290 | 290 |
291 BeginFrameArgs last_begin_impl_frame_args_; | 291 BeginFrameArgs begin_impl_frame_args_; |
292 | 292 |
293 int commit_count_; | 293 int commit_count_; |
294 int current_frame_number_; | 294 int current_frame_number_; |
295 int last_frame_number_swap_performed_; | 295 int last_frame_number_swap_performed_; |
296 int last_frame_number_begin_main_frame_sent_; | 296 int last_frame_number_begin_main_frame_sent_; |
297 int last_frame_number_update_visible_tiles_was_called_; | 297 int last_frame_number_update_visible_tiles_was_called_; |
298 | 298 |
299 // manage_tiles_funnel_ is "filled" each time ManageTiles is called | 299 // manage_tiles_funnel_ is "filled" each time ManageTiles is called |
300 // and "drained" on each BeginImplFrame. If the funnel gets too full, | 300 // and "drained" on each BeginImplFrame. If the funnel gets too full, |
301 // we start throttling ACTION_MANAGE_TILES such that we average one | 301 // we start throttling ACTION_MANAGE_TILES such that we average one |
(...skipping 19 matching lines...) Expand all Loading... |
321 bool skip_begin_main_frame_to_reduce_latency_; | 321 bool skip_begin_main_frame_to_reduce_latency_; |
322 bool continuous_painting_; | 322 bool continuous_painting_; |
323 | 323 |
324 private: | 324 private: |
325 DISALLOW_COPY_AND_ASSIGN(SchedulerStateMachine); | 325 DISALLOW_COPY_AND_ASSIGN(SchedulerStateMachine); |
326 }; | 326 }; |
327 | 327 |
328 } // namespace cc | 328 } // namespace cc |
329 | 329 |
330 #endif // CC_SCHEDULER_SCHEDULER_STATE_MACHINE_H_ | 330 #endif // CC_SCHEDULER_SCHEDULER_STATE_MACHINE_H_ |
OLD | NEW |