Chromium Code Reviews| Index: ui/ozone/platform/drm/gpu/gbm_surface_factory.cc |
| diff --git a/ui/ozone/platform/drm/gpu/gbm_surface_factory.cc b/ui/ozone/platform/drm/gpu/gbm_surface_factory.cc |
| index 711ed04702e8cd903d2cadfdaf2c14f5b9598967..73f4cd49bba91b74173c8391fdb7c2403a4d6ce6 100644 |
| --- a/ui/ozone/platform/drm/gpu/gbm_surface_factory.cc |
| +++ b/ui/ozone/platform/drm/gpu/gbm_surface_factory.cc |
| @@ -114,9 +114,9 @@ scoped_refptr<ui::NativePixmap> GbmSurfaceFactory::CreateNativePixmapFromHandle( |
| gfx::Size size, |
| gfx::BufferFormat format, |
| const gfx::NativePixmapHandle& handle) { |
| - size_t planes = gfx::NumberOfPlanesForBufferFormat(format); |
| - if (handle.strides_and_offsets.size() != planes || |
| - (handle.fds.size() != 1 && handle.fds.size() != planes)) { |
| + size_t num_planes = gfx::NumberOfPlanesForBufferFormat(format); |
| + if (handle.planes.size() != num_planes || |
| + (handle.fds.size() != 1 && handle.fds.size() != num_planes)) { |
| return nullptr; |
| } |
| std::vector<base::ScopedFD> scoped_fds; |
| @@ -124,16 +124,14 @@ scoped_refptr<ui::NativePixmap> GbmSurfaceFactory::CreateNativePixmapFromHandle( |
| scoped_fds.emplace_back(fd.fd); |
| } |
| - std::vector<int> strides; |
| - std::vector<int> offsets; |
| + std::vector<gfx::GbmBufferPlane> planes; |
| - for (const auto& stride_and_offset : handle.strides_and_offsets) { |
| - strides.push_back(stride_and_offset.first); |
| - offsets.push_back(stride_and_offset.second); |
| + for (const auto& plane : handle.planes) { |
| + planes.emplace_back(plane); |
|
Daniele Castagna
2016/06/15 03:50:20
emplace_back here has the same effect of push_back
vinceh
2016/06/15 04:35:18
Yes. You prefer push_back here?
Daniele Castagna
2016/06/15 17:34:29
I don't have any preference. It's just that I'm us
|
| } |
| scoped_refptr<GbmBuffer> buffer = drm_thread_->CreateBufferFromFds( |
| - size, format, std::move(scoped_fds), strides, offsets); |
| + size, format, std::move(scoped_fds), std::move(planes)); |
| if (!buffer) |
| return nullptr; |
| return make_scoped_refptr(new GbmPixmap(this, buffer)); |