| 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> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/hash_tables.h" | 10 #include "base/hash_tables.h" |
| 11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
| 14 #include "base/message_loop_proxy.h" | 14 #include "base/message_loop_proxy.h" |
| 15 #include "build/build_config.h" | 15 #include "build/build_config.h" |
| 16 #include "content/common/gpu/gpu_memory_manager.h" | 16 #include "content/common/gpu/gpu_memory_manager.h" |
| 17 #include "ipc/ipc_listener.h" | 17 #include "ipc/ipc_listener.h" |
| 18 #include "ipc/ipc_sender.h" | 18 #include "ipc/ipc_sender.h" |
| 19 #include "ui/gfx/native_widget_types.h" | 19 #include "ui/gfx/native_widget_types.h" |
| 20 #include "ui/gl/gl_surface.h" |
| 20 | 21 |
| 21 namespace base { | 22 namespace base { |
| 22 class WaitableEvent; | 23 class WaitableEvent; |
| 23 } | 24 } |
| 24 | 25 |
| 25 namespace gfx { | 26 namespace gfx { |
| 26 class GLShareGroup; | 27 class GLShareGroup; |
| 27 } | 28 } |
| 28 | 29 |
| 29 namespace gpu { | 30 namespace gpu { |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 void RemoveRoute(int32 routing_id); | 86 void RemoveRoute(int32 routing_id); |
| 86 | 87 |
| 87 gpu::gles2::ProgramCache* program_cache(); | 88 gpu::gles2::ProgramCache* program_cache(); |
| 88 | 89 |
| 89 GpuMemoryManager* gpu_memory_manager() { return &gpu_memory_manager_; } | 90 GpuMemoryManager* gpu_memory_manager() { return &gpu_memory_manager_; } |
| 90 | 91 |
| 91 GpuChannel* LookupChannel(int32 client_id); | 92 GpuChannel* LookupChannel(int32 client_id); |
| 92 | 93 |
| 93 SyncPointManager* sync_point_manager() { return sync_point_manager_; } | 94 SyncPointManager* sync_point_manager() { return sync_point_manager_; } |
| 94 | 95 |
| 96 gfx::GLSurface* GetDefaultOffscreenSurface(); |
| 97 |
| 95 private: | 98 private: |
| 96 // Message handlers. | 99 // Message handlers. |
| 97 void OnEstablishChannel(int client_id, bool share_context); | 100 void OnEstablishChannel(int client_id, bool share_context); |
| 98 void OnCloseChannel(const IPC::ChannelHandle& channel_handle); | 101 void OnCloseChannel(const IPC::ChannelHandle& channel_handle); |
| 99 void OnVisibilityChanged( | 102 void OnVisibilityChanged( |
| 100 int32 render_view_id, int32 client_id, bool visible); | 103 int32 render_view_id, int32 client_id, bool visible); |
| 101 void OnCreateViewCommandBuffer( | 104 void OnCreateViewCommandBuffer( |
| 102 const gfx::GLSurfaceHandle& window, | 105 const gfx::GLSurfaceHandle& window, |
| 103 int32 render_view_id, | 106 int32 render_view_id, |
| 104 int32 client_id, | 107 int32 client_id, |
| (...skipping 11 matching lines...) Expand all Loading... |
| 116 // one channel for each renderer process that has connected to this GPU | 119 // one channel for each renderer process that has connected to this GPU |
| 117 // process. | 120 // process. |
| 118 typedef base::hash_map<int, scoped_refptr<GpuChannel> > GpuChannelMap; | 121 typedef base::hash_map<int, scoped_refptr<GpuChannel> > GpuChannelMap; |
| 119 GpuChannelMap gpu_channels_; | 122 GpuChannelMap gpu_channels_; |
| 120 scoped_refptr<gfx::GLShareGroup> share_group_; | 123 scoped_refptr<gfx::GLShareGroup> share_group_; |
| 121 scoped_refptr<gpu::gles2::MailboxManager> mailbox_manager_; | 124 scoped_refptr<gpu::gles2::MailboxManager> mailbox_manager_; |
| 122 GpuMemoryManager gpu_memory_manager_; | 125 GpuMemoryManager gpu_memory_manager_; |
| 123 GpuWatchdog* watchdog_; | 126 GpuWatchdog* watchdog_; |
| 124 scoped_refptr<SyncPointManager> sync_point_manager_; | 127 scoped_refptr<SyncPointManager> sync_point_manager_; |
| 125 scoped_ptr<gpu::gles2::ProgramCache> program_cache_; | 128 scoped_ptr<gpu::gles2::ProgramCache> program_cache_; |
| 129 scoped_refptr<gfx::GLSurface> default_offscreen_surface_; |
| 126 | 130 |
| 127 DISALLOW_COPY_AND_ASSIGN(GpuChannelManager); | 131 DISALLOW_COPY_AND_ASSIGN(GpuChannelManager); |
| 128 }; | 132 }; |
| 129 | 133 |
| 130 #endif // CONTENT_COMMON_GPU_GPU_CHANNEL_MANAGER_H_ | 134 #endif // CONTENT_COMMON_GPU_GPU_CHANNEL_MANAGER_H_ |
| OLD | NEW |