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_TREES_THREAD_PROXY_H_ | 5 #ifndef CC_TREES_THREAD_PROXY_H_ |
6 #define CC_TREES_THREAD_PROXY_H_ | 6 #define CC_TREES_THREAD_PROXY_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
11 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
12 #include "base/time.h" | 12 #include "base/time.h" |
13 #include "cc/animation/animation_events.h" | 13 #include "cc/animation/animation_events.h" |
14 #include "cc/base/completion_event.h" | 14 #include "cc/base/completion_event.h" |
15 #include "cc/resources/resource_update_controller.h" | 15 #include "cc/resources/resource_update_controller.h" |
16 #include "cc/scheduler/rolling_time_delta_history.h" | 16 #include "cc/scheduler/rolling_time_delta_history.h" |
17 #include "cc/scheduler/scheduler.h" | 17 #include "cc/scheduler/scheduler.h" |
18 #include "cc/trees/layer_tree_host_impl.h" | 18 #include "cc/trees/layer_tree_host_impl.h" |
19 #include "cc/trees/proxy.h" | 19 #include "cc/trees/proxy.h" |
20 | 20 |
| 21 namespace base { class SingleThreadTaskRunner; } |
| 22 |
21 namespace cc { | 23 namespace cc { |
22 | 24 |
23 class ContextProvider; | 25 class ContextProvider; |
24 class InputHandlerClient; | 26 class InputHandlerClient; |
25 class LayerTreeHost; | 27 class LayerTreeHost; |
26 class ResourceUpdateQueue; | 28 class ResourceUpdateQueue; |
27 class Scheduler; | 29 class Scheduler; |
28 class ScopedThreadProxy; | 30 class ScopedThreadProxy; |
29 class Thread; | |
30 | 31 |
31 class ThreadProxy : public Proxy, | 32 class ThreadProxy : public Proxy, |
32 LayerTreeHostImplClient, | 33 LayerTreeHostImplClient, |
33 SchedulerClient, | 34 SchedulerClient, |
34 ResourceUpdateControllerClient { | 35 ResourceUpdateControllerClient { |
35 public: | 36 public: |
36 static scoped_ptr<Proxy> Create(LayerTreeHost* layer_tree_host, | 37 static scoped_ptr<Proxy> Create( |
37 scoped_ptr<Thread> impl_thread); | 38 LayerTreeHost* layer_tree_host, |
| 39 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner); |
38 | 40 |
39 virtual ~ThreadProxy(); | 41 virtual ~ThreadProxy(); |
40 | 42 |
41 // Proxy implementation | 43 // Proxy implementation |
42 virtual bool CompositeAndReadback(void* pixels, gfx::Rect rect) OVERRIDE; | 44 virtual bool CompositeAndReadback(void* pixels, gfx::Rect rect) OVERRIDE; |
43 virtual void FinishAllRendering() OVERRIDE; | 45 virtual void FinishAllRendering() OVERRIDE; |
44 virtual bool IsStarted() const OVERRIDE; | 46 virtual bool IsStarted() const OVERRIDE; |
45 virtual void SetLayerTreeHostClientReady() OVERRIDE; | 47 virtual void SetLayerTreeHostClientReady() OVERRIDE; |
46 virtual void SetVisible(bool visible) OVERRIDE; | 48 virtual void SetVisible(bool visible) OVERRIDE; |
47 virtual void CreateAndInitializeOutputSurface() OVERRIDE; | 49 virtual void CreateAndInitializeOutputSurface() OVERRIDE; |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 virtual void ScheduledActionActivatePendingTreeIfNeeded() OVERRIDE; | 103 virtual void ScheduledActionActivatePendingTreeIfNeeded() OVERRIDE; |
102 virtual void ScheduledActionBeginOutputSurfaceCreation() OVERRIDE; | 104 virtual void ScheduledActionBeginOutputSurfaceCreation() OVERRIDE; |
103 virtual void ScheduledActionAcquireLayerTexturesForMainThread() OVERRIDE; | 105 virtual void ScheduledActionAcquireLayerTexturesForMainThread() OVERRIDE; |
104 virtual void DidAnticipatedDrawTimeChange(base::TimeTicks time) OVERRIDE; | 106 virtual void DidAnticipatedDrawTimeChange(base::TimeTicks time) OVERRIDE; |
105 virtual base::TimeDelta DrawDurationEstimate() OVERRIDE; | 107 virtual base::TimeDelta DrawDurationEstimate() OVERRIDE; |
106 | 108 |
107 // ResourceUpdateControllerClient implementation | 109 // ResourceUpdateControllerClient implementation |
108 virtual void ReadyToFinalizeTextureUpdates() OVERRIDE; | 110 virtual void ReadyToFinalizeTextureUpdates() OVERRIDE; |
109 | 111 |
110 private: | 112 private: |
111 ThreadProxy(LayerTreeHost* layer_tree_host, scoped_ptr<Thread> impl_thread); | 113 ThreadProxy(LayerTreeHost* layer_tree_host, |
| 114 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner); |
112 | 115 |
113 struct BeginFrameAndCommitState { | 116 struct BeginFrameAndCommitState { |
114 BeginFrameAndCommitState(); | 117 BeginFrameAndCommitState(); |
115 ~BeginFrameAndCommitState(); | 118 ~BeginFrameAndCommitState(); |
116 | 119 |
117 base::TimeTicks monotonic_frame_begin_time; | 120 base::TimeTicks monotonic_frame_begin_time; |
118 scoped_ptr<ScrollAndScaleSet> scroll_info; | 121 scoped_ptr<ScrollAndScaleSet> scroll_info; |
119 size_t memory_allocation_limit_bytes; | 122 size_t memory_allocation_limit_bytes; |
120 }; | 123 }; |
121 | 124 |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 bool renew_tree_priority_on_impl_thread_pending_; | 249 bool renew_tree_priority_on_impl_thread_pending_; |
247 | 250 |
248 RollingTimeDeltaHistory draw_duration_history_; | 251 RollingTimeDeltaHistory draw_duration_history_; |
249 | 252 |
250 DISALLOW_COPY_AND_ASSIGN(ThreadProxy); | 253 DISALLOW_COPY_AND_ASSIGN(ThreadProxy); |
251 }; | 254 }; |
252 | 255 |
253 } // namespace cc | 256 } // namespace cc |
254 | 257 |
255 #endif // CC_TREES_THREAD_PROXY_H_ | 258 #endif // CC_TREES_THREAD_PROXY_H_ |
OLD | NEW |