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

Support latest skia #293

Closed
RazrFalcon opened this issue Jun 3, 2020 · 22 comments
Closed

Support latest skia #293

RazrFalcon opened this issue Jun 3, 2020 · 22 comments

Comments

@RazrFalcon
Copy link
Owner

No description provided.

@Brooooooklyn
Copy link

Brooooooklyn commented Jun 3, 2020

Recommend https://github.com/rust-skia/rust-skia, we will always sync with the latest skia

@RazrFalcon
Copy link
Owner Author

It's a very heavy dependency. It requires 100 dependencies on linux. This is no go for me.

@Brooooooklyn
Copy link

It's a very heavy dependency. It requires 100 dependencies on linux.

Oh, that's weird, we should have no extra dependencies if our prebuild script worked fine. Shouldn't we ? @pragmatrix

@pragmatrix
Copy link

pragmatrix commented Jun 3, 2020

The set of dependencies is statically determined by cargo, which means that as long we support a fallback to the full Skia build, the dependencies include all the crates that are needed for that.

To mitigate that, we could add a feature for the full build to rust-skia, set this as the default to keep the compatilibity, and resvg could then specify the an empty feature set by default to keep the dependencies to a minimum (excluding dev-deps ~39 vs. ~100 on Windows for CPU rendering). If needed, users of resvg may re-enable the full build by patching the skia-safe dependency.

Besides of that, the API differs from the Skia backend that is used by resvg (which AFAIK is based on the C API), so we need to port the backend drawing code to skia-safe and test it before even considering the integration. I could offer to do that and, also test a bit, and also keep it updated to the latest Skia milestones if needed, but in return I would need a strong commitment from the community around resvg that the rust-skia backend is kept updated in terms of resvg features in the foreseeable future.

@RazrFalcon
Copy link
Owner Author

@pragmatrix The current resvg skia bindings has just a single dependency - cc. So even 39 is too much. This is especially critical, since it will affect vendored archive, which includes all dependencies.

So the only way for me to use skia-safe is too have an option to select a prebuilt skia. And this variant should depend only on cc for linkage.

@pragmatrix
Copy link

@RazrFalcon What do you mean by "select a prebuilt skia" exactly? Does that mean that your build script or a manual process provides a suitable platform binary from https://github.com/rust-skia/skia-binaries/releases extracts them and sets up an environment variable so that - say a build.rs - can be used to inform cargo about how and what to link? This way, I think we can get the dependencies down to 3 (bitflags, lazy_static, and skia-bindings), and we would not need cc, because our prebuilt packages already include the compiled bindings.

@RazrFalcon
Copy link
Owner Author

Right now, resvg simply requires setting a path to a prebuilt skia. How you built it or where you get it in the first place, we don't care.

Anyway, the skia backend future is a bit vague. So for me, this more about maintaining the current setup rather than finding new solutions.

@pragmatrix
Copy link

I see, but just to be clear, given that the discussed preconditions are met, you are open to add a second skia backend as an option if someone is driving demand for that?

@RazrFalcon
Copy link
Owner Author

The current direction is to remove all backends altogether in favor of raqote.

@Absolucy
Copy link

Absolucy commented Jul 4, 2020

The current direction is to remove all backends altogether in favor of raqote.

@RazrFalcon Well, that aged well. Skia is a pain in the ass.

@RazrFalcon
Copy link
Owner Author

@Luxxxxy Well, raqote is basically alpha-quality. And Skia is the best 2D library in existence. So the choice was obvious.

@Absolucy
Copy link

Absolucy commented Jul 4, 2020

@RazrFalcon problem is it's impossible to compile

@RazrFalcon
Copy link
Owner Author

@Luxxxxy Again, there are no other choice.

@Absolucy
Copy link

Absolucy commented Jul 4, 2020

@RazrFalcon at least provide semi-useful documentation on how the hell to make it compile properly. I couldn't figure it out on either Windows or Linux. Skia isn't even in the fuckin' AUR (well, skia-git is, but that just errors out) or Homebrew.

@RazrFalcon
Copy link
Owner Author

https://github.com/RazrFalcon/tiny-skia#build-with-embedded-skia ?

Skia isn't even in the fuckin' AUR (well, skia-git is, but that just errors out) or Homebrew.

This is up to Google.

@Absolucy
Copy link

Absolucy commented Jul 4, 2020

@RazrFalcon Huh, this works now, even though I remember it not working earlier.

@Absolucy
Copy link

Absolucy commented Jul 7, 2020

@RazrFalcon I'm not sure that Skia works on platforms such as RISC-V, though.

@RazrFalcon
Copy link
Owner Author

@Luxxxxy I don't care about those platforms.

@Absolucy
Copy link

Absolucy commented Jul 7, 2020

Sorry if this comes off as rude, but only caring about x86 is a very quick way to ensure your library never sees any big use.

@RazrFalcon
Copy link
Owner Author

Well, you can always port Skia to Rust. This would help a lot. But you won't. Because you're not Google. End of story.

Anyway, resvg is still the most cross-platform one. The next closest one feature-wise is librsvg, and it supports only Linux+Gnome. So... make your choice.

@Absolucy
Copy link

Absolucy commented Jul 7, 2020

I mean, you ditched a fully Rust-based backend...

@RazrFalcon
Copy link
Owner Author

Raqote? It supports like 1% of Skia features and very buggy and slow.

Again, you can spend your time making it better. I can't. That's why I'm using Skia.

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

No branches or pull requests

4 participants