-
Notifications
You must be signed in to change notification settings - Fork 768
Add path drawing to software renderer #9894
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
Add path drawing to software renderer #9894
Conversation
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.
Really nice, thank you very much.
Just one detail would be to try to keep this optional when running on MCU in no_std environment where we want to keep the binary as small as possible.
04b6b70 to
ca423fe
Compare
|
I'm not entirely sure why the build failed there |
We've seen that error before. I think this could be that the CI machine runs out of memory. Re-trying. |
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 is good.
And it really doesn't impact anyone who is not opting it for it.
And so I see no objections in merging it.
But on the other hand, this is never used.
User only can opt in to it by enabling internal crate.
I think it should be done similar to software-renderer-systemfonts:
- enabled by default for linuxkms and winit backend
- have a way to enable it from the
slintcrate features.
I would say that ideally the feature should automatically be enabled if both std and software-renderer feature are on, but I think that's a bit hard to do with Cargo. Unless we split the software renderer in its own crate, but that's another thing.
This is my first real foray into graphics programming (and serious Rust), so please forgive me for any mistakes.
This adds path rendering support to the software renderer with the Zeno crate as per the recommendation at #4178 (comment). This closes #4178 and would supersede #6032.
In theory this should be no_std compatible, but that's currently blocked by lyon_path/lyon_geom requiring std due to a bug in lyon_geom. Once the PR addressing that is merged we could move lyon_path/lyon_geom off of the std feature and use their internal dependents (PathDataIterator) in a no_std environment.
Details:
ProcessScenetraitRenderToBuffer<'_, B>, notPrepareScene, since I didn't add path rendering variants to SceneCommand, and there's not really an easy way to render paths line-by-line that I could think of. Suggestions welcome!I ran into this because we needed it for a hardware simulator for an embedded device potentially using slint, where the simulator GUI is using Iced and embedding the output of the Slint software renderer into the location of the display. Some of our elements are Paths since they're directly imported from an SVG/design file.