diff options
author | 2023-04-27 16:09:39 +0200 | |
---|---|---|
committer | 2023-04-27 16:09:39 +0200 | |
commit | c31ab8eee6a49a48b4e6ad92207b8ee0360a0eff (patch) | |
tree | 0b099fc1e3810c2709a40627e11da5dc4988822b /tiny_skia/src/vector.rs | |
parent | e3730106e9d4f75de199e1b83cf285b8ff031968 (diff) | |
parent | a755472ee35dfb7839f989becafc6028921a3b99 (diff) | |
download | iced-c31ab8eee6a49a48b4e6ad92207b8ee0360a0eff.tar.gz iced-c31ab8eee6a49a48b4e6ad92207b8ee0360a0eff.tar.bz2 iced-c31ab8eee6a49a48b4e6ad92207b8ee0360a0eff.zip |
Merge pull request #1811 from iced-rs/incremental-rendering
Incremental rendering
Diffstat (limited to 'tiny_skia/src/vector.rs')
-rw-r--r-- | tiny_skia/src/vector.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/tiny_skia/src/vector.rs b/tiny_skia/src/vector.rs index 8509b761..fc411fdd 100644 --- a/tiny_skia/src/vector.rs +++ b/tiny_skia/src/vector.rs @@ -32,7 +32,7 @@ impl Pipeline { color: Option<Color>, bounds: Rectangle, pixels: &mut tiny_skia::PixmapMut<'_>, - clip_mask: Option<&tiny_skia::ClipMask>, + clip_mask: Option<&tiny_skia::Mask>, ) { if let Some(image) = self.cache.borrow_mut().draw( handle, @@ -72,6 +72,8 @@ struct RasterKey { impl Cache { fn load(&mut self, handle: &Handle) -> Option<&usvg::Tree> { + use usvg::TreeParsing; + let id = handle.id(); if let hash_map::Entry::Vacant(entry) = self.trees.entry(id) { @@ -131,9 +133,9 @@ impl Cache { resvg::render( tree, if size.width > size.height { - usvg::FitTo::Width(size.width) + resvg::FitTo::Width(size.width) } else { - usvg::FitTo::Height(size.height) + resvg::FitTo::Height(size.height) }, tiny_skia::Transform::default(), image.as_mut(), |