| 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 "content/common/content_export.h" | 19 #include "content/common/content_export.h" |
| 20 #include "gpu/command_buffer/client/gpu_memory_buffer_manager.h" | 20 #include "gpu/command_buffer/client/gpu_memory_buffer_manager.h" |
| 21 #include "gpu/ipc/client/gpu_host_memory_buffer_manager.h" |
| 21 #include "gpu/ipc/common/surface_handle.h" | 22 #include "gpu/ipc/common/surface_handle.h" |
| 22 | 23 |
| 23 namespace content { | 24 namespace content { |
| 24 | 25 |
| 25 using GpuMemoryBufferConfigurationKey = | 26 using GpuMemoryBufferConfigurationKey = |
| 26 std::pair<gfx::BufferFormat, gfx::BufferUsage>; | 27 std::pair<gfx::BufferFormat, gfx::BufferUsage>; |
| 27 using GpuMemoryBufferConfigurationSet = | 28 using GpuMemoryBufferConfigurationSet = |
| 28 base::hash_set<GpuMemoryBufferConfigurationKey>; | 29 base::hash_set<GpuMemoryBufferConfigurationKey>; |
| 29 | 30 |
| 30 } // content | 31 } // content |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 void DestroyGpuMemoryBufferOnIO(gfx::GpuMemoryBufferId id, | 163 void DestroyGpuMemoryBufferOnIO(gfx::GpuMemoryBufferId id, |
| 163 int client_id, | 164 int client_id, |
| 164 const gpu::SyncToken& sync_token); | 165 const gpu::SyncToken& sync_token); |
| 165 | 166 |
| 166 uint64_t ClientIdToTracingProcessId(int client_id) const; | 167 uint64_t ClientIdToTracingProcessId(int client_id) const; |
| 167 | 168 |
| 168 const GpuMemoryBufferConfigurationSet native_configurations_; | 169 const GpuMemoryBufferConfigurationSet native_configurations_; |
| 169 const int gpu_client_id_; | 170 const int gpu_client_id_; |
| 170 const uint64_t gpu_client_tracing_id_; | 171 const uint64_t gpu_client_tracing_id_; |
| 171 | 172 |
| 173 std::unique_ptr<gpu::GpuHostMemoryBufferManager> gpu_memory_buffer_manager_; |
| 174 |
| 172 // The GPU process host ID. This should only be accessed on the IO thread. | 175 // The GPU process host ID. This should only be accessed on the IO thread. |
| 173 int gpu_host_id_; | 176 int gpu_host_id_; |
| 174 | 177 |
| 178 #if 1 |
| 175 // Stores info about buffers for all clients. This should only be accessed | 179 // Stores info about buffers for all clients. This should only be accessed |
| 176 // on the IO thread. | 180 // on the IO thread. |
| 177 using BufferMap = base::hash_map<gfx::GpuMemoryBufferId, BufferInfo>; | 181 using BufferMap = base::hash_map<gfx::GpuMemoryBufferId, BufferInfo>; |
| 178 using ClientMap = base::hash_map<int, BufferMap>; | 182 using ClientMap = base::hash_map<int, BufferMap>; |
| 179 ClientMap clients_; | 183 ClientMap clients_; |
| 184 #endif |
| 180 | 185 |
| 181 DISALLOW_COPY_AND_ASSIGN(BrowserGpuMemoryBufferManager); | 186 DISALLOW_COPY_AND_ASSIGN(BrowserGpuMemoryBufferManager); |
| 182 }; | 187 }; |
| 183 | 188 |
| 184 } // namespace content | 189 } // namespace content |
| 185 | 190 |
| 186 #endif // CONTENT_BROWSER_GPU_BROWSER_GPU_MEMORY_BUFFER_MANAGER_H_ | 191 #endif // CONTENT_BROWSER_GPU_BROWSER_GPU_MEMORY_BUFFER_MANAGER_H_ |
| OLD | NEW |