LavaUI docs GitHub

class CompositorResources

Swift

final class CompositorResources

The client's end of resource naming: LavaUI asks, the compositor answers.

Install it on the editor once, before anything loads, and every font id and texture id the app stamps into a frame becomes one the renderer will resolve to the same thing:

guard let editor = LavaClient.open(title: "My App") else { exit(1) }
editor.resources = CompositorResources(compositor)

Nothing above that line changes. FontStore and ImageStore keep their caches, their budget and their eviction, because none of that was ever about who owns the GPU — only the ids were, and this is the whole of that difference. See GPUResourceHost.

Sources/LavaClient/ControlPlane.swift:146

Constructors

init(_ compositor: Compositor)

Creates a host that registers resources with compositor.

Sources/LavaClient/ControlPlane.swift:191

Methods

func attachVideoBuffer(fd: Int32, layout: LavaUI.VideoBufferLayout) -> UInt32?

Not documented.

Sources/LavaClient/ControlPlane.swift:463

func detachVideoBuffer(_ handle: UInt32)

Not documented.

Sources/LavaClient/ControlPlane.swift:497

func registerFont(path: String, pixelSize26_6: UInt32, faceIndex: UInt32, rasterFlags: UInt32) -> UInt32?

Not documented.

Sources/LavaClient/ControlPlane.swift:222

func registerImage(path: String, maxPixelSize: UInt32, turn: LavaUI.ImageTurn) -> UIImage?

Not documented.

Sources/LavaClient/ControlPlane.swift:241

func registerImage(data: [UInt8], maxPixelSize: UInt32) -> UIImage?

Not documented.

Sources/LavaClient/ControlPlane.swift:287

func releaseImage(key: String)

Not documented.

Sources/LavaClient/ControlPlane.swift:422

func showVideoBuffer(_ handle: UInt32) -> VideoFrame?

Not documented.

Sources/LavaClient/ControlPlane.swift:484

func uploadPixels(_ pixels: UnsafeRawBufferPointer, width: UInt32, height: UInt32, stride: UInt32, format: LavaUI.PixelFormat) -> UIImage?

Not documented.

Sources/LavaClient/ControlPlane.swift:324

func videoTarget() -> LavaUI.VideoTarget?

Not documented.

Sources/LavaClient/ControlPlane.swift:442