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

Unified Diff: ui/gfx/gpu_memory_buffer.cc

Issue 1281043006: Move NumberOfPlanesForGpuMemoryBufferFormat to gfx (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix build warning again 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
« ui/gfx/gpu_memory_buffer.h ('K') | « ui/gfx/gpu_memory_buffer.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..adb8d98edb71eba492e269ce633616e1dd29d033 100644
--- a/ui/gfx/gpu_memory_buffer.cc
+++ b/ui/gfx/gpu_memory_buffer.cc
@@ -21,4 +21,25 @@ 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:
+ return 3;
+ }
+ NOTREACHED();
+ return 0;
+}
+
} // namespace gfx
« ui/gfx/gpu_memory_buffer.h ('K') | « ui/gfx/gpu_memory_buffer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698