OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 GPU_COMMAND_BUFFER_CLIENT_GPU_MEMORY_BUFFER_MANAGER_H_ | 5 #ifndef GPU_COMMAND_BUFFER_CLIENT_GPU_MEMORY_BUFFER_MANAGER_H_ |
6 #define GPU_COMMAND_BUFFER_CLIENT_GPU_MEMORY_BUFFER_MANAGER_H_ | 6 #define GPU_COMMAND_BUFFER_CLIENT_GPU_MEMORY_BUFFER_MANAGER_H_ |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "gpu/gpu_export.h" | 9 #include "gpu/gpu_export.h" |
10 #include "ui/gfx/geometry/size.h" | 10 #include "ui/gfx/geometry/size.h" |
11 #include "ui/gfx/gpu_memory_buffer.h" | 11 #include "ui/gfx/gpu_memory_buffer.h" |
12 | 12 |
13 namespace gpu { | 13 namespace gpu { |
14 | 14 |
| 15 struct SyncToken; |
| 16 |
15 class GPU_EXPORT GpuMemoryBufferManager { | 17 class GPU_EXPORT GpuMemoryBufferManager { |
16 public: | 18 public: |
17 GpuMemoryBufferManager(); | 19 GpuMemoryBufferManager(); |
18 | 20 |
19 // Allocates a GpuMemoryBuffer that can be shared with another process. | 21 // Allocates a GpuMemoryBuffer that can be shared with another process. |
20 virtual scoped_ptr<gfx::GpuMemoryBuffer> AllocateGpuMemoryBuffer( | 22 virtual scoped_ptr<gfx::GpuMemoryBuffer> AllocateGpuMemoryBuffer( |
21 const gfx::Size& size, | 23 const gfx::Size& size, |
22 gfx::BufferFormat format, | 24 gfx::BufferFormat format, |
23 gfx::BufferUsage usage) = 0; | 25 gfx::BufferUsage usage) = 0; |
24 | 26 |
25 // Creates a GpuMemoryBuffer from existing handle. | 27 // Creates a GpuMemoryBuffer from existing handle. |
26 virtual scoped_ptr<gfx::GpuMemoryBuffer> CreateGpuMemoryBufferFromHandle( | 28 virtual scoped_ptr<gfx::GpuMemoryBuffer> CreateGpuMemoryBufferFromHandle( |
27 const gfx::GpuMemoryBufferHandle& handle, | 29 const gfx::GpuMemoryBufferHandle& handle, |
28 const gfx::Size& size, | 30 const gfx::Size& size, |
29 gfx::BufferFormat format) = 0; | 31 gfx::BufferFormat format) = 0; |
30 | 32 |
31 // Returns a GpuMemoryBuffer instance given a ClientBuffer. Returns NULL on | 33 // Returns a GpuMemoryBuffer instance given a ClientBuffer. Returns NULL on |
32 // failure. | 34 // failure. |
33 virtual gfx::GpuMemoryBuffer* GpuMemoryBufferFromClientBuffer( | 35 virtual gfx::GpuMemoryBuffer* GpuMemoryBufferFromClientBuffer( |
34 ClientBuffer buffer) = 0; | 36 ClientBuffer buffer) = 0; |
35 | 37 |
36 // Associates destruction sync point with |buffer|. | 38 // Associates destruction sync point with |buffer|. |
37 virtual void SetDestructionSyncPoint(gfx::GpuMemoryBuffer* buffer, | 39 virtual void SetDestructionSyncToken(gfx::GpuMemoryBuffer* buffer, |
38 uint32 sync_point) = 0; | 40 const gpu::SyncToken& sync_token) = 0; |
39 | 41 |
40 protected: | 42 protected: |
41 virtual ~GpuMemoryBufferManager(); | 43 virtual ~GpuMemoryBufferManager(); |
42 }; | 44 }; |
43 | 45 |
44 } // namespace gpu | 46 } // namespace gpu |
45 | 47 |
46 #endif // GPU_COMMAND_BUFFER_CLIENT_GPU_MEMORY_BUFFER_MANAGER_H_ | 48 #endif // GPU_COMMAND_BUFFER_CLIENT_GPU_MEMORY_BUFFER_MANAGER_H_ |
OLD | NEW |