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

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: Enable it on Mac 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 cc0ac0044ac2997e2a9d6782d171e202a8ea4ad0..a294323f666a6707a7db9ec268aaa7fc18bcbd0a 100644
--- a/content/common/gpu/client/gpu_memory_buffer_impl.cc
+++ b/content/common/gpu/client/gpu_memory_buffer_impl.cc
@@ -97,6 +97,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;
@@ -144,6 +149,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