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 GPU_COMMAND_BUFFER_COMMON_GPU_MEMORY_BUFFER_SUPPORT_H_ | 5 #ifndef GPU_COMMAND_BUFFER_COMMON_GPU_MEMORY_BUFFER_SUPPORT_H_ |
6 #define GPU_COMMAND_BUFFER_COMMON_GPU_MEMORY_BUFFER_SUPPORT_H_ | 6 #define GPU_COMMAND_BUFFER_COMMON_GPU_MEMORY_BUFFER_SUPPORT_H_ |
7 | 7 |
8 #include "gpu/gpu_export.h" | 8 #include "gpu/gpu_export.h" |
9 #include "ui/gfx/buffer_types.h" | 9 #include "ui/gfx/buffer_types.h" |
10 #include "ui/gfx/geometry/size.h" | 10 #include "ui/gfx/geometry/size.h" |
11 #include "ui/gfx/gpu_memory_buffer.h" | 11 #include "ui/gfx/gpu_memory_buffer.h" |
12 | 12 |
13 namespace gpu { | 13 namespace gpu { |
14 | 14 |
15 struct Capabilities; | 15 struct Capabilities; |
16 | 16 |
17 // Returns a valid GpuMemoryBuffer format given a valid internalformat as | 17 // Returns a valid GpuMemoryBuffer format given a valid internalformat as |
18 // defined by CHROMIUM_image. | 18 // defined by CHROMIUM_image. |
19 GPU_EXPORT gfx::BufferFormat DefaultBufferFormatForImageFormat( | 19 GPU_EXPORT gfx::BufferFormat DefaultBufferFormatForImageFormat( |
20 unsigned internalformat); | 20 unsigned internalformat); |
21 | 21 |
22 // Returns true if |internalformat| is compatible with |format|. | 22 // Returns true if |internalformat| is compatible with |format|. |
23 GPU_EXPORT bool IsImageFormatCompatibleWithGpuMemoryBufferFormat( | 23 GPU_EXPORT bool IsImageFormatCompatibleWithGpuMemoryBufferFormat( |
24 unsigned internalformat, | 24 unsigned internalformat, |
25 gfx::BufferFormat format); | 25 gfx::BufferFormat format); |
26 | 26 |
27 // Returns true if |format| is supported by |capabilities|. | 27 // Returns true if creating an image for a GpuMemoryBuffer with |format| is |
28 GPU_EXPORT bool IsGpuMemoryBufferFormatSupported( | 28 // supported by |capabilities|. |
| 29 GPU_EXPORT bool IsImageFromGpuMemoryBufferFormatSupported( |
29 gfx::BufferFormat format, | 30 gfx::BufferFormat format, |
30 const Capabilities& capabilities); | 31 const Capabilities& capabilities); |
31 | 32 |
32 // Returns true if |size| is valid for |format|. | 33 // Returns true if |size| is valid for |format|. |
33 GPU_EXPORT bool IsImageSizeValidForGpuMemoryBufferFormat( | 34 GPU_EXPORT bool IsImageSizeValidForGpuMemoryBufferFormat( |
34 const gfx::Size& size, | 35 const gfx::Size& size, |
35 gfx::BufferFormat format); | 36 gfx::BufferFormat format); |
36 | 37 |
37 } // namespace gpu | 38 } // namespace gpu |
38 | 39 |
39 #endif // GPU_COMMAND_BUFFER_COMMON_GPU_MEMORY_BUFFER_SUPPORT_H_ | 40 #endif // GPU_COMMAND_BUFFER_COMMON_GPU_MEMORY_BUFFER_SUPPORT_H_ |
OLD | NEW |