-
Notifications
You must be signed in to change notification settings - Fork 567
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 ability to save a render of a widget to file during tests #527
Comments
I was thinking that i might be able to use this to test how the fill function is working for image and svg. if you point me in the right direction i may be able to help. |
There's an example of writing a piet context to an image in piet itself: https://github.com/linebender/piet/tree/master/piet-cairo/examples/basic-cairo.rs |
^^ That is cairo only example, common one is here https://github.com/linebender/piet/blob/master/piet-common/examples/png.rs |
I played around with this a week or two ago, you can maybe use this as somewhere to start? https://github.com/xi-editor/druid/tree/write-image-in-tests |
I have been busy using druid rather then developing it recently, I want to circle back to this soon. thanks for all the links they all look really useful! |
closed in #784 |
This would be a debug tool, but I think it would be quite useful; basically it would be helpful if there was a method on the test harness, like
paint_to_file(path: AsRef<Path>)
that would call paint, and then write the buffer to disk.This is currently blocked on linebender/piet#132, which will provide us with an API in
piet_common
that we can use to write a png.One thing I'm not sure about is whether or not we will be able to continue calling harness methods after doing this; it's possible that it consumes the render context. That's okay, though, for our purposes.
The text was updated successfully, but these errors were encountered: