| 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 <vector> |
| 9 |
| 8 #include "base/hash_tables.h" | 10 #include "base/hash_tables.h" |
| 9 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 12 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
| 11 #include "base/message_loop_proxy.h" | 14 #include "base/message_loop_proxy.h" |
| 12 #include "build/build_config.h" | 15 #include "build/build_config.h" |
| 13 #include "content/common/gpu/gpu_memory_manager.h" | 16 #include "content/common/gpu/gpu_memory_manager.h" |
| 14 #include "ipc/ipc_listener.h" | 17 #include "ipc/ipc_listener.h" |
| 15 #include "ipc/ipc_sender.h" | 18 #include "ipc/ipc_sender.h" |
| 16 #include "ui/gfx/native_widget_types.h" | 19 #include "ui/gfx/native_widget_types.h" |
| 17 | 20 |
| 18 namespace base { | 21 namespace base { |
| 19 class WaitableEvent; | 22 class WaitableEvent; |
| 20 } | 23 } |
| 21 | 24 |
| 22 namespace gfx { | 25 namespace gfx { |
| 23 class GLShareGroup; | 26 class GLShareGroup; |
| 24 } | 27 } |
| 25 | 28 |
| 26 namespace gpu { | 29 namespace gpu { |
| 27 namespace gles2 { | 30 namespace gles2 { |
| 28 class MailboxManager; | 31 class MailboxManager; |
| 32 class ProgramCache; |
| 29 } | 33 } |
| 30 } | 34 } |
| 31 | 35 |
| 32 namespace IPC { | 36 namespace IPC { |
| 33 struct ChannelHandle; | 37 struct ChannelHandle; |
| 34 } | 38 } |
| 35 | 39 |
| 36 class ChildThread; | 40 class ChildThread; |
| 37 class GpuChannel; | 41 class GpuChannel; |
| 38 class GpuWatchdog; | 42 class GpuWatchdog; |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 std::vector<GpuCommandBufferStubBase*>& stubs) OVERRIDE; | 77 std::vector<GpuCommandBufferStubBase*>& stubs) OVERRIDE; |
| 74 | 78 |
| 75 void LoseAllContexts(); | 79 void LoseAllContexts(); |
| 76 | 80 |
| 77 base::WeakPtrFactory<GpuChannelManager> weak_factory_; | 81 base::WeakPtrFactory<GpuChannelManager> weak_factory_; |
| 78 | 82 |
| 79 int GenerateRouteID(); | 83 int GenerateRouteID(); |
| 80 void AddRoute(int32 routing_id, IPC::Listener* listener); | 84 void AddRoute(int32 routing_id, IPC::Listener* listener); |
| 81 void RemoveRoute(int32 routing_id); | 85 void RemoveRoute(int32 routing_id); |
| 82 | 86 |
| 87 gpu::gles2::ProgramCache* program_cache(); |
| 88 |
| 83 GpuMemoryManager* gpu_memory_manager() { return &gpu_memory_manager_; } | 89 GpuMemoryManager* gpu_memory_manager() { return &gpu_memory_manager_; } |
| 84 | 90 |
| 85 GpuChannel* LookupChannel(int32 client_id); | 91 GpuChannel* LookupChannel(int32 client_id); |
| 86 | 92 |
| 87 SyncPointManager* sync_point_manager() { return sync_point_manager_; } | 93 SyncPointManager* sync_point_manager() { return sync_point_manager_; } |
| 88 | 94 |
| 89 private: | 95 private: |
| 90 // Message handlers. | 96 // Message handlers. |
| 91 void OnEstablishChannel(int client_id, bool share_context); | 97 void OnEstablishChannel(int client_id, bool share_context); |
| 92 void OnCloseChannel(const IPC::ChannelHandle& channel_handle); | 98 void OnCloseChannel(const IPC::ChannelHandle& channel_handle); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 109 // These objects manage channels to individual renderer processes there is | 115 // These objects manage channels to individual renderer processes there is |
| 110 // one channel for each renderer process that has connected to this GPU | 116 // one channel for each renderer process that has connected to this GPU |
| 111 // process. | 117 // process. |
| 112 typedef base::hash_map<int, scoped_refptr<GpuChannel> > GpuChannelMap; | 118 typedef base::hash_map<int, scoped_refptr<GpuChannel> > GpuChannelMap; |
| 113 GpuChannelMap gpu_channels_; | 119 GpuChannelMap gpu_channels_; |
| 114 scoped_refptr<gfx::GLShareGroup> share_group_; | 120 scoped_refptr<gfx::GLShareGroup> share_group_; |
| 115 scoped_refptr<gpu::gles2::MailboxManager> mailbox_manager_; | 121 scoped_refptr<gpu::gles2::MailboxManager> mailbox_manager_; |
| 116 GpuMemoryManager gpu_memory_manager_; | 122 GpuMemoryManager gpu_memory_manager_; |
| 117 GpuWatchdog* watchdog_; | 123 GpuWatchdog* watchdog_; |
| 118 scoped_refptr<SyncPointManager> sync_point_manager_; | 124 scoped_refptr<SyncPointManager> sync_point_manager_; |
| 125 scoped_ptr<gpu::gles2::ProgramCache> program_cache_; |
| 119 | 126 |
| 120 DISALLOW_COPY_AND_ASSIGN(GpuChannelManager); | 127 DISALLOW_COPY_AND_ASSIGN(GpuChannelManager); |
| 121 }; | 128 }; |
| 122 | 129 |
| 123 #endif // CONTENT_COMMON_GPU_GPU_CHANNEL_MANAGER_H_ | 130 #endif // CONTENT_COMMON_GPU_GPU_CHANNEL_MANAGER_H_ |
| OLD | NEW |