wzzc-dev/moui/render/common does not have a README file

    SvgTextPathResolver

    type SvgTextPathResolver = (SvgTextRun) -> SvgTextRunOutline?

    Host-supplied conversion from an SVG text run to glyph outline polygons.

    GpuRenderWorker

    pub struct GpuRenderWorker {
    state : GpuRenderWorkerState
    surface_generation : Int
    gpu_context_generation : Int
    next_sequence : Int
    in_flight : GpuRenderWorkerFrame?
    pending : GpuRenderWorkerFrame?
    controls : Array[
    RendererControlMessage
    ]
    completions : Array[
    RenderPresentCompletion
    ]
    submitted : Int
    started : Int
    completed : Int
    dropped : Int
    replaced_pending : Int
    rejected_generation : Int
    recovery_count : Int
    recovery_failures : Int
    readback_count : Int
    resource_cache_bytes : Int64
    worker_thread_id : Int
    fail_next_recovery : Bool
    }

    GpuRenderWorker::diagnostics

    GpuRenderWorker::drain_present_completions

    GpuRenderWorker::fail_next_context_recovery

    fn GpuRenderWorker::fail_next_context_recovery(self : GpuRenderWorker) -> Unit

    Make the next context recreation fail. This is intentionally test-only in spirit but public so platform providers can model a failed native probe.

    GpuRenderWorker::gpu_context_generation

    fn GpuRenderWorker::gpu_context_generation(self : GpuRenderWorker) -> Int

    GpuRenderWorker::new

    fn GpuRenderWorker::new(surface_generation? : Int, worker_thread_id? : Int) -> GpuRenderWorker

    GpuRenderWorker::poll

    fn GpuRenderWorker::poll(self : GpuRenderWorker, completed_at_ms? : Double) -> Unit

    Process controls first, then at most one frame. Native workers call this from their event loop; fallback-safe providers call it from the host tick.

    GpuRenderWorker::state

    GpuRenderWorker::submit_control

    GpuRenderWorker::surface_generation

    fn GpuRenderWorker::surface_generation(self : GpuRenderWorker) -> Int

    GpuRenderWorkerDiagnostics

    pub(all) struct GpuRenderWorkerDiagnostics {
    state : GpuRenderWorkerState
    submitted : Int
    started : Int
    completed : Int
    dropped : Int
    replaced_pending : Int
    rejected_generation : Int
    surface_generation : Int
    gpu_context_generation : Int
    recovery_count : Int
    recovery_failures : Int
    readback_count : Int
    resource_cache_bytes : Int64
    in_flight : Bool
    pending : Bool
    control_pending : Int
    worker_thread_id : Int
    } derive(Eq,
    Debug
    ,
    ToJson
    )

    GpuRenderWorkerDiagnostics::equal

    automatically derived

    GpuRenderWorkerDiagnostics::not_equal

    automatically derived

    GpuRenderWorkerDiagnostics::to_json

    automatically derived

    GpuRenderWorkerDiagnostics::to_repr

    automatically derived

    GpuRenderWorkerFrame

    pub(all) struct GpuRenderWorkerFrame {
    token :
    FrameToken

    submitted_at_ms : Double
    input :
    RenderFrameInput

    } derive(
    Debug
    )

    GpuRenderWorkerFrame::to_repr

    automatically derived

    GpuRenderWorkerState

    pub(all) enum GpuRenderWorkerState {
    Idle
    Lost
    Recovering
    Recovered
    FallbackToRaster
    Shutdown
    } derive(Eq,
    Debug
    ,
    ToJson
    )

    Renderer-worker protocol lifecycle. This value-level model exercises queue, generation, and recovery behavior; it does not prove a platform present. It is a same-thread model: submitted frames are held by reference and never mutated or consumed here, so no per-frame command copy is made (the real handoff copies happen in the platform worker, if any).

    GpuRenderWorkerState::equal

    automatically derived

    GpuRenderWorkerState::not_equal

    automatically derived

    GpuRenderWorkerState::to_json

    automatically derived

    GpuRenderWorkerState::to_repr

    automatically derived

    ImageCropAxis

    pub enum ImageCropAxis {
    None
    Horizontal
    Vertical
    }

    Which source axis is cropped by visible (the fraction of the source that remains visible). None means the full source is sampled.

    ImagePlacement

    pub struct ImagePlacement {
    frame :
    Rect

    crop_axis : ImageCropAxis
    visible : Double
    }

    ImageResourceLifecycle

    pub struct ImageResourceLifecycle {
    // private fields
    } derive(Eq,
    Debug
    )

    Renderer-neutral image record state machine. generation advances on every actual record mutation so hot per-frame callers can skip re-reading the record set when nothing changed.

    ImageResourceLifecycle::apply_load_completion

    ImageResourceLifecycle::dispose

    fn ImageResourceLifecycle::dispose(self : ImageResourceLifecycle, source : String) -> Bool

    ImageResourceLifecycle::equal

    automatically derived

    ImageResourceLifecycle::evict_disposed

    fn ImageResourceLifecycle::evict_disposed(self : ImageResourceLifecycle) -> Int

    ImageResourceLifecycle::generation

    fn ImageResourceLifecycle::generation(self : ImageResourceLifecycle) -> Int64

    Monotonic diff token: bumped every time the record set actually changes (new record, changed status, eviction). A caller that observes the same generation twice knows a re-scan would find nothing new, so the snapshot pull and dedup scan can be skipped.

    ImageResourceLifecycle::mark_failed

    fn ImageResourceLifecycle::mark_failed(self : ImageResourceLifecycle, source : String, diagnostic~ : String) -> Bool

    ImageResourceLifecycle::mark_loading

    fn ImageResourceLifecycle::mark_loading(self : ImageResourceLifecycle, source : String) -> Bool

    ImageResourceLifecycle::mark_ready

    fn ImageResourceLifecycle::mark_ready(self : ImageResourceLifecycle, source : String, width~ : Int, height~ : Int) -> Bool

    ImageResourceLifecycle::new

    ImageResourceLifecycle::not_equal

    automatically derived

    ImageResourceLifecycle::reset

    Forget every record. A host hot-reload swap calls this when the process keeps its renderer but the plugin image changes: source bytes, fonts and retained layers at the same path may now describe different content, and an old Loading/Ready/Failed record must not keep serving or suppressing it. The generation advances so per-frame record scans observe the reset.

    ImageResourceLifecycle::snapshot

    Returns the current records as a fresh array. Hot per-frame callers should consult generation first and skip this call while it stands still; the rebuild is only paid when a change actually happened.

    ImageResourceLifecycle::to_repr

    automatically derived

    PathMesh

    pub struct PathMesh {
    // private fields
    } derive(Eq,
    Debug
    ,
    ToJson
    )

    PathMesh::diagnostics

    fn PathMesh::diagnostics(self : PathMesh) -> Array[String]

    PathMesh::equal

    fn PathMesh::equal(PathMesh, PathMesh) -> Bool
    automatically derived

    PathMesh::not_equal

    fn PathMesh::not_equal(x : PathMesh, y : PathMesh) -> Bool
    automatically derived

    PathMesh::to_json

    automatically derived

    PathMesh::to_repr

    automatically derived

    PathMesh::vertices

    fn PathMesh::vertices(self : PathMesh) -> Array[PathVertex]

    PathVertex

    pub struct PathVertex {
    // private fields
    } derive(Eq,
    Debug
    ,
    ToJson
    )

    PathVertex::components

    fn PathVertex::components(self : PathVertex) -> Array[Double]

    PathVertex::equal

    fn PathVertex::equal(PathVertex, PathVertex) -> Bool
    automatically derived

    PathVertex::not_equal

    fn PathVertex::not_equal(x : PathVertex, y : PathVertex) -> Bool
    automatically derived

    PathVertex::to_json

    automatically derived

    PathVertex::to_repr

    automatically derived

    PlanScopeKind

    pub(all) enum PlanScopeKind {
    Clip
    RoundedClip
    Transform
    Opacity
    Layer
    Filter
    } derive(Eq)

    The scope kinds tracked for scope-balance validation. This is the shared vocabulary renderers push/pop on their own execution state stacks while interpreting a @core.DrawCommand stream directly, and the same kinds plan_renderer_command_fallbacks validates on the stream itself.

    PlanScopeKind::equal

    automatically derived

    PlanScopeKind::not_equal

    fn PlanScopeKind::not_equal(x : PlanScopeKind, y : PlanScopeKind) -> Bool
    automatically derived

    RendererBindingResolution

    pub(all) struct RendererBindingResolution {
    session :
    RendererSession
    ?
    plan : RendererCapabilityPlan
    }

    RendererCapabilityPlan

    pub(all) struct RendererCapabilityPlan {
    provider_ids : Array[String]
    selected_provider_id : String?
    rejections : Array[RendererRejection]
    features : Array[
    RendererFeatureCapability
    ]
    follow_ups : Array[
    RendererFeatureCapability
    ]
    surface_error : String?
    }

    Declarative startup view of a provider list: declared capabilities, follow-up features, surface eligibility, and every rejection encountered before the selected session. It is a plan, not a central renderer switch.

    RendererCapabilityPlan::from_providers

    A surface-free plan for AppBuilder preflight. The selected provider is unknown before a host surface exists, so a required feature is acceptable when any registered provider declares it at the policy's level.

    RendererCapabilityPlan::policy_problems

    fn RendererCapabilityPlan::policy_problems(self : RendererCapabilityPlan, policy : RendererCapabilityPolicy) -> Array[String]

    RendererCapabilityPlan::rejection_summary

    fn RendererCapabilityPlan::rejection_summary(self : RendererCapabilityPlan) -> String

    RendererCapabilityPolicy

    pub(all) struct RendererCapabilityPolicy {
    required_features : Array[
    RendererFeature
    ]
    allow_partial : Bool
    fail_on_missing : Bool
    }

    Startup policy for a provider list. required_features must be present in the plan with a status at least as strong as the policy allows; allow_partial keeps a Partial feature acceptable, while fail_on_missing turns a Gap or Unavailable feature into a startup failure.

    RendererCapabilityPolicy::new

    fn RendererCapabilityPolicy::new(required_features? : Array[
    RendererFeature
    ], allow_partial? : Bool, fail_on_missing? : Bool) -> RendererCapabilityPolicy

    RendererProviderRegistry

    pub struct RendererProviderRegistry {
    // private fields
    }

    RendererRejection

    pub(all) struct RendererRejection {
    provider_id : String
    reason : String
    }

    One provider that rejected a host surface, with the provider-supplied reason. The plan records only providers attempted before the first successful bind; selection still stops at the first Bound session.

    ShaderRegistryResult

    pub struct ShaderRegistryResult {
    // private fields
    } derive(Eq,
    Debug
    ,
    ToJson
    )

    ShaderRegistryResult::diagnostic

    fn ShaderRegistryResult::diagnostic(self : ShaderRegistryResult) -> String

    ShaderRegistryResult::equal

    automatically derived

    ShaderRegistryResult::fallback

    ShaderRegistryResult::name

    fn ShaderRegistryResult::name(self : ShaderRegistryResult) -> String

    ShaderRegistryResult::not_equal

    automatically derived

    ShaderRegistryResult::status

    ShaderRegistryResult::to_json

    automatically derived

    ShaderRegistryResult::to_repr

    automatically derived

    ShaderRegistryStatus

    pub(all) enum ShaderRegistryStatus {
    ShaderReady
    ShaderFallback
    } derive(Eq,
    Debug
    ,
    ToJson
    )

    ShaderRegistryStatus::equal

    automatically derived

    ShaderRegistryStatus::not_equal

    automatically derived

    ShaderRegistryStatus::to_json

    automatically derived

    ShaderRegistryStatus::to_repr

    automatically derived

    SvgImportResult

    pub struct SvgImportResult {
    // private fields
    } derive(Eq,
    Debug
    ,
    ToJson
    )

    SvgImportResult::diagnostics

    fn SvgImportResult::diagnostics(self : SvgImportResult) -> Array[String]

    SvgImportResult::equal

    automatically derived

    SvgImportResult::not_equal

    fn SvgImportResult::not_equal(x : SvgImportResult, y : SvgImportResult) -> Bool
    automatically derived

    SvgImportResult::to_json

    automatically derived

    SvgImportResult::to_repr

    automatically derived

    SvgTextAnchor

    pub(all) enum SvgTextAnchor {
    Start
    Middle
    End
    } derive(Eq,
    Debug
    )

    Anchor semantics of an SVG <text> run, resolved from the text-anchor attribute (with group inheritance) at scan time.

    SvgTextAnchor::equal

    automatically derived

    SvgTextAnchor::not_equal

    fn SvgTextAnchor::not_equal(x : SvgTextAnchor, y : SvgTextAnchor) -> Bool
    automatically derived

    SvgTextAnchor::to_repr

    automatically derived

    SvgTextRun

    pub(all) struct SvgTextRun {
    text : String
    font_size : Double
    x : Double
    baseline_y : Double
    anchor : SvgTextAnchor
    text_length : Double
    } derive(
    Debug
    )

    One SVG <text> run, in the node's own user space. x/baseline_y carry the anchor point and baseline; text and font_size are the element's literal content.

    SvgTextRun::to_repr

    automatically derived

    SvgTextRunOutline

    pub(all) struct SvgTextRunOutline {
    width : Double
    polygons : Array[Array[(Double, Double)]]
    } derive(
    Debug
    )

    Glyph outlines for one SvgTextRun, in text-local space: the origin is the run's left edge on the baseline (Start anchoring), width is the laid-out advance, and polygons are closed contours ready for a nonzero fill. Returning None keeps the bitmap fallback for that run.

    SvgTextRunOutline::to_repr

    automatically derived

    TextParagraphCache

    pub struct TextParagraphCache {
    // private fields
    }

    Bounded, single-owner paragraph cache. The cache is intentionally not a process global: the renderer session or text service owns one instance and decides its capacity and byte budget.

    TextParagraphCache::count

    fn TextParagraphCache::count(self : TextParagraphCache) -> Int

    TextParagraphCache::font_generation

    fn TextParagraphCache::font_generation(self : TextParagraphCache) -> Int

    TextParagraphCache::new

    fn TextParagraphCache::new(capacity? : Int, text_budget_bytes? : Int) -> TextParagraphCache

    TextParagraphCache::register_font_data

    fn TextParagraphCache::register_font_data(self : TextParagraphCache) -> Unit

    Retire every pre-registration entry for this owner. Called when the owner's font set changes: measured widths can change for every cached paragraph.

    TextParagraphCache::text_bytes

    fn TextParagraphCache::text_bytes(self : TextParagraphCache) -> Int

    async_image_read_i32_le

    fn async_image_read_i32_le(data : Bytes, offset : Int) -> Int

    Read a little-endian i32 from data at offset.

    Single shared implementation for decoding async image load-completion payloads; platform providers (skia/sun on macos/linux/windows) used to carry six identical private copies.

    builtin_shader_names

    fn builtin_shader_names() -> Array[String]

    clear_svg_text_path_resolver

    fn clear_svg_text_path_resolver() -> Unit

    Drop the installed resolver; SVG text falls back to the bitmap font.

    codepoint_is_cjk

    fn codepoint_is_cjk(codepoint : Int) -> Bool

    codepoint_is_cjk_ideograph

    fn codepoint_is_cjk_ideograph(codepoint : Int) -> Bool

    codepoint_is_emoji_hint

    fn codepoint_is_emoji_hint(codepoint : Int) -> Bool

    codepoint_is_hangul_cluster_codepoint

    fn codepoint_is_hangul_cluster_codepoint(codepoint : Int) -> Bool

    codepoint_is_hangul_compatibility_jamo

    fn codepoint_is_hangul_compatibility_jamo(codepoint : Int) -> Bool

    codepoint_is_hangul_l

    fn codepoint_is_hangul_l(codepoint : Int) -> Bool

    codepoint_is_hangul_lv

    fn codepoint_is_hangul_lv(codepoint : Int) -> Bool

    codepoint_is_hangul_lvt

    fn codepoint_is_hangul_lvt(codepoint : Int) -> Bool

    codepoint_is_hangul_syllable

    fn codepoint_is_hangul_syllable(codepoint : Int) -> Bool

    codepoint_is_hangul_t

    fn codepoint_is_hangul_t(codepoint : Int) -> Bool

    codepoint_is_hangul_v

    fn codepoint_is_hangul_v(codepoint : Int) -> Bool

    codepoint_is_kana

    fn codepoint_is_kana(codepoint : Int) -> Bool

    codepoint_is_rtl_script

    fn codepoint_is_rtl_script(codepoint : Int) -> Bool

    env_flag

    fn env_flag(name : String) -> Bool

    True when the environment variable name is set to exactly "1".

    Single shared implementation for platform-entrypoint feature switches; the skia providers (macos/linux/windows) used to carry three identical private copies.

    host_surface_metrics_error

    fn host_surface_metrics_error(surface :
    HostSurface
    ) -> String?

    Validate the neutral metrics every provider receives before it attempts to inspect CPU or native-surface capabilities.

    image_decoder_plugin_chain

    Build a decoder that tries every registered plugin, then any builtin decoder, and finally delegates to fallback.

    builtin carries decoders the framework ships with — formats the backend codec library cannot handle but which need no host support. They rank below app-registered plugins, so an application can still override them, and above fallback, which stays the backend's own codec.

    image_decoder_plugin_clear

    fn image_decoder_plugin_clear() -> Unit

    Drop every registered decoder, restoring the untouched fallback path.

    image_decoder_plugin_count

    fn image_decoder_plugin_count() -> Int

    Number of currently registered decoders, for diagnostics and tests.

    image_decoder_plugin_register

    fn image_decoder_plugin_register(decoder :
    RendererImageDecoder
    ) -> Unit

    Register an additional decoder. Plugins registered later are consulted after those registered earlier, and always before the fallback decoder.

    image_source_provider_clear

    fn image_source_provider_clear() -> Unit

    Drop every registered reader, restoring the untouched fallback path.

    image_source_provider_count

    fn image_source_provider_count() -> Int

    Number of currently registered readers, for diagnostics and tests.

    image_source_provider_read

    fn image_source_provider_read(source : String) -> Bytes?

    Read source through the registered providers in registration order. Returns None when no prefix matches, or when the matching reader cannot produce bytes, leaving the caller free to fall back.

    image_source_provider_register

    fn image_source_provider_register(prefix~ : String, read~ : (String) -> Bytes?) -> Unit

    Register a reader for every source beginning with prefix.

    image_src_window

    Clamp a caller-supplied source sub-rectangle to a decoded image. Both are in source pixel coordinates; None means the window samples nothing and the draw must be skipped rather than fall back to the whole image.

    import_svg

    fn import_svg(svg : String) -> SvgImportResult

    plan_renderer_command_fallbacks

    The single standalone scope-balance validation of a @core.DrawCommand stream, and the producer of the capability-report RendererCommandPlan. Renderers execute @core.DrawCommand directly (each maintaining its own execution state stacks); this check stays the one shared structural validation with per-command fallback records.

    plan_scope_name

    fn plan_scope_name(kind : PlanScopeKind) -> String

    plan_scope_pop_command

    fn plan_scope_pop_command(kind : PlanScopeKind) -> String

    plan_scope_push_command

    fn plan_scope_push_command(kind : PlanScopeKind) -> String

    rect_shader_wgsl

    fn rect_shader_wgsl() -> String

    renderer_feature_capability_report

    Aggregate the capability declarations supplied by the providers registered in a composition root. Reports are indexed by @render.RendererProvider.id; the optional backend classification inside a capability is diagnostic metadata only and is never used to select or group providers.

    renderer_features

    Canonical feature ordering for a provider report. This is a feature catalogue, not a renderer/backend selection matrix.

    renderer_provider_capabilities

    Build one provider-owned capability row per renderer feature. Providers supply the status and note functions; render only preserves the common feature ordering and carries the provider id into the report.

    representative_fallback_codepoint

    fn representative_fallback_codepoint(text : String, skip_joiners? : Bool) -> Int

    Representative codepoint for fallback planning: the first emoji-hint codepoint (optionally skipping ZWJ/VS16 joiners), else the first non-ASCII codepoint, else the first codepoint.

    resolve_renderer

    Bind providers in registration order and return the first live session. Rejected providers are required to leave no persistent resources behind.

    resolve_renderer_with_plan

    Bind providers in registration order, stop at the first live session, and return the ordered rejection reasons plus the declared capability plan. Rejected providers remain side-effect-free; providers after the first success are never called.

    resolve_shader_effect

    set_svg_text_path_resolver

    fn set_svg_text_path_resolver(resolver : (SvgTextRun) -> SvgTextRunOutline?) -> Unit

    Install (replace) the process-wide text resolver. Call once at application startup, before SVG assets decode; later calls swap the implementation for subsequent documents.

    svg_image_decoder

    The SVG decoder plugin. Sources that are not SVG produce a failed completion so a decoder chain can continue to a raster codec; SVG sources either rasterize or fail with a diagnostic the renderer can surface.

    svg_intrinsic_size

    fn svg_intrinsic_size(svg_text : String) ->
    Size
    ?

    Intrinsic size of an SVG document: viewBox when present, otherwise the root element's width/height. Returns None when neither is usable, which lets callers keep their own placeholder sizing.

    svg_intrinsic_size_from_bytes

    fn svg_intrinsic_size_from_bytes(bytes : Bytes) ->
    Size
    ?

    Intrinsic size of bytes when they hold an SVG document, otherwise None.

    Size probes that only have raw bytes — the markdown intrinsic-size reader, for example — route SVG through the same detection the image decoder uses, so a vector asset reserves the right box instead of a placeholder ratio.

    svg_raster_target_size

    fn svg_raster_target_size(intrinsic :
    Size
    ) -> (Int, Int)

    Rasterized pixel size for an intrinsic size, preserving aspect ratio while respecting the oversampling preference and the memory budget.

    svg_rasterize_rgba

    fn svg_rasterize_rgba(svg_text : String, pixel_width : Int, pixel_height : Int) -> Bytes?

    Rasterize svg_text into premultiplied RGBA8888 pixels with row_bytes = pixel_width * 4. Returns None when the document cannot be parsed or the requested size is degenerate.

    The premultiplied layout matches what raster backends expect from a decoded image payload, so the result is interchangeable with a codec's output.

    svg_source_is_svg

    fn svg_source_is_svg(source : String, bytes : Bytes) -> Bool

    True when source should be treated as SVG: either its path carries an .svg/.svgz suffix, or its leading bytes contain an <svg root tag. The suffix alone is not enough — plenty of sources are served without one — and the tag scan is bounded so a large binary payload is never walked whole.

    tessellate_path

    fn tessellate_path(spec :
    PathSpec
    ) -> PathMesh

    text_bidi_visual_clusters

    fn text_bidi_visual_clusters(text : String) -> Array[String]

    Split text into grapheme clusters via the shared @core UAX-style boundary scanner, then order runs visually (RTL runs reversed).

    text_grapheme_clusters

    fn text_grapheme_clusters(text : String) -> Array[String]

    Split text into grapheme clusters using @core.TextGraphemeBoundaries.

    text_join_clusters

    fn text_join_clusters(clusters : Array[String]) -> String

    Join grapheme clusters back into a single string.

    text_mixed_segments

    fn text_mixed_segments(text : String) -> Array[String]

    Split mixed-script text into grapheme-safe fallback segments in visual order, one segment per contiguous same-class run.

    text_segment_class

    fn text_segment_class(text : String) -> Int

    Classify a text segment for fallback planning: 1 emoji, 2 CJK, 3 Hangul, 4 RTL script, 5 combining marks, 0 other.

    text_string_arrays_equal

    fn text_string_arrays_equal(left : Array[String], right : Array[String]) -> Bool