Updated shaders and removed debug_stub_derive dependency
This commit is contained in:
parent
c0996923c6
commit
2f695ef980
6 changed files with 51 additions and 19 deletions
|
|
@ -3,9 +3,7 @@ use iced_native::image;
|
|||
use std::{
|
||||
collections::{HashMap, HashSet},
|
||||
};
|
||||
use debug_stub_derive::*;
|
||||
|
||||
#[derive(DebugStub)]
|
||||
pub enum Memory {
|
||||
Host(::image::ImageBuffer<::image::Bgra<u8>, Vec<u8>>),
|
||||
Device(ImageAllocation),
|
||||
|
|
@ -24,6 +22,17 @@ impl Memory {
|
|||
}
|
||||
}
|
||||
|
||||
impl std::fmt::Debug for Memory {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
match self {
|
||||
Memory::Host(_) => write!(f, "Memory::Host"),
|
||||
Memory::Device(_) => write!(f, "Memory::Device"),
|
||||
Memory::NotFound => write!(f, "Memory::NotFound"),
|
||||
Memory::Invalid => write!(f, "Memory::Invalid"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct Cache {
|
||||
map: HashMap<u64, Memory>,
|
||||
|
|
|
|||
|
|
@ -3,14 +3,9 @@ use iced_native::svg;
|
|||
use std::{
|
||||
collections::{HashMap, HashSet},
|
||||
};
|
||||
use debug_stub_derive::*;
|
||||
|
||||
#[derive(DebugStub)]
|
||||
pub enum Svg {
|
||||
Loaded(
|
||||
#[debug_stub="ReplacementValue"]
|
||||
resvg::usvg::Tree
|
||||
),
|
||||
Loaded(resvg::usvg::Tree),
|
||||
NotFound,
|
||||
}
|
||||
|
||||
|
|
@ -27,10 +22,17 @@ impl Svg {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(DebugStub)]
|
||||
impl std::fmt::Debug for Svg {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
match self {
|
||||
Svg::Loaded(_) => write!(f, "Svg::Loaded"),
|
||||
Svg::NotFound => write!(f, "Svg::NotFound"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub struct Cache {
|
||||
svgs: HashMap<u64, Svg>,
|
||||
#[debug_stub="ReplacementValue"]
|
||||
rasterized: HashMap<(u64, u32, u32), ImageAllocation>,
|
||||
svg_hits: HashSet<u64>,
|
||||
rasterized_hits: HashSet<(u64, u32, u32)>,
|
||||
|
|
@ -144,3 +146,9 @@ impl Cache {
|
|||
self.rasterized_hits.clear();
|
||||
}
|
||||
}
|
||||
|
||||
impl std::fmt::Debug for Cache {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
write!(f, "vector::Cache")
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue