Commit 7c4b7d21 authored by Robert Sesek's avatar Robert Sesek Committed by Commit Bot

Convert ui/ozone/public/mojom/wayland/wayland_buffer_manager.mojom to handle<platform>

Bug: 778317
Change-Id: I4e61655092747c02a18faae294d836876e6015a6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2063211Reviewed-by: default avatarMaksim Sisov <msisov@igalia.com>
Commit-Queue: Robert Sesek <rsesek@chromium.org>
Cr-Commit-Position: refs/heads/master@{#742629}
parent 9fb7a501
......@@ -18,7 +18,6 @@
#include "base/message_loop/message_pump_type.h"
#include "base/task/single_thread_task_executor.h"
#include "mojo/core/embedder/embedder.h"
#include "mojo/public/cpp/system/platform_handle.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/ozone/platform/wayland/host/wayland_buffer_manager_host.h"
......@@ -132,9 +131,8 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
EXPECT_CALL(*server.zwp_linux_dmabuf_v1(), CreateParams(_, _, _));
auto* manager_host = connection->buffer_manager_host();
manager_host->CreateDmabufBasedBuffer(
widget, mojo::WrapPlatformHandle(mojo::PlatformHandle(std::move(fd))),
buffer_size, strides, offsets, modifiers, kFormat, kPlaneCount,
kBufferId);
widget, mojo::PlatformHandle(std::move(fd)), buffer_size, strides,
offsets, modifiers, kFormat, kPlaneCount, kBufferId);
// Wait until the buffers are created.
base::RunLoop().RunUntilIdle();
......
......@@ -9,7 +9,6 @@
#include "base/bind.h"
#include "base/message_loop/message_loop_current.h"
#include "base/process/process.h"
#include "mojo/public/cpp/system/platform_handle.h"
#include "ui/gfx/linux/drm_util_linux.h"
#include "ui/ozone/platform/wayland/gpu/wayland_surface_gpu.h"
......@@ -174,9 +173,8 @@ void WaylandBufferManagerGpu::CreateDmabufBasedBufferInternal(
DCHECK(io_thread_runner_->BelongsToCurrentThread());
DCHECK(remote_host_);
remote_host_->CreateDmabufBasedBuffer(
mojo::WrapPlatformHandle(mojo::PlatformHandle(std::move(dmabuf_fd))),
size, strides, offsets, modifiers, current_format, planes_count,
buffer_id);
mojo::PlatformHandle(std::move(dmabuf_fd)), size, strides, offsets,
modifiers, current_format, planes_count, buffer_id);
}
void WaylandBufferManagerGpu::CreateShmBasedBufferInternal(
......@@ -186,9 +184,8 @@ void WaylandBufferManagerGpu::CreateShmBasedBufferInternal(
uint32_t buffer_id) {
DCHECK(io_thread_runner_->BelongsToCurrentThread());
DCHECK(remote_host_);
remote_host_->CreateShmBasedBuffer(
mojo::WrapPlatformHandle(mojo::PlatformHandle(std::move(shm_fd))), length,
size, buffer_id);
remote_host_->CreateShmBasedBuffer(mojo::PlatformHandle(std::move(shm_fd)),
length, size, buffer_id);
}
void WaylandBufferManagerGpu::CommitBufferInternal(
......
......@@ -12,7 +12,6 @@
#include "base/strings/strcat.h"
#include "base/strings/utf_string_conversions.h"
#include "base/trace_event/trace_event.h"
#include "mojo/public/cpp/system/platform_handle.h"
#include "ui/gfx/linux/drm_util_linux.h"
#include "ui/ozone/platform/wayland/host/wayland_connection.h"
#include "ui/ozone/platform/wayland/host/wayland_drm.h"
......@@ -679,7 +678,7 @@ void WaylandBufferManagerHost::SetWaylandBufferManagerGpu(
}
void WaylandBufferManagerHost::CreateDmabufBasedBuffer(
mojo::ScopedHandle dmabuf_fd,
mojo::PlatformHandle dmabuf_fd,
const gfx::Size& size,
const std::vector<uint32_t>& strides,
const std::vector<uint32_t>& offsets,
......@@ -693,7 +692,7 @@ void WaylandBufferManagerHost::CreateDmabufBasedBuffer(
TRACE_EVENT2("wayland", "WaylandBufferManagerHost::CreateDmabufBasedBuffer",
"Format", format, "Buffer id", buffer_id);
base::ScopedFD fd = mojo::UnwrapPlatformHandle(std::move(dmabuf_fd)).TakeFD();
base::ScopedFD fd = dmabuf_fd.TakeFD();
// Validate data and ask surface to create a buffer associated with the
// |buffer_id|.
......@@ -723,7 +722,7 @@ void WaylandBufferManagerHost::CreateDmabufBasedBuffer(
}
}
void WaylandBufferManagerHost::CreateShmBasedBuffer(mojo::ScopedHandle shm_fd,
void WaylandBufferManagerHost::CreateShmBasedBuffer(mojo::PlatformHandle shm_fd,
uint64_t length,
const gfx::Size& size,
uint32_t buffer_id) {
......@@ -733,7 +732,7 @@ void WaylandBufferManagerHost::CreateShmBasedBuffer(mojo::ScopedHandle shm_fd,
TRACE_EVENT1("wayland", "WaylandBufferManagerHost::CreateShmBasedBuffer",
"Buffer id", buffer_id);
base::ScopedFD fd = mojo::UnwrapPlatformHandle(std::move(shm_fd)).TakeFD();
base::ScopedFD fd = shm_fd.TakeFD();
// Validate data and create a buffer associated with the |buffer_id|.
if (!ValidateDataFromGpu(fd, length, size, buffer_id) ||
!CreateBuffer(size, buffer_id)) {
......
......@@ -109,7 +109,7 @@ class WaylandBufferManagerHost : public ozone::mojom::WaylandBufferManagerHost,
// Called by the GPU and asks to import a wl_buffer based on a gbm file
// descriptor using zwp_linux_dmabuf protocol. Check comments in the
// ui/ozone/public/mojom/wayland/wayland_connection.mojom.
void CreateDmabufBasedBuffer(mojo::ScopedHandle dmabuf_fd,
void CreateDmabufBasedBuffer(mojo::PlatformHandle dmabuf_fd,
const gfx::Size& size,
const std::vector<uint32_t>& strides,
const std::vector<uint32_t>& offsets,
......@@ -120,7 +120,7 @@ class WaylandBufferManagerHost : public ozone::mojom::WaylandBufferManagerHost,
// Called by the GPU and asks to import a wl_buffer based on a shared memory
// file descriptor using wl_shm protocol. Check comments in the
// ui/ozone/public/mojom/wayland/wayland_connection.mojom.
void CreateShmBasedBuffer(mojo::ScopedHandle shm_fd,
void CreateShmBasedBuffer(mojo::PlatformHandle shm_fd,
uint64_t length,
const gfx::Size& size,
uint32_t buffer_id) override;
......
......@@ -35,7 +35,7 @@ interface WaylandBufferManagerHost {
// very first CommitBuffer request comes from viz to browser process.
// If the buffer has been committed at least once, it is not possible to
// reassign it to another AcceleratedWidget.
CreateDmabufBasedBuffer(handle dmabuf_fd,
CreateDmabufBasedBuffer(handle<platform> dmabuf_fd,
gfx.mojom.Size size,
array<uint32> strides,
array<uint32> offsets,
......@@ -52,7 +52,7 @@ interface WaylandBufferManagerHost {
// very first CommitBuffer request comes from viz to browser process. If
// the buffer has been committed at least once, it is not possible to
// reassign it to another AcceleratedWidget.
CreateShmBasedBuffer(handle shm_fd,
CreateShmBasedBuffer(handle<platform> shm_fd,
uint64 length,
gfx.mojom.Size size,
uint32 buffer_id);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment