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

Unified Diff: components/exo/display.cc

Issue 2046743002: exo: Add support for importing YVU_420 buffers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@yv12-test
Patch Set: Avoid vector aggregate initialization in exo test. Created 4 years, 6 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 | « components/exo/display.h ('k') | components/exo/display_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/exo/display.cc
diff --git a/components/exo/display.cc b/components/exo/display.cc
index 719a9459e4db1f16f38427c6fdb01adf009ef7aa..78e9606ac1f82dee199b2f6c0d43719c75fc8832 100644
--- a/components/exo/display.cc
+++ b/components/exo/display.cc
@@ -60,18 +60,24 @@ std::unique_ptr<SharedMemory> Display::CreateSharedMemory(
#if defined(USE_OZONE)
std::unique_ptr<Buffer> Display::CreateLinuxDMABufBuffer(
- base::ScopedFD fd,
const gfx::Size& size,
gfx::BufferFormat format,
- int stride) {
+ const std::vector<int>& strides,
+ const std::vector<int>& offsets,
+ std::vector<base::ScopedFD>&& fds) {
TRACE_EVENT1("exo", "Display::CreateLinuxDMABufBuffer", "size",
size.ToString());
gfx::GpuMemoryBufferHandle handle;
handle.type = gfx::OZONE_NATIVE_PIXMAP;
- handle.native_pixmap_handle.fds.emplace_back(
- base::FileDescriptor(std::move(fd)));
- handle.native_pixmap_handle.strides_and_offsets.emplace_back(stride, 0);
+ for (auto& fd : fds)
+ handle.native_pixmap_handle.fds.emplace_back(std::move(fd));
+
+ DCHECK_EQ(strides.size(), offsets.size());
+ for (size_t plane = 0; plane < strides.size(); ++plane) {
+ handle.native_pixmap_handle.strides_and_offsets.emplace_back(
+ strides[plane], offsets[plane]);
+ }
std::unique_ptr<gfx::GpuMemoryBuffer> gpu_memory_buffer =
aura::Env::GetInstance()
« no previous file with comments | « components/exo/display.h ('k') | components/exo/display_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698