summaryrefslogtreecommitdiffstats
path: root/tiny_skia/src/window/compositor.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2023-03-02 00:40:36 +0100
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2023-03-02 00:40:36 +0100
commit868f79d22e2be82e98b06d66da3b4cbc6139d7c7 (patch)
treef90308d40c2ff48ca7c7dd6d3a123dac0d1c0351 /tiny_skia/src/window/compositor.rs
parent350427e82c3a49367da65086c20a307e9b864a23 (diff)
downloadiced-868f79d22e2be82e98b06d66da3b4cbc6139d7c7.tar.gz
iced-868f79d22e2be82e98b06d66da3b4cbc6139d7c7.tar.bz2
iced-868f79d22e2be82e98b06d66da3b4cbc6139d7c7.zip
Reuse `ClipMask` in `iced_tiny_skia`
Diffstat (limited to 'tiny_skia/src/window/compositor.rs')
-rw-r--r--tiny_skia/src/window/compositor.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/tiny_skia/src/window/compositor.rs b/tiny_skia/src/window/compositor.rs
index 08159cd8..76f371e1 100644
--- a/tiny_skia/src/window/compositor.rs
+++ b/tiny_skia/src/window/compositor.rs
@@ -6,6 +6,7 @@ use raw_window_handle::{HasRawDisplayHandle, HasRawWindowHandle};
use std::marker::PhantomData;
pub struct Compositor<Theme> {
+ clip_mask: tiny_skia::ClipMask,
_theme: PhantomData<Theme>,
}
@@ -83,9 +84,10 @@ impl<Theme> iced_graphics::window::Compositor for Compositor<Theme> {
}
pub fn new<Theme>(settings: Settings) -> (Compositor<Theme>, Backend) {
- // TODO
+ // TOD
(
Compositor {
+ clip_mask: tiny_skia::ClipMask::new(),
_theme: PhantomData,
},
Backend::new(settings),
@@ -93,7 +95,7 @@ pub fn new<Theme>(settings: Settings) -> (Compositor<Theme>, Backend) {
}
pub fn present<Theme, T: AsRef<str>>(
- _compositor: &mut Compositor<Theme>,
+ compositor: &mut Compositor<Theme>,
backend: &mut Backend,
surface: &mut Surface,
primitives: &[Primitive],
@@ -110,6 +112,7 @@ pub fn present<Theme, T: AsRef<str>>(
physical_size.height,
)
.expect("Create pixel map"),
+ &mut compositor.clip_mask,
primitives,
viewport,
background_color,