-
Notifications
You must be signed in to change notification settings - Fork 143
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
Remove SceneBuilder/Fragment #432
Conversation
In a move toward dropping the SceneFragment and SceneBuilder types, this unifies the underlying encoding of Scene and SceneFragment. Specifically, we no longer encode an initial transform and style for Scene. This causes the transform and style indices in the path tag monoid to be off by one. I chose the simple approach of subtracting 1 from each in the combine_tag_monoid() functions in both GPU and CPU code to correct this.
This removes both `SceneBuilder` and `SceneFragment` while moving all of the "builder" methods directly to `Scene`. Based on #426 which must land first.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything looks good and runs without any issues. This change really improves the scene API and resolves some of the long standing issues around its usability. Thank you for tackling it!
@@ -376,7 +376,7 @@ fn run( | |||
height, | |||
antialiasing_method, | |||
}; | |||
let mut builder = SceneBuilder::for_scene(&mut scene); | |||
scene.reset(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like that this is explicit now (instead of implicitly resetting the scene by creating a new fragment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was a definite pain point and we have the complaints to prove it :)
pub struct Scene { | ||
data: Encoding, | ||
encoding: Encoding, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
examples/scenes/src/lib.rs
Outdated
@@ -43,11 +43,11 @@ pub struct ExampleScene { | |||
} | |||
|
|||
pub trait TestScene { | |||
fn render(&mut self, sb: &mut SceneBuilder, params: &mut SceneParams); | |||
fn render(&mut self, sb: &mut Scene, params: &mut SceneParams); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sb
here is short for SceneBuilder
, which is of course no longer accurate
I'm not certain what we should change it to. Maybe scene
would be fine?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, good catch. Renamed all of these (and occurrences of builder
) to scene
.
This removes both
SceneBuilder
andSceneFragment
while moving all of the "builder" methods directly toScene
. Also derivesClone
forScene
.Fixes #342 and subsumes #243.
Based on #426 which must land first.