#include "ui/gfx/mojom/native_handle_types_mojom_traits.h"
#include "build/build_config.h"
namespace mojo {
#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_OZONE)
mojo::PlatformHandle StructTraits<
gfx::mojom::NativePixmapPlaneDataView,
gfx::NativePixmapPlane>::buffer_handle(gfx::NativePixmapPlane& plane) { … }
bool StructTraits<
gfx::mojom::NativePixmapPlaneDataView,
gfx::NativePixmapPlane>::Read(gfx::mojom::NativePixmapPlaneDataView data,
gfx::NativePixmapPlane* out) { … }
#if BUILDFLAG(IS_FUCHSIA)
PlatformHandle
StructTraits<gfx::mojom::NativePixmapHandleDataView, gfx::NativePixmapHandle>::
buffer_collection_handle(gfx::NativePixmapHandle& pixmap_handle) {
return mojo::PlatformHandle(
std::move(pixmap_handle.buffer_collection_handle));
}
#endif
bool StructTraits<
gfx::mojom::NativePixmapHandleDataView,
gfx::NativePixmapHandle>::Read(gfx::mojom::NativePixmapHandleDataView data,
gfx::NativePixmapHandle* out) { … }
#endif
#if BUILDFLAG(IS_WIN)
bool StructTraits<gfx::mojom::DXGIHandleTokenDataView, gfx::DXGIHandleToken>::
Read(gfx::mojom::DXGIHandleTokenDataView& input,
gfx::DXGIHandleToken* output) {
base::UnguessableToken token;
if (!input.ReadValue(&token))
return false;
*output = gfx::DXGIHandleToken(token);
return true;
}
#endif
}