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 CONTENT_COMMON_GPU_GPU_CHANNEL_MANAGER_H_ | 5 #ifndef CONTENT_COMMON_GPU_GPU_CHANNEL_MANAGER_H_ |
6 #define CONTENT_COMMON_GPU_GPU_CHANNEL_MANAGER_H_ | 6 #define CONTENT_COMMON_GPU_GPU_CHANNEL_MANAGER_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <deque> | 10 #include <deque> |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 class ProgramCache; | 47 class ProgramCache; |
48 class ShaderTranslatorCache; | 48 class ShaderTranslatorCache; |
49 } | 49 } |
50 } | 50 } |
51 | 51 |
52 namespace IPC { | 52 namespace IPC { |
53 struct ChannelHandle; | 53 struct ChannelHandle; |
54 class SyncChannel; | 54 class SyncChannel; |
55 } | 55 } |
56 | 56 |
57 struct GPUCreateCommandBufferConfig; | |
58 struct GpuMsg_EstablishChannel_Params; | 57 struct GpuMsg_EstablishChannel_Params; |
59 | 58 |
60 namespace content { | 59 namespace content { |
| 60 |
61 class GpuChannel; | 61 class GpuChannel; |
62 class GpuMemoryBufferFactory; | 62 class GpuMemoryBufferFactory; |
63 class GpuWatchdog; | 63 class GpuWatchdog; |
| 64 struct GpuCreateCommandBufferConfig; |
64 | 65 |
65 // A GpuChannelManager is a thread responsible for issuing rendering commands | 66 // A GpuChannelManager is a thread responsible for issuing rendering commands |
66 // managing the lifetimes of GPU channels and forwarding IPC requests from the | 67 // managing the lifetimes of GPU channels and forwarding IPC requests from the |
67 // browser process to them based on the corresponding renderer ID. | 68 // browser process to them based on the corresponding renderer ID. |
68 class CONTENT_EXPORT GpuChannelManager : public IPC::Listener, | 69 class CONTENT_EXPORT GpuChannelManager : public IPC::Listener, |
69 public IPC::Sender { | 70 public IPC::Sender { |
70 public: | 71 public: |
71 GpuChannelManager(IPC::SyncChannel* channel, | 72 GpuChannelManager(IPC::SyncChannel* channel, |
72 GpuWatchdog* watchdog, | 73 GpuWatchdog* watchdog, |
73 base::SingleThreadTaskRunner* task_runner, | 74 base::SingleThreadTaskRunner* task_runner, |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 // Message handlers. | 149 // Message handlers. |
149 bool OnControlMessageReceived(const IPC::Message& msg); | 150 bool OnControlMessageReceived(const IPC::Message& msg); |
150 void OnEstablishChannel(const GpuMsg_EstablishChannel_Params& params); | 151 void OnEstablishChannel(const GpuMsg_EstablishChannel_Params& params); |
151 void OnCloseChannel(const IPC::ChannelHandle& channel_handle); | 152 void OnCloseChannel(const IPC::ChannelHandle& channel_handle); |
152 void OnVisibilityChanged(int32_t render_view_id, | 153 void OnVisibilityChanged(int32_t render_view_id, |
153 int32_t client_id, | 154 int32_t client_id, |
154 bool visible); | 155 bool visible); |
155 void OnCreateViewCommandBuffer( | 156 void OnCreateViewCommandBuffer( |
156 const gfx::GLSurfaceHandle& window, | 157 const gfx::GLSurfaceHandle& window, |
157 int32_t client_id, | 158 int32_t client_id, |
158 const GPUCreateCommandBufferConfig& init_params, | 159 const GpuCreateCommandBufferConfig& init_params, |
159 int32_t route_id); | 160 int32_t route_id); |
160 void OnLoadedShader(const std::string& shader); | 161 void OnLoadedShader(const std::string& shader); |
161 void DestroyGpuMemoryBuffer(gfx::GpuMemoryBufferId id, int client_id); | 162 void DestroyGpuMemoryBuffer(gfx::GpuMemoryBufferId id, int client_id); |
162 void DestroyGpuMemoryBufferOnIO(gfx::GpuMemoryBufferId id, int client_id); | 163 void DestroyGpuMemoryBufferOnIO(gfx::GpuMemoryBufferId id, int client_id); |
163 void OnDestroyGpuMemoryBuffer(gfx::GpuMemoryBufferId id, | 164 void OnDestroyGpuMemoryBuffer(gfx::GpuMemoryBufferId id, |
164 int client_id, | 165 int client_id, |
165 const gpu::SyncToken& sync_token); | 166 const gpu::SyncToken& sync_token); |
166 | 167 |
167 void OnUpdateValueState(int client_id, | 168 void OnUpdateValueState(int client_id, |
168 unsigned int target, | 169 unsigned int target, |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 // that any WeakPtrs to Controller are invalidated before its members | 207 // that any WeakPtrs to Controller are invalidated before its members |
207 // variable's destructors are executed, rendering them invalid. | 208 // variable's destructors are executed, rendering them invalid. |
208 base::WeakPtrFactory<GpuChannelManager> weak_factory_; | 209 base::WeakPtrFactory<GpuChannelManager> weak_factory_; |
209 | 210 |
210 DISALLOW_COPY_AND_ASSIGN(GpuChannelManager); | 211 DISALLOW_COPY_AND_ASSIGN(GpuChannelManager); |
211 }; | 212 }; |
212 | 213 |
213 } // namespace content | 214 } // namespace content |
214 | 215 |
215 #endif // CONTENT_COMMON_GPU_GPU_CHANNEL_MANAGER_H_ | 216 #endif // CONTENT_COMMON_GPU_GPU_CHANNEL_MANAGER_H_ |
OLD | NEW |