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 | |
18 // defined by CHROMIUM_image. | |
19 GPU_EXPORT gfx::BufferFormat DefaultBufferFormatForImageFormat( | |
20 unsigned internalformat); | |
21 | |
22 // Returns true if |internalformat| is compatible with |format|. | 17 // Returns true if |internalformat| is compatible with |format|. |
23 GPU_EXPORT bool IsImageFormatCompatibleWithGpuMemoryBufferFormat( | 18 GPU_EXPORT bool IsImageFormatCompatibleWithGpuMemoryBufferFormat( |
24 unsigned internalformat, | 19 unsigned internalformat, |
25 gfx::BufferFormat format); | 20 gfx::BufferFormat format); |
26 | 21 |
27 // Returns true if creating an image for a GpuMemoryBuffer with |format| is | 22 // Returns true if creating an image for a GpuMemoryBuffer with |format| is |
28 // supported by |capabilities|. | 23 // supported by |capabilities|. |
29 GPU_EXPORT bool IsImageFromGpuMemoryBufferFormatSupported( | 24 GPU_EXPORT bool IsImageFromGpuMemoryBufferFormatSupported( |
30 gfx::BufferFormat format, | 25 gfx::BufferFormat format, |
31 const Capabilities& capabilities); | 26 const Capabilities& capabilities); |
32 | 27 |
33 // Returns true if |size| is valid for |format|. | 28 // Returns true if |size| is valid for |format|. |
34 GPU_EXPORT bool IsImageSizeValidForGpuMemoryBufferFormat( | 29 GPU_EXPORT bool IsImageSizeValidForGpuMemoryBufferFormat( |
35 const gfx::Size& size, | 30 const gfx::Size& size, |
36 gfx::BufferFormat format); | 31 gfx::BufferFormat format); |
37 | 32 |
38 } // namespace gpu | 33 } // namespace gpu |
39 | 34 |
40 #endif // GPU_COMMAND_BUFFER_COMMON_GPU_MEMORY_BUFFER_SUPPORT_H_ | 35 #endif // GPU_COMMAND_BUFFER_COMMON_GPU_MEMORY_BUFFER_SUPPORT_H_ |
OLD | NEW |