diff options
author | 2024-04-30 07:57:54 +0200 | |
---|---|---|
committer | 2024-04-30 07:57:54 +0200 | |
commit | b5b78d505e22cafccb4ecbf57dc61f536ca558ca (patch) | |
tree | 2563da1f3038607a329088ac3f7e460ca3d772fd /graphics/src/cached.rs | |
parent | 24501fd73b5ae884367a2d112ff44625058b876b (diff) | |
download | iced-b5b78d505e22cafccb4ecbf57dc61f536ca558ca.tar.gz iced-b5b78d505e22cafccb4ecbf57dc61f536ca558ca.tar.bz2 iced-b5b78d505e22cafccb4ecbf57dc61f536ca558ca.zip |
Introduce `canvas::Cache` grouping
Caches with the same `Group` will share their text
atlas!
Diffstat (limited to 'graphics/src/cached.rs')
-rw-r--r-- | graphics/src/cached.rs | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/graphics/src/cached.rs b/graphics/src/cached.rs deleted file mode 100644 index c0e4e029..00000000 --- a/graphics/src/cached.rs +++ /dev/null @@ -1,24 +0,0 @@ -/// A piece of data that can be cached. -pub trait Cached: Sized { - /// The type of cache produced. - type Cache: Clone; - - /// Loads the [`Cache`] into a proper instance. - /// - /// [`Cache`]: Self::Cache - fn load(cache: &Self::Cache) -> Self; - - /// Caches this value, producing its corresponding [`Cache`]. - /// - /// [`Cache`]: Self::Cache - fn cache(self, previous: Option<Self::Cache>) -> Self::Cache; -} - -#[cfg(debug_assertions)] -impl Cached for () { - type Cache = (); - - fn load(_cache: &Self::Cache) -> Self {} - - fn cache(self, _previous: Option<Self::Cache>) -> Self::Cache {} -} |