Skip to content
Closed
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
32 changes: 31 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,34 @@ Subheadings to categorize changes are `added, changed, deprecated, removed, fixe

This release has an [MSRV][] of 1.86.

### Migration

To continue rendering with Vello you can follow the following migration instructions:

If you previously had codee like:

```rust
let lottie = Composition = ...;
let renderer : velato::Renderer = ...;
let frame : f64 = ...;
let scene : vello::Scene = renderer.render(lottie, frame, Affine::IDENTITY, 1.0);
```

You should replace it with the following:

```rust
let lottie = Composition = ...;
let renderer : velato::Renderer = ...;
let frame : f64 = ...;
let mut scene = vello::Scene::new();
let mut painter = anyrender_vello::VelloScenePainter::new(&mut scene);
renderer.render(lottie, frame, Affine::IDENTITY, 1.0, &mut painter);
```

### Changed

- Velato no longer depends directly on [Vello](https://github.com/linebender/vello). It now depends on the [AnyRender](https://github.com/dioxuslabs/anyrender) rendering abstraction instead. This allows Velato to be integrated with any rendering backend by implementing AnyRender's [PaintScene](https://docs.rs/anyrender/latest/anyrender/trait.PaintScene.html) trait (The AnyRender projects currently provides implementations Vello, Vello CPU, Vello Hybrid, and Skia). ([#92][] by [@nicoburns][])

## [0.8.1]

This release has an [MSRV][] of 1.86.
Expand All @@ -26,7 +54,7 @@ This release has an [MSRV][] of 1.86.

### Added

- Added image schema layer. ([#78][] by [@RobertBrewitz][])
- Added image schema layer.
- Added deserializer to deserialize into the correct Layer type based on the "ty" field. ([#78][] by [@RobertBrewitz][])
- Added twist, stroke_dash, modifier and rounded_corners schema shapes. ([#78][] by [@RobertBrewitz][])
- Added support for trim paths in animations. ([#83][] by [@RobertBrewitz][])
Expand Down Expand Up @@ -137,6 +165,7 @@ This release has an [MSRV][] of 1.75.
[@atoktoto]: https://github.com/atoktoto
[@RishiChalla]: https://github.com/RishiChalla
[@RobertBrewitz]: https://github.com/RobertBrewitz
[@nicoburns]: https://github.com/nicoburns

[#16]: https://github.com/linebender/velato/pull/16
[#17]: https://github.com/linebender/velato/pull/17
Expand All @@ -153,6 +182,7 @@ This release has an [MSRV][] of 1.75.
[#83]: https://github.com/linebender/velato/pull/83
[#84]: https://github.com/linebender/velato/pull/82
[#85]: https://github.com/linebender/velato/pull/85
[#92]: https://github.com/linebender/velato/pull/92

[Unreleased]: https://github.com/linebender/velato/compare/v0.8.1...HEAD
[0.8.1]: https://github.com/linebender/velato/compare/v0.8.0...v0.8.1
Expand Down
72 changes: 69 additions & 3 deletions Cargo.lock

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

13 changes: 11 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -86,22 +86,31 @@ clippy.wildcard_dependencies = "warn"

[workspace.dependencies]
# NOTE: Make sure to keep this in sync with the version badge in README.md
anyrender = { version = "0.6.0" }
anyrender_vello = { version = "0.6.0" }
vello = { version = "0.6.0", default-features = false }
kurbo = { version = "0.12.0" }
peniko = { version = "0.5.0" }

[lints]
workspace = true

[dependencies]
vello = { workspace = true }
anyrender = { workspace = true }
kurbo = { workspace = true }
peniko = { workspace = true }

# For the parser
serde = { version = "1.0.228", features = ["derive"] }
serde_json = "1.0.145"
serde_repr = "0.1.20"

[dev-dependencies]
vello = { workspace = true }
anyrender_vello = { workspace = true }

[target.'cfg(target_arch = "wasm32")'.dev-dependencies]
wasm-bindgen-test = "0.3.56"

[features]
default = []
wgpu = ["vello/wgpu"]
4 changes: 4 additions & 0 deletions examples/scenes/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ publish = false
workspace = true

[dependencies]
anyrender = { workspace = true }
anyrender_vello = { workspace = true }
vello = { workspace = true }
kurbo = { workspace = true }
peniko = { workspace = true }
velato = { path = "../.." }
anyhow = "1"
clap = { version = "4.5.38", features = ["derive"] }
Expand Down
4 changes: 2 additions & 2 deletions examples/scenes/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ pub use lottie::{default_scene, scene_from_files};
pub use simple_text::RobotoText;
pub use test_scenes::test_scenes;

use kurbo::Vec2;
use peniko::{Color, color};
use vello::Scene;
use vello::kurbo::Vec2;
use vello::peniko::{Color, color};

pub struct SceneParams<'a> {
pub time: f64,
Expand Down
8 changes: 6 additions & 2 deletions examples/scenes/src/lottie.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use crate::{ExampleScene, SceneSet};
#[cfg(not(target_arch = "wasm32"))]
use anyhow::{Ok, Result};
use instant::Instant;
use kurbo::{Affine, Vec2};
use std::sync::Arc;
#[cfg(not(target_arch = "wasm32"))]
use std::{
Expand All @@ -15,7 +16,6 @@ use std::{
};
use velato::Composition;
use vello::Scene;
use vello::kurbo::{Affine, Vec2};

#[cfg(not(target_arch = "wasm32"))]
pub fn scene_from_files(files: &[PathBuf]) -> Result<SceneSet> {
Expand Down Expand Up @@ -106,7 +106,11 @@ pub fn lottie_function_of<R: AsRef<str>>(
let frame = ((start.elapsed().as_secs_f64() * lottie.frame_rate)
% (lottie.frames.end - lottie.frames.start))
+ lottie.frames.start;
renderer.render(lottie, frame, Affine::IDENTITY, 1.0)

let mut scene = vello::Scene::new();
let mut painter = anyrender_vello::VelloScenePainter::new(&mut scene);
renderer.render(lottie, frame, Affine::IDENTITY, 1.0, &mut painter);
scene
}
let started = Instant::now();
let mut renderer = velato::Renderer::new();
Expand Down
6 changes: 3 additions & 3 deletions examples/scenes/src/simple_text.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// Copyright 2022 the Velato Authors
// SPDX-License-Identifier: Apache-2.0 OR MIT

use kurbo::Affine;
use peniko::{Blob, Brush, BrushRef, FontData, StyleRef};
use skrifa::MetadataProvider;
use skrifa::raw::FontRef;
use std::sync::Arc;
use vello::kurbo::Affine;
use vello::peniko::{Blob, Brush, BrushRef, FontData, StyleRef};
use vello::{Glyph, Scene};

// This is very much a hack to get things working.
Expand Down Expand Up @@ -113,7 +113,7 @@ impl RobotoText {
transform: Affine,
text: &str,
) {
use vello::peniko::{Color, Fill};
use peniko::{Color, Fill};
let brush = brush.unwrap_or(&Brush::Solid(Color::WHITE));
self.add_run(
scene,
Expand Down
2 changes: 1 addition & 1 deletion examples/scenes/src/test_scenes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0 OR MIT

use crate::{ExampleScene, SceneConfig, SceneParams, SceneSet};
use vello::kurbo::Affine;
use kurbo::Affine;
use vello::*;

macro_rules! scene {
Expand Down
2 changes: 2 additions & 0 deletions examples/with_winit/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ workspace = true

[dependencies]
vello = { workspace = true, features = ["wgpu"] }
kurbo = { workspace = true }
peniko = { workspace = true }
wgpu = { version = "26.0", features = ["vulkan", "metal", "dx12"] }
scenes = { path = "../scenes" }
anyhow = "1"
Expand Down
4 changes: 2 additions & 2 deletions examples/with_winit/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ use std::sync::Arc;

use anyhow::Result;
use clap::{CommandFactory, Parser};
use kurbo::{Affine, Vec2};
use peniko::Color;
use scenes::{RobotoText, SceneParams, SceneSet};
use vello::kurbo::{Affine, Vec2};
use vello::low_level::BumpAllocators;
use vello::peniko::Color;
use vello::util::{RenderContext, RenderSurface};
use vello::{AaConfig, Renderer, RendererOptions, Scene, wgpu};

Expand Down
2 changes: 1 addition & 1 deletion examples/with_winit/src/multi_touch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
/// Adapted from <https://github.com/emilk/egui/blob/212656f3fc6b931b21eaad401e5cec2b0da93baa/crates/egui/src/input_state/touch_state.rs>
use std::{collections::BTreeMap, fmt::Debug};

use vello::kurbo::{Point, Vec2};
use kurbo::{Point, Vec2};
use winit::event::{Touch, TouchPhase};

/// All you probably need to know about a multi-touch gesture.
Expand Down
4 changes: 2 additions & 2 deletions examples/with_winit/src/stats.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// Copyright 2023 the Velato Authors
// SPDX-License-Identifier: Apache-2.0 OR MIT

use kurbo::{Affine, PathEl, Rect, Stroke};
use peniko::{Brush, Color, Fill};
use scenes::RobotoText;
use std::collections::VecDeque;
use vello::kurbo::{Affine, PathEl, Rect, Stroke};
use vello::low_level::BumpAllocators;
use vello::peniko::{Brush, Color, Fill};
use vello::{AaConfig, Scene};

const SLIDING_WINDOW_SIZE: usize = 100;
Expand Down
2 changes: 1 addition & 1 deletion src/import/builders.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use super::defaults::FLOAT_VALUE_ONE_HUNDRED;
use crate::runtime::model::Layer;
use crate::schema::helpers::int_boolean::BoolInt;
use crate::{runtime, schema};
use vello::peniko::{self, BlendMode, Compose, Mix};
use peniko::{self, BlendMode, Compose, Mix};

pub struct LayerSetupParams {
pub layer_index: usize,
Expand Down
4 changes: 2 additions & 2 deletions src/import/converters.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ use crate::schema::animated_properties::split_vector::SplitVector;
use crate::schema::constants::gradient_type::GradientType;
use crate::schema::helpers::int_boolean::BoolInt;
use crate::{Composition, schema};
use kurbo::{Cap, Join, Point, Size, Vec2};
use peniko::{BlendMode, Color, Mix};
use std::collections::HashMap;
use vello::kurbo::{Cap, Join, Point, Size, Vec2};
use vello::peniko::{BlendMode, Color, Mix};

fn process_layers(
source_layers: &[schema::layers::AnyLayer],
Expand Down
Loading