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

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

Issue 130483010: cc: Limit ManageTiles calls to once per-frame on average (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Add tests Created 6 years, 11 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.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 #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 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 bool ShouldBeginOutputSurfaceCreation() const; 247 bool ShouldBeginOutputSurfaceCreation() const;
248 bool ShouldDrawForced() const; 248 bool ShouldDrawForced() const;
249 bool ShouldDraw() const; 249 bool ShouldDraw() const;
250 bool ShouldActivatePendingTree() const; 250 bool ShouldActivatePendingTree() const;
251 bool ShouldAcquireLayerTexturesForMainThread() const; 251 bool ShouldAcquireLayerTexturesForMainThread() const;
252 bool ShouldUpdateVisibleTiles() const; 252 bool ShouldUpdateVisibleTiles() const;
253 bool ShouldSendBeginMainFrame() const; 253 bool ShouldSendBeginMainFrame() const;
254 bool ShouldCommit() const; 254 bool ShouldCommit() const;
255 bool ShouldManageTiles() const; 255 bool ShouldManageTiles() const;
256 256
257 void AdvanceCurrentFrameNumber();
257 bool HasSentBeginMainFrameThisFrame() const; 258 bool HasSentBeginMainFrameThisFrame() const;
258 bool HasScheduledManageTilesThisFrame() const; 259 bool HasScheduledManageTilesThisFrame() const;
259 bool HasUpdatedVisibleTilesThisFrame() const; 260 bool HasUpdatedVisibleTilesThisFrame() const;
260 bool HasSwappedThisFrame() const; 261 bool HasSwappedThisFrame() const;
261 262
262 void UpdateStateOnCommit(bool commit_was_aborted); 263 void UpdateStateOnCommit(bool commit_was_aborted);
263 void UpdateStateOnActivation(); 264 void UpdateStateOnActivation();
264 void UpdateStateOnDraw(bool did_swap); 265 void UpdateStateOnDraw(bool did_swap);
265 void UpdateStateOnManageTiles(); 266 void UpdateStateOnManageTiles();
266 267
267 const SchedulerSettings settings_; 268 const SchedulerSettings settings_;
268 269
269 OutputSurfaceState output_surface_state_; 270 OutputSurfaceState output_surface_state_;
270 BeginImplFrameState begin_impl_frame_state_; 271 BeginImplFrameState begin_impl_frame_state_;
271 CommitState commit_state_; 272 CommitState commit_state_;
272 TextureState texture_state_; 273 TextureState texture_state_;
273 ForcedRedrawOnTimeoutState forced_redraw_state_; 274 ForcedRedrawOnTimeoutState forced_redraw_state_;
274 SynchronousReadbackState readback_state_; 275 SynchronousReadbackState readback_state_;
275 276
276 BeginFrameArgs last_begin_impl_frame_args_; 277 BeginFrameArgs last_begin_impl_frame_args_;
277 278
278 int commit_count_; 279 int commit_count_;
279 int current_frame_number_; 280 int current_frame_number_;
280 int last_frame_number_swap_performed_; 281 int last_frame_number_swap_performed_;
281 int last_frame_number_begin_main_frame_sent_; 282 int last_frame_number_begin_main_frame_sent_;
282 int last_frame_number_update_visible_tiles_was_called_; 283 int last_frame_number_update_visible_tiles_was_called_;
283 int last_frame_number_manage_tiles_called_;
284 284
285 // manage_tiles_funnel_ is "filled" each time ManageTiles is called
286 // and "drained" on each BeginImplFrame. If the funnel gets too full,
287 // we start throttling ACTION_MANAGE_TILES such that we average one
288 // ManageTile per BeginImplFrame.
289 int manage_tiles_funnel_;
285 int consecutive_failed_draws_; 290 int consecutive_failed_draws_;
286 bool needs_redraw_; 291 bool needs_redraw_;
287 bool needs_manage_tiles_; 292 bool needs_manage_tiles_;
288 bool swap_used_incomplete_tile_; 293 bool swap_used_incomplete_tile_;
289 bool needs_commit_; 294 bool needs_commit_;
290 bool main_thread_needs_layer_textures_; 295 bool main_thread_needs_layer_textures_;
291 bool inside_poll_for_anticipated_draw_triggers_; 296 bool inside_poll_for_anticipated_draw_triggers_;
292 bool visible_; 297 bool visible_;
293 bool can_start_; 298 bool can_start_;
294 bool can_draw_; 299 bool can_draw_;
295 bool has_pending_tree_; 300 bool has_pending_tree_;
296 bool pending_tree_is_ready_for_activation_; 301 bool pending_tree_is_ready_for_activation_;
297 bool active_tree_needs_first_draw_; 302 bool active_tree_needs_first_draw_;
298 bool draw_if_possible_failed_; 303 bool draw_if_possible_failed_;
299 bool did_create_and_initialize_first_output_surface_; 304 bool did_create_and_initialize_first_output_surface_;
300 bool smoothness_takes_priority_; 305 bool smoothness_takes_priority_;
301 bool skip_begin_main_frame_to_reduce_latency_; 306 bool skip_begin_main_frame_to_reduce_latency_;
302 307
303 private: 308 private:
304 DISALLOW_COPY_AND_ASSIGN(SchedulerStateMachine); 309 DISALLOW_COPY_AND_ASSIGN(SchedulerStateMachine);
305 }; 310 };
306 311
307 } // namespace cc 312 } // namespace cc
308 313
309 #endif // CC_SCHEDULER_SCHEDULER_STATE_MACHINE_H_ 314 #endif // CC_SCHEDULER_SCHEDULER_STATE_MACHINE_H_
OLDNEW
« no previous file with comments | « no previous file | cc/scheduler/scheduler_state_machine.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698