| 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 struct GpuListenerInfo { | 53 struct GpuListenerInfo { |
| 54 GpuListenerInfo(); | 54 GpuListenerInfo(); |
| 55 ~GpuListenerInfo(); | 55 ~GpuListenerInfo(); |
| 56 | 56 |
| 57 base::WeakPtr<IPC::Listener> listener; | 57 base::WeakPtr<IPC::Listener> listener; |
| 58 scoped_refptr<base::MessageLoopProxy> loop; | 58 scoped_refptr<base::MessageLoopProxy> loop; |
| 59 }; | 59 }; |
| 60 | 60 |
| 61 class CONTENT_EXPORT GpuChannelHostFactory { | 61 class CONTENT_EXPORT GpuChannelHostFactory { |
| 62 public: | 62 public: |
| 63 typedef base::Callback<void(const gfx::Size)> CreateImageCallback; | 63 typedef base::Callback<void(bool)> CreateImageCallback; |
| 64 | 64 |
| 65 virtual ~GpuChannelHostFactory() {} | 65 virtual ~GpuChannelHostFactory() {} |
| 66 | 66 |
| 67 virtual bool IsMainThread() = 0; | 67 virtual bool IsMainThread() = 0; |
| 68 virtual base::MessageLoop* GetMainLoop() = 0; | 68 virtual base::MessageLoop* GetMainLoop() = 0; |
| 69 virtual scoped_refptr<base::MessageLoopProxy> GetIOLoopProxy() = 0; | 69 virtual scoped_refptr<base::MessageLoopProxy> GetIOLoopProxy() = 0; |
| 70 virtual scoped_ptr<base::SharedMemory> AllocateSharedMemory(size_t size) = 0; | 70 virtual scoped_ptr<base::SharedMemory> AllocateSharedMemory(size_t size) = 0; |
| 71 virtual bool CreateViewCommandBuffer( | 71 virtual bool CreateViewCommandBuffer( |
| 72 int32 surface_id, | 72 int32 surface_id, |
| 73 const GPUCreateCommandBufferConfig& init_params, | 73 const GPUCreateCommandBufferConfig& init_params, |
| 74 int32 route_id) = 0; | 74 int32 route_id) = 0; |
| 75 virtual void CreateImage( | 75 virtual void CreateImage( |
| 76 gfx::PluginWindowHandle window, | 76 const gfx::GpuMemoryBufferHandle& handle, |
| 77 const gfx::Size& size, |
| 78 unsigned internalformat, |
| 77 int32 image_id, | 79 int32 image_id, |
| 78 const CreateImageCallback& callback) = 0; | 80 const CreateImageCallback& callback) = 0; |
| 79 virtual void DeleteImage(int32 image_id, int32 sync_point) = 0; | 81 virtual void DeleteImage(int32 image_id, int32 sync_point) = 0; |
| 80 virtual scoped_ptr<gfx::GpuMemoryBuffer> AllocateGpuMemoryBuffer( | 82 virtual scoped_ptr<gfx::GpuMemoryBuffer> AllocateGpuMemoryBuffer( |
| 81 size_t width, | 83 size_t width, |
| 82 size_t height, | 84 size_t height, |
| 83 unsigned internalformat, | 85 unsigned internalformat, |
| 84 unsigned usage) = 0; | 86 unsigned usage) = 0; |
| 85 }; | 87 }; |
| 86 | 88 |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 // Used to look up a proxy from its routing id. | 246 // Used to look up a proxy from its routing id. |
| 245 typedef base::hash_map<int, CommandBufferProxyImpl*> ProxyMap; | 247 typedef base::hash_map<int, CommandBufferProxyImpl*> ProxyMap; |
| 246 ProxyMap proxies_; | 248 ProxyMap proxies_; |
| 247 | 249 |
| 248 DISALLOW_COPY_AND_ASSIGN(GpuChannelHost); | 250 DISALLOW_COPY_AND_ASSIGN(GpuChannelHost); |
| 249 }; | 251 }; |
| 250 | 252 |
| 251 } // namespace content | 253 } // namespace content |
| 252 | 254 |
| 253 #endif // CONTENT_COMMON_GPU_CLIENT_GPU_CHANNEL_HOST_H_ | 255 #endif // CONTENT_COMMON_GPU_CLIENT_GPU_CHANNEL_HOST_H_ |
| OLD | NEW |