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 support #128

Closed
jjl opened this issue Aug 24, 2019 · 3 comments · Fixed by #759
Closed

wasm support #128

jjl opened this issue Aug 24, 2019 · 3 comments · Fixed by #759

Comments

@jjl
Copy link
Contributor

jjl commented Aug 24, 2019

Hi Raph,

I thought i'd have a go at making druid work with wasm, since piet appears to support it (although curiously with the web feature rather than selecting by target architecture?).

druid-shell brings up 8 errors when i try and do it there. my gut feeling is that this is probably not the place to make the change, since the errors are for Window, WindowBuilder etc.
Trying to make the changes in in druid itself is definitely less good, with rustc giving up after 200 errors.

I know you've said it's probably a bit early to be worrying about too many backends, but given the logistical differences with this one, i thought it would be a good test of druid's design.

I'm willing to continue with the work as i'm able, but i think i'm going to need some guidance on the best way to go about it to get any further.

@raphlinus
Copy link
Contributor

You probably want to start with #30, as it has been working at some point.

The piet-common layer should be selecting the web backend automatically with the wasm32 target.

@jjl
Copy link
Contributor Author

jjl commented Aug 24, 2019

After an uneventful rebase, this branch seems to compile and run in the browser. Numbers and clearing seem to work, but there's what looks like a width calculation problem, so I can't try arithmetic operations because they're clipped. Going to look into that

@jjl
Copy link
Contributor Author

jjl commented Aug 24, 2019

investigation shows this was related to DPI - specifically that canvas defaults to 96dpi. I'm going to try and enable a high-dpi canvas with this technique, but setting dpr to 1 makes it render correctly at lower dpi.

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 a pull request may close this issue.

2 participants