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

Unified Diff: components/exo/wayland/server.cc

Issue 2039813002: Add format modifier IDs for EGL_EXT_image_dma_buf_import extension (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add format modifier IDs for EGL_EXT_image_dma_buf_import extension 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_unittest.cc ('k') | gpu/ipc/client/gpu_channel_host.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/exo/wayland/server.cc
diff --git a/components/exo/wayland/server.cc b/components/exo/wayland/server.cc
index 55df4d18b6cc7c186fe6701ecbf06b58ba0c81ca..9d01332dfc3a114b112555128439b6ad7a8c2c79 100644
--- a/components/exo/wayland/server.cc
+++ b/components/exo/wayland/server.cc
@@ -521,20 +521,21 @@ void drm_create_prime_buffer(wl_client* client,
return;
}
- std::vector<int> strides{stride0, stride1, stride2};
- std::vector<int> offsets{offset0, offset1, offset2};
+ std::vector<gfx::NativePixmapPlane> planes;
+ planes.emplace_back(stride0, offset0, 0);
+ planes.emplace_back(stride1, offset1, 0);
+ planes.emplace_back(stride2, offset2, 0);
std::vector<base::ScopedFD> fds;
- int planes =
+ size_t num_planes =
gfx::NumberOfPlanesForBufferFormat(supported_format->buffer_format);
- strides.resize(planes);
- offsets.resize(planes);
+ planes.resize(num_planes);
fds.push_back(base::ScopedFD(name));
std::unique_ptr<Buffer> buffer =
GetUserDataAs<Display>(resource)->CreateLinuxDMABufBuffer(
- gfx::Size(width, height), supported_format->buffer_format, strides,
- offsets, std::move(fds));
+ gfx::Size(width, height), supported_format->buffer_format, planes,
+ std::move(fds));
if (!buffer) {
wl_resource_post_no_memory(resource);
return;
@@ -667,8 +668,7 @@ void linux_buffer_params_create(wl_client* client,
return;
}
- std::vector<int> strides;
- std::vector<int> offsets;
+ std::vector<gfx::NativePixmapPlane> planes;
std::vector<base::ScopedFD> fds;
for (uint32_t i = 0; i < num_planes; ++i) {
@@ -680,16 +680,15 @@ void linux_buffer_params_create(wl_client* client,
return;
}
LinuxBufferParams::Plane& plane = plane_it->second;
- strides.push_back(plane.stride);
- offsets.push_back(plane.offset);
+ planes.emplace_back(plane.stride, plane.offset, 0);
if (plane.fd.is_valid())
fds.push_back(std::move(plane.fd));
}
std::unique_ptr<Buffer> buffer =
linux_buffer_params->display->CreateLinuxDMABufBuffer(
- gfx::Size(width, height), supported_format->buffer_format, strides,
- offsets, std::move(fds));
+ gfx::Size(width, height), supported_format->buffer_format, planes,
+ std::move(fds));
if (!buffer) {
zwp_linux_buffer_params_v1_send_failed(resource);
return;
« no previous file with comments | « components/exo/display_unittest.cc ('k') | gpu/ipc/client/gpu_channel_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698