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 |format| is supported by |capabilities|. |
28 GPU_EXPORT bool IsGpuMemoryBufferFormatSupported( | 28 GPU_EXPORT bool IsImageFromGpuMemoryBufferFormatSupported( |
reveman
2017/04/11 16:28:26
nit: can update the comment above too? "Returns tr
ccameron
2017/04/12 05:34:35
Done.
| |
29 gfx::BufferFormat format, | 29 gfx::BufferFormat format, |
30 const Capabilities& capabilities); | 30 const Capabilities& capabilities); |
31 | 31 |
32 // Returns true if |size| is valid for |format|. | 32 // Returns true if |size| is valid for |format|. |
33 GPU_EXPORT bool IsImageSizeValidForGpuMemoryBufferFormat( | 33 GPU_EXPORT bool IsImageSizeValidForGpuMemoryBufferFormat( |
34 const gfx::Size& size, | 34 const gfx::Size& size, |
35 gfx::BufferFormat format); | 35 gfx::BufferFormat format); |
36 | 36 |
37 } // namespace gpu | 37 } // namespace gpu |
38 | 38 |
39 #endif // GPU_COMMAND_BUFFER_COMMON_GPU_MEMORY_BUFFER_SUPPORT_H_ | 39 #endif // GPU_COMMAND_BUFFER_COMMON_GPU_MEMORY_BUFFER_SUPPORT_H_ |
OLD | NEW |