| 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 15 matching lines...) Expand all Loading... |
| 26 // Overridden from gpu::GpuMemoryBufferManager: | 26 // Overridden from gpu::GpuMemoryBufferManager: |
| 27 std::unique_ptr<gfx::GpuMemoryBuffer> AllocateGpuMemoryBuffer( | 27 std::unique_ptr<gfx::GpuMemoryBuffer> AllocateGpuMemoryBuffer( |
| 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 gfx::GpuMemoryBuffer* GpuMemoryBufferFromClientBuffer( | |
| 37 ClientBuffer buffer) override; | |
| 38 void SetDestructionSyncToken(gfx::GpuMemoryBuffer* buffer, | 36 void SetDestructionSyncToken(gfx::GpuMemoryBuffer* buffer, |
| 39 const gpu::SyncToken& sync_token) override; | 37 const gpu::SyncToken& sync_token) override; |
| 40 | 38 |
| 41 private: | 39 private: |
| 42 // Buffers allocated by this manager. | 40 // Buffers allocated by this manager. |
| 43 int last_gpu_memory_buffer_id_ = 1000; | 41 int last_gpu_memory_buffer_id_ = 1000; |
| 44 std::map<int, gfx::GpuMemoryBuffer*> buffers_; | 42 std::map<int, gfx::GpuMemoryBuffer*> buffers_; |
| 45 | 43 |
| 46 // Parent information for child managers. | 44 // Parent information for child managers. |
| 47 int client_id_ = -1; | 45 int client_id_ = -1; |
| 48 TestGpuMemoryBufferManager* parent_gpu_memory_buffer_manager_ = nullptr; | 46 TestGpuMemoryBufferManager* parent_gpu_memory_buffer_manager_ = nullptr; |
| 49 | 47 |
| 50 // Child infomration for parent managers. | 48 // Child infomration for parent managers. |
| 51 int last_client_id_ = 5000; | 49 int last_client_id_ = 5000; |
| 52 std::map<int, TestGpuMemoryBufferManager*> clients_; | 50 std::map<int, TestGpuMemoryBufferManager*> clients_; |
| 53 | 51 |
| 54 DISALLOW_COPY_AND_ASSIGN(TestGpuMemoryBufferManager); | 52 DISALLOW_COPY_AND_ASSIGN(TestGpuMemoryBufferManager); |
| 55 }; | 53 }; |
| 56 | 54 |
| 57 } // namespace cc | 55 } // namespace cc |
| 58 | 56 |
| 59 #endif // CC_TEST_TEST_GPU_MEMORY_BUFFER_MANAGER_H_ | 57 #endif // CC_TEST_TEST_GPU_MEMORY_BUFFER_MANAGER_H_ |
| OLD | NEW |