Skip to main content

Module retained_raster

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.
FrameContent
One frame’s scene, surface size and damage, as the worker received it.
RasterCheck
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::differences answers once both are in.
RetainedFrames
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.
RetainedRaster
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.
RetainedTarget
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. Rgba8Unorm with storage, copy-source and copy-destination usage.
TargetKey
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 with parts, repainting damage (target pixels) on the target key names takes: the scene without the parts that cannot reach the damage (crate::scene_parts::culled), or None when 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.