nx_paint_walk_layout.nx
buildroot/runtime/nx_paint_walk_layout.nx
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
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
| 53 | struct PaintPropTable |
| 71 | struct PaintCtx |
consts
| 46 | const NX_MAGIC_100000: i64 = 100000 |
| 47 | const NX_MAGIC_65536: i64 = 65536 |
| 59 | const NX_PAINT_PROP_TABLE_BYTES: i64 = 24 |
| 83 | const NX_PAINT_CTX_BYTES: i64 = 72 |
functions
| 87 | func _paint_put_byte(buf: *u8, i: i64, v: i64) -> i64 called by 1: nx_paint_prop_table_init |
| 95 | func nx_paint_prop_table_init(t: *PaintPropTable, buf: *u8) -> i64 |
| 123 | func _paint_bytes_equal(a_src: *u8, a_off: i64, a_len: i64, called by 1: _paint_lookup_decl |
| 139 | func _paint_lookup_decl(ctx: *PaintCtx, |
| 160 | func _bg_extract_color(src: *u8, off: i64, len: i64, out: *CssColor) -> i64 called by 1: _paint_box_background calls 3: nx_css_color_decodenx_css_color_namednx_css_color_rgb_func |
| 181 | func _paint_lookup_bg(ctx: *PaintCtx, element_idx: i64) -> *CssComputedDecl called by 1: _paint_box_background |
| 202 | func _paint_box_background(ctx: *PaintCtx, box_idx: i64) -> i64 |
| 230 | func _paint_color_decl(ctx: *PaintCtx, element_idx: i64) -> *CssComputedDecl called by 1: _paint_text_color |
| 253 | func _paint_text_color(ctx: *PaintCtx, box_idx: i64, out: *CssColor) -> i64 called by 1: _paint_box_text calls 4: _paint_color_declnx_css_color_decodenx_css_color_namednx_css_color_rgb_func |
| 278 | func _paint_fontsize_decl_px(ctx: *PaintCtx, element_idx: i64) -> i64 called by 1: _paint_fontsize_px |
| 310 | func _paint_fontsize_px(ctx: *PaintCtx, box_idx: i64) -> i64 |
| 326 | func _paint_scale_for_px(px: i64) -> i64 called by 1: _paint_box_text |
| 334 | func _paint_display_none(ctx: *PaintCtx, box_idx: i64) -> i64 called by 1: nx_paint_walk_layout |
| 362 | func _paint_prop_ident_is(ctx: *PaintCtx, box_idx: i64, prop: *u8, prop_len: i64, val: *u8, val_len: i64) -> i64 called by 1: _paint_inherited_style |
| 390 | func _paint_inherited_style(ctx: *PaintCtx, box_idx: i64, prop: *u8, prop_len: i64, val: *u8, val_len: i64) -> i64 |
| 405 | func _paint_box_text(ctx: *PaintCtx, box_idx: i64) -> i64 |
| 448 | func nx_paint_ctx_init(ctx: *PaintCtx, |
| 469 | func nx_paint_ctx_set_boxel(ctx: *PaintCtx, boxel: *CssElement) -> i64 called by 1: _rh_to_fb |
| 479 | func nx_paint_ctx_set_text(ctx: *PaintCtx, |
| 489 | func _paint_li_marker(ctx: *PaintCtx, box_idx: i64) -> i64 |
| 546 | func _paint_border_lookup(ctx: *PaintCtx, box_idx: i64) -> *CssComputedDecl called by 1: _paint_box_border |
| 563 | func _hex_is(c: i64) -> i64 called by 1: _paint_box_border |
| 573 | func _paint_box_border(ctx: *PaintCtx, box_idx: i64) -> i64 |
| 635 | func nx_paint_walk_layout(ctx: *PaintCtx, root_idx: i64) -> i64 |