| 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 <deque> | 8 #include <deque> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 int32 client_id, | 123 int32 client_id, |
| 124 const GPUCreateCommandBufferConfig& init_params, | 124 const GPUCreateCommandBufferConfig& init_params, |
| 125 int32 route_id); | 125 int32 route_id); |
| 126 void OnLoadedShader(std::string shader); | 126 void OnLoadedShader(std::string shader); |
| 127 void DestroyGpuMemoryBuffer(gfx::GpuMemoryBufferId id, int client_id); | 127 void DestroyGpuMemoryBuffer(gfx::GpuMemoryBufferId id, int client_id); |
| 128 void DestroyGpuMemoryBufferOnIO(gfx::GpuMemoryBufferId id, int client_id); | 128 void DestroyGpuMemoryBufferOnIO(gfx::GpuMemoryBufferId id, int client_id); |
| 129 void OnDestroyGpuMemoryBuffer(gfx::GpuMemoryBufferId id, | 129 void OnDestroyGpuMemoryBuffer(gfx::GpuMemoryBufferId id, |
| 130 int client_id, | 130 int client_id, |
| 131 int32 sync_point); | 131 int32 sync_point); |
| 132 | 132 |
| 133 void OnRelinquishResources(); | 133 void OnFinalize(); |
| 134 void OnResourcesRelinquished(); | |
| 135 | 134 |
| 136 void OnUpdateValueState(int client_id, | 135 void OnUpdateValueState(int client_id, |
| 137 unsigned int target, | 136 unsigned int target, |
| 138 const gpu::ValueState& state); | 137 const gpu::ValueState& state); |
| 139 | 138 |
| 140 void OnLoseAllContexts(); | 139 void OnLoseAllContexts(); |
| 141 void CheckRelinquishGpuResources(); | |
| 142 | 140 |
| 143 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_; | 141 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_; |
| 144 base::WaitableEvent* shutdown_event_; | 142 base::WaitableEvent* shutdown_event_; |
| 145 | 143 |
| 146 // Used to send and receive IPC messages from the browser process. | 144 // Used to send and receive IPC messages from the browser process. |
| 147 MessageRouter* const router_; | 145 MessageRouter* const router_; |
| 148 | 146 |
| 149 // These objects manage channels to individual renderer processes there is | 147 // These objects manage channels to individual renderer processes there is |
| 150 // one channel for each renderer process that has connected to this GPU | 148 // one channel for each renderer process that has connected to this GPU |
| 151 // process. | 149 // process. |
| 152 GpuChannelMap gpu_channels_; | 150 GpuChannelMap gpu_channels_; |
| 153 scoped_refptr<gfx::GLShareGroup> share_group_; | 151 scoped_refptr<gfx::GLShareGroup> share_group_; |
| 154 scoped_refptr<gpu::gles2::MailboxManager> mailbox_manager_; | 152 scoped_refptr<gpu::gles2::MailboxManager> mailbox_manager_; |
| 155 GpuMemoryManager gpu_memory_manager_; | 153 GpuMemoryManager gpu_memory_manager_; |
| 156 GpuWatchdog* watchdog_; | 154 GpuWatchdog* watchdog_; |
| 157 // SyncPointManager guaranteed to outlive running MessageLoop. | 155 // SyncPointManager guaranteed to outlive running MessageLoop. |
| 158 gpu::SyncPointManager* sync_point_manager_; | 156 gpu::SyncPointManager* sync_point_manager_; |
| 159 scoped_ptr<gpu::gles2::ProgramCache> program_cache_; | 157 scoped_ptr<gpu::gles2::ProgramCache> program_cache_; |
| 160 scoped_refptr<gpu::gles2::ShaderTranslatorCache> shader_translator_cache_; | 158 scoped_refptr<gpu::gles2::ShaderTranslatorCache> shader_translator_cache_; |
| 161 scoped_refptr<gfx::GLSurface> default_offscreen_surface_; | 159 scoped_refptr<gfx::GLSurface> default_offscreen_surface_; |
| 162 GpuMemoryBufferFactory* const gpu_memory_buffer_factory_; | 160 GpuMemoryBufferFactory* const gpu_memory_buffer_factory_; |
| 163 IPC::SyncChannel* channel_; | 161 IPC::SyncChannel* channel_; |
| 164 bool relinquish_resources_pending_; | |
| 165 // Must outlive this instance of GpuChannelManager. | 162 // Must outlive this instance of GpuChannelManager. |
| 166 IPC::AttachmentBroker* attachment_broker_; | 163 IPC::AttachmentBroker* attachment_broker_; |
| 167 | 164 |
| 168 // Member variables should appear before the WeakPtrFactory, to ensure | 165 // Member variables should appear before the WeakPtrFactory, to ensure |
| 169 // that any WeakPtrs to Controller are invalidated before its members | 166 // that any WeakPtrs to Controller are invalidated before its members |
| 170 // variable's destructors are executed, rendering them invalid. | 167 // variable's destructors are executed, rendering them invalid. |
| 171 base::WeakPtrFactory<GpuChannelManager> weak_factory_; | 168 base::WeakPtrFactory<GpuChannelManager> weak_factory_; |
| 172 | 169 |
| 173 DISALLOW_COPY_AND_ASSIGN(GpuChannelManager); | 170 DISALLOW_COPY_AND_ASSIGN(GpuChannelManager); |
| 174 }; | 171 }; |
| 175 | 172 |
| 176 } // namespace content | 173 } // namespace content |
| 177 | 174 |
| 178 #endif // CONTENT_COMMON_GPU_GPU_CHANNEL_MANAGER_H_ | 175 #endif // CONTENT_COMMON_GPU_GPU_CHANNEL_MANAGER_H_ |
| OLD | NEW |