Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 15 additions & 14 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ members = [
"crates/wgpu_context",
"crates/pixels_window_renderer",
"crates/softbuffer_window_renderer",
"examples/winit",
"examples/player",
"examples/bunnymark",
"examples/serialize",
]
Expand Down
5 changes: 5 additions & 0 deletions crates/anyrender/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
//! - [anyrender_vello](https://docs.rs/anyrender_vello)
//! - [anyrender_vello_cpu](https://docs.rs/anyrender_vello_cpu)

#![allow(clippy::collapsible_if)]

use kurbo::{Affine, Rect, Shape, Stroke};
use peniko::{BlendMode, Brush, Color, Fill, FontData, ImageBrushRef, StyleRef};
use recording::RenderCommand;
Expand All @@ -41,6 +43,9 @@ pub use null_backend::*;
pub mod recording;
pub use recording::Scene;

#[cfg(feature = "serde")]
mod svg_path_parser;

/// Abstraction for rendering a scene to a window
pub trait WindowRenderer {
type ScenePainter<'a>: PaintScene
Expand Down
4 changes: 3 additions & 1 deletion crates/anyrender/src/recording.rs
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,8 @@ mod svg_path {
use kurbo::BezPath;
use serde::{self, Deserialize, Deserializer, Serializer};

use crate::svg_path_parser;

pub fn serialize<S>(path: &BezPath, serializer: S) -> Result<S::Ok, S::Error>
where
S: Serializer,
Expand All @@ -311,6 +313,6 @@ mod svg_path {
D: Deserializer<'de>,
{
let s = String::deserialize(deserializer)?;
BezPath::from_svg(&s).map_err(serde::de::Error::custom)
svg_path_parser::parse_svg_path(&s).map_err(serde::de::Error::custom)
}
}
Loading
Loading