Sign in

    moui_sun_renderer

    Experimental Sun CPU raster renderer provider for MoUI

    moui
    renderer
    cpu-raster
    experimental
    Download zip
    Author
    Version
    0.2.1
    License
    Apache-2.0
    Last updated
    5 days ago
    Downloads
    10

    #MoUI Sun Renderer

    Experimental MoonBit-native CPU raster renderer for wzzc-dev/moui.

    SunRendererError

    pub(all) suberror SunRendererError {
    InvalidSurfaceSize(Int, Int)
    PresentFailed(String)
    } derive(Eq, ToJson,
    Debug
    )

    SunRendererError::equal

    SunRendererError::message

    fn SunRendererError::message(self : SunRendererError) -> String

    SunRendererError::not_equal

    fn SunRendererError::not_equal(x : SunRendererError, y : SunRendererError) -> Bool

    SunRendererError::to_json

    SunCachedLayerAdmissionDiagnostic

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

    SunCachedLayerAdmissionDiagnostic::churn_without_hit

    SunCachedLayerAdmissionDiagnostic::hit_count

    SunCachedLayerAdmissionDiagnostic::identity_key

    SunCachedLayerAdmissionDiagnostic::not_equal

    SunCachedLayerAdmissionDiagnostic::skip_reason

    SunCachedLayerAdmissionDiagnostic::to_json

    SunCachedLayerAdmissionDiagnostic::update_streak

    SunCachedLayerAdmissionRecord

    pub struct SunCachedLayerAdmissionRecord {
    identity_key : String
    update_streak : Int
    hit_count : Int
    skip_reason : String
    last_revision : Int
    }

    SunCachedLayerDiagnostic

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

    SunCachedLayerDiagnostic::admission_record_count

    fn SunCachedLayerDiagnostic::admission_record_count(self : SunCachedLayerDiagnostic) -> Int

    SunCachedLayerDiagnostic::admission_records

    SunCachedLayerDiagnostic::cache_ready

    fn SunCachedLayerDiagnostic::cache_ready(self : SunCachedLayerDiagnostic) -> Bool

    SunCachedLayerDiagnostic::cached_layer_count

    fn SunCachedLayerDiagnostic::cached_layer_count(self : SunCachedLayerDiagnostic) -> Int

    SunCachedLayerDiagnostic::cached_layer_keys

    fn SunCachedLayerDiagnostic::cached_layer_keys(self : SunCachedLayerDiagnostic) -> Array[String]

    SunCachedLayerDiagnostic::churn_without_hit_count

    fn SunCachedLayerDiagnostic::churn_without_hit_count(self : SunCachedLayerDiagnostic) -> Int

    SunCachedLayerDiagnostic::equal

    SunCachedLayerDiagnostic::max_cached_layer_count

    fn SunCachedLayerDiagnostic::max_cached_layer_count(self : SunCachedLayerDiagnostic) -> Int

    SunCachedLayerDiagnostic::not_equal

    SunCachedLayerDiagnostic::summary

    SunCachedLayerDiagnostic::to_json

    SunCachedLayerDiagnostic::total_evict_count

    fn SunCachedLayerDiagnostic::total_evict_count(self : SunCachedLayerDiagnostic) -> Int

    SunCachedLayerDiagnostic::total_hit_count

    fn SunCachedLayerDiagnostic::total_hit_count(self : SunCachedLayerDiagnostic) -> Int

    SunCachedLayerDiagnostic::total_miss_count

    fn SunCachedLayerDiagnostic::total_miss_count(self : SunCachedLayerDiagnostic) -> Int

    SunCachedLayerDiagnostic::total_update_count

    fn SunCachedLayerDiagnostic::total_update_count(self : SunCachedLayerDiagnostic) -> Int

    SunEmojiFontFallbackDiagnostic

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

    SunEmojiFontFallbackDiagnostic::cluster_count

    SunEmojiFontFallbackDiagnostic::covered_char_count

    SunEmojiFontFallbackDiagnostic::deterministic_color_emoji_ready

    fn SunEmojiFontFallbackDiagnostic::deterministic_color_emoji_ready(self : SunEmojiFontFallbackDiagnostic) -> Bool

    SunEmojiFontFallbackDiagnostic::emoji_fallback_attempted

    fn SunEmojiFontFallbackDiagnostic::emoji_fallback_attempted(self : SunEmojiFontFallbackDiagnostic) -> Bool

    SunEmojiFontFallbackDiagnostic::emoji_hint

    SunEmojiFontFallbackDiagnostic::fallback_character

    SunEmojiFontFallbackDiagnostic::fallback_language_tag_count

    fn SunEmojiFontFallbackDiagnostic::fallback_language_tag_count(self : SunEmojiFontFallbackDiagnostic) -> Int

    SunEmojiFontFallbackDiagnostic::fallback_language_tags

    fn SunEmojiFontFallbackDiagnostic::fallback_language_tags(self : SunEmojiFontFallbackDiagnostic) -> Array[String]

    SunEmojiFontFallbackDiagnostic::fallback_request_language_count

    fn SunEmojiFontFallbackDiagnostic::fallback_request_language_count(self : SunEmojiFontFallbackDiagnostic) -> Int

    SunEmojiFontFallbackDiagnostic::fallback_request_ready

    fn SunEmojiFontFallbackDiagnostic::fallback_request_ready(self : SunEmojiFontFallbackDiagnostic) -> Bool

    SunEmojiFontFallbackDiagnostic::fallback_script_tag

    fn SunEmojiFontFallbackDiagnostic::fallback_script_tag(self : SunEmojiFontFallbackDiagnostic) -> String

    SunEmojiFontFallbackDiagnostic::fallback_span_count

    fn SunEmojiFontFallbackDiagnostic::fallback_span_count(self : SunEmojiFontFallbackDiagnostic) -> Int

    SunEmojiFontFallbackDiagnostic::font_source

    SunEmojiFontFallbackDiagnostic::glyph_count

    SunEmojiFontFallbackDiagnostic::glyph_format

    SunEmojiFontFallbackDiagnostic::glyph_height

    SunEmojiFontFallbackDiagnostic::glyph_key

    SunEmojiFontFallbackDiagnostic::glyph_width

    SunEmojiFontFallbackDiagnostic::missing_char_count

    SunEmojiFontFallbackDiagnostic::missing_glyph_recovery_ready

    fn SunEmojiFontFallbackDiagnostic::missing_glyph_recovery_ready(self : SunEmojiFontFallbackDiagnostic) -> Bool

    SunEmojiFontFallbackDiagnostic::not_equal

    SunEmojiFontFallbackDiagnostic::registered_font_count

    fn SunEmojiFontFallbackDiagnostic::registered_font_count(self : SunEmojiFontFallbackDiagnostic) -> Int

    SunEmojiFontFallbackDiagnostic::registered_font_fallback_ready

    fn SunEmojiFontFallbackDiagnostic::registered_font_fallback_ready(self : SunEmojiFontFallbackDiagnostic) -> Bool

    SunEmojiFontFallbackDiagnostic::requested_font_family

    fn SunEmojiFontFallbackDiagnostic::requested_font_family(self : SunEmojiFontFallbackDiagnostic) -> String

    SunEmojiFontFallbackDiagnostic::resolved_face_count

    fn SunEmojiFontFallbackDiagnostic::resolved_face_count(self : SunEmojiFontFallbackDiagnostic) -> Int

    SunEmojiFontFallbackDiagnostic::resolved_fallback_face_index

    fn SunEmojiFontFallbackDiagnostic::resolved_fallback_face_index(self : SunEmojiFontFallbackDiagnostic) -> Int

    SunEmojiFontFallbackDiagnostic::resolved_font_name

    fn SunEmojiFontFallbackDiagnostic::resolved_font_name(self : SunEmojiFontFallbackDiagnostic) -> String

    SunEmojiFontFallbackDiagnostic::resolved_missing_glyph_count

    fn SunEmojiFontFallbackDiagnostic::resolved_missing_glyph_count(self : SunEmojiFontFallbackDiagnostic) -> Int

    SunEmojiFontFallbackDiagnostic::shaper

    SunEmojiFontFallbackDiagnostic::span_count

    SunEmojiFontFallbackDiagnostic::summary

    SunEmojiFontFallbackDiagnostic::text

    SunEmojiFontFallbackDiagnostic::text_system_id

    SunEmojiFontFallbackDiagnostic::to_json

    SunPixelFrame

    pub struct SunPixelFrame {
    // private fields
    } derive(
    Debug
    )

    SunPixelFrame::bytes

    fn SunPixelFrame::bytes(self : SunPixelFrame) -> Bytes

    SunPixelFrame::height

    fn SunPixelFrame::height(self : SunPixelFrame) -> Int

    SunPixelFrame::pixels

    fn SunPixelFrame::pixels(self : SunPixelFrame) -> FixedArray[Byte]

    SunPixelFrame::row_bytes

    fn SunPixelFrame::row_bytes(self : SunPixelFrame) -> Int

    SunPixelFrame::scale_factor

    fn SunPixelFrame::scale_factor(self : SunPixelFrame) -> Double

    SunPixelFrame::width

    fn SunPixelFrame::width(self : SunPixelFrame) -> Int

    SunPresentTarget

    pub struct SunPresentTarget {
    description : String
    present : (SunPixelFrame) -> Bool
    }

    SunPresentTarget::new

    fn SunPresentTarget::new(description~ : String, present~ : (SunPixelFrame) -> Bool) -> SunPresentTarget

    SunRasterRenderer

    pub struct SunRasterRenderer {
    metrics :
    SurfaceMetrics

    target : SunPresentTarget
    canvas :
    Canvas

    present_count : Int
    unsupported_command_count : Int
    unsupported_command_diagnostics : Array[SunUnsupportedCommandDiagnostic]
    last_frame : SunPixelFrame?
    text_system :
    TextSystem

    resources :
    RendererResources

    image_lifecycle :
    ImageResourceLifecycle

    async_image_loading : Bool
    canvas_stack : Array[
    Canvas
    ]
    filter_stack : Array[
    PaintFilter
    ]
    cached_layer_pixmaps : Map[String,
    Pixmap
    ]
    cached_layer_revisions : Map[String, Int]
    cached_layer_scales : Map[String, Double]
    cached_layer_order : Array[String]
    cached_layer_hit_count : Int
    cached_layer_miss_count : Int
    cached_layer_update_count : Int
    cached_layer_evict_count : Int
    cached_layer_admissions : Array[SunCachedLayerAdmissionRecord]
    blur_radius_stack : Array[Double]
    rounded_clip_stack : Array[
    RoundedRect
    ]
    platform_view_draw_fn : () -> Unit?
    }

    SunRasterRenderer::apply_image_resource_load_completion

    SunRasterRenderer::cached_layer_diagnostic

    fn SunRasterRenderer::cached_layer_diagnostic(self : SunRasterRenderer) -> SunCachedLayerDiagnostic

    SunRasterRenderer::cached_layer_hit_count

    fn SunRasterRenderer::cached_layer_hit_count(self : SunRasterRenderer) -> Int

    SunRasterRenderer::cached_layer_miss_count

    fn SunRasterRenderer::cached_layer_miss_count(self : SunRasterRenderer) -> Int

    SunRasterRenderer::dispose

    fn SunRasterRenderer::dispose(self : SunRasterRenderer) -> Unit

    SunRasterRenderer::draw_platform_view_pixels

    fn SunRasterRenderer::draw_platform_view_pixels(self : SunRasterRenderer, pixels : Bytes, src_width : Int, src_height : Int, src_stride : Int, dst_x : Double, dst_y : Double, dst_width : Double, dst_height : Double) -> Unit

    SunRasterRenderer::emoji_font_fallback_diagnostic

    fn SunRasterRenderer::emoji_font_fallback_diagnostic(self : SunRasterRenderer, text? : String, font? :
    FontSpec
    ) -> SunEmojiFontFallbackDiagnostic

    SunRasterRenderer::image_resources

    SunRasterRenderer::last_frame

    SunRasterRenderer::present_count

    fn SunRasterRenderer::present_count(self : SunRasterRenderer) -> Int

    SunRasterRenderer::register_font_bytes

    fn SunRasterRenderer::register_font_bytes(self : SunRasterRenderer, key : String, data : Bytes) -> Unit

    SunRasterRenderer::register_font_file

    fn SunRasterRenderer::register_font_file(self : SunRasterRenderer, key : String, path : String, font_index? : Int) -> Unit

    SunRasterRenderer::render

    SunRasterRenderer::resize

    SunRasterRenderer::set_platform_view_draw_fn

    fn SunRasterRenderer::set_platform_view_draw_fn(self : SunRasterRenderer, draw_fn : () -> Unit?) -> Unit

    SunRasterRenderer::surface_diagnostic_summary

    fn SunRasterRenderer::surface_diagnostic_summary(self : SunRasterRenderer) -> String

    SunRasterRenderer::text_maturity_diagnostic

    fn SunRasterRenderer::text_maturity_diagnostic(self : SunRasterRenderer, text? : String, font? :
    FontSpec
    , max_width? : Double) -> SunTextMaturityDiagnostic

    SunRasterRenderer::text_selection_geometry_diagnostic

    fn SunRasterRenderer::text_selection_geometry_diagnostic(self : SunRasterRenderer, text? : String, selection? :
    TextRange
    ?, font? :
    FontSpec
    , max_width? : Double) -> SunTextSelectionGeometryDiagnostic

    SunRasterRenderer::text_system

    SunRasterRenderer::text_visual_order_diagnostic

    fn SunRasterRenderer::text_visual_order_diagnostic(self : SunRasterRenderer, text : String, font? :
    FontSpec
    , max_width? : Double) -> SunTextVisualOrderDiagnostic?

    SunRasterRenderer::unsupported_command_count

    fn SunRasterRenderer::unsupported_command_count(self : SunRasterRenderer) -> Int

    SunRasterRenderer::unsupported_command_diagnostics

    fn SunRasterRenderer::unsupported_command_diagnostics(self : SunRasterRenderer) -> Array[SunUnsupportedCommandDiagnostic]

    SunTextMaturityDiagnostic

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

    SunTextMaturityDiagnostic::bidi_visual_order_ready

    fn SunTextMaturityDiagnostic::bidi_visual_order_ready(self : SunTextMaturityDiagnostic) -> Bool

    SunTextMaturityDiagnostic::color_emoji_ready

    fn SunTextMaturityDiagnostic::color_emoji_ready(self : SunTextMaturityDiagnostic) -> Bool

    SunTextMaturityDiagnostic::equal

    SunTextMaturityDiagnostic::gap_count

    SunTextMaturityDiagnostic::hit_test_inside

    fn SunTextMaturityDiagnostic::hit_test_inside(self : SunTextMaturityDiagnostic) -> Bool

    SunTextMaturityDiagnostic::hit_test_ready

    fn SunTextMaturityDiagnostic::hit_test_ready(self : SunTextMaturityDiagnostic) -> Bool

    SunTextMaturityDiagnostic::line_metrics_ready

    fn SunTextMaturityDiagnostic::line_metrics_ready(self : SunTextMaturityDiagnostic) -> Bool

    SunTextMaturityDiagnostic::native_paragraph_ready

    fn SunTextMaturityDiagnostic::native_paragraph_ready(self : SunTextMaturityDiagnostic) -> Bool

    SunTextMaturityDiagnostic::not_equal

    SunTextMaturityDiagnostic::paragraph_layout_ready

    fn SunTextMaturityDiagnostic::paragraph_layout_ready(self : SunTextMaturityDiagnostic) -> Bool

    SunTextMaturityDiagnostic::paragraph_line_count

    fn SunTextMaturityDiagnostic::paragraph_line_count(self : SunTextMaturityDiagnostic) -> Int

    SunTextMaturityDiagnostic::ready_count

    SunTextMaturityDiagnostic::registered_font_count

    fn SunTextMaturityDiagnostic::registered_font_count(self : SunTextMaturityDiagnostic) -> Int

    SunTextMaturityDiagnostic::selection_rect_count

    fn SunTextMaturityDiagnostic::selection_rect_count(self : SunTextMaturityDiagnostic) -> Int

    SunTextMaturityDiagnostic::selection_rects_ready

    fn SunTextMaturityDiagnostic::selection_rects_ready(self : SunTextMaturityDiagnostic) -> Bool

    SunTextMaturityDiagnostic::summary

    SunTextMaturityDiagnostic::text_system_id

    fn SunTextMaturityDiagnostic::text_system_id(self : SunTextMaturityDiagnostic) -> String

    SunTextMaturityDiagnostic::to_json

    SunTextMaturityDiagnostic::unicode_17_grapheme_boundary_ready

    fn SunTextMaturityDiagnostic::unicode_17_grapheme_boundary_ready(self : SunTextMaturityDiagnostic) -> Bool

    SunTextSelectionGeometryDiagnostic

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

    SunTextSelectionGeometryDiagnostic::bidi_visual_order_observed

    fn SunTextSelectionGeometryDiagnostic::bidi_visual_order_observed(self : SunTextSelectionGeometryDiagnostic) -> Bool

    SunTextSelectionGeometryDiagnostic::bidi_visual_order_ready

    SunTextSelectionGeometryDiagnostic::hit_test_inside

    SunTextSelectionGeometryDiagnostic::hit_test_line_index

    SunTextSelectionGeometryDiagnostic::hit_test_offset

    SunTextSelectionGeometryDiagnostic::line_count

    SunTextSelectionGeometryDiagnostic::not_equal

    SunTextSelectionGeometryDiagnostic::selected_line_count

    SunTextSelectionGeometryDiagnostic::selection_range

    SunTextSelectionGeometryDiagnostic::selection_rect_count

    SunTextSelectionGeometryDiagnostic::text

    SunTextSelectionGeometryDiagnostic::to_json

    SunTextSelectionGeometryDiagnostic::visual_order_differs

    SunTextSelectionGeometryDiagnostic::visual_segment_count

    SunTextVisualOrderDiagnostic

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

    SunTextVisualOrderDiagnostic::bidi_visual_order_ready

    fn SunTextVisualOrderDiagnostic::bidi_visual_order_ready(self : SunTextVisualOrderDiagnostic) -> Bool

    SunTextVisualOrderDiagnostic::glyph_count

    SunTextVisualOrderDiagnostic::logical_cluster_count

    fn SunTextVisualOrderDiagnostic::logical_cluster_count(self : SunTextVisualOrderDiagnostic) -> Int

    SunTextVisualOrderDiagnostic::logical_text

    SunTextVisualOrderDiagnostic::not_equal

    SunTextVisualOrderDiagnostic::segment_count

    SunTextVisualOrderDiagnostic::to_json

    SunTextVisualOrderDiagnostic::visual_cluster_count

    fn SunTextVisualOrderDiagnostic::visual_cluster_count(self : SunTextVisualOrderDiagnostic) -> Int

    SunTextVisualOrderDiagnostic::visual_order_differs

    fn SunTextVisualOrderDiagnostic::visual_order_differs(self : SunTextVisualOrderDiagnostic) -> Bool

    SunTextVisualOrderDiagnostic::visual_text

    SunTextVisualOrderDiagnostic::width

    SunUnsupportedCommandDiagnostic

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

    SunUnsupportedCommandDiagnostic::command

    SunUnsupportedCommandDiagnostic::not_equal

    SunUnsupportedCommandDiagnostic::reason

    SunUnsupportedCommandDiagnostic::to_json

    create_with_present_target

    fn create_with_present_target(metrics :
    SurfaceMetrics
    , target : SunPresentTarget, async_image_loading? : Bool) -> SunRasterRenderer raise SunRendererError

    install_svg_text_path_resolver

    fn install_svg_text_path_resolver() -> Bool

    Register the glyph-outline resolver with the renderer-neutral SVG pipeline. Returns false when no default platform font could be loaded, leaving SVG text on the renderer's bitmap fallback.

    raster

    Build a Sun CPU raster provider from the renderer-neutral host contract.

    renderer_descriptor

    sun_feature_capabilities

    Build a Sun raster feature-level capabilities array. Each entry pairs a feature with its status and note. The Sun provider calls this directly instead of depending on a central backend capability table. matrix (ADR 0019 Phase E).

    sun_feature_note

    fn sun_feature_note(feature :
    RendererFeature
    ) -> String

    sun_feature_status

    Sun raster feature capability status. Migrated from the central capabilities_backend_matrix.mbt (ADR 0019 Phase E) so the Sun provider owns its own feature knowledge.

    sun_image_load_completion

    sun_image_load_completion_from_bytes

    fn sun_image_load_completion_from_bytes(source : String, data : Bytes, background_io? : Bool) ->
    ImageResourceLoadCompletion

    sun_raster_native_descriptor