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

Wasm bitmap target #167

Merged
merged 5 commits into from
Apr 27, 2020
Merged

Wasm bitmap target #167

merged 5 commits into from
Apr 27, 2020

Conversation

elrnv
Copy link
Contributor

@elrnv elrnv commented Apr 12, 2020

This PR adds a placeholder for the bitmap target rendering mechanism present in other backends. In the current state this PR will enable druid unit tests to be built with WASM, although their execution will need to be thought out further.

I intend this PR to simply get the ball rolling toward getting testing working for the wasm backend in druid since linebender/druid#759 doesn't provide any testing in wasm.

@cmyr
Copy link
Member

cmyr commented Apr 15, 2020

@elrnv any suggestions for how I should test that this is working as intended?

@elrnv
Copy link
Contributor Author

elrnv commented Apr 15, 2020

Yes! In druid, remove the #[cfg(not(target_arch = "wasm32"))] instances in /src/window.rs, /src/lib.rs and /src/event.rs and compile against this PR. The compile errors should be removed.

@elrnv
Copy link
Contributor Author

elrnv commented Apr 17, 2020

I should emphasize that this is just a placeholder for the implementation. I'm not sure yet how to actually test it.

@cmyr
Copy link
Member

cmyr commented Apr 21, 2020

this is maybe a bit daft, but what target tam I building? I can't seem to get compilation to fail even without this PR. 😕

@elrnv
Copy link
Contributor Author

elrnv commented Apr 21, 2020

Ah sorry, I should have been more clear. I guess the idea is that the test harness in druid fails to build without this bitmap target, so to trigger the build of the test harness in druid (for wasm) you need

cargo test --no-run --target wasm32-unknown-unknown

Of course on top of removing the #[cfg(not(target_arch = "wasm32"))] instances, you also need to add something like

[patch.crates-io]
piet-common = { git = "https://github.com/elrnv/piet.git", branch = "wasm-bitmap-target", features = ["png"] }

To the top level Cargo.toml to ensure that the right piet-common version is being pulled.

(BTW It seems like I had some things missing for some reason, but I think the issues should be fixed now).

Copy link
Member

@cmyr cmyr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the walk through, this works for me!

@cmyr cmyr merged commit c54ef80 into linebender:master Apr 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants