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

Unified Diff: content/common/gpu/client/gpu_memory_buffer_impl.cc

Issue 1282313002: Add YUV_420_BIPLANAR to gfx::BufferFormat. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@gmb-planes
Patch Set: Rebase 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: content/common/gpu/client/gpu_memory_buffer_impl.cc
diff --git a/content/common/gpu/client/gpu_memory_buffer_impl.cc b/content/common/gpu/client/gpu_memory_buffer_impl.cc
index 81af39991d6c6f2698b4154d3d511c077ab2b23f..8daabd07546ac28d9071a60f6572012226930813 100644
--- a/content/common/gpu/client/gpu_memory_buffer_impl.cc
+++ b/content/common/gpu/client/gpu_memory_buffer_impl.cc
@@ -98,6 +98,11 @@ size_t GpuMemoryBufferImpl::SubsamplingFactor(gfx::BufferFormat format,
DCHECK_LT(static_cast<size_t>(plane), arraysize(factor));
return factor[plane];
}
+ case gfx::BufferFormat::YUV_420_BIPLANAR: {
+ static size_t factor[] = {1, 2};
+ DCHECK_LT(static_cast<size_t>(plane), arraysize(factor));
+ return factor[plane];
+ }
}
NOTREACHED();
return 0;
@@ -145,6 +150,10 @@ bool GpuMemoryBufferImpl::RowSizeInBytes(size_t width,
DCHECK_EQ(width % 2, 0u);
*size_in_bytes = width / SubsamplingFactor(format, plane);
return true;
+ case gfx::BufferFormat::YUV_420_BIPLANAR:
+ DCHECK_EQ(width % 2, 0u);
+ *size_in_bytes = width;
+ return true;
}
NOTREACHED();
return false;

Powered by Google App Engine
This is Rietveld 408576698