Class GraphicsDeviceLease
Namespace: VelloSharp.Avalonia.Core.Device
Assembly: VelloSharp.Avalonia.Core.dll
Represents a leased rendering device and associated resources.
public sealed class GraphicsDeviceLease : IDisposable
Inheritance
Implements
Inherited Members
object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.ReferenceEquals(object?, object?), object.ToString()
Extension Methods
GraphicsDeviceLeaseExtensions.TryGetWgpuResources(GraphicsDeviceLease, out WgpuDeviceResources)
Constructors
GraphicsDeviceLease(GraphicsBackendKind, object, object?, GraphicsFeatureSet, IDisposable?, Action?)
Initializes a new instance of
public GraphicsDeviceLease(GraphicsBackendKind backend, object platformDevice, object? auxiliaryContext, GraphicsFeatureSet features, IDisposable? disposeTarget = null, Action? disposeAction = null)
Parameters
backend GraphicsBackendKind
Backend that produced the device.
platformDevice object
Backend-specific device object.
auxiliaryContext object?
Optional companion context (queue, GRContext, etc.).
features GraphicsFeatureSet
Feature set resolved for the device.
disposeTarget IDisposable?
Disposable invoked when the lease completes.
disposeAction Action?
Action invoked before disposing disposeTarget.
Properties
AuxiliaryContext
Gets an optional auxiliary context, such as a command queue or Skia GRContext.
public object? AuxiliaryContext { get; }
Property Value
Backend
Gets the backend that produced the device.
public GraphicsBackendKind Backend { get; }
Property Value
Features
Gets the feature set resolved for the device.
public GraphicsFeatureSet Features { get; }
Property Value
PlatformDevice
Gets the underlying device object (e.g., ISkiaGpu).
public object PlatformDevice { get; }
Property Value
Methods
Dispose()
Releases resources associated with the lease.
public void Dispose()
TryGetAuxiliaryContext<TContext>(out TContext?)
Attempts to retrieve the auxiliary context as the specified type.
public bool TryGetAuxiliaryContext<TContext>(out TContext? context) where TContext : class
Parameters
context TContext?
Returns
Type Parameters
TContext
TryGetDevice<TDevice>(out TDevice?)
Attempts to retrieve the platform device as the specified type.
public bool TryGetDevice<TDevice>(out TDevice? device) where TDevice : class
Parameters
device TDevice?
Returns
Type Parameters
TDevice