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

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

Issue 246753008: cc: Unify use of DidSwapBuffers() and did_request_swap (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix comment Created 6 years, 7 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 | Annotate | Revision Log
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"
11 #include "base/memory/scoped_ptr.h" 11 #include "base/memory/scoped_ptr.h"
12 #include "base/time/time.h" 12 #include "base/time/time.h"
13 #include "cc/base/cc_export.h" 13 #include "cc/base/cc_export.h"
14 #include "cc/output/begin_frame_args.h" 14 #include "cc/output/begin_frame_args.h"
15 #include "cc/scheduler/draw_swap_readback_result.h" 15 #include "cc/scheduler/draw_result.h"
16 #include "cc/scheduler/scheduler_settings.h" 16 #include "cc/scheduler/scheduler_settings.h"
17 17
18 namespace base { 18 namespace base {
19 class Value; 19 class Value;
20 } 20 }
21 21
22 namespace cc { 22 namespace cc {
23 23
24 // The SchedulerStateMachine decides how to coordinate main thread activites 24 // The SchedulerStateMachine decides how to coordinate main thread activites
25 // like painting/running javascript with rendering and input activities on the 25 // like painting/running javascript with rendering and input activities on the
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 186
187 // Notification from the OutputSurface that a swap has been consumed. 187 // Notification from the OutputSurface that a swap has been consumed.
188 void DidSwapBuffersComplete(); 188 void DidSwapBuffersComplete();
189 189
190 // Indicates whether to prioritize animation smoothness over new content 190 // Indicates whether to prioritize animation smoothness over new content
191 // activation. 191 // activation.
192 void SetSmoothnessTakesPriority(bool smoothness_takes_priority); 192 void SetSmoothnessTakesPriority(bool smoothness_takes_priority);
193 bool smoothness_takes_priority() const { return smoothness_takes_priority_; } 193 bool smoothness_takes_priority() const { return smoothness_takes_priority_; }
194 194
195 // Indicates whether ACTION_DRAW_AND_SWAP_IF_POSSIBLE drew to the screen. 195 // Indicates whether ACTION_DRAW_AND_SWAP_IF_POSSIBLE drew to the screen.
196 void DidDrawIfPossibleCompleted(DrawSwapReadbackResult::DrawResult result); 196 void DidDrawIfPossibleCompleted(DrawResult result);
197 197
198 // Indicates that a new commit flow needs to be performed, either to pull 198 // Indicates that a new commit flow needs to be performed, either to pull
199 // updates from the main thread to the impl, or to push deltas from the impl 199 // updates from the main thread to the impl, or to push deltas from the impl
200 // thread to main. 200 // thread to main.
201 void SetNeedsCommit(); 201 void SetNeedsCommit();
202 202
203 // As SetNeedsCommit(), but ensures the BeginMainFrame will be sent even 203 // As SetNeedsCommit(), but ensures the BeginMainFrame will be sent even
204 // if we are not visible. After this call we expect to go through 204 // if we are not visible. After this call we expect to go through
205 // the forced commit flow and then return to waiting for a non-forced 205 // the forced commit flow and then return to waiting for a non-forced
206 // BeginMainFrame to finish. 206 // BeginMainFrame to finish.
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 bool ShouldDrawForced() const; 263 bool ShouldDrawForced() const;
264 bool ShouldDraw() const; 264 bool ShouldDraw() const;
265 bool ShouldActivatePendingTree() const; 265 bool ShouldActivatePendingTree() const;
266 bool ShouldUpdateVisibleTiles() const; 266 bool ShouldUpdateVisibleTiles() const;
267 bool ShouldSendBeginMainFrame() const; 267 bool ShouldSendBeginMainFrame() const;
268 bool ShouldCommit() const; 268 bool ShouldCommit() const;
269 bool ShouldManageTiles() const; 269 bool ShouldManageTiles() const;
270 270
271 void AdvanceCurrentFrameNumber(); 271 void AdvanceCurrentFrameNumber();
272 bool HasSentBeginMainFrameThisFrame() const; 272 bool HasSentBeginMainFrameThisFrame() const;
273 bool HasRequestedDrawThisFrame() const;
273 bool HasUpdatedVisibleTilesThisFrame() const; 274 bool HasUpdatedVisibleTilesThisFrame() const;
274 bool HasSwappedThisFrame() const; 275 bool HasSwappedThisFrame() const;
276 bool HasRequestedSwapThisFrame() const;
brianderson 2014/05/08 17:40:19 nit: Here and elsewhere, can you reorder these so
simonhong 2014/05/09 00:18:40 Done.
275 277
276 void UpdateStateOnCommit(bool commit_was_aborted); 278 void UpdateStateOnCommit(bool commit_was_aborted);
277 void UpdateStateOnActivation(); 279 void UpdateStateOnActivation();
278 void UpdateStateOnDraw(bool did_request_swap); 280 void UpdateStateOnDraw(bool did_request_swap);
279 void UpdateStateOnManageTiles(); 281 void UpdateStateOnManageTiles();
280 282
281 const SchedulerSettings settings_; 283 const SchedulerSettings settings_;
282 284
283 OutputSurfaceState output_surface_state_; 285 OutputSurfaceState output_surface_state_;
284 BeginImplFrameState begin_impl_frame_state_; 286 BeginImplFrameState begin_impl_frame_state_;
285 CommitState commit_state_; 287 CommitState commit_state_;
286 ForcedRedrawOnTimeoutState forced_redraw_state_; 288 ForcedRedrawOnTimeoutState forced_redraw_state_;
287 SynchronousReadbackState readback_state_; 289 SynchronousReadbackState readback_state_;
288 290
289 BeginFrameArgs begin_impl_frame_args_; 291 BeginFrameArgs begin_impl_frame_args_;
290 292
291 int commit_count_; 293 int commit_count_;
292 int current_frame_number_; 294 int current_frame_number_;
293 int last_frame_number_animate_performed_; 295 int last_frame_number_animate_performed_;
294 int last_frame_number_swap_performed_; 296 int last_frame_number_swap_performed_;
297 int last_frame_number_swap_request_sent_;
brianderson 2014/05/08 17:40:19 last_frame_number_swap_requested_
simonhong 2014/05/09 00:18:40 Done.
295 int last_frame_number_begin_main_frame_sent_; 298 int last_frame_number_begin_main_frame_sent_;
299 int last_frame_number_draw_request_sent_;
brianderson 2014/05/08 17:40:19 last_frame_number_draw_requested_;
simonhong 2014/05/09 00:18:40 Done.
296 int last_frame_number_update_visible_tiles_was_called_; 300 int last_frame_number_update_visible_tiles_was_called_;
297 301
298 // manage_tiles_funnel_ is "filled" each time ManageTiles is called 302 // manage_tiles_funnel_ is "filled" each time ManageTiles is called
299 // and "drained" on each BeginImplFrame. If the funnel gets too full, 303 // and "drained" on each BeginImplFrame. If the funnel gets too full,
300 // we start throttling ACTION_MANAGE_TILES such that we average one 304 // we start throttling ACTION_MANAGE_TILES such that we average one
301 // ManageTile per BeginImplFrame. 305 // ManageTile per BeginImplFrame.
302 int manage_tiles_funnel_; 306 int manage_tiles_funnel_;
303 int consecutive_checkerboard_animations_; 307 int consecutive_checkerboard_animations_;
304 int max_pending_swaps_; 308 int max_pending_swaps_;
305 int pending_swaps_; 309 int pending_swaps_;
(...skipping 16 matching lines...) Expand all
322 bool continuous_painting_; 326 bool continuous_painting_;
323 bool needs_back_to_back_readback_; 327 bool needs_back_to_back_readback_;
324 328
325 private: 329 private:
326 DISALLOW_COPY_AND_ASSIGN(SchedulerStateMachine); 330 DISALLOW_COPY_AND_ASSIGN(SchedulerStateMachine);
327 }; 331 };
328 332
329 } // namespace cc 333 } // namespace cc
330 334
331 #endif // CC_SCHEDULER_SCHEDULER_STATE_MACHINE_H_ 335 #endif // CC_SCHEDULER_SCHEDULER_STATE_MACHINE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698