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 <utility> | 11 #include <utility> |
12 | 12 |
13 #include "base/callback.h" | 13 #include "base/callback.h" |
14 #include "base/containers/hash_tables.h" | 14 #include "base/containers/hash_tables.h" |
15 #include "base/hash.h" | |
16 #include "base/macros.h" | 15 #include "base/macros.h" |
17 #include "base/trace_event/memory_dump_provider.h" | 16 #include "base/trace_event/memory_dump_provider.h" |
18 #include "content/common/content_export.h" | 17 #include "content/common/content_export.h" |
19 #include "gpu/command_buffer/client/gpu_memory_buffer_manager.h" | 18 #include "gpu/command_buffer/client/gpu_memory_buffer_manager.h" |
20 | 19 |
21 namespace content { | 20 namespace content { |
22 | 21 |
23 using GpuMemoryBufferConfigurationKey = | 22 using GpuMemoryBufferConfigurationKey = |
24 std::pair<gfx::BufferFormat, gfx::BufferUsage>; | 23 std::pair<gfx::BufferFormat, gfx::BufferUsage>; |
25 using GpuMemoryBufferConfigurationSet = | 24 using GpuMemoryBufferConfigurationSet = |
26 base::hash_set<GpuMemoryBufferConfigurationKey>; | 25 base::hash_set<GpuMemoryBufferConfigurationKey>; |
27 | 26 |
28 } // content | 27 } // content |
29 | 28 |
30 namespace BASE_HASH_NAMESPACE { | 29 namespace BASE_HASH_NAMESPACE { |
31 | 30 |
32 template <> | 31 template <> |
33 struct hash<content::GpuMemoryBufferConfigurationKey> { | 32 struct hash<content::GpuMemoryBufferConfigurationKey> { |
34 size_t operator()(const content::GpuMemoryBufferConfigurationKey& key) const { | 33 size_t operator()(const content::GpuMemoryBufferConfigurationKey& key) const { |
35 return base::HashInts(static_cast<int>(key.first), | 34 return base::HashPair(static_cast<int>(key.first), |
36 static_cast<int>(key.second)); | 35 static_cast<int>(key.second)); |
37 } | 36 } |
38 }; | 37 }; |
39 | 38 |
40 } // namespace BASE_HASH_NAMESPACE | 39 } // namespace BASE_HASH_NAMESPACE |
41 | 40 |
42 namespace content { | 41 namespace content { |
43 class GpuProcessHost; | 42 class GpuProcessHost; |
44 | 43 |
45 class CONTENT_EXPORT BrowserGpuMemoryBufferManager | 44 class CONTENT_EXPORT BrowserGpuMemoryBufferManager |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 using BufferMap = base::hash_map<gfx::GpuMemoryBufferId, BufferInfo>; | 186 using BufferMap = base::hash_map<gfx::GpuMemoryBufferId, BufferInfo>; |
188 using ClientMap = base::hash_map<int, BufferMap>; | 187 using ClientMap = base::hash_map<int, BufferMap>; |
189 ClientMap clients_; | 188 ClientMap clients_; |
190 | 189 |
191 DISALLOW_COPY_AND_ASSIGN(BrowserGpuMemoryBufferManager); | 190 DISALLOW_COPY_AND_ASSIGN(BrowserGpuMemoryBufferManager); |
192 }; | 191 }; |
193 | 192 |
194 } // namespace content | 193 } // namespace content |
195 | 194 |
196 #endif // CONTENT_BROWSER_GPU_BROWSER_GPU_MEMORY_BUFFER_MANAGER_H_ | 195 #endif // CONTENT_BROWSER_GPU_BROWSER_GPU_MEMORY_BUFFER_MANAGER_H_ |
OLD | NEW |