summaryrefslogtreecommitdiffstats
path: root/tiny_skia/src/vector.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tiny_skia/src/vector.rs')
-rw-r--r--tiny_skia/src/vector.rs21
1 files changed, 19 insertions, 2 deletions
diff --git a/tiny_skia/src/vector.rs b/tiny_skia/src/vector.rs
index fd1ab3de..bbe08cb8 100644
--- a/tiny_skia/src/vector.rs
+++ b/tiny_skia/src/vector.rs
@@ -4,11 +4,13 @@ use crate::graphics::text;
use resvg::usvg::{self, TreeTextToPath};
use rustc_hash::{FxHashMap, FxHashSet};
+use tiny_skia::Transform;
use std::cell::RefCell;
use std::collections::hash_map;
use std::fs;
+#[derive(Debug)]
pub struct Pipeline {
cache: RefCell<Cache>,
}
@@ -32,7 +34,9 @@ impl Pipeline {
handle: &Handle,
color: Option<Color>,
bounds: Rectangle,
+ opacity: f32,
pixels: &mut tiny_skia::PixmapMut<'_>,
+ transform: Transform,
clip_mask: Option<&tiny_skia::Mask>,
) {
if let Some(image) = self.cache.borrow_mut().draw(
@@ -44,8 +48,11 @@ impl Pipeline {
bounds.x as i32,
bounds.y as i32,
image,
- &tiny_skia::PixmapPaint::default(),
- tiny_skia::Transform::identity(),
+ &tiny_skia::PixmapPaint {
+ opacity,
+ ..tiny_skia::PixmapPaint::default()
+ },
+ transform,
clip_mask,
);
}
@@ -203,3 +210,13 @@ impl Cache {
self.raster_hits.clear();
}
}
+
+impl std::fmt::Debug for Cache {
+ fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+ f.debug_struct("Cache")
+ .field("tree_hits", &self.tree_hits)
+ .field("rasters", &self.rasters)
+ .field("raster_hits", &self.raster_hits)
+ .finish_non_exhaustive()
+ }
+}