From b05e61f5c8ae61c9f3c7cc08cded53901ebbccfd Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Wed, 3 Apr 2024 21:07:54 +0200 Subject: Redesign `iced_wgpu` layering architecture --- graphics/src/cached.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'graphics/src/cached.rs') diff --git a/graphics/src/cached.rs b/graphics/src/cached.rs index b52f9d9d..1ba82f9f 100644 --- a/graphics/src/cached.rs +++ b/graphics/src/cached.rs @@ -5,7 +5,7 @@ use std::sync::Arc; /// A piece of data that can be cached. pub trait Cached: Sized { /// The type of cache produced. - type Cache; + type Cache: Clone; /// Loads the [`Cache`] into a proper instance. /// @@ -15,7 +15,7 @@ pub trait Cached: Sized { /// Caches this value, producing its corresponding [`Cache`]. /// /// [`Cache`]: Self::Cache - fn cache(self) -> Self::Cache; + fn cache(self, previous: Option) -> Self::Cache; } impl Cached for Primitive { @@ -27,7 +27,7 @@ impl Cached for Primitive { } } - fn cache(self) -> Arc { + fn cache(self, _previous: Option>) -> Arc { Arc::new(self) } } @@ -38,5 +38,5 @@ impl Cached for () { fn load(_cache: &Self::Cache) -> Self {} - fn cache(self) -> Self::Cache {} + fn cache(self, _previous: Option) -> Self::Cache {} } -- cgit From 6ad5bb3597f640ac329801adf735d633bf0a512f Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Tue, 9 Apr 2024 22:25:16 +0200 Subject: Port `iced_tiny_skia` to new layering architecture --- graphics/src/cached.rs | 18 ------------------ 1 file changed, 18 deletions(-) (limited to 'graphics/src/cached.rs') diff --git a/graphics/src/cached.rs b/graphics/src/cached.rs index 1ba82f9f..c0e4e029 100644 --- a/graphics/src/cached.rs +++ b/graphics/src/cached.rs @@ -1,7 +1,3 @@ -use crate::Primitive; - -use std::sync::Arc; - /// A piece of data that can be cached. pub trait Cached: Sized { /// The type of cache produced. @@ -18,20 +14,6 @@ pub trait Cached: Sized { fn cache(self, previous: Option) -> Self::Cache; } -impl Cached for Primitive { - type Cache = Arc; - - fn load(cache: &Arc) -> Self { - Self::Cache { - content: cache.clone(), - } - } - - fn cache(self, _previous: Option>) -> Arc { - Arc::new(self) - } -} - #[cfg(debug_assertions)] impl Cached for () { type Cache = (); -- cgit