| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 SERVICES_UI_COMMON_SERVER_GPU_MEMORY_BUFFER_MANAGER_H_ | 5 #ifndef SERVICES_UI_COMMON_SERVER_GPU_MEMORY_BUFFER_MANAGER_H_ |
| 6 #define SERVICES_UI_COMMON_SERVER_GPU_MEMORY_BUFFER_MANAGER_H_ | 6 #define SERVICES_UI_COMMON_SERVER_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 26 matching lines...) Expand all Loading... |
| 37 gfx::BufferFormat format, | 37 gfx::BufferFormat format, |
| 38 gfx::BufferUsage usage, | 38 gfx::BufferUsage usage, |
| 39 gpu::SurfaceHandle surface_handle); | 39 gpu::SurfaceHandle surface_handle); |
| 40 | 40 |
| 41 // Overridden from gpu::GpuMemoryBufferManager: | 41 // Overridden from gpu::GpuMemoryBufferManager: |
| 42 std::unique_ptr<gfx::GpuMemoryBuffer> CreateGpuMemoryBuffer( | 42 std::unique_ptr<gfx::GpuMemoryBuffer> CreateGpuMemoryBuffer( |
| 43 const gfx::Size& size, | 43 const gfx::Size& size, |
| 44 gfx::BufferFormat format, | 44 gfx::BufferFormat format, |
| 45 gfx::BufferUsage usage, | 45 gfx::BufferUsage usage, |
| 46 gpu::SurfaceHandle surface_handle) override; | 46 gpu::SurfaceHandle surface_handle) override; |
| 47 std::unique_ptr<gfx::GpuMemoryBuffer> CreateGpuMemoryBufferFromHandle( | |
| 48 const gfx::GpuMemoryBufferHandle& handle, | |
| 49 const gfx::Size& size, | |
| 50 gfx::BufferFormat format) override; | |
| 51 void SetDestructionSyncToken(gfx::GpuMemoryBuffer* buffer, | 47 void SetDestructionSyncToken(gfx::GpuMemoryBuffer* buffer, |
| 52 const gpu::SyncToken& sync_token) override; | 48 const gpu::SyncToken& sync_token) override; |
| 53 | 49 |
| 54 private: | 50 private: |
| 55 mojom::GpuService* gpu_service_; | 51 mojom::GpuService* gpu_service_; |
| 56 const int client_id_; | 52 const int client_id_; |
| 57 int next_gpu_memory_id_ = 1; | 53 int next_gpu_memory_id_ = 1; |
| 58 | 54 |
| 59 using NativeBuffers = | 55 using NativeBuffers = |
| 60 std::unordered_set<gfx::GpuMemoryBufferId, | 56 std::unordered_set<gfx::GpuMemoryBufferId, |
| 61 BASE_HASH_NAMESPACE::hash<gfx::GpuMemoryBufferId>>; | 57 BASE_HASH_NAMESPACE::hash<gfx::GpuMemoryBufferId>>; |
| 62 std::unordered_map<int, NativeBuffers> native_buffers_; | 58 std::unordered_map<int, NativeBuffers> native_buffers_; |
| 63 | 59 |
| 64 const gpu::GpuMemoryBufferConfigurationSet native_configurations_; | 60 const gpu::GpuMemoryBufferConfigurationSet native_configurations_; |
| 65 base::WeakPtrFactory<ServerGpuMemoryBufferManager> weak_factory_; | 61 base::WeakPtrFactory<ServerGpuMemoryBufferManager> weak_factory_; |
| 66 | 62 |
| 67 DISALLOW_COPY_AND_ASSIGN(ServerGpuMemoryBufferManager); | 63 DISALLOW_COPY_AND_ASSIGN(ServerGpuMemoryBufferManager); |
| 68 }; | 64 }; |
| 69 | 65 |
| 70 } // namespace ui | 66 } // namespace ui |
| 71 | 67 |
| 72 #endif // SERVICES_UI_COMMON_SERVER_GPU_MEMORY_BUFFER_MANAGER_H_ | 68 #endif // SERVICES_UI_COMMON_SERVER_GPU_MEMORY_BUFFER_MANAGER_H_ |
| OLD | NEW |