| 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 19 matching lines...) Expand all Loading... |
| 30 // Overridden from gpu::GpuMemoryBufferManager: | 30 // Overridden from gpu::GpuMemoryBufferManager: |
| 31 std::unique_ptr<gfx::GpuMemoryBuffer> AllocateGpuMemoryBuffer( | 31 std::unique_ptr<gfx::GpuMemoryBuffer> AllocateGpuMemoryBuffer( |
| 32 const gfx::Size& size, | 32 const gfx::Size& size, |
| 33 gfx::BufferFormat format, | 33 gfx::BufferFormat format, |
| 34 gfx::BufferUsage usage, | 34 gfx::BufferUsage usage, |
| 35 gpu::SurfaceHandle surface_handle) override; | 35 gpu::SurfaceHandle surface_handle) override; |
| 36 std::unique_ptr<gfx::GpuMemoryBuffer> CreateGpuMemoryBufferFromHandle( | 36 std::unique_ptr<gfx::GpuMemoryBuffer> CreateGpuMemoryBufferFromHandle( |
| 37 const gfx::GpuMemoryBufferHandle& handle, | 37 const gfx::GpuMemoryBufferHandle& handle, |
| 38 const gfx::Size& size, | 38 const gfx::Size& size, |
| 39 gfx::BufferFormat format) override; | 39 gfx::BufferFormat format) override; |
| 40 std::unique_ptr<gfx::GpuMemoryBuffer> CreateGpuMemoryBufferFromClientId( | |
| 41 int client_id, | |
| 42 const gfx::GpuMemoryBufferId& gpu_memory_buffer_id) override; | |
| 43 gfx::GpuMemoryBuffer* GpuMemoryBufferFromClientBuffer( | 40 gfx::GpuMemoryBuffer* GpuMemoryBufferFromClientBuffer( |
| 44 ClientBuffer buffer) override; | 41 ClientBuffer buffer) override; |
| 45 void SetDestructionSyncToken(gfx::GpuMemoryBuffer* buffer, | 42 void SetDestructionSyncToken(gfx::GpuMemoryBuffer* buffer, |
| 46 const gpu::SyncToken& sync_token) override; | 43 const gpu::SyncToken& sync_token) override; |
| 47 | 44 |
| 48 private: | 45 private: |
| 49 // Buffers allocated by this manager. | 46 // Buffers allocated by this manager. |
| 50 int last_gpu_memory_buffer_id_ = 1000; | 47 int last_gpu_memory_buffer_id_ = 1000; |
| 51 std::map<int, gfx::GpuMemoryBuffer*> buffers_; | 48 std::map<int, gfx::GpuMemoryBuffer*> buffers_; |
| 52 | 49 |
| 53 // Parent information for child managers. | 50 // Parent information for child managers. |
| 54 int client_id_ = -1; | 51 int client_id_ = -1; |
| 55 TestGpuMemoryBufferManager* parent_gpu_memory_buffer_manager_ = nullptr; | 52 TestGpuMemoryBufferManager* parent_gpu_memory_buffer_manager_ = nullptr; |
| 56 | 53 |
| 57 // Child infomration for parent managers. | 54 // Child infomration for parent managers. |
| 58 int last_client_id_ = 5000; | 55 int last_client_id_ = 5000; |
| 59 std::map<int, TestGpuMemoryBufferManager*> clients_; | 56 std::map<int, TestGpuMemoryBufferManager*> clients_; |
| 60 | 57 |
| 61 DISALLOW_COPY_AND_ASSIGN(TestGpuMemoryBufferManager); | 58 DISALLOW_COPY_AND_ASSIGN(TestGpuMemoryBufferManager); |
| 62 }; | 59 }; |
| 63 | 60 |
| 64 } // namespace cc | 61 } // namespace cc |
| 65 | 62 |
| 66 #endif // CC_TEST_TEST_GPU_MEMORY_BUFFER_MANAGER_H_ | 63 #endif // CC_TEST_TEST_GPU_MEMORY_BUFFER_MANAGER_H_ |
| OLD | NEW |