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 initial support for OpenHarmony #285

Closed
wants to merge 3 commits into from

Conversation

jschwe
Copy link
Contributor

@jschwe jschwe commented Apr 22, 2024

This adds support all the surfman APIs servo seems to be requiring on OpenHarmony.
Generic surfaces are not supported at the moment.
This patch is heavily based on the existing android implementation.

This adds support all the APIs servo seems to be requiring on OpenHarmony.
This patch is heavily based on the existing android implementation.
// TODO: is `target_os = "linux"` the same as the following check?
linux: { all(unix, not(any(macos, android))) },
linux: { all(unix, not(any(macos, android, ohos))) },
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I believe it might be a good opportunity to rename the linux cfg option to something that makes it more clear, that it is meant for unix systems with x11 or wayland. But I'm not sure what a good name would be.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think this script is just reusing what winit has. Not many other UNIX-like OSes care about desktop environments usually. It's okay to stay linux IMHO.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If it is indeed based on winit, then winit has since changed the names - there is now e.g. free_unix, x11 and wayland.
https://github.com/rust-windowing/winit/blob/master/build.rs
I think it would make sense to rename our cfg flags here to match the ones from winit - would you agree?

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh I didn't realize they changed it. It seems like a good idea!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I opened a seperate PR for the cfg changes in #290

The rust toolchain file overrides the Rust version selected in CI.
To allow testing different rust versions in CI, respect the toolchain
defined in CI.
@wusyong
Copy link
Contributor

wusyong commented Apr 26, 2024

Could it just reuse the same Android implementation and add #[cfg(ohos)] when it's necessary?

@jschwe
Copy link
Contributor Author

jschwe commented Apr 29, 2024

Could it just reuse the same Android implementation and add #[cfg(ohos)] when it's necessary?

Hmm, perhaps the common parts could be extracted to a shared egl implementation.

@jschwe
Copy link
Contributor Author

jschwe commented May 15, 2024

@mrobinson Do you have any opinions regarding this PR and #290? Would you prefer if the android and ohos implementations would be merged into one directory?

@mrobinson
Copy link
Member

@mrobinson Do you have any opinions regarding this PR and #290? Would you prefer if the android and ohos implementations would be merged into one directory?

Sorry for taking so long to look at this. I think that if both platforms use EGL and they have a lot of shared code it probably makes sense to make a shard EGL backend, as you say.

@jschwe
Copy link
Contributor Author

jschwe commented May 24, 2024

Superceded by #293

@jschwe jschwe closed this May 24, 2024
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.

None yet

3 participants