| 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 // Encapsulates an IPC channel between the GPU process and one renderer | 54 // Encapsulates an IPC channel between the GPU process and one renderer |
| 55 // process. On the renderer side there's a corresponding GpuChannelHost. | 55 // process. On the renderer side there's a corresponding GpuChannelHost. |
| 56 class GPU_EXPORT GpuChannel | 56 class GPU_EXPORT GpuChannel |
| 57 : public IPC::Listener, | 57 : public IPC::Listener, |
| 58 public IPC::Sender { | 58 public IPC::Sender { |
| 59 public: | 59 public: |
| 60 // Takes ownership of the renderer process handle. | 60 // Takes ownership of the renderer process handle. |
| 61 GpuChannel(GpuChannelManager* gpu_channel_manager, | 61 GpuChannel(GpuChannelManager* gpu_channel_manager, |
| 62 SyncPointManager* sync_point_manager, | 62 SyncPointManager* sync_point_manager, |
| 63 GpuWatchdog* watchdog, | 63 GpuWatchdog* watchdog, |
| 64 gfx::GLShareGroup* share_group, | 64 gl::GLShareGroup* share_group, |
| 65 gles2::MailboxManager* mailbox_manager, | 65 gles2::MailboxManager* mailbox_manager, |
| 66 PreemptionFlag* preempting_flag, | 66 PreemptionFlag* preempting_flag, |
| 67 PreemptionFlag* preempted_flag, | 67 PreemptionFlag* preempted_flag, |
| 68 base::SingleThreadTaskRunner* task_runner, | 68 base::SingleThreadTaskRunner* task_runner, |
| 69 base::SingleThreadTaskRunner* io_task_runner, | 69 base::SingleThreadTaskRunner* io_task_runner, |
| 70 int32_t client_id, | 70 int32_t client_id, |
| 71 uint64_t client_tracing_id, | 71 uint64_t client_tracing_id, |
| 72 bool allow_view_command_buffers, | 72 bool allow_view_command_buffers, |
| 73 bool allow_real_time_streams); | 73 bool allow_real_time_streams); |
| 74 ~GpuChannel() override; | 74 ~GpuChannel() override; |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 | 116 |
| 117 // IPC::Listener implementation: | 117 // IPC::Listener implementation: |
| 118 bool OnMessageReceived(const IPC::Message& msg) override; | 118 bool OnMessageReceived(const IPC::Message& msg) override; |
| 119 void OnChannelError() override; | 119 void OnChannelError() override; |
| 120 | 120 |
| 121 // IPC::Sender implementation: | 121 // IPC::Sender implementation: |
| 122 bool Send(IPC::Message* msg) override; | 122 bool Send(IPC::Message* msg) override; |
| 123 | 123 |
| 124 void OnStreamRescheduled(int32_t stream_id, bool scheduled); | 124 void OnStreamRescheduled(int32_t stream_id, bool scheduled); |
| 125 | 125 |
| 126 gfx::GLShareGroup* share_group() const { return share_group_.get(); } | 126 gl::GLShareGroup* share_group() const { return share_group_.get(); } |
| 127 | 127 |
| 128 GpuCommandBufferStub* LookupCommandBuffer(int32_t route_id); | 128 GpuCommandBufferStub* LookupCommandBuffer(int32_t route_id); |
| 129 | 129 |
| 130 void LoseAllContexts(); | 130 void LoseAllContexts(); |
| 131 void MarkAllContextsLost(); | 131 void MarkAllContextsLost(); |
| 132 | 132 |
| 133 // Called to add a listener for a particular message routing ID. | 133 // Called to add a listener for a particular message routing ID. |
| 134 // Returns true if succeeded. | 134 // Returns true if succeeded. |
| 135 bool AddRoute(int32_t route_id, int32_t stream_id, IPC::Listener* listener); | 135 bool AddRoute(int32_t route_id, int32_t stream_id, IPC::Listener* listener); |
| 136 | 136 |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 | 250 |
| 251 // The tracing ID used for memory allocations associated with this client. | 251 // The tracing ID used for memory allocations associated with this client. |
| 252 const uint64_t client_tracing_id_; | 252 const uint64_t client_tracing_id_; |
| 253 | 253 |
| 254 // The task runners for the main thread and the io thread. | 254 // The task runners for the main thread and the io thread. |
| 255 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | 255 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
| 256 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_; | 256 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_; |
| 257 | 257 |
| 258 // The share group that all contexts associated with a particular renderer | 258 // The share group that all contexts associated with a particular renderer |
| 259 // process use. | 259 // process use. |
| 260 scoped_refptr<gfx::GLShareGroup> share_group_; | 260 scoped_refptr<gl::GLShareGroup> share_group_; |
| 261 | 261 |
| 262 scoped_refptr<gles2::MailboxManager> mailbox_manager_; | 262 scoped_refptr<gles2::MailboxManager> mailbox_manager_; |
| 263 | 263 |
| 264 GpuWatchdog* const watchdog_; | 264 GpuWatchdog* const watchdog_; |
| 265 | 265 |
| 266 // Map of stream id to appropriate message queue. | 266 // Map of stream id to appropriate message queue. |
| 267 base::hash_map<int32_t, scoped_refptr<GpuChannelMessageQueue>> streams_; | 267 base::hash_map<int32_t, scoped_refptr<GpuChannelMessageQueue>> streams_; |
| 268 | 268 |
| 269 // Multimap of stream id to route ids. | 269 // Multimap of stream id to route ids. |
| 270 base::hash_map<int32_t, int> streams_to_num_routes_; | 270 base::hash_map<int32_t, int> streams_to_num_routes_; |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 470 scoped_refptr<PreemptionFlag> preempting_flag_; | 470 scoped_refptr<PreemptionFlag> preempting_flag_; |
| 471 scoped_refptr<PreemptionFlag> preempted_flag_; | 471 scoped_refptr<PreemptionFlag> preempted_flag_; |
| 472 SyncPointManager* const sync_point_manager_; | 472 SyncPointManager* const sync_point_manager_; |
| 473 | 473 |
| 474 DISALLOW_COPY_AND_ASSIGN(GpuChannelMessageQueue); | 474 DISALLOW_COPY_AND_ASSIGN(GpuChannelMessageQueue); |
| 475 }; | 475 }; |
| 476 | 476 |
| 477 } // namespace gpu | 477 } // namespace gpu |
| 478 | 478 |
| 479 #endif // GPU_IPC_SERVICE_GPU_CHANNEL_H_ | 479 #endif // GPU_IPC_SERVICE_GPU_CHANNEL_H_ |
| OLD | NEW |