| // Copyright 2020 The Chromium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| module gfx.mojom; |
| |
| import "mojo/public/mojom/base/shared_memory.mojom"; |
| import "mojo/public/mojom/base/unguessable_token.mojom"; |
| |
| // gfx::NativePixmapPlane |
| [EnableIf=supports_native_pixmap] |
| struct NativePixmapPlane { |
| uint32 stride; |
| uint64 offset; |
| uint64 size; |
| |
| // A platform-specific handle the underlying memory object. |
| handle<platform> buffer_handle; |
| }; |
| |
| // gfx::NativePixmapHandle |
| [EnableIf=supports_native_pixmap] |
| struct NativePixmapHandle { |
| array<NativePixmapPlane> planes; |
| |
| [EnableIf=is_linux] |
| uint64 modifier; |
| [EnableIf=is_chromeos] |
| uint64 modifier; |
| |
| [EnableIf=is_fuchsia] |
| mojo_base.mojom.UnguessableToken? buffer_collection_id; |
| [EnableIf=is_fuchsia] |
| uint32 buffer_index; |
| [EnableIf=is_fuchsia] |
| bool ram_coherency; |
| }; |
| |
| [EnableIf=is_android] |
| struct AHardwareBufferHandle { |
| // The actual file descriptor used to wrap the AHardwareBuffer object for |
| // serialization. |
| handle<platform> buffer_handle; |
| |
| // A message pipe handle which tracks the lifetime of this |
| // AHardwareBufferHandle. The sender may use this to observe the lifetime |
| // remotely by watching the other end of this pipe. Useful for retaining a |
| // sender-side AHB ref until the receiver deserializes the AHB and acquires |
| // its own ref. |
| handle<message_pipe> tracking_pipe; |
| }; |
| |
| union GpuMemoryBufferPlatformHandle { |
| mojo_base.mojom.UnsafeSharedMemoryRegion shared_memory_handle; |
| |
| [EnableIf=supports_native_pixmap] |
| NativePixmapHandle native_pixmap_handle; |
| |
| [EnableIf=is_mac] |
| handle<platform> mach_port; |
| |
| [EnableIf=is_win] |
| handle<platform> dxgi_handle; |
| |
| [EnableIf=is_android] |
| AHardwareBufferHandle android_hardware_buffer_handle; |
| }; |