code wiki / (root) / nx_paint_walk_layout.nx

nx_paint_walk_layout.nx

buildroot/runtime/nx_paint_walk_layout.nx

30524 B665 linesdepth 6pulls 12 transitivereach 85 importersview sourcekind librarytopic paint
docsdependenciesstructsconstsfunctions

about

nx_paint_walk_layout.nx -- walk a laid-out LayoutBox tree and paint each box's `background-color` declaration into a Framebuffer. Phase 4 second primitive of NISHI_BROWSER_ROADMAP. THE integration primitive that proves the full bits-up pipeline composes end-to-end: CSS bytes -> nx_css_tokenize -> nx_css_parse -> nx_css_apply (cascade -> per-box decls) HTML tree -> nx_layout_box -> nx_layout_block (per-box x, y, w, h) Cascade -> nx_css_lookup_property -> nx_css_color_decode (per-box CssColor) Box+color -> nx_paint_solid_rect (pixels into Framebuffer) This primitive owns the walk + per-box lookup + color decode + paint orchestration. Each individual step is a sovereign primitive shipped prior; this is the connective tissue. What it does NOT handle yet (Phase 4b queued, explicit in header): - background-image / gradient backgrounds - foreground text rendering (waits for nx_paint_text + nx_font_bitmap glyph rasterizer) - border-color / border-style / border-width stroke - box-shadow / outline / drop shadow - opacity / alpha blending (currently solid overwrite) - z-index stacking contexts (currently document-order paint) - overflow:hidden clip-rect propagation to children - sub-pixel positioning Per cardinal feedback-honest-perf-verdict-no-aspirational-claims: gap list is EXACT. genealogy_id: w3c_css_backgrounds_module_level_3 + substrate_browser_phase_4_walk_paint lineage_id: nishi_browser_paint_walk_layout_v1

dependencies 8 imports · 8 importers

nx_syscalls.nx nx_css_tokenize.nx nx_css_apply.nx nx_css_color_decode.nx nx_layout_box.nx nx_paint_solid_rect.nx nx_paint_text.nx nx_text_wrap.nx nx_paint_walk_layout.nx nx_browser_demo_html.nx nx_browser_demo_html_nishi.nx nx_browser_demo_styled.nx nx_paint_walk_layout_test.nx nx_paint_walk_layout_text_test.nx nx_render_ascii.nx nx_render_html.nx nx_render_wiki_bmp.nx

imports: nx_syscalls.nxnx_css_tokenize.nxnx_css_apply.nxnx_css_color_decode.nxnx_layout_box.nxnx_paint_solid_rect.nxnx_paint_text.nxnx_text_wrap.nx

imported by: nx_browser_demo_html.nxnx_browser_demo_html_nishi.nxnx_browser_demo_styled.nxnx_paint_walk_layout_test.nxnx_paint_walk_layout_text_test.nxnx_render_ascii.nxnx_render_html.nxnx_render_wiki_bmp.nx

structs

53struct PaintPropTable
71struct PaintCtx

consts

46const NX_MAGIC_100000: i64 = 100000
47const NX_MAGIC_65536: i64 = 65536
59const NX_PAINT_PROP_TABLE_BYTES: i64 = 24
83const NX_PAINT_CTX_BYTES: i64 = 72

functions

87func _paint_put_byte(buf: *u8, i: i64, v: i64) -> i64
95func nx_paint_prop_table_init(t: *PaintPropTable, buf: *u8) -> i64
123func _paint_bytes_equal(a_src: *u8, a_off: i64, a_len: i64,
called by 1: _paint_lookup_decl
139func _paint_lookup_decl(ctx: *PaintCtx,
160func _bg_extract_color(src: *u8, off: i64, len: i64, out: *CssColor) -> i64
181func _paint_lookup_bg(ctx: *PaintCtx, element_idx: i64) -> *CssComputedDecl
202func _paint_box_background(ctx: *PaintCtx, box_idx: i64) -> i64
230func _paint_color_decl(ctx: *PaintCtx, element_idx: i64) -> *CssComputedDecl
called by 1: _paint_text_color
253func _paint_text_color(ctx: *PaintCtx, box_idx: i64, out: *CssColor) -> i64
278func _paint_fontsize_decl_px(ctx: *PaintCtx, element_idx: i64) -> i64
called by 1: _paint_fontsize_px
310func _paint_fontsize_px(ctx: *PaintCtx, box_idx: i64) -> i64
326func _paint_scale_for_px(px: i64) -> i64
called by 1: _paint_box_text
334func _paint_display_none(ctx: *PaintCtx, box_idx: i64) -> i64
362func _paint_prop_ident_is(ctx: *PaintCtx, box_idx: i64, prop: *u8, prop_len: i64, val: *u8, val_len: i64) -> i64
390func _paint_inherited_style(ctx: *PaintCtx, box_idx: i64, prop: *u8, prop_len: i64, val: *u8, val_len: i64) -> i64
405func _paint_box_text(ctx: *PaintCtx, box_idx: i64) -> i64
448func nx_paint_ctx_init(ctx: *PaintCtx,
469func nx_paint_ctx_set_boxel(ctx: *PaintCtx, boxel: *CssElement) -> i64
called by 1: _rh_to_fb
479func nx_paint_ctx_set_text(ctx: *PaintCtx,
489func _paint_li_marker(ctx: *PaintCtx, box_idx: i64) -> i64
546func _paint_border_lookup(ctx: *PaintCtx, box_idx: i64) -> *CssComputedDecl
called by 1: _paint_box_border
563func _hex_is(c: i64) -> i64
called by 1: _paint_box_border
573func _paint_box_border(ctx: *PaintCtx, box_idx: i64) -> i64
635func nx_paint_walk_layout(ctx: *PaintCtx, root_idx: i64) -> i64