Expand description
frus-gpu — the GPU context and the 2D rendering engine.
This crate depends on no windowing library: it is handed a
wgpu::SurfaceTarget by the platform layer — frus-shell, say — and takes
care of everything else: device, queue, pipeline, presentation.
What is to be drawn is described in a Scene — coloured Rects and the
rest — which is then handed to Renderer::render.
Re-exports§
pub use wgpu;
Structs§
- Color
- An RGBA colour. Components lie in
[0.0, 1.0]. - Offscreen
Frame - A frame rendered offscreen: sRGB RGBA bytes, row by row.
- Rect
- An axis-aligned rectangle, in logical pixels.
- Render
Timings - Where a frame’s rendering spent its time, in milliseconds. See
Renderer::last_timings. - Renderer
- Holds the GPU state bound to a surface and presents the frames.
- Scene
- A 2D scene: the declarative description of what to draw.
Enums§
- Render
Outcome - What happened when
Renderer::rendertried to present a frame.
Functions§
- backdrop
- The window’s background where nothing is drawn — the clear colour, as a scene colour —
for a
see-throughrenderer, whose frames start transparent and whose owner paints it where the window is not meant to be seen through (milestone 643). - draw_
calls - How many draw calls a scene’s rectangles, images and paths will cost.
- render_
offscreen - Renders
sceneinto awidth×heighttexture cleared toclear, then reads the pixels back.Nonewhen no GPU adapter is available — a machine with neither GPU nor software rasteriser — in which case test callers skip themselves.