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 CONTENT_BROWSER_GPU_BROWSER_GPU_MEMORY_BUFFER_MANAGER_H_ | 5 #ifndef CONTENT_BROWSER_GPU_BROWSER_GPU_MEMORY_BUFFER_MANAGER_H_ |
6 #define CONTENT_BROWSER_GPU_BROWSER_GPU_MEMORY_BUFFER_MANAGER_H_ | 6 #define CONTENT_BROWSER_GPU_BROWSER_GPU_MEMORY_BUFFER_MANAGER_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
11 #include <memory> | 11 #include <memory> |
12 #include <utility> | 12 #include <utility> |
13 | 13 |
14 #include "base/callback.h" | 14 #include "base/callback.h" |
15 #include "base/containers/hash_tables.h" | 15 #include "base/containers/hash_tables.h" |
16 #include "base/hash.h" | 16 #include "base/hash.h" |
17 #include "base/macros.h" | 17 #include "base/macros.h" |
18 #include "base/trace_event/memory_dump_provider.h" | 18 #include "base/trace_event/memory_dump_provider.h" |
| 19 #include "components/viz/common/server_gpu_memory_buffer_manager.h" |
19 #include "content/browser/gpu/gpu_process_host.h" | 20 #include "content/browser/gpu/gpu_process_host.h" |
20 #include "content/common/content_export.h" | 21 #include "content/common/content_export.h" |
21 #include "gpu/command_buffer/client/gpu_memory_buffer_manager.h" | 22 #include "gpu/command_buffer/client/gpu_memory_buffer_manager.h" |
22 #include "gpu/ipc/common/surface_handle.h" | 23 #include "gpu/ipc/common/surface_handle.h" |
23 #include "gpu/ipc/host/gpu_memory_buffer_support.h" | 24 #include "gpu/ipc/host/gpu_memory_buffer_support.h" |
24 | 25 |
25 namespace content { | 26 namespace content { |
26 | 27 |
27 class CONTENT_EXPORT BrowserGpuMemoryBufferManager | 28 class CONTENT_EXPORT BrowserGpuMemoryBufferManager |
28 : public gpu::GpuMemoryBufferManager, | 29 : public gpu::GpuMemoryBufferManager, |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 void DestroyGpuMemoryBufferOnIO(gfx::GpuMemoryBufferId id, | 118 void DestroyGpuMemoryBufferOnIO(gfx::GpuMemoryBufferId id, |
118 int client_id, | 119 int client_id, |
119 const gpu::SyncToken& sync_token); | 120 const gpu::SyncToken& sync_token); |
120 | 121 |
121 uint64_t ClientIdToTracingProcessId(int client_id) const; | 122 uint64_t ClientIdToTracingProcessId(int client_id) const; |
122 | 123 |
123 const gpu::GpuMemoryBufferConfigurationSet native_configurations_; | 124 const gpu::GpuMemoryBufferConfigurationSet native_configurations_; |
124 const int gpu_client_id_; | 125 const int gpu_client_id_; |
125 const uint64_t gpu_client_tracing_id_; | 126 const uint64_t gpu_client_tracing_id_; |
126 | 127 |
| 128 scoped_refptr<viz::ServerGpuMemoryBufferManager> gmb_manager_; |
| 129 |
127 // Stores info about buffers for all clients. This should only be accessed | 130 // Stores info about buffers for all clients. This should only be accessed |
128 // on the IO thread. | 131 // on the IO thread. |
129 using BufferMap = base::hash_map<gfx::GpuMemoryBufferId, BufferInfo>; | 132 using BufferMap = base::hash_map<gfx::GpuMemoryBufferId, BufferInfo>; |
130 using ClientMap = base::hash_map<int, BufferMap>; | 133 using ClientMap = base::hash_map<int, BufferMap>; |
131 ClientMap clients_; | 134 ClientMap clients_; |
132 | 135 |
133 DISALLOW_COPY_AND_ASSIGN(BrowserGpuMemoryBufferManager); | 136 DISALLOW_COPY_AND_ASSIGN(BrowserGpuMemoryBufferManager); |
134 }; | 137 }; |
135 | 138 |
136 } // namespace content | 139 } // namespace content |
137 | 140 |
138 #endif // CONTENT_BROWSER_GPU_BROWSER_GPU_MEMORY_BUFFER_MANAGER_H_ | 141 #endif // CONTENT_BROWSER_GPU_BROWSER_GPU_MEMORY_BUFFER_MANAGER_H_ |
OLD | NEW |