| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 GPU_IPC_SERVICE_GPU_CHANNEL_H_ | 5 #ifndef GPU_IPC_SERVICE_GPU_CHANNEL_H_ |
| 6 #define GPU_IPC_SERVICE_GPU_CHANNEL_H_ | 6 #define GPU_IPC_SERVICE_GPU_CHANNEL_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 // process. On the renderer side there's a corresponding GpuChannelHost. | 80 // process. On the renderer side there's a corresponding GpuChannelHost. |
| 81 class GPU_EXPORT GpuChannel : public IPC::Listener, public FilteredSender { | 81 class GPU_EXPORT GpuChannel : public IPC::Listener, public FilteredSender { |
| 82 public: | 82 public: |
| 83 // Takes ownership of the renderer process handle. | 83 // Takes ownership of the renderer process handle. |
| 84 GpuChannel(GpuChannelManager* gpu_channel_manager, | 84 GpuChannel(GpuChannelManager* gpu_channel_manager, |
| 85 Scheduler* scheduler, | 85 Scheduler* scheduler, |
| 86 SyncPointManager* sync_point_manager, | 86 SyncPointManager* sync_point_manager, |
| 87 GpuWatchdogThread* watchdog, | 87 GpuWatchdogThread* watchdog, |
| 88 scoped_refptr<gl::GLShareGroup> share_group, | 88 scoped_refptr<gl::GLShareGroup> share_group, |
| 89 scoped_refptr<gles2::MailboxManager> mailbox_manager, | 89 scoped_refptr<gles2::MailboxManager> mailbox_manager, |
| 90 ServiceDiscardableManager* discardable_manager_, |
| 90 scoped_refptr<PreemptionFlag> preempting_flag, | 91 scoped_refptr<PreemptionFlag> preempting_flag, |
| 91 scoped_refptr<PreemptionFlag> preempted_flag, | 92 scoped_refptr<PreemptionFlag> preempted_flag, |
| 92 scoped_refptr<base::SingleThreadTaskRunner> task_runner, | 93 scoped_refptr<base::SingleThreadTaskRunner> task_runner, |
| 93 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner, | 94 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner, |
| 94 int32_t client_id, | 95 int32_t client_id, |
| 95 uint64_t client_tracing_id, | 96 uint64_t client_tracing_id, |
| 96 bool is_gpu_host); | 97 bool is_gpu_host); |
| 97 ~GpuChannel() override; | 98 ~GpuChannel() override; |
| 98 | 99 |
| 99 // The IPC channel cannot be passed in the constructor because it needs a | 100 // The IPC channel cannot be passed in the constructor because it needs a |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 // FilteredSender implementation: | 148 // FilteredSender implementation: |
| 148 bool Send(IPC::Message* msg) override; | 149 bool Send(IPC::Message* msg) override; |
| 149 void AddFilter(IPC::MessageFilter* filter) override; | 150 void AddFilter(IPC::MessageFilter* filter) override; |
| 150 void RemoveFilter(IPC::MessageFilter* filter) override; | 151 void RemoveFilter(IPC::MessageFilter* filter) override; |
| 151 | 152 |
| 152 void OnCommandBufferScheduled(GpuCommandBufferStub* stub); | 153 void OnCommandBufferScheduled(GpuCommandBufferStub* stub); |
| 153 void OnCommandBufferDescheduled(GpuCommandBufferStub* stub); | 154 void OnCommandBufferDescheduled(GpuCommandBufferStub* stub); |
| 154 | 155 |
| 155 gl::GLShareGroup* share_group() const { return share_group_.get(); } | 156 gl::GLShareGroup* share_group() const { return share_group_.get(); } |
| 156 | 157 |
| 158 ServiceDiscardableManager* discardable_manager() const { |
| 159 return discardable_manager_; |
| 160 } |
| 161 |
| 157 GpuCommandBufferStub* LookupCommandBuffer(int32_t route_id); | 162 GpuCommandBufferStub* LookupCommandBuffer(int32_t route_id); |
| 158 | 163 |
| 159 void LoseAllContexts(); | 164 void LoseAllContexts(); |
| 160 void MarkAllContextsLost(); | 165 void MarkAllContextsLost(); |
| 161 | 166 |
| 162 // Called to add a listener for a particular message routing ID. | 167 // Called to add a listener for a particular message routing ID. |
| 163 // Returns true if succeeded. | 168 // Returns true if succeeded. |
| 164 bool AddRoute(int32_t route_id, | 169 bool AddRoute(int32_t route_id, |
| 165 SequenceId sequence_id, | 170 SequenceId sequence_id, |
| 166 IPC::Listener* listener); | 171 IPC::Listener* listener); |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 265 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_; | 270 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_; |
| 266 | 271 |
| 267 // The share group that all contexts associated with a particular renderer | 272 // The share group that all contexts associated with a particular renderer |
| 268 // process use. | 273 // process use. |
| 269 scoped_refptr<gl::GLShareGroup> share_group_; | 274 scoped_refptr<gl::GLShareGroup> share_group_; |
| 270 | 275 |
| 271 scoped_refptr<gles2::MailboxManager> mailbox_manager_; | 276 scoped_refptr<gles2::MailboxManager> mailbox_manager_; |
| 272 | 277 |
| 273 GpuWatchdogThread* const watchdog_; | 278 GpuWatchdogThread* const watchdog_; |
| 274 | 279 |
| 280 ServiceDiscardableManager* discardable_manager_; |
| 281 |
| 275 const bool is_gpu_host_; | 282 const bool is_gpu_host_; |
| 276 | 283 |
| 277 // Member variables should appear before the WeakPtrFactory, to ensure that | 284 // Member variables should appear before the WeakPtrFactory, to ensure that |
| 278 // any WeakPtrs to Controller are invalidated before its members variable's | 285 // any WeakPtrs to Controller are invalidated before its members variable's |
| 279 // destructors are executed, rendering them invalid. | 286 // destructors are executed, rendering them invalid. |
| 280 base::WeakPtrFactory<GpuChannel> weak_factory_; | 287 base::WeakPtrFactory<GpuChannel> weak_factory_; |
| 281 | 288 |
| 282 DISALLOW_COPY_AND_ASSIGN(GpuChannel); | 289 DISALLOW_COPY_AND_ASSIGN(GpuChannel); |
| 283 }; | 290 }; |
| 284 | 291 |
| 285 } // namespace gpu | 292 } // namespace gpu |
| 286 | 293 |
| 287 #endif // GPU_IPC_SERVICE_GPU_CHANNEL_H_ | 294 #endif // GPU_IPC_SERVICE_GPU_CHANNEL_H_ |
| OLD | NEW |