| 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_CLIENT_GPU_CHANNEL_HOST_H_ | 5 #ifndef CONTENT_COMMON_GPU_CLIENT_GPU_CHANNEL_HOST_H_ |
| 6 #define CONTENT_COMMON_GPU_CLIENT_GPU_CHANNEL_HOST_H_ | 6 #define CONTENT_COMMON_GPU_CLIENT_GPU_CHANNEL_HOST_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 struct GpuListenerInfo { | 54 struct GpuListenerInfo { |
| 55 GpuListenerInfo(); | 55 GpuListenerInfo(); |
| 56 ~GpuListenerInfo(); | 56 ~GpuListenerInfo(); |
| 57 | 57 |
| 58 base::WeakPtr<IPC::Listener> listener; | 58 base::WeakPtr<IPC::Listener> listener; |
| 59 scoped_refptr<base::MessageLoopProxy> loop; | 59 scoped_refptr<base::MessageLoopProxy> loop; |
| 60 }; | 60 }; |
| 61 | 61 |
| 62 class CONTENT_EXPORT GpuChannelHostFactory { | 62 class CONTENT_EXPORT GpuChannelHostFactory { |
| 63 public: | 63 public: |
| 64 typedef base::Callback<void(const gfx::Size)> CreateImageCallback; | |
| 65 | |
| 66 virtual ~GpuChannelHostFactory() {} | 64 virtual ~GpuChannelHostFactory() {} |
| 67 | 65 |
| 68 virtual bool IsMainThread() = 0; | 66 virtual bool IsMainThread() = 0; |
| 69 virtual base::MessageLoop* GetMainLoop() = 0; | 67 virtual base::MessageLoop* GetMainLoop() = 0; |
| 70 virtual scoped_refptr<base::MessageLoopProxy> GetIOLoopProxy() = 0; | 68 virtual scoped_refptr<base::MessageLoopProxy> GetIOLoopProxy() = 0; |
| 71 virtual scoped_ptr<base::SharedMemory> AllocateSharedMemory(size_t size) = 0; | 69 virtual scoped_ptr<base::SharedMemory> AllocateSharedMemory(size_t size) = 0; |
| 72 virtual CreateCommandBufferResult CreateViewCommandBuffer( | 70 virtual CreateCommandBufferResult CreateViewCommandBuffer( |
| 73 int32 surface_id, | 71 int32 surface_id, |
| 74 const GPUCreateCommandBufferConfig& init_params, | 72 const GPUCreateCommandBufferConfig& init_params, |
| 75 int32 route_id) = 0; | 73 int32 route_id) = 0; |
| 76 virtual void CreateImage( | |
| 77 gfx::PluginWindowHandle window, | |
| 78 int32 image_id, | |
| 79 const CreateImageCallback& callback) = 0; | |
| 80 virtual void DeleteImage(int32 image_id, int32 sync_point) = 0; | |
| 81 virtual scoped_ptr<gfx::GpuMemoryBuffer> AllocateGpuMemoryBuffer( | 74 virtual scoped_ptr<gfx::GpuMemoryBuffer> AllocateGpuMemoryBuffer( |
| 82 size_t width, | 75 size_t width, |
| 83 size_t height, | 76 size_t height, |
| 84 unsigned internalformat, | 77 unsigned internalformat, |
| 85 unsigned usage) = 0; | 78 unsigned usage) = 0; |
| 86 }; | 79 }; |
| 87 | 80 |
| 88 // Encapsulates an IPC channel between the client and one GPU process. | 81 // Encapsulates an IPC channel between the client and one GPU process. |
| 89 // On the GPU process side there's a corresponding GpuChannel. | 82 // On the GPU process side there's a corresponding GpuChannel. |
| 90 // Every method can be called on any thread with a message loop, except for the | 83 // Every method can be called on any thread with a message loop, except for the |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 // Used to look up a proxy from its routing id. | 238 // Used to look up a proxy from its routing id. |
| 246 typedef base::hash_map<int, CommandBufferProxyImpl*> ProxyMap; | 239 typedef base::hash_map<int, CommandBufferProxyImpl*> ProxyMap; |
| 247 ProxyMap proxies_; | 240 ProxyMap proxies_; |
| 248 | 241 |
| 249 DISALLOW_COPY_AND_ASSIGN(GpuChannelHost); | 242 DISALLOW_COPY_AND_ASSIGN(GpuChannelHost); |
| 250 }; | 243 }; |
| 251 | 244 |
| 252 } // namespace content | 245 } // namespace content |
| 253 | 246 |
| 254 #endif // CONTENT_COMMON_GPU_CLIENT_GPU_CHANNEL_HOST_H_ | 247 #endif // CONTENT_COMMON_GPU_CLIENT_GPU_CHANNEL_HOST_H_ |
| OLD | NEW |