Add path drawing to software renderer#9894
Conversation
ogoffart
left a comment
There was a problem hiding this comment.
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. |
ogoffart
left a comment
There was a problem hiding this comment.
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.
The PR #9894 implemented support for Path, made a public feature for it similar to `software-renderer-systemfonts` Note that since the feature is enabled by default with winit, the "simulator" mode of the mcu examples also enable it. And it can't be disabled. But there is still a warning in the compiler when using `Path` element and `EmbedForSoftwareRenderer` is used as this generally mean that this is for MCU which still can't render `Path`
The PR #9894 implemented support for Path, made a public feature for it similar to `software-renderer-systemfonts` Note that since the feature is enabled by default with winit, the "simulator" mode of the mcu examples also enable it. And it can't be disabled. But there is still a warning in the compiler when using `Path` element and `EmbedForSoftwareRenderer` is used as this generally mean that this is for MCU which still can't render `Path`
|
Any plans to support this in |
I've got a branch with the relevant changeset, just haven't rebased on current master and created a PR yet. |
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.