Skip to main content

Module render

Module render 

Source
Expand description

Scene → pixels. The engine lays a scene out once (taffy, parley) and turns it into a display list of vello drawing commands; a backend draws the list — vello_cpu here, for the PNG.

Structs§

Difference
How two drawings of the same size differ.
Drawing
A scene laid out and ready to paint: every node’s box in tree order, the design’s drawing, the commands that paint it, and the images they paint.
Frame
A node’s box after layout, in the scene’s pixels.
Renderer
The fonts and text layout state a renderer keeps between paints.
Undrawable
Why a scene can’t be drawn: too big a drawing, or images and shadows that don’t fit the GPU’s atlas — at the attribute that broke it, when one did.

Enums§

Draw
One drawing command, in scene pixels: what both vello backends replay. Every decision about the drawing is made before a command is made; a backend only translates it into its library’s call.
Paint
What a Draw::Fill covers its path with.

Constants§

CLUSTER
The largest cluster of touching unexplained pixels.
EDGE
A PNG’s or JPEG’s pixels, straight RGBA. How far apart two drawings of the same scene may be. Two rasterizers of one display list differ only in how they anti-alias an edge: a pixel on an edge takes some value between the colors either side of it, and each rasterizer picks a slightly different one. So a pixel is unexplained when, in some channel, its value lies more than EDGE outside the range of the other drawing’s pixels around it (itself and its eight neighbours), in either direction. A missing or moved part — a divider, an icon, a word — leaves pixels no neighbour in the other drawing explains. At most SHARE of the pixels may be unexplained, and no 8-connected cluster of them may be larger than CLUSTER.
MAX_SIDE
The largest drawing a design may have, in pixels a side at 1×: far beyond any screen, and a PNG of it still fits in memory.
SHARE
The largest share of pixels that may be unexplained.

Functions§

compare
How two RGBA buffers width pixels wide differ; None when their sizes differ.
matches
Whether two RGBA buffers width pixels wide are the same drawing within the tolerance; otherwise how they differ, or None for different sizes.
paint_list
Replays a display list with vello_cpu into a pixmap of its area at scale, as Renderer::paint does.
pixels
A PNG’s or JPEG’s pixels as straight RGBA, with its width and height — for comparing drawings.