Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bring more of the Velato runtime, including Composition, Renderer. #15

Merged

Conversation

waywardmonkeys
Copy link
Collaborator

This code will need a lot of enhancements and improvements, but it is still very close to what was in Velato with only minimal changes.

This brings an optional dependency on Vello so that the Renderer can be used to create a Vello Scene from the animation and composition data.

@waywardmonkeys waywardmonkeys force-pushed the bring-more-of-velato-runtime branch from 71688cc to dc853aa Compare September 14, 2024 16:50
This code will need a lot of enhancements and improvements, but it
is still very close to what was in Velato with only minimal changes.

This brings an optional dependency on Vello so that the `Renderer`
can be used to create a Vello `Scene` from the animation and
composition data.
@waywardmonkeys waywardmonkeys force-pushed the bring-more-of-velato-runtime branch from dc853aa to 53c4ce6 Compare September 14, 2024 16:58
@waywardmonkeys
Copy link
Collaborator Author

There's a reasonable argument that some of this should be elsewhere and not in interpoli itself.

But we don't have another place yet, we don't have a clear idea of which pieces would belong where, and we're not sure which pieces will survive the coming refactors and changes ...

So this gets stuff moved to where we can start iterating, and we can always think about splitting up the crate further in the future.

@xorgy
Copy link
Member

xorgy commented Sep 14, 2024

There's a reasonable argument that some of this should be elsewhere and not in interpoli itself.
...

I've filed #16 to track the work of making interpoli multi-crate.

Copy link
Member

@xorgy xorgy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are design improvements that should follow after this, but we know this code works and it is not crazy.

/// Frames in which the animation is active.
pub frames: Range<f64>,
/// Frames per second.
pub frame_rate: f64,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Improvement: The interval of frames should not be fixed in the composition, but encoded on the frames themselves.
Filed as #17

pub height: f64,
/// Blend mode for the layer.
pub blend_mode: Option<peniko::BlendMode>,
/// Range of frames in which the layer is active.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are hax to address the design issue of putting frame_rate on Composition, which should be addressed by the change in #17

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

frames is not related to that ... That's so that a layer can be active for some subset of the full composition.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They are relative to the Composition's rate though, right?

@xorgy xorgy added this to the Interpoli Compose milestone Sep 14, 2024
pub height: usize,
/// Precomposed layers that may be instanced.
#[cfg(feature = "std")]
pub assets: HashMap<String, Vec<Layer>>,
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made this #[cfg(feature = "std")] to keep it compiling as it is to get it landed.

After it lands, I'll replace with hashbrown so that no_std works (with alloc).

@waywardmonkeys waywardmonkeys added this pull request to the merge queue Sep 16, 2024
Merged via the queue into linebender:main with commit 71eaf45 Sep 16, 2024
15 checks passed
@waywardmonkeys waywardmonkeys deleted the bring-more-of-velato-runtime branch September 16, 2024 11:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants