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

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

Issue 199523002: cc: Throttle swaps in Scheduler instead of OutputSurface (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: WIP: pulling FRC out of OS 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 unified diff | Download patch
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 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 169
170 // Indicates that a redraw is required, either due to the impl tree changing 170 // Indicates that a redraw is required, either due to the impl tree changing
171 // or the screen being damaged and simply needing redisplay. 171 // or the screen being damaged and simply needing redisplay.
172 void SetNeedsRedraw(); 172 void SetNeedsRedraw();
173 bool needs_redraw() const { return needs_redraw_; } 173 bool needs_redraw() const { return needs_redraw_; }
174 174
175 // Indicates that manage-tiles is required. This guarantees another 175 // Indicates that manage-tiles is required. This guarantees another
176 // ManageTiles will occur shortly (even if no redraw is required). 176 // ManageTiles will occur shortly (even if no redraw is required).
177 void SetNeedsManageTiles(); 177 void SetNeedsManageTiles();
178 178
179 // Sets how many swaps can be pending to the OutputSurface.
180 void SetMaxSwapsPending(int max);
181
182 // If the scheduler attempted to draw and swap, this provides feedback
183 // regarding whether or not the swap actually occured. We might skip the
184 // swap when there is not damage, for example.
Sami 2014/03/14 15:34:58 Nit: we skip both the draw & swap when this happen
185 void DidSwapBuffers();
186
179 // Indicates whether a redraw is required because we are currently rendering 187 // Indicates whether a redraw is required because we are currently rendering
180 // with a low resolution or checkerboarded tile. 188 // with a low resolution or checkerboarded tile.
181 void SetSwapUsedIncompleteTile(bool used_incomplete_tile); 189 void SetSwapUsedIncompleteTile(bool used_incomplete_tile);
182 190
191 // Notification from the OutputSurface that a swap has been consumed.
192 void OnSwapBuffersComplete();
193
183 // Indicates whether to prioritize animation smoothness over new content 194 // Indicates whether to prioritize animation smoothness over new content
184 // activation. 195 // activation.
185 void SetSmoothnessTakesPriority(bool smoothness_takes_priority); 196 void SetSmoothnessTakesPriority(bool smoothness_takes_priority);
186 bool smoothness_takes_priority() const { return smoothness_takes_priority_; } 197 bool smoothness_takes_priority() const { return smoothness_takes_priority_; }
187 198
188 // Indicates whether ACTION_DRAW_AND_SWAP_IF_POSSIBLE drew to the screen. 199 // Indicates whether ACTION_DRAW_AND_SWAP_IF_POSSIBLE drew to the screen.
189 void DidDrawIfPossibleCompleted(DrawSwapReadbackResult::DrawResult result); 200 void DidDrawIfPossibleCompleted(DrawSwapReadbackResult::DrawResult result);
190 201
191 // Indicates that a new commit flow needs to be performed, either to pull 202 // Indicates that a new commit flow needs to be performed, either to pull
192 // updates from the main thread to the impl, or to push deltas from the impl 203 // updates from the main thread to the impl, or to push deltas from the impl
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 int last_frame_number_swap_performed_; 302 int last_frame_number_swap_performed_;
292 int last_frame_number_begin_main_frame_sent_; 303 int last_frame_number_begin_main_frame_sent_;
293 int last_frame_number_update_visible_tiles_was_called_; 304 int last_frame_number_update_visible_tiles_was_called_;
294 305
295 // manage_tiles_funnel_ is "filled" each time ManageTiles is called 306 // manage_tiles_funnel_ is "filled" each time ManageTiles is called
296 // and "drained" on each BeginImplFrame. If the funnel gets too full, 307 // and "drained" on each BeginImplFrame. If the funnel gets too full,
297 // we start throttling ACTION_MANAGE_TILES such that we average one 308 // we start throttling ACTION_MANAGE_TILES such that we average one
298 // ManageTile per BeginImplFrame. 309 // ManageTile per BeginImplFrame.
299 int manage_tiles_funnel_; 310 int manage_tiles_funnel_;
300 int consecutive_checkerboard_animations_; 311 int consecutive_checkerboard_animations_;
312 int max_pending_swaps_;
313 int pending_swaps_;
301 bool needs_redraw_; 314 bool needs_redraw_;
302 bool needs_manage_tiles_; 315 bool needs_manage_tiles_;
303 bool swap_used_incomplete_tile_; 316 bool swap_used_incomplete_tile_;
304 bool needs_commit_; 317 bool needs_commit_;
305 bool main_thread_needs_layer_textures_; 318 bool main_thread_needs_layer_textures_;
306 bool inside_poll_for_anticipated_draw_triggers_; 319 bool inside_poll_for_anticipated_draw_triggers_;
307 bool visible_; 320 bool visible_;
308 bool can_start_; 321 bool can_start_;
309 bool can_draw_; 322 bool can_draw_;
310 bool has_pending_tree_; 323 bool has_pending_tree_;
311 bool pending_tree_is_ready_for_activation_; 324 bool pending_tree_is_ready_for_activation_;
312 bool active_tree_needs_first_draw_; 325 bool active_tree_needs_first_draw_;
313 bool draw_if_possible_failed_; 326 bool draw_if_possible_failed_;
314 bool did_create_and_initialize_first_output_surface_; 327 bool did_create_and_initialize_first_output_surface_;
315 bool smoothness_takes_priority_; 328 bool smoothness_takes_priority_;
316 bool skip_next_begin_main_frame_to_reduce_latency_; 329 bool skip_next_begin_main_frame_to_reduce_latency_;
317 bool skip_begin_main_frame_to_reduce_latency_; 330 bool skip_begin_main_frame_to_reduce_latency_;
318 331
319 private: 332 private:
320 DISALLOW_COPY_AND_ASSIGN(SchedulerStateMachine); 333 DISALLOW_COPY_AND_ASSIGN(SchedulerStateMachine);
321 }; 334 };
322 335
323 } // namespace cc 336 } // namespace cc
324 337
325 #endif // CC_SCHEDULER_SCHEDULER_STATE_MACHINE_H_ 338 #endif // CC_SCHEDULER_SCHEDULER_STATE_MACHINE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698