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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 int32 image_id, | 77 int32 image_id, |
78 const CreateImageCallback& callback) = 0; | 78 const CreateImageCallback& callback) = 0; |
79 virtual void DeleteImage(int32 image_id, int32 sync_point) = 0; | 79 virtual void DeleteImage(int32 image_id, int32 sync_point) = 0; |
80 virtual scoped_ptr<gfx::GpuMemoryBuffer> AllocateGpuMemoryBuffer( | 80 virtual scoped_ptr<gfx::GpuMemoryBuffer> AllocateGpuMemoryBuffer( |
81 size_t width, | 81 size_t width, |
82 size_t height, | 82 size_t height, |
83 unsigned internalformat, | 83 unsigned internalformat, |
84 unsigned usage) = 0; | 84 unsigned usage) = 0; |
85 }; | 85 }; |
86 | 86 |
| 87 class CONTENT_EXPORT GpuChannelHostGpuBufferFactory { |
| 88 public: |
| 89 typedef base::Callback<void(const gfx::GpuMemoryBufferHandle& handle)> |
| 90 CreateGpuMemoryBufferCallback; |
| 91 |
| 92 virtual ~GpuChannelHostGpuBufferFactory() {} |
| 93 |
| 94 virtual void CreateGpuMemoryBuffer( |
| 95 size_t width, |
| 96 size_t height, |
| 97 unsigned internalformat, |
| 98 unsigned usage, |
| 99 const gfx::GpuMemoryBufferHandle& handle, |
| 100 const CreateGpuMemoryBufferCallback& callback) = 0; |
| 101 virtual void DeleteGpuMemoryBuffer(const gfx::GpuMemoryBufferHandle& handle, |
| 102 int32 sync_point) = 0; |
| 103 }; |
| 104 |
87 // Encapsulates an IPC channel between the client and one GPU process. | 105 // Encapsulates an IPC channel between the client and one GPU process. |
88 // On the GPU process side there's a corresponding GpuChannel. | 106 // On the GPU process side there's a corresponding GpuChannel. |
89 // Every method can be called on any thread with a message loop, except for the | 107 // Every method can be called on any thread with a message loop, except for the |
90 // IO thread. | 108 // IO thread. |
91 class GpuChannelHost : public IPC::Sender, | 109 class GpuChannelHost : public IPC::Sender, |
92 public base::RefCountedThreadSafe<GpuChannelHost> { | 110 public base::RefCountedThreadSafe<GpuChannelHost> { |
93 public: | 111 public: |
94 // Must be called on the main thread (as defined by the factory). | 112 // Must be called on the main thread (as defined by the factory). |
95 static scoped_refptr<GpuChannelHost> Create( | 113 static scoped_refptr<GpuChannelHost> Create( |
96 GpuChannelHostFactory* factory, | 114 GpuChannelHostFactory* factory, |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 // Used to look up a proxy from its routing id. | 262 // Used to look up a proxy from its routing id. |
245 typedef base::hash_map<int, CommandBufferProxyImpl*> ProxyMap; | 263 typedef base::hash_map<int, CommandBufferProxyImpl*> ProxyMap; |
246 ProxyMap proxies_; | 264 ProxyMap proxies_; |
247 | 265 |
248 DISALLOW_COPY_AND_ASSIGN(GpuChannelHost); | 266 DISALLOW_COPY_AND_ASSIGN(GpuChannelHost); |
249 }; | 267 }; |
250 | 268 |
251 } // namespace content | 269 } // namespace content |
252 | 270 |
253 #endif // CONTENT_COMMON_GPU_CLIENT_GPU_CHANNEL_HOST_H_ | 271 #endif // CONTENT_COMMON_GPU_CLIENT_GPU_CHANNEL_HOST_H_ |
OLD | NEW |