| 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> |
| 11 | 11 |
| 12 #include "base/containers/hash_tables.h" | 12 #include "base/containers/scoped_ptr_hash_map.h" |
| 13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
| 14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
| 15 #include "base/memory/weak_ptr.h" | 15 #include "base/memory/weak_ptr.h" |
| 16 #include "base/message_loop/message_loop_proxy.h" | 16 #include "base/message_loop/message_loop_proxy.h" |
| 17 #include "build/build_config.h" | 17 #include "build/build_config.h" |
| 18 #include "content/common/gpu/devtools_gpu_instrumentation.h" | 18 #include "content/common/gpu/devtools_gpu_instrumentation.h" |
| 19 #include "content/common/gpu/gpu_memory_manager.h" | 19 #include "content/common/gpu/gpu_memory_manager.h" |
| 20 #include "ipc/ipc_listener.h" | 20 #include "ipc/ipc_listener.h" |
| 21 #include "ipc/ipc_sender.h" | 21 #include "ipc/ipc_sender.h" |
| 22 #include "ui/gfx/native_widget_types.h" | 22 #include "ui/gfx/native_widget_types.h" |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 gfx::GLSurface* GetDefaultOffscreenSurface(); | 98 gfx::GLSurface* GetDefaultOffscreenSurface(); |
| 99 | 99 |
| 100 private: | 100 private: |
| 101 struct ImageOperation { | 101 struct ImageOperation { |
| 102 ImageOperation(int32 sync_point, base::Closure callback); | 102 ImageOperation(int32 sync_point, base::Closure callback); |
| 103 ~ImageOperation(); | 103 ~ImageOperation(); |
| 104 | 104 |
| 105 int32 sync_point; | 105 int32 sync_point; |
| 106 base::Closure callback; | 106 base::Closure callback; |
| 107 }; | 107 }; |
| 108 typedef base::hash_map<int, scoped_refptr<GpuChannel> > GpuChannelMap; | 108 typedef base::ScopedPtrHashMap<int, GpuChannel> GpuChannelMap; |
| 109 typedef std::deque<ImageOperation*> ImageOperationQueue; | 109 typedef std::deque<ImageOperation*> ImageOperationQueue; |
| 110 | 110 |
| 111 // Message handlers. | 111 // Message handlers. |
| 112 void OnEstablishChannel(int client_id, bool share_context); | 112 void OnEstablishChannel(int client_id, bool share_context); |
| 113 void OnCloseChannel(const IPC::ChannelHandle& channel_handle); | 113 void OnCloseChannel(const IPC::ChannelHandle& channel_handle); |
| 114 void OnVisibilityChanged( | 114 void OnVisibilityChanged( |
| 115 int32 render_view_id, int32 client_id, bool visible); | 115 int32 render_view_id, int32 client_id, bool visible); |
| 116 void OnCreateViewCommandBuffer( | 116 void OnCreateViewCommandBuffer( |
| 117 const gfx::GLSurfaceHandle& window, | 117 const gfx::GLSurfaceHandle& window, |
| 118 int32 render_view_id, | 118 int32 render_view_id, |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 scoped_refptr<gpu::gles2::ShaderTranslatorCache> shader_translator_cache_; | 150 scoped_refptr<gpu::gles2::ShaderTranslatorCache> shader_translator_cache_; |
| 151 scoped_refptr<gfx::GLSurface> default_offscreen_surface_; | 151 scoped_refptr<gfx::GLSurface> default_offscreen_surface_; |
| 152 ImageOperationQueue image_operations_; | 152 ImageOperationQueue image_operations_; |
| 153 | 153 |
| 154 DISALLOW_COPY_AND_ASSIGN(GpuChannelManager); | 154 DISALLOW_COPY_AND_ASSIGN(GpuChannelManager); |
| 155 }; | 155 }; |
| 156 | 156 |
| 157 } // namespace content | 157 } // namespace content |
| 158 | 158 |
| 159 #endif // CONTENT_COMMON_GPU_GPU_CHANNEL_MANAGER_H_ | 159 #endif // CONTENT_COMMON_GPU_GPU_CHANNEL_MANAGER_H_ |
| OLD | NEW |