Refactor texture image filtering
- Support only `Linear` or `Nearest` - Simplify `Layer` groups - Move `FilterMethod` to `Image` and `image::Viewer`
This commit is contained in:
parent
75c9afc608
commit
a5125d6fea
12 changed files with 250 additions and 160 deletions
|
|
@ -68,6 +68,8 @@ pub enum Primitive<T> {
|
|||
Image {
|
||||
/// The handle of the image
|
||||
handle: image::Handle,
|
||||
/// The filter method of the image
|
||||
filter_method: image::FilterMethod,
|
||||
/// The bounds of the image
|
||||
bounds: Rectangle,
|
||||
},
|
||||
|
|
|
|||
|
|
@ -215,8 +215,17 @@ where
|
|||
self.backend().dimensions(handle)
|
||||
}
|
||||
|
||||
fn draw(&mut self, handle: image::Handle, bounds: Rectangle) {
|
||||
self.primitives.push(Primitive::Image { handle, bounds });
|
||||
fn draw(
|
||||
&mut self,
|
||||
handle: image::Handle,
|
||||
filter_method: image::FilterMethod,
|
||||
bounds: Rectangle,
|
||||
) {
|
||||
self.primitives.push(Primitive::Image {
|
||||
handle,
|
||||
filter_method,
|
||||
bounds,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue