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

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

Issue 1425973003: cc: Don't attempt main thread synchronization if it is slow. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase on 1415763008; existing tests pass; new tests needed Created 5 years, 1 month 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 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 // with a low resolution or checkerboarded tile. 186 // with a low resolution or checkerboarded tile.
187 void SetSwapUsedIncompleteTile(bool used_incomplete_tile); 187 void SetSwapUsedIncompleteTile(bool used_incomplete_tile);
188 188
189 // Notification from the OutputSurface that a swap has been consumed. 189 // Notification from the OutputSurface that a swap has been consumed.
190 void DidSwapBuffersComplete(); 190 void DidSwapBuffersComplete();
191 191
192 int pending_swaps() const { return pending_swaps_; } 192 int pending_swaps() const { return pending_swaps_; }
193 193
194 // Indicates whether to prioritize impl thread latency (i.e., animation 194 // Indicates whether to prioritize impl thread latency (i.e., animation
195 // smoothness) over new content activation. 195 // smoothness) over new content activation.
196 void SetImplLatencyTakesPriority(bool impl_latency_takes_priority); 196 void SetSmoothnessMode(bool smoothness_takes_priority,
197 bool impl_latency_takes_priority() const { 197 bool scroll_affects_scroll_handler);
198 return impl_latency_takes_priority_; 198
199 } 199 // Indicates if the main thread will likely respond within 1 vsync.
200 void SetCriticalBeginMainFrameToActivateIsFast(bool is_fast);
201
202 // A function of SetSmoothnessMode and
203 // SetCriticalBeginMainFrameToActivateIsFast.
204 bool ImplLatencyTakesPriority() const;
200 205
201 // Indicates whether ACTION_DRAW_AND_SWAP_IF_POSSIBLE drew to the screen. 206 // Indicates whether ACTION_DRAW_AND_SWAP_IF_POSSIBLE drew to the screen.
202 void DidDrawIfPossibleCompleted(DrawResult result); 207 void DidDrawIfPossibleCompleted(DrawResult result);
203 208
204 // Indicates that a new begin main frame flow needs to be performed, either 209 // Indicates that a new begin main frame flow needs to be performed, either
205 // to pull updates from the main thread to the impl, or to push deltas from 210 // to pull updates from the main thread to the impl, or to push deltas from
206 // the impl thread to main. 211 // the impl thread to main.
207 void SetNeedsBeginMainFrame(); 212 void SetNeedsBeginMainFrame();
208 bool needs_begin_main_frame() const { return needs_begin_main_frame_; } 213 bool needs_begin_main_frame() const { return needs_begin_main_frame_; }
209 214
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
326 bool needs_prepare_tiles_; 331 bool needs_prepare_tiles_;
327 bool needs_begin_main_frame_; 332 bool needs_begin_main_frame_;
328 bool needs_one_begin_impl_frame_; 333 bool needs_one_begin_impl_frame_;
329 bool visible_; 334 bool visible_;
330 bool resourceless_draw_; 335 bool resourceless_draw_;
331 bool can_draw_; 336 bool can_draw_;
332 bool has_pending_tree_; 337 bool has_pending_tree_;
333 bool pending_tree_is_ready_for_activation_; 338 bool pending_tree_is_ready_for_activation_;
334 bool active_tree_needs_first_draw_; 339 bool active_tree_needs_first_draw_;
335 bool did_create_and_initialize_first_output_surface_; 340 bool did_create_and_initialize_first_output_surface_;
336 bool impl_latency_takes_priority_; 341 bool smoothness_takes_priority_;
342 bool scroll_affects_scroll_handler_;
343 bool critical_begin_main_frame_to_activate_is_fast_;
337 bool main_thread_missed_last_deadline_; 344 bool main_thread_missed_last_deadline_;
338 bool skip_next_begin_main_frame_to_reduce_latency_; 345 bool skip_next_begin_main_frame_to_reduce_latency_;
339 bool children_need_begin_frames_; 346 bool children_need_begin_frames_;
340 bool defer_commits_; 347 bool defer_commits_;
341 bool video_needs_begin_frames_; 348 bool video_needs_begin_frames_;
342 bool last_commit_had_no_updates_; 349 bool last_commit_had_no_updates_;
343 bool wait_for_ready_to_draw_; 350 bool wait_for_ready_to_draw_;
344 bool did_request_swap_in_last_frame_; 351 bool did_request_swap_in_last_frame_;
345 bool did_perform_swap_in_last_draw_; 352 bool did_perform_swap_in_last_draw_;
346 353
347 private: 354 private:
348 DISALLOW_COPY_AND_ASSIGN(SchedulerStateMachine); 355 DISALLOW_COPY_AND_ASSIGN(SchedulerStateMachine);
349 }; 356 };
350 357
351 } // namespace cc 358 } // namespace cc
352 359
353 #endif // CC_SCHEDULER_SCHEDULER_STATE_MACHINE_H_ 360 #endif // CC_SCHEDULER_SCHEDULER_STATE_MACHINE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698