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 <memory> | 8 #include <memory> |
9 | 9 |
10 #include "gpu/gpu_export.h" | 10 #include "gpu/gpu_export.h" |
11 #include "gpu/ipc/common/surface_handle.h" | 11 #include "gpu/ipc/common/surface_handle.h" |
12 #include "ui/gfx/geometry/size.h" | 12 #include "ui/gfx/geometry/size.h" |
13 #include "ui/gfx/gpu_memory_buffer.h" | 13 #include "ui/gfx/gpu_memory_buffer.h" |
14 | 14 |
15 namespace gpu { | 15 namespace gpu { |
16 | 16 |
17 struct SyncToken; | 17 struct SyncToken; |
18 | 18 |
19 class GPU_EXPORT GpuMemoryBufferManager { | 19 class GPU_EXPORT GpuMemoryBufferManager { |
20 public: | 20 public: |
21 GpuMemoryBufferManager(); | 21 GpuMemoryBufferManager(); |
22 virtual ~GpuMemoryBufferManager(); | 22 virtual ~GpuMemoryBufferManager(); |
23 | 23 |
24 // Creates a GpuMemoryBuffer that can be shared with another process. | 24 // Creates a GpuMemoryBuffer that can be shared with another process. It can |
| 25 // be called on any thread. |
25 virtual std::unique_ptr<gfx::GpuMemoryBuffer> CreateGpuMemoryBuffer( | 26 virtual std::unique_ptr<gfx::GpuMemoryBuffer> CreateGpuMemoryBuffer( |
26 const gfx::Size& size, | 27 const gfx::Size& size, |
27 gfx::BufferFormat format, | 28 gfx::BufferFormat format, |
28 gfx::BufferUsage usage, | 29 gfx::BufferUsage usage, |
29 gpu::SurfaceHandle surface_handle) = 0; | 30 gpu::SurfaceHandle surface_handle) = 0; |
30 | 31 |
31 // Associates destruction sync point with |buffer|. | 32 // Associates destruction sync point with |buffer|. It can be called on any |
| 33 // thread. |
32 virtual void SetDestructionSyncToken(gfx::GpuMemoryBuffer* buffer, | 34 virtual void SetDestructionSyncToken(gfx::GpuMemoryBuffer* buffer, |
33 const gpu::SyncToken& sync_token) = 0; | 35 const gpu::SyncToken& sync_token) = 0; |
34 }; | 36 }; |
35 | 37 |
36 } // namespace gpu | 38 } // namespace gpu |
37 | 39 |
38 #endif // GPU_COMMAND_BUFFER_CLIENT_GPU_MEMORY_BUFFER_MANAGER_H_ | 40 #endif // GPU_COMMAND_BUFFER_CLIENT_GPU_MEMORY_BUFFER_MANAGER_H_ |
OLD | NEW |