diff options
| author | Sébastien d'Herbais de Thun <sebastien.d.herbais@gmail.com> | 2023-12-30 13:36:15 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-12-30 12:36:15 +0000 |
| commit | c4d9b0c3d8d2cf895137d2047e597fd3e24e0104 (patch) | |
| tree | 679241e556928726824262f65b41fcbcb2fbd4a3 /crates/typst-render | |
| parent | 4e5afa672f502d53e931d432ec1a36bdc6e16583 (diff) | |
New performance timings (#3096)
Co-authored-by: Laurenz <laurmaedje@gmail.com>
Diffstat (limited to 'crates/typst-render')
| -rw-r--r-- | crates/typst-render/Cargo.toml | 2 | ||||
| -rw-r--r-- | crates/typst-render/src/lib.rs | 1 |
2 files changed, 3 insertions, 0 deletions
diff --git a/crates/typst-render/Cargo.toml b/crates/typst-render/Cargo.toml index 546afccb..28033b3e 100644 --- a/crates/typst-render/Cargo.toml +++ b/crates/typst-render/Cargo.toml @@ -17,6 +17,8 @@ bench = false [dependencies] typst = { workspace = true } +typst-macros = { workspace = true } +typst-timing = { workspace = true } bytemuck = { workspace = true } comemo = { workspace = true } flate2 = { workspace = true } diff --git a/crates/typst-render/src/lib.rs b/crates/typst-render/src/lib.rs index b906ac53..34e9b7b3 100644 --- a/crates/typst-render/src/lib.rs +++ b/crates/typst-render/src/lib.rs @@ -24,6 +24,7 @@ use usvg::{NodeExt, TreeParsing}; /// /// This renders the frame at the given number of pixels per point and returns /// the resulting `tiny-skia` pixel buffer. +#[typst_macros::time(name = "render")] pub fn render(frame: &Frame, pixel_per_pt: f32, fill: Color) -> sk::Pixmap { let size = frame.size(); let pxw = (pixel_per_pt * size.x.to_f32()).round().max(1.0) as u32; |
