code wiki / _hdl_build / nx_browser_render_gif_t139.nx
nx_browser_render_gif_t139.nx
buildroot/runtime/_hdl_build/nx_browser_render_gif_t139.nx
about
nx_browser_render.nx -- REUSABLE sovereign CSS render core. Holds nx_browser's OS-AGNOSTIC pipeline:
br_layout (HTML body -> CSS cascade -> box/flex/float layout -> LayoutTree + computed styles) and
br_draw_fb / br_shot_png (paint the laid-out page into an RGBA framebuffer / PNG). NO X11, NO network --
pure compute over sys_mmap, so it compiles into the native-Windows GUI PE exactly as into the WSL/X11
browser. The window/blit/input + fetch live in the consumers. CSS-on-native-Windows arc R2.
NOTE (R3 dedup pending): these fns are still ALSO defined in runtime/_hdl_build/nx_browser.nx; once this
organ is proven, nx_browser.nx imports this and drops its copies. license_tier: ORIGINAL
dependencies 18 imports · 2 importers
diagram shows first 10 each side; +8 more imports, +0 more importers in the complete lists below.
imports: nx_syscalls.nxnx_font8x8.nxnx_html_tokenizer.nxnx_dom_query.nxnx_srcset_lib.nxnx_html_entities.nxnx_render_html.nxnx_css_color_decode.nxnx_layout_box.nxnx_layout_default_display.nxnx_layout_from_dom.nxnx_layout_block.nxnx_paint_solid_rect.nxnx_paint_text.nxnx_png_write.nxnx_font.nxnx_aa_raster.nxnx_ttf_fontlib.nx
imported by: nishi_gui_gif_t139.nxnx_gif_consumer_gate_t139.nx
structs
| 27 | struct Page |
consts
| 65 | const NX_PAGE_FIELDS: i64 = 24 |
| 66 | const NX_PAGE_FIELD_BYTES: i64 = 8 |
| 67 | const NX_PAGE_BYTES: i64 = NX_PAGE_FIELDS * NX_PAGE_FIELD_BYTES |
| 68 | const NX_CHROME_H: i64 = 44 // browser chrome (toolbar + address bar) height; page viewport is below it |
| 827 | const BR_FACE_BYTES: i64 = 256 |
| 1249 | const BR_LO: i64 = 40 |
| 1250 | const BR_HI: i64 = 165 |
functions
| 70 | func br_slen(s: *u8) -> i64 { var k: i64=0; while s[k]!=(0 as u8){k=k+1} return k } |
| 88 | func br_cidx_build(tree: *LayoutTree, computed: *CssComputedDecl, ncomp: i64) -> i64 |
| 138 | func br_comp_int(src: *u8, computed: *CssComputedDecl, ncomp: i64, box_idx: i64, prop: *u8, plen: i64, dflt: i64) -> i64 |
| 172 | func br_comp_color(src: *u8, computed: *CssComputedDecl, ncomp: i64, box_idx: i64, prop: *u8, plen: i64) -> i64 called by 1: br_comp_color_inh calls 4: sys_mmapnx_css_color_decodenx_css_color_namednx_css_color_rgb_func |
| 213 | func br_comp_fontsize_own(src: *u8, computed: *CssComputedDecl, ncomp: i64, box_idx: i64, pct_out: *i64) -> i64 |
| 259 | func br_comp_lineheight_own(src: *u8, computed: *CssComputedDecl, ncomp: i64, box_idx: i64, fs: i64) -> i64 |
| 354 | func br_comp_lineheight_px(src: *u8, computed: *CssComputedDecl, ncomp: i64, tree: *LayoutTree, box_idx: i64, fs: i64) -> i64 |
| 368 | func br_comp_fontsize_inh(src: *u8, computed: *CssComputedDecl, ncomp: i64, tree: *LayoutTree, box_idx: i64, dflt: i64) -> i64 called by 2: br_comp_fontsize_inhbr_draw_fb_at calls 3: sys_mmapbr_comp_fontsize_ownbr_comp_fontsize_inh |
| 390 | func br_comp_color_inh(src: *u8, computed: *CssComputedDecl, ncomp: i64, tree: *LayoutTree, box_idx: i64) -> i64 |
| 407 | func br_prop_eq(src: *u8, off: i64, lit: *u8, len: i64) -> i64 |
| 416 | func br_comp_bg(src: *u8, computed: *CssComputedDecl, ncomp: i64, box_idx: i64) -> i64 called by 1: br_draw_fb_at calls 5: br_prop_eqsys_mmapnx_css_color_decodenx_css_color_namednx_css_color_rgb_func |
| 451 | func br_comp_border(src: *u8, computed: *CssComputedDecl, ncomp: i64, box_idx: i64, wout: *i64) -> i64 |
| 497 | func br_extract(html: *u8, hlen: i64, elements: *CssElement, ehref_off: *i64, ehref_len: *i64, esrc_off: *i64, esrc_len: *i64, elazy: *i64, vw: i64, dpr_permil: i64, maxn: i64) -> i64 |
| 571 | func br_layout(page: *Page, vw: i64) -> i64 called by 2: mainmain calls 24: br_release_image_metadatabr_slensys_mmaprh_extract_stylesrh_filter_medianx_layout_tree_init+18 |
| 775 | func br_find_canvas(page: *Page, from: i64) -> i64 |
| 814 | func br_set_fast_vec(v: i64) -> i64 { bpv_fast_on = v; return 0 } called by 1: paint_css |
| 830 | func br_face_register(idx: i64, fh: *i64) -> i64 called by 2: br_set_facebr_face_load_idx calls 7: sys_mmaptf_adv_em1000tf_kern_em1000tf_gidtf_adv_units_gidtf_upem+1 |
| 867 | func br_face_select(idx: i64) -> i64 |
| 876 | func br_set_face(fh: *i64) -> i64 |
| 885 | func br_face_resolve(src: *u8, computed: *CssComputedDecl, ncomp: i64, tree: *LayoutTree, box_idx: i64) -> i64 |
| 889 | func br_face_load_idx(idx: i64, path: *u8) -> i64 |
| 895 | func br_face_load(path: *u8) -> i64 |
| 900 | func br_face_on() -> i64 { if br_face != 0 { return 1 } return 0 } |
| 904 | func br_face_line_h(px: i64) -> i64 { if br_face == 0 { return (px * 12) / 10 + 2 } return tf_content_px(br_face as *i64, px) } |
| 913 | func br_fold_text(src: *u8, off: i64, len: i64, out: *u8, out_cap: i64) -> i64 |
| 938 | func br_text_cp(text: *u8, i: i64, len: i64, cp: *i64) -> i64 { return font_next_cp(text, i, len, cp) } |
| 939 | func bpv_atlas_init() -> i64 |
| 957 | func bpv_cell(ch: i64, empx: i64, cs: *i64, sn: *i64, out: *i64) -> i64 called by 1: br_paint_vec_atlas calls 9: font_face_hasfs_face_adv_ptrtf_glyph_notdeftf_glyphtf_glyph_cpfont_vec_adv_px2+3 |
| 1009 | func bpv_blit_rgba(fb: *Framebuffer, ox: i64, oy: i64, cov: *u8, gw: i64, gh: i64, cr: i64, cg: i64, cb: i64) -> i64 called by 1: br_paint_vec_atlas |
| 1036 | func br_paint_vec_atlas(fb: *Framebuffer, x0: i64, y0: i64, text: *u8, text_len: i64, empx: i64, color: *CssColor, avail_w: i64) -> i64 called by 1: br_paint_vec calls 14: bpv_atlas_initfont_trig_initbr_face_line_hsys_mmapfont_vec_next_break_pxbr_text_cp+8 |
| 1082 | func br_paint_vec(fb: *Framebuffer, x0: i64, y0: i64, text: *u8, text_len: i64, empx: i64, color: *CssColor, avail_w: i64) -> i64 |
| 1169 | func font_vec_adv_px2(ch: i64, empx: i64) -> i64 { return (font_adv_em(ch) * empx) / 1000 } |
| 1172 | func font_vec_text_w_px(text: *u8, start: i64, end: i64, empx: i64) -> i64 { return font_vec_text_w_fs(text, start, end, empx) } |
| 1173 | func font_vec_next_break_px(text: *u8, len: i64, avail_px: i64, start: i64, empx: i64) -> i64 { return font_vec_next_break_fs(text, len, avail_px, start, empx) } |
| 1180 | func br_ci(a: i64) -> i64 { if a >= 65 { if a <= 90 { return a + 32 } } return a } called by 1: br_box_has_term |
| 1181 | func br_box_has_term(buf: *u8, off: i64, len: i64, term: *u8, tlen: i64) -> i64 |
| 1193 | func br_find(page: *Page, term: *u8, tlen: i64, yb: *i64) -> i64 calls 1: br_box_has_term |
| 1215 | func br_color_from_int(c: i64) -> *CssColor |
| 1224 | func br_bit(ft8: *u8, go: i64, col: i64, row: i64) -> i64 |
| 1233 | func br_glyph_cov(ft8: *u8, go: i64, fx256: i64, fy256: i64) -> i64 |
| 1251 | func br_sharpen(c: i64) -> i64 called by 1: br_cov_hybrid |
| 1259 | func br_cov_hybrid(ft8: *u8, go: i64, fx256: i64, fy256: i64) -> i64 |
| 1275 | func br_paint_text2x(fb: *Framebuffer, x: i64, y: i64, text: *u8, text_len: i64, color: *CssColor, scale: i64) -> i64 |
| 1331 | func br_blit_pixels(fb: *Framebuffer, dx: i64, dy: i64, boxW: i64, boxH: i64, src: *u8, sw: i64, sh: i64,channels: i64) -> i64 |
| 1372 | func br_blit_rgb(fb: *Framebuffer,dx: i64,dy: i64,boxW: i64,boxH: i64,src: *u8,sw: i64,sh: i64) -> i64 {return br_blit_pixels(fb,dx,dy,boxW,boxH,src,sw,sh,3)} calls 1: br_blit_pixels |
| 1373 | func br_blit_rgba(fb: *Framebuffer,dx: i64,dy: i64,boxW: i64,boxH: i64,src: *u8,sw: i64,sh: i64) -> i64 {return br_blit_pixels(fb,dx,dy,boxW,boxH,src,sw,sh,4)} |
| 1379 | func br_draw_fb_at(fb: *Framebuffer, page: *Page, win_w: i64, cur_url: *u8, ulen: i64, scale: i64, scroll_y: i64) -> i64 called by 2: paint_cssbr_draw_fb calls 20: sys_mmapbr_comp_bgnx_paint_solid_rectbr_color_from_intbr_comp_borderbr_box_has_term+14 |
| 1641 | func br_draw_fb(fb: *Framebuffer, page: *Page, win_w: i64, cur_url: *u8, ulen: i64, scale: i64) -> i64 |
| 1652 | func br_shot_png(page: *Page, cur_url: *u8, ulen: i64, path: *u8) -> i64 |
| 1679 | func br_hit_link(page: *Page, dx: i64, dy: i64, off: *i64, len: *i64) -> i64 called by 1: main |
| 1744 | func br_image_meta_bytes(count: i64) -> i64 {let n: i64=(count+1)*8;if n<=NXA_SMALL_MAX{return NXA_SMALL_MAX+1}return n} |
| 1745 | func br_release_owned_images(page: *Page) -> i64 |
| 1753 | func br_release_image_metadata(page: *Page) -> i64 |
| 1763 | func br_image_take_result(page: *Page,i: i64,result: *i64) -> i64 |