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 COMPONENTS_VIZ_COMMON_SERVER_GPU_MEMORY_BUFFER_MANAGER_H_ | 5 #ifndef COMPONENTS_VIZ_HOST_SERVER_GPU_MEMORY_BUFFER_MANAGER_H_ |
6 #define COMPONENTS_VIZ_COMMON_SERVER_GPU_MEMORY_BUFFER_MANAGER_H_ | 6 #define COMPONENTS_VIZ_HOST_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" |
11 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
12 #include "base/sequenced_task_runner.h" | 12 #include "base/sequenced_task_runner.h" |
13 #include "base/synchronization/waitable_event.h" | 13 #include "base/synchronization/waitable_event.h" |
| 14 #include "components/viz/host/viz_host_export.h" |
14 #include "gpu/command_buffer/client/gpu_memory_buffer_manager.h" | 15 #include "gpu/command_buffer/client/gpu_memory_buffer_manager.h" |
15 #include "gpu/ipc/host/gpu_memory_buffer_support.h" | 16 #include "gpu/ipc/host/gpu_memory_buffer_support.h" |
16 | 17 |
17 namespace ui { | 18 namespace ui { |
18 namespace mojom { | 19 namespace mojom { |
19 class GpuService; | 20 class GpuService; |
20 } | 21 } |
21 } | 22 } // namespace ui |
22 | 23 |
23 namespace viz { | 24 namespace viz { |
24 | 25 |
25 // This GpuMemoryBufferManager implementation is for [de]allocating gpu memory | 26 // This GpuMemoryBufferManager implementation is for [de]allocating gpu memory |
26 // from the gpu process over the mojom.GpuService api. | 27 // from the gpu process over the mojom.GpuService api. |
27 // Note that |CreateGpuMemoryBuffer()| can be called on any thread. All the rest | 28 // Note that |CreateGpuMemoryBuffer()| can be called on any thread. All the rest |
28 // of the functions must be called on the thread this object is created on. | 29 // of the functions must be called on the thread this object is created on. |
29 class ServerGpuMemoryBufferManager : public gpu::GpuMemoryBufferManager { | 30 class VIZ_HOST_EXPORT ServerGpuMemoryBufferManager |
| 31 : public gpu::GpuMemoryBufferManager { |
30 public: | 32 public: |
31 ServerGpuMemoryBufferManager(ui::mojom::GpuService* gpu_service, | 33 ServerGpuMemoryBufferManager(ui::mojom::GpuService* gpu_service, |
32 int client_id); | 34 int client_id); |
33 ~ServerGpuMemoryBufferManager() override; | 35 ~ServerGpuMemoryBufferManager() override; |
34 | 36 |
35 void DestroyGpuMemoryBuffer(gfx::GpuMemoryBufferId id, | 37 void DestroyGpuMemoryBuffer(gfx::GpuMemoryBufferId id, |
36 int client_id, | 38 int client_id, |
37 const gpu::SyncToken& sync_token); | 39 const gpu::SyncToken& sync_token); |
38 | 40 |
39 void DestroyAllGpuMemoryBufferForClient(int client_id); | 41 void DestroyAllGpuMemoryBufferForClient(int client_id); |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 | 76 |
75 const gpu::GpuMemoryBufferConfigurationSet native_configurations_; | 77 const gpu::GpuMemoryBufferConfigurationSet native_configurations_; |
76 scoped_refptr<base::SequencedTaskRunner> task_runner_; | 78 scoped_refptr<base::SequencedTaskRunner> task_runner_; |
77 base::WeakPtrFactory<ServerGpuMemoryBufferManager> weak_factory_; | 79 base::WeakPtrFactory<ServerGpuMemoryBufferManager> weak_factory_; |
78 | 80 |
79 DISALLOW_COPY_AND_ASSIGN(ServerGpuMemoryBufferManager); | 81 DISALLOW_COPY_AND_ASSIGN(ServerGpuMemoryBufferManager); |
80 }; | 82 }; |
81 | 83 |
82 } // namespace viz | 84 } // namespace viz |
83 | 85 |
84 #endif // COMPONENTS_VIZ_COMMON_SERVER_GPU_MEMORY_BUFFER_MANAGER_H_ | 86 #endif // COMPONENTS_VIZ_HOST_SERVER_GPU_MEMORY_BUFFER_MANAGER_H_ |
OLD | NEW |