OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef GPU_IPC_HOST_GPU_MEMORY_BUFFER_SUPPORT_H_ | |
6 #define GPU_IPC_HOST_GPU_MEMORY_BUFFER_SUPPORT_H_ | |
7 | |
8 #include "base/containers/hash_tables.h" | |
9 #include "base/hash.h" | |
10 #include "ui/gfx/buffer_types.h" | |
11 | |
12 namespace gpu { | |
13 | |
14 using GpuMemoryBufferConfigurationKey = | |
15 std::pair<gfx::BufferFormat, gfx::BufferUsage>; | |
16 using GpuMemoryBufferConfigurationSet = | |
17 base::hash_set<GpuMemoryBufferConfigurationKey>; | |
18 | |
19 } // namespace gpu | |
20 | |
21 namespace BASE_HASH_NAMESPACE { | |
22 | |
23 template <> | |
24 struct hash<gpu::GpuMemoryBufferConfigurationKey> { | |
25 size_t operator()(const gpu::GpuMemoryBufferConfigurationKey& key) const { | |
26 return base::HashInts(static_cast<int>(key.first), | |
27 static_cast<int>(key.second)); | |
28 } | |
29 }; | |
30 | |
31 } // namespace BASE_HASH_NAMESPACE | |
32 | |
33 namespace gpu { | |
34 | |
35 bool AreNativeGpuMemoryBuffersEnabled(); | |
36 | |
37 // Returns the set of supported configurations. | |
38 GpuMemoryBufferConfigurationSet GetNativeGpuMemoryBufferConfigurations(); | |
39 | |
40 // Returns the OpenGL target to use for image textures. | |
41 uint32_t GetImageTextureTarget(gfx::BufferFormat format, | |
42 gfx::BufferUsage usage); | |
43 | |
44 } // namespace gpu | |
45 | |
46 #endif // GPU_IPC_HOST_GPU_MEMORY_BUFFER_SUPPORT_H_ | |
OLD | NEW |