1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
//! How a Tilo app hands its frames to the render service of its room, and
//! how the service makes sure a frame is safe to draw.
//!
//! An app does not rasterize. Its toolkit builds the widget tree, lays it out
//! and records the frame as vello's encoding, as before, then writes that
//! encoding into shared memory instead of onto a GPU. The room's render
//! service — the only toolkit-app process that opens the GPU — validates it,
//! rasterizes it on its warm device into dma-bufs and hands those back; the app
//! attaches them to its own `wl_surface`, so the compositor imports them like
//! any client buffer (zero copies, direct scanout kept).
//!
//! This crate is the contract both sides compile:
//!
//! - [`scene`]: a vello [`Encoding`](vello_encoding::Encoding) as bytes, with
//! fonts, images and external surfaces referenced by id instead of by
//! pointer.
//! - [`frame`]: one frame of one surface: its size, damage, scroll copies,
//! the layers it changes and the backdrops it blurs. Records are
//! type-length-value sections, so later steps (scene annotations,
//! service-run motion) add sections without breaking older peers.
//! - [`validate`]: the CPU pass every scene passes before a GPU sees it, and
//! the per-app [`Limits`] it enforces. A scene is hostile until it passes.
//! - [`control`]: the messages on the control channel ("frame N is in the
//! ring", "frame N is in buffer B", "frame N was presented"), and on Unix
//! [`channel`] carries them with descriptors over a packet socket pair, and
//! [`shm`] the shared memory: the ring frames are written to, and the images
//! an app uploads once.
//! - [`patch`]: beside scenes, the component patches a tilolang app sends the
//! room's UI host instead of pixels, the events, bindings, focus and
//! composition that come back, and the check every batch passes.
// The render service's broker serves the Linux session's apps alone.
pub use Limits;
/// The version both peers name in their hello. A peer that speaks a newer
/// version must still accept this one's sections; a section it does not
/// know is skipped only when its sender marked it optional.
pub const PROTOCOL_VERSION: u16 = 3;
/// A font an app registered, by the number it chose.
;
/// An image an app uploaded once, by the number it chose.
;
/// A surface (a window, a popup) the app renders through the service.
;
/// One layer of a surface's scene. Layer 0 is the surface's content; others
/// are parts of it the app updates on their own (scrolling regions,
/// popovers) and, from step 2 on, parts the service animates.
;
/// Why bytes could not be read as a record, or a record was refused.