diff --git a/RUST.md b/RUST.md index 8193a80..eb47386 100644 --- a/RUST.md +++ b/RUST.md @@ -648,17 +648,62 @@ step measured. latent on Wayland only because winit asks for a redraw after a resize by itself; on Android, where the surface work of I2 will not have winit underneath it, nothing else here would have asked. -- [ ] **I1 — the text stack decision.** iris uses cosmic-text; the - transcript needs rich inline spans (links, code chips, colour), - selection across many widgets with the platform's handles on the - phone, and an editor the IME can drive (composition regions, not - just committed characters). Compare cosmic-text and Parley against - exactly those three, in iris, on a real transcript's text. Parley - is the expectation because android-view's IME bridge and AccessKit's - text properties are written against it; measure rather than assume. - Pass: a written decision here with what each was tried on, and the - TODO's "text resizing per frame is really slow" measured and either - fixed or explained. +- [x] **I1 — parley, and a glyph atlas (done 2026-09-04).** No bake-off: + Iris decided for parley directly ("I wanted to switch it to parley + anyways"), and then asked for the atlas as well ("just do the atlas, + commit to it, we do want it"). Both are in. + + **What parley bought, beyond shaping.** Its editing model addresses + text by byte offset into one string, where cosmic-text used + `(line, index)` — so `select_content`, `delete_between`, + `insert_inner` and `newline` collapse into ordinary string + operations. Bigger: `Selection::geometry` and `Cursor::geometry` + replace `iter_layout_lines`, `index_x` and `cursor_pos`, which walked + runs by hand to place the caret and the selection boxes and were not + bidi- or wrap-correct. `edit.rs` lost about 130 lines and gained + Home/End. Its cursor motions map onto parley's `next_visual`, + `previous_visual_word`, `next_line` and so on, in one function. + + **The atlas is what "text resizing (per frame) is really slow" + was.** Every string used to be rasterised into its own `RgbaImage` + and uploaded as a whole texture whenever anything about it changed, + so a window resize re-rasterised and re-uploaded every visible + string. Now a glyph is rasterised once per font, size and subpixel + phase, shared by every string that contains it, and a resize + re-emits quads without touching the GPU's copy. **The tabs example + reports it: `views`, the number of texture views bound, went from 6 + to 1** — six per-string textures became one shared page. Supporting + pieces: a `GLYPH` primitive that samples a sub-rectangle and tints + it (the existing texture primitive samples a whole texture), a + `Patch` texture update so a new glyph costs its own bytes rather + than a 4 MB page, and `GpuTextures` keeping its `Texture`s, since a + view cannot be written through. + + **Not yet measured**, and the honest gap in this step: the TODO's + "really slow" was never given a number, so neither is the + improvement. What is evidence rather than argument is the view count + and the shape of the work — a resize no longer rasterises. A + before/after timing wants the transcript screen of I5 to be worth + taking. + + **Two bugs found on the way**, both pre-existing: `primitives!`'s + `@count` rule recursed comma-separated while matching + space-separated, so it terminated only for exactly two primitives + and adding a third hit the recursion limit; and `Color` had no + `Default`, which parley's `Brush` requires. + + **Fourteen tests**, iris's first. The editor is the one part that is + pure logic rather than something needing a GPU and a window, and it + was rewritten wholesale with no way to exercise it — synthetic input + does not reach a client under the headless compositor, which has no + seat devices. Two of the tests are aimed at what the rewrite could + plausibly have broken: the IME preedit path, and editing multi-byte + text now that offsets are bytes. + + Dropping cosmic-text and unicode-segmentation also retired two + nightly gates — `portable_simd` (the old glyph compositing) and + `gen_blocks` (the deleted line iterator). **Eleven left.** + - [ ] **I2 — iris on android-view.** An `android-view` surface as a second backend beside winit: `wgpu` on the view's surface (GLES here, see the Vulkan section; Vulkan on the phone), touch as pointer events,