Allow to load an image from memory

New `image::Handle` opaque type uniquely identifying some `image::Data`,
allowing reliable caching.
This commit is contained in:
Héctor Ramón Jiménez 2019-11-29 21:44:39 +01:00
parent 811d8b90d7
commit 505588d585
5 changed files with 133 additions and 33 deletions

View file

@ -229,9 +229,9 @@ impl Renderer {
border_radius: *border_radius as f32,
});
}
Primitive::Image { path, bounds } => {
Primitive::Image { handle, bounds } => {
layer.images.push(Image {
path: path.clone(),
handle: handle.clone(),
position: [bounds.x, bounds.y],
scale: [bounds.width, bounds.height],
});