Chromium Code Reviews| Index: ui/gfx/buffer_format_util.cc |
| diff --git a/ui/gfx/buffer_format_util.cc b/ui/gfx/buffer_format_util.cc |
| index 36222c9032119bed0a26cb053c807096771d4808..6da9e88e863f30824310415adba6abd4100df0c4 100644 |
| --- a/ui/gfx/buffer_format_util.cc |
| +++ b/ui/gfx/buffer_format_util.cc |
| @@ -8,6 +8,26 @@ |
| #include "base/numerics/safe_math.h" |
| namespace gfx { |
| +namespace { |
| + |
| +const BufferFormat kBufferFormats[] = { |
| + BufferFormat::ATC, BufferFormat::ATCIA, |
| + BufferFormat::DXT1, BufferFormat::DXT5, |
| + BufferFormat::ETC1, BufferFormat::R_8, |
| + BufferFormat::RGBA_4444, BufferFormat::RGBA_8888, |
| + BufferFormat::BGRX_8888, BufferFormat::BGRA_8888, |
| + BufferFormat::UYVY_422, BufferFormat::YUV_420_BIPLANAR, |
| + BufferFormat::YUV_420}; |
| +static_assert(arraysize(kBufferFormats) == |
|
sky
2015/10/07 17:35:13
nit: a newline would be nice between 20 and 21.
reveman
2015/10/07 18:12:57
Done.
|
| + (static_cast<int>(BufferFormat::LAST) + 1), |
| + "BufferFormat::LAST must be last value of kBufferFormats"); |
| + |
| +} // namespace |
| + |
| +std::vector<BufferFormat> GetBufferFormats() { |
| + return std::vector<BufferFormat>(kBufferFormats, |
| + kBufferFormats + arraysize(kBufferFormats)); |
| +} |
| size_t NumberOfPlanesForBufferFormat(BufferFormat format) { |
| switch (format) { |