Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(437)

Unified Diff: ui/gfx/buffer_format_util.cc

Issue 1389133002: content: Use type-parameterized tests for GpuMemoryBuffer implementations. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add blankline Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/gfx/buffer_format_util.h ('k') | ui/ozone/common/stub_client_native_pixmap_factory.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..33bf627aad2817e56a82ac1d6e9f05e396f0343d 100644
--- a/ui/gfx/buffer_format_util.cc
+++ b/ui/gfx/buffer_format_util.cc
@@ -8,6 +8,27 @@
#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) ==
+ (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) {
« no previous file with comments | « ui/gfx/buffer_format_util.h ('k') | ui/ozone/common/stub_client_native_pixmap_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698