pub(crate) fn scanout_candidate<R>(
elements: &[CompositionElements<R, WaylandSurfaceRenderElement<R>>],
size: (i32, i32),
scale: f64,
) -> Result<&WaylandSurfaceRenderElement<R>, &'static str>where
R: Renderer + ImportAll + ImportMem,
R::TextureId: Clone + 'static,Expand description
The surface whose buffer is an output’s frame as it stands, or why there is none.
Decided from the frame’s element list every frame, as a display compositor picks direct scanout: the topmost element on the output has to be a surface drawn over exactly the output, unscaled, uncropped, untransformed, at full alpha, and opaque throughout, so its buffer holds the frame pixel for pixel and hides everything under it. A cursor drawn into the frame, a watermark, an overlay or frame of the window manager, a layer surface, a popup, or a second window on the output is on top of it or beside it, and ends the direct path the frame it appears. The client whose buffer qualifies is the usual full-screen case: a game, a kiosk browser, a maximized window under a policy that frames none.