Skip to main content

AppImageSource

Trait AppImageSource 

pub trait AppImageSource: Send + Sync {
    // Required methods
    fn key(&self) -> &str;
    fn pixels(&self, device_px: u32) -> Option<ImageData>;
}
Expand description

Where an AppImage’s pixels come from.

Required Methods§

fn key(&self) -> &str

Identity of the artwork: two images with the same key paint the same pixels, so chrome can skip replacing one with the other.

fn pixels(&self, device_px: u32) -> Option<ImageData>

Pixels for an icon painted device_px square, or None when the artwork cannot be decoded. Called every frame the icon is painted, so a source caches its rasterisations.

Implementors§