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

Unified Diff: components/exo/display_unittest.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.cc ('k') | components/exo/wayland/server.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/exo/display_unittest.cc
diff --git a/components/exo/display_unittest.cc b/components/exo/display_unittest.cc
index e8becff7e28123a7f787c0b107d7bb020c20611e..953abcc94ec801f82513ea58f5f67c7b33f17406 100644
--- a/components/exo/display_unittest.cc
+++ b/components/exo/display_unittest.cc
@@ -68,17 +68,30 @@ TEST_F(DisplayTest, CreateLinuxDMABufBuffer) {
gfx::BufferFormat::RGBA_8888,
gfx::BufferUsage::GPU_READ);
gfx::NativePixmapHandle native_pixmap_handle = pixmap->ExportHandle();
+ std::vector<int> strides;
+ std::vector<int> offsets;
+ std::vector<base::ScopedFD> fds;
+ strides.push_back(native_pixmap_handle.strides_and_offsets[0].first);
+ offsets.push_back(native_pixmap_handle.strides_and_offsets[0].second);
+ fds.push_back(base::ScopedFD(native_pixmap_handle.fds[0].fd));
+
std::unique_ptr<Buffer> buffer1 = display->CreateLinuxDMABufBuffer(
- base::ScopedFD(native_pixmap_handle.fd.fd), buffer_size,
- gfx::BufferFormat::RGBA_8888, native_pixmap_handle.stride);
+ buffer_size, gfx::BufferFormat::RGBA_8888, strides, offsets,
+ std::move(fds));
EXPECT_TRUE(buffer1);
+ std::vector<base::ScopedFD> invalid_fds;
+ invalid_fds.push_back(base::ScopedFD());
// Creating a prime buffer using an invalid fd should fail.
std::unique_ptr<Buffer> buffer2 = display->CreateLinuxDMABufBuffer(
- base::ScopedFD(), buffer_size, gfx::BufferFormat::RGBA_8888,
- buffer_size.width() * 4);
+ buffer_size, gfx::BufferFormat::RGBA_8888, strides, offsets,
+ std::move(invalid_fds));
EXPECT_FALSE(buffer2);
}
+
+// TODO(dcastagna): Add YV12 unittest once we can allocate the buffer
+// via Ozone. crbug.com/618516
+
#endif
TEST_F(DisplayTest, CreateShellSurface) {
« no previous file with comments | « components/exo/display.cc ('k') | components/exo/wayland/server.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698