diff options
author | 2024-04-30 07:57:54 +0200 | |
---|---|---|
committer | 2024-04-30 07:57:54 +0200 | |
commit | b5b78d505e22cafccb4ecbf57dc61f536ca558ca (patch) | |
tree | 2563da1f3038607a329088ac3f7e460ca3d772fd /tiny_skia | |
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 'tiny_skia')
-rw-r--r-- | tiny_skia/src/geometry.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tiny_skia/src/geometry.rs b/tiny_skia/src/geometry.rs index 117daf41..02b6e1b9 100644 --- a/tiny_skia/src/geometry.rs +++ b/tiny_skia/src/geometry.rs @@ -1,9 +1,10 @@ use crate::core::text::LineHeight; use crate::core::{Pixels, Point, Radians, Rectangle, Size, Vector}; +use crate::graphics::cache::{self, Cached}; use crate::graphics::geometry::fill::{self, Fill}; use crate::graphics::geometry::stroke::{self, Stroke}; use crate::graphics::geometry::{self, Path, Style}; -use crate::graphics::{Cached, Gradient, Text}; +use crate::graphics::{Gradient, Text}; use crate::Primitive; use std::rc::Rc; @@ -32,7 +33,7 @@ impl Cached for Geometry { Self::Cache(cache.clone()) } - fn cache(self, _previous: Option<Cache>) -> Cache { + fn cache(self, _group: cache::Group, _previous: Option<Cache>) -> Cache { match self { Self::Live { primitives, |