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 CC_TEST_TEST_GPU_MEMORY_BUFFER_MANAGER_H_ | 5 #ifndef CC_TEST_TEST_GPU_MEMORY_BUFFER_MANAGER_H_ |
6 #define CC_TEST_TEST_GPU_MEMORY_BUFFER_MANAGER_H_ | 6 #define CC_TEST_TEST_GPU_MEMORY_BUFFER_MANAGER_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 const gfx::Size& size, | 28 const gfx::Size& size, |
29 gfx::BufferFormat format, | 29 gfx::BufferFormat format, |
30 gfx::BufferUsage usage, | 30 gfx::BufferUsage usage, |
31 gpu::SurfaceHandle surface_handle) override; | 31 gpu::SurfaceHandle surface_handle) override; |
32 std::unique_ptr<gfx::GpuMemoryBuffer> CreateGpuMemoryBufferFromHandle( | 32 std::unique_ptr<gfx::GpuMemoryBuffer> CreateGpuMemoryBufferFromHandle( |
33 const gfx::GpuMemoryBufferHandle& handle, | 33 const gfx::GpuMemoryBufferHandle& handle, |
34 const gfx::Size& size, | 34 const gfx::Size& size, |
35 gfx::BufferFormat format) override; | 35 gfx::BufferFormat format) override; |
36 void SetDestructionSyncToken(gfx::GpuMemoryBuffer* buffer, | 36 void SetDestructionSyncToken(gfx::GpuMemoryBuffer* buffer, |
37 const gpu::SyncToken& sync_token) override; | 37 const gpu::SyncToken& sync_token) override; |
| 38 std::unique_ptr<gfx::GpuFence> CreateGpuFence() override; |
| 39 std::unique_ptr<gfx::GpuFence> CreateGpuFenceFromHandle( |
| 40 const gfx::GpuFenceHandle& handle) override; |
| 41 gfx::GpuFence* GpuFenceFromClientFence(ClientFence fence) override; |
38 | 42 |
39 private: | 43 private: |
40 // Buffers allocated by this manager. | 44 // Buffers allocated by this manager. |
41 int last_gpu_memory_buffer_id_ = 1000; | 45 int last_gpu_memory_buffer_id_ = 1000; |
42 std::map<int, gfx::GpuMemoryBuffer*> buffers_; | 46 std::map<int, gfx::GpuMemoryBuffer*> buffers_; |
43 | 47 |
44 // Parent information for child managers. | 48 // Parent information for child managers. |
45 int client_id_ = -1; | 49 int client_id_ = -1; |
46 TestGpuMemoryBufferManager* parent_gpu_memory_buffer_manager_ = nullptr; | 50 TestGpuMemoryBufferManager* parent_gpu_memory_buffer_manager_ = nullptr; |
47 | 51 |
48 // Child infomration for parent managers. | 52 // Child infomration for parent managers. |
49 int last_client_id_ = 5000; | 53 int last_client_id_ = 5000; |
50 std::map<int, TestGpuMemoryBufferManager*> clients_; | 54 std::map<int, TestGpuMemoryBufferManager*> clients_; |
51 | 55 |
52 DISALLOW_COPY_AND_ASSIGN(TestGpuMemoryBufferManager); | 56 DISALLOW_COPY_AND_ASSIGN(TestGpuMemoryBufferManager); |
53 }; | 57 }; |
54 | 58 |
55 } // namespace cc | 59 } // namespace cc |
56 | 60 |
57 #endif // CC_TEST_TEST_GPU_MEMORY_BUFFER_MANAGER_H_ | 61 #endif // CC_TEST_TEST_GPU_MEMORY_BUFFER_MANAGER_H_ |
OLD | NEW |