Thank you for considering to contribute to rust-skia.
We welcome all contributions. Most likely, a large part of your contribution will be Rust code.
The repository consists of two primary cargo packages in the folders skia-bindings and skia-safe. skia-bindings contains the build support for Skia and the C++ bindings. skia-safe contains all the Rust code that wraps the Skia APIs.
We did our best to cover most of the Skia API, but you'll find a lot of blind spots by looking closer:
- GPU API support is incomplete, specifically functions that use callbacks.
For larger contributions, familiarize yourself with the various wrapper types and consider filing an issue beforehand to give us a heads up and to receive additional directions.
Documentation porting is welcome too. Good documentation is just as important as code, and much of the Skia API surface still lacks it. Porting documentation from the Skia C++ headers into the Rust wrappers is a valuable contribution on its own — you don't need to touch any code. To learn the conventions we use, follow the guidance in cpp-to-rust-documentation — it explains how to port C++ header docs to the corresponding Rust APIs, and how to word them so they render correctly in rustdoc. Even porting a single function's documentation is appreciated.
Examples should be added to skia-safe/examples or directly to the skia-org executable which provides a minimal infrastructure to render to PNG, PDF, and SVG files using the CPU or the GPU backends.
To contribute Rust code, format the code with cargo fmt and be sure that there are no warnings with cargo clippy. Don't try too hard to follow Clippy suggestions. If a warning does not make sense, add a comment that explains why and allow it explicitly with an attribute such as #[allow(clippy::some_lint)].
If possible, add a small test case for your changes.
In your PR description, say how you verified your change: which tests or examples you ran, and on which platform and backend. This matters most for code the CI cannot run, such as GPU backends or targets it only builds for. Please submit only changes you understand and can explain during review.
Your PR will be built for and tested on a number of targets on the CI before it can be merged. If that fails, we will do our best to help out.
We often merge a PR that is good enough as a first iteration and then make corrections ourselves, instead of asking you for another round. If your PR allows edits from maintainers, we may also push corrections directly to its branch. So don't depend on that branch elsewhere, for example as a git dependency, because its history may change. Either way, we say so in the PR.
If you'd like the changes in your PR to be released to crates.io timely, please say so, because we prefer to align crate releases with major updates to Chrome stable.
Please ensure that the code you contribute is compatible with the MIT license.