Skip to main content

encode_scene_texture

Function encode_scene_texture 

Source
pub fn encode_scene_texture(
    id: u64,
    dest: Rect,
    transform: Affine,
    extents: &mut ExternalExtents,
    encoded_paints: &mut Vec<EncodedPaint>,
) -> Result<ExternalEncoding, ExternalSkip>
Expand description

Encode a Command::SceneTexture: the whole of the texture bound under id scaled to fill dest, under transform.

The natural-to-dest composition is natural_to_dest, the same one Command::Image takes, so a texture and an image drawn over the same rectangle land on identical device pixels. The sampler is the display list’s own default — ImageQuality::Medium (bilinear) with padded extends — since the command carries no sampling parameters of its own and a scaled texture filtered at nearest would be visibly worse.

The entry is marked as possibly transparent unconditionally. The command carries no opacity statement and the engine never reads the caller’s texels, so every such draw goes to the frame’s blended pass; claiming opacity would route it through the depth-writing pass and let it occlude what it should have blended over.

§Errors

Returns the ExternalSkip the draw is dropped for. An unregistered id is reported once per id at warning level and at debug level thereafter — the same shape the image residency’s own refusals take.