Optional ReadonlycolorThe colour space of the texels this source produces. Default "srgb"
— a deliberate difference from TextureSource's "linear" default, with
the reason written at both (RFC 0004 Q3, adopted): R-15's linear default
exists only so that already-authored textures and their pixel goldens do
not move, a class that did not exist then has neither, and a host 2D
canvas produces sRGB-encoded bytes unambiguously. Choosing "linear" here
for consistency would make the new tier wrong on purpose.
ReadonlyheightHeight in texels. A finite integer ≥ 1. Constant until the application calls CanvasTexture.resize after changing it.
Optional ReadonlyoriginWhich row RasterSource.readPixels writes first — see
RasterOrigin. Default "bottom-left". Read once, at
CanvasTexture construction, like the size.
ReadonlywidthWidth in texels. A finite integer ≥ 1. Constant until the application calls CanvasTexture.resize after changing it.
OptionalpaintRepaint, if this source paints on demand. Called by
CanvasTexture.update immediately before
RasterSource.readPixels, and — like update() itself — never from
a fixed step (§33; see the module header).
No parameter, deliberately: the source closes over whatever it paints with, and the engine never learns what that is. The hook exists only so the engine can order the repaint against the read.
Write exactly width * height * 4 tightly packed RGBA8 bytes into out,
straight alpha, in the order declared by RasterSource.origin.
out is engine-owned and exactly the right length; a source neither
allocates nor retains it.
A surface an application paints and the engine reads (§77a; RFC 0004).
Structural and DOM-free, in the discipline of
TextureSource,FetchLike,PointerSurface, andSurfaceObserver: the engine names a shape, the host supplies a value, and the browser adapter is a few lines in the application — see the module header for it, and for the §33 and §96 rules every source lives under.