Write docs for iced_wgpu

This commit is contained in:
Héctor Ramón Jiménez 2019-11-22 22:14:24 +01:00
parent fa227255b0
commit 6a0e442ad6
7 changed files with 74 additions and 16 deletions

View file

@ -1,11 +1,9 @@
use crate::Transformation;
use iced_native::Rectangle;
use std::cell::RefCell;
use std::collections::HashMap;
use std::mem;
use std::rc::Rc;
use std::{cell::RefCell, collections::HashMap, mem, rc::Rc};
#[derive(Debug)]
pub struct Pipeline {
cache: RefCell<HashMap<String, Memory>>,
@ -207,7 +205,8 @@ impl Pipeline {
if !self.cache.borrow().contains_key(path) {
let image = image::open(path).expect("Load image").to_bgra();
self.cache
let _ = self
.cache
.borrow_mut()
.insert(path.to_string(), Memory::Host { image });
}
@ -308,6 +307,7 @@ impl Pipeline {
}
}
#[derive(Debug)]
enum Memory {
Host {
image: image::ImageBuffer<image::Bgra<u8>, Vec<u8>>,