Module retained_raster
Expand description
Rasterizing frames into one retained target: only a frame’s damage (or
all of it), its scroll copies made first and its backdrops blurred. Every
host that keeps the pixels it presented draws through RetainedRaster:
the native app’s render worker, the workspace’s render service and the
browser desktop, so they produce the same pixels from the same frame.
Structs§
- Differences
- How a frame repainted in part differed from a full render of it.
- Frame
Content - One frame’s scene, surface size and damage, as the worker received it.
- Raster
Check - A check that a retained target shows what a full render of the same
frame does: a frame repainted only where it changed must leave no stale
pixel. Debug and test builds run it on the frames they repaint in part.
The two images are read back asynchronously;
Self::differencesanswers once both are in. - Retained
Frames - The frame a host presented last, to compare the next with. Where a scene
drawn with damage parts (
crate::scene_parts) changed is the parts whose commands differ (or what a hinted part says changed); every other pixel is drawn by the same commands as before. Anything that cannot be proven (no parts, a change outside every part, another target) repaints the whole frame. - Retained
Raster - What a host keeps between frames to rasterize them into one retained target: the damage scratch, the backdrop blur and, on a software adapter, the CPU canvas. The app’s own render worker draws with it, and so does the workspace’s render service for each surface it draws for an app, so both produce the same pixels from the same frame.
- Retained
Target - The retained frame the native host rasterizes into and presents from.
Pixels outside a frame’s damage are whatever the previous frame left, so
it must only ever be written through
RetainedRaster::rasterize.Rgba8Unormwith storage, copy-source and copy-destination usage. - Target
Key - What a target holds and how a scene is placed on it: a frame drawn for another key cannot be repainted over the last one.
Enums§
- Readback
- What reading a frame repainted in part and a full render of it back said.
- Repaint
- What of a frame to repaint over the one presented before.
- Unknown
- Why a frame is repainted in full.
Constants§
- DAMAGE_
ONLY_ REFUSED - Why a frame drawn for its damage only was not rasterized.
Functions§
- culled_
for_ damage - What of
scene, drawn withparts, repaintingdamage(target pixels) on the targetkeynames takes: the scene without the parts that cannot reach the damage (crate::scene_parts::culled), orNonewhen it takes all of it: no parts, every part reaching the damage, or a damage repainted as one whole frame ([repaints_alone]), which draws every pixel. The renderer works through every path it is given, wherever it lands, so a software GPU otherwise spends as long on a caret as on the whole page.