OLD | NEW |
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 <deque> | 8 #include <deque> |
9 #include <memory> | 9 #include <memory> |
10 #include <string> | 10 #include <string> |
(...skipping 27 matching lines...) Expand all Loading... |
38 virtual void WillBeginImplFrame(const BeginFrameArgs& args) = 0; | 38 virtual void WillBeginImplFrame(const BeginFrameArgs& args) = 0; |
39 virtual void ScheduledActionSendBeginMainFrame( | 39 virtual void ScheduledActionSendBeginMainFrame( |
40 const BeginFrameArgs& args) = 0; | 40 const BeginFrameArgs& args) = 0; |
41 virtual DrawResult ScheduledActionDrawIfPossible() = 0; | 41 virtual DrawResult ScheduledActionDrawIfPossible() = 0; |
42 virtual DrawResult ScheduledActionDrawForced() = 0; | 42 virtual DrawResult ScheduledActionDrawForced() = 0; |
43 virtual void ScheduledActionCommit() = 0; | 43 virtual void ScheduledActionCommit() = 0; |
44 virtual void ScheduledActionActivateSyncTree() = 0; | 44 virtual void ScheduledActionActivateSyncTree() = 0; |
45 virtual void ScheduledActionBeginCompositorFrameSinkCreation() = 0; | 45 virtual void ScheduledActionBeginCompositorFrameSinkCreation() = 0; |
46 virtual void ScheduledActionPrepareTiles() = 0; | 46 virtual void ScheduledActionPrepareTiles() = 0; |
47 virtual void ScheduledActionInvalidateCompositorFrameSink() = 0; | 47 virtual void ScheduledActionInvalidateCompositorFrameSink() = 0; |
| 48 virtual void ScheduledActionPerformImplSideInvalidation() = 0; |
48 virtual void DidFinishImplFrame() = 0; | 49 virtual void DidFinishImplFrame() = 0; |
49 virtual void SendBeginMainFrameNotExpectedSoon() = 0; | 50 virtual void SendBeginMainFrameNotExpectedSoon() = 0; |
50 | 51 |
51 protected: | 52 protected: |
52 virtual ~SchedulerClient() {} | 53 virtual ~SchedulerClient() {} |
53 }; | 54 }; |
54 | 55 |
55 class CC_EXPORT Scheduler : public BeginFrameObserverBase { | 56 class CC_EXPORT Scheduler : public BeginFrameObserverBase { |
56 public: | 57 public: |
57 Scheduler(SchedulerClient* client, | 58 Scheduler(SchedulerClient* client, |
(...skipping 24 matching lines...) Expand all Loading... |
82 | 83 |
83 void SetNeedsBeginMainFrame(); | 84 void SetNeedsBeginMainFrame(); |
84 // Requests a single impl frame (after the current frame if there is one | 85 // Requests a single impl frame (after the current frame if there is one |
85 // active). | 86 // active). |
86 void SetNeedsOneBeginImplFrame(); | 87 void SetNeedsOneBeginImplFrame(); |
87 | 88 |
88 void SetNeedsRedraw(); | 89 void SetNeedsRedraw(); |
89 | 90 |
90 void SetNeedsPrepareTiles(); | 91 void SetNeedsPrepareTiles(); |
91 | 92 |
| 93 // Requests a pending tree should be created to invalidate content on the impl |
| 94 // thread, after the current tree is activated, if any. If the request |
| 95 // necessitates creating a pending tree only for impl-side invalidations, the |
| 96 // |client_| is informed to perform this action using |
| 97 // ScheduledActionRunImplSideInvalidation. |
| 98 // If ScheduledActionCommit is performed, the impl-side invalidations should |
| 99 // be merged with the main frame and the request is assumed to be completed. |
| 100 void SetNeedsImplSideInvalidation(); |
| 101 |
92 // Drawing should result in submitting a CompositorFrame to the | 102 // Drawing should result in submitting a CompositorFrame to the |
93 // CompositorFrameSink and then calling this. | 103 // CompositorFrameSink and then calling this. |
94 void DidSubmitCompositorFrame(); | 104 void DidSubmitCompositorFrame(); |
95 // The CompositorFrameSink acks when it is ready for a new frame which | 105 // The CompositorFrameSink acks when it is ready for a new frame which |
96 // should result in this getting called to unblock the next draw. | 106 // should result in this getting called to unblock the next draw. |
97 void DidReceiveCompositorFrameAck(); | 107 void DidReceiveCompositorFrameAck(); |
98 | 108 |
99 void SetTreePrioritiesAndScrollState(TreePriority tree_priority, | 109 void SetTreePrioritiesAndScrollState(TreePriority tree_priority, |
100 ScrollHandlerState scroll_handler_state); | 110 ScrollHandlerState scroll_handler_state); |
101 | 111 |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 } | 214 } |
205 | 215 |
206 base::WeakPtrFactory<Scheduler> weak_factory_; | 216 base::WeakPtrFactory<Scheduler> weak_factory_; |
207 | 217 |
208 DISALLOW_COPY_AND_ASSIGN(Scheduler); | 218 DISALLOW_COPY_AND_ASSIGN(Scheduler); |
209 }; | 219 }; |
210 | 220 |
211 } // namespace cc | 221 } // namespace cc |
212 | 222 |
213 #endif // CC_SCHEDULER_SCHEDULER_H_ | 223 #endif // CC_SCHEDULER_SCHEDULER_H_ |
OLD | NEW |