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

Unified Diff: ui/gfx/gpu_memory_buffer.cc

Issue 1282313002: Add YUV_420_BIPLANAR to gfx::BufferFormat. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@gmb-planes
Patch Set: Fixes for reveman Created 5 years, 4 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
Index: ui/gfx/gpu_memory_buffer.cc
diff --git a/ui/gfx/gpu_memory_buffer.cc b/ui/gfx/gpu_memory_buffer.cc
index 44fcd31fd87513868f5d135d32393f7f92fc545d..4dd4f072a76e38948ec665a1330ef727f2e1688c 100644
--- a/ui/gfx/gpu_memory_buffer.cc
+++ b/ui/gfx/gpu_memory_buffer.cc
@@ -21,4 +21,27 @@ GpuMemoryBufferHandle::GpuMemoryBufferHandle()
: type(EMPTY_BUFFER), id(0), handle(base::SharedMemory::NULLHandle()) {
}
+// static
+size_t GpuMemoryBuffer::NumberOfPlanes(BufferFormat format) {
+ switch (format) {
+ case BufferFormat::ATC:
+ case BufferFormat::ATCIA:
+ case BufferFormat::DXT1:
+ case BufferFormat::DXT5:
+ case BufferFormat::ETC1:
+ case BufferFormat::R_8:
+ case BufferFormat::RGBA_4444:
+ case BufferFormat::RGBA_8888:
+ case BufferFormat::RGBX_8888:
+ case BufferFormat::BGRA_8888:
+ return 1;
+ case BufferFormat::YUV_420_BIPLANAR:
+ return 2;
+ case BufferFormat::YUV_420:
+ return 3;
+ }
+ NOTREACHED();
+ return 0;
+}
reveman 2015/08/11 08:20:08 bad rebase?
Andre 2015/08/11 18:15:44 Oops, fixed.
+
} // namespace gfx

Powered by Google App Engine
This is Rietveld 408576698