Skip to main content

backdrop_texels

Function backdrop_texels 

pub fn backdrop_texels(
    bounds: Rect,
    sampling: Sampling,
    cell_px: f64,
) -> (u32, u32)
Expand description

The size in texels of the image a surface with bounds (recording pixels) is drawn with: what a provided backdrop must measure. cell_px is the cell the surface shows as pixels (Sampling::Blocky), in the same recording pixels, or 0 for a smoothly sampled surface.

One texel per cell, as [Self::record] takes for a blocky sample: a host that blurs outside the renderer has to hand back an image the size the placeholder takes, or the surface draws the opaque placeholder and its look never shows.