Skip to content

IGraphicsFactory interface

Factory interface for creating graphics resources. Allows different graphics backends to be plugged in.

public interface IGraphicsFactory : IDisposable, IRenderDevice
name description
Backend { get; } Backend name matching the package suffix (Aprillz.MewUI.Backend.<Backend>). Do not branch on this value.
TextEngine { get; } Gets the retained text layout engine associated with this backend factory.
AcquireBackgroundRenderScope() Reserves any per-thread state needed to perform rendering on the calling thread. Required for backends with thread-affine state (context-current style APIs). Backends with thread-safe APIs return a no-op disposable.
AcquireConcurrentRenderUnit() Serializes worker-thread offline render units against UI window frames. Backends with share-listed GPU contexts override this to acquire the same mutex their UI BeginFrame / EndFrame path holds, so filter offline renders and UI renders don’t overlap (overlap races on some drivers produce intermittent black filter regions). Backends with thread-safe APIs return a no-op disposable.
CreateContext(…) Creates a graphics context for the specified render target. The returned context is not yet started; call BeginFrame before drawing.
CreateFont(…) Creates a font resource at the system DPI; size is in DIPs. (2 methods)
CreateImageFilterExecutor() Creates an executor for evaluating ImageFilter graphs. The default returns a CPU reference implementation; backends override to return GPU-accelerated executors that internally chain CPU fallback for unsupported nodes.