| 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 "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
| 10 #include "base/time.h" | 10 #include "base/time.h" |
| 11 #include "cc/animation/animation_events.h" | 11 #include "cc/animation/animation_events.h" |
| 12 #include "cc/base/completion_event.h" | 12 #include "cc/base/completion_event.h" |
| 13 #include "cc/resources/resource_update_controller.h" | 13 #include "cc/resources/resource_update_controller.h" |
| 14 #include "cc/scheduler/rolling_time_delta_history.h" | 14 #include "cc/scheduler/rolling_time_delta_history.h" |
| 15 #include "cc/scheduler/scheduler.h" | 15 #include "cc/scheduler/scheduler.h" |
| 16 #include "cc/scheduler/vsync_time_source.h" | 16 #include "cc/scheduler/vsync_time_source.h" |
| 17 #include "cc/trees/layer_tree_host_impl.h" | 17 #include "cc/trees/layer_tree_host_impl.h" |
| 18 #include "cc/trees/proxy.h" | 18 #include "cc/trees/proxy.h" |
| 19 | 19 |
| 20 namespace base { class SingleThreadTaskRunner; } |
| 21 |
| 20 namespace cc { | 22 namespace cc { |
| 21 | 23 |
| 22 class ContextProvider; | 24 class ContextProvider; |
| 23 class InputHandlerClient; | 25 class InputHandlerClient; |
| 24 class LayerTreeHost; | 26 class LayerTreeHost; |
| 25 class ResourceUpdateQueue; | 27 class ResourceUpdateQueue; |
| 26 class Scheduler; | 28 class Scheduler; |
| 27 class ScopedThreadProxy; | 29 class ScopedThreadProxy; |
| 28 class Thread; | |
| 29 | 30 |
| 30 class ThreadProxy : public Proxy, | 31 class ThreadProxy : public Proxy, |
| 31 LayerTreeHostImplClient, | 32 LayerTreeHostImplClient, |
| 32 SchedulerClient, | 33 SchedulerClient, |
| 33 ResourceUpdateControllerClient, | 34 ResourceUpdateControllerClient, |
| 34 VSyncProvider { | 35 VSyncProvider { |
| 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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 | 115 |
| 114 int MaxFramesPendingForTesting() const { | 116 int MaxFramesPendingForTesting() const { |
| 115 return scheduler_on_impl_thread_->MaxFramesPending(); | 117 return scheduler_on_impl_thread_->MaxFramesPending(); |
| 116 } | 118 } |
| 117 | 119 |
| 118 int NumFramesPendingForTesting() const { | 120 int NumFramesPendingForTesting() const { |
| 119 return scheduler_on_impl_thread_->NumFramesPendingForTesting(); | 121 return scheduler_on_impl_thread_->NumFramesPendingForTesting(); |
| 120 } | 122 } |
| 121 | 123 |
| 122 private: | 124 private: |
| 123 ThreadProxy(LayerTreeHost* layer_tree_host, scoped_ptr<Thread> impl_thread); | 125 ThreadProxy(LayerTreeHost* layer_tree_host, |
| 126 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner); |
| 124 | 127 |
| 125 struct BeginFrameAndCommitState { | 128 struct BeginFrameAndCommitState { |
| 126 BeginFrameAndCommitState(); | 129 BeginFrameAndCommitState(); |
| 127 ~BeginFrameAndCommitState(); | 130 ~BeginFrameAndCommitState(); |
| 128 | 131 |
| 129 base::TimeTicks monotonic_frame_begin_time; | 132 base::TimeTicks monotonic_frame_begin_time; |
| 130 scoped_ptr<ScrollAndScaleSet> scroll_info; | 133 scoped_ptr<ScrollAndScaleSet> scroll_info; |
| 131 size_t memory_allocation_limit_bytes; | 134 size_t memory_allocation_limit_bytes; |
| 132 }; | 135 }; |
| 133 | 136 |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 bool renew_tree_priority_on_impl_thread_pending_; | 266 bool renew_tree_priority_on_impl_thread_pending_; |
| 264 | 267 |
| 265 RollingTimeDeltaHistory draw_duration_history_; | 268 RollingTimeDeltaHistory draw_duration_history_; |
| 266 | 269 |
| 267 DISALLOW_COPY_AND_ASSIGN(ThreadProxy); | 270 DISALLOW_COPY_AND_ASSIGN(ThreadProxy); |
| 268 }; | 271 }; |
| 269 | 272 |
| 270 } // namespace cc | 273 } // namespace cc |
| 271 | 274 |
| 272 #endif // CC_TREES_THREAD_PROXY_H_ | 275 #endif // CC_TREES_THREAD_PROXY_H_ |
| OLD | NEW |