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

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

Issue 60353002: cc: add DevTools instrumentation for impl-side frames (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Insturment tree activation instead of commit for linking main thread frames to imple-side ones Created 7 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 | 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_H_ 5 #ifndef CC_SCHEDULER_SCHEDULER_H_
6 #define CC_SCHEDULER_SCHEDULER_H_ 6 #define CC_SCHEDULER_SCHEDULER_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 virtual void DidBeginImplFrameDeadline() = 0; 53 virtual void DidBeginImplFrameDeadline() = 0;
54 54
55 protected: 55 protected:
56 virtual ~SchedulerClient() {} 56 virtual ~SchedulerClient() {}
57 }; 57 };
58 58
59 class CC_EXPORT Scheduler { 59 class CC_EXPORT Scheduler {
60 public: 60 public:
61 static scoped_ptr<Scheduler> Create( 61 static scoped_ptr<Scheduler> Create(
62 SchedulerClient* client, 62 SchedulerClient* client,
63 const SchedulerSettings& scheduler_settings) { 63 const SchedulerSettings& scheduler_settings,
64 return make_scoped_ptr(new Scheduler(client, scheduler_settings)); 64 int layer_tree_host_id) {
65 return make_scoped_ptr(
66 new Scheduler(client, scheduler_settings, layer_tree_host_id));
65 } 67 }
66 68
67 virtual ~Scheduler(); 69 virtual ~Scheduler();
68 70
69 void SetCanStart(); 71 void SetCanStart();
70 72
71 void SetVisible(bool visible); 73 void SetVisible(bool visible);
72 void SetCanDraw(bool can_draw); 74 void SetCanDraw(bool can_draw);
73 void NotifyReadyToActivate(); 75 void NotifyReadyToActivate();
74 76
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 scoped_ptr<base::Value> StateAsValue() { 122 scoped_ptr<base::Value> StateAsValue() {
121 return state_machine_.AsValue().Pass(); 123 return state_machine_.AsValue().Pass();
122 } 124 }
123 125
124 bool IsInsideAction(SchedulerStateMachine::Action action) { 126 bool IsInsideAction(SchedulerStateMachine::Action action) {
125 return inside_action_ == action; 127 return inside_action_ == action;
126 } 128 }
127 129
128 private: 130 private:
129 Scheduler(SchedulerClient* client, 131 Scheduler(SchedulerClient* client,
130 const SchedulerSettings& scheduler_settings); 132 const SchedulerSettings& scheduler_settings,
133 int layer_tree_host_id);
131 134
132 void PostBeginImplFrameDeadline(base::TimeTicks deadline); 135 void PostBeginImplFrameDeadline(base::TimeTicks deadline);
133 void SetupNextBeginImplFrameIfNeeded(); 136 void SetupNextBeginImplFrameIfNeeded();
134 void ActivatePendingTree(); 137 void ActivatePendingTree();
135 void DrawAndSwapIfPossible(); 138 void DrawAndSwapIfPossible();
136 void DrawAndSwapForced(); 139 void DrawAndSwapForced();
137 void DrawAndReadback(); 140 void DrawAndReadback();
138 void ProcessScheduledActions(); 141 void ProcessScheduledActions();
139 142
140 bool CanCommitAndActivateBeforeDeadline() const; 143 bool CanCommitAndActivateBeforeDeadline() const;
141 144
142 const SchedulerSettings settings_; 145 const SchedulerSettings settings_;
143 SchedulerClient* client_; 146 SchedulerClient* client_;
147 int layer_tree_host_id_;
144 148
145 bool last_set_needs_begin_impl_frame_; 149 bool last_set_needs_begin_impl_frame_;
146 BeginFrameArgs last_begin_impl_frame_args_; 150 BeginFrameArgs last_begin_impl_frame_args_;
147 base::CancelableClosure begin_impl_frame_deadline_closure_; 151 base::CancelableClosure begin_impl_frame_deadline_closure_;
148 base::CancelableClosure poll_for_draw_triggers_closure_; 152 base::CancelableClosure poll_for_draw_triggers_closure_;
149 153
150 SchedulerStateMachine state_machine_; 154 SchedulerStateMachine state_machine_;
151 bool inside_process_scheduled_actions_; 155 bool inside_process_scheduled_actions_;
152 SchedulerStateMachine::Action inside_action_; 156 SchedulerStateMachine::Action inside_action_;
153 157
154 base::WeakPtrFactory<Scheduler> weak_factory_; 158 base::WeakPtrFactory<Scheduler> weak_factory_;
155 159
156 DISALLOW_COPY_AND_ASSIGN(Scheduler); 160 DISALLOW_COPY_AND_ASSIGN(Scheduler);
157 }; 161 };
158 162
159 } // namespace cc 163 } // namespace cc
160 164
161 #endif // CC_SCHEDULER_SCHEDULER_H_ 165 #endif // CC_SCHEDULER_SCHEDULER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698