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

Add ability to save a render of a widget to file during tests #527

Closed
cmyr opened this issue Feb 7, 2020 · 6 comments
Closed

Add ability to save a render of a widget to file during tests #527

cmyr opened this issue Feb 7, 2020 · 6 comments
Assignees
Labels
D-Easy just needs to be implemented help wanted has no one working on it yet

Comments

@cmyr
Copy link
Member

cmyr commented Feb 7, 2020

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.

@cmyr cmyr added help wanted has no one working on it yet D-Easy just needs to be implemented labels Feb 7, 2020
@fishrockz
Copy link
Collaborator

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.

@futurepaul
Copy link
Collaborator

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

@Dmitry-Borodin
Copy link
Collaborator

^^ That is cairo only example, common one is here https://github.com/linebender/piet/blob/master/piet-common/examples/png.rs

@cmyr
Copy link
Member Author

cmyr commented Feb 20, 2020

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

@fishrockz
Copy link
Collaborator

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!

@fishrockz fishrockz self-assigned this Mar 26, 2020
@totsteps
Copy link
Collaborator

closed in #784

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
D-Easy just needs to be implemented help wanted has no one working on it yet
Projects
None yet
Development

No branches or pull requests

5 participants