tiny-skia
is a stripped down [Skia] fork that supports only 2D shapes rendering on a CPU
and provides a Rust API. Designed specifically for [resvg].
Despite being a fork, it's still compatible with a mainline [Skia].
There are no additive modifications.
So you can build it using embedded Skia
or you can provide your own build.
Embedded Skia version: 85
pathops
SkFlattenable
)The full diff can be found at tiny.patch
This reduces the source code size from 370 KLOC down to 80 KLOC. Compilation time from 75s down to 18s on AMD 3700X. And, binary overhead from 3.3MiB down to 0.7MiB on Linux (used config).
Also, the official source tree is 4.3 GiB (with dependencies).
It's recommended to build [Skia] using clang
, therefore we support only clang
too.
Cargo will automatically choose clang
, but you can override it using
CC
and CXX
environment variables.
Also, the embedded version doesn't rely on gn
, cmake
and/or ninja
. Just cargo
.
32-bit version is not supported.
Build:
cargo build --release
No external compile time and/or runtime dependencies required.
Only MSVC toolchain is supported.
Dependencies:
stable-x86_64-pc-windows-msvc
targetBuild:
Open x64 Native Tools Command Prompt for VS 2017 and then:
batch
set PATH="C:\Program Files\LLVM\bin";%PATH%
rustup default stable-x86_64-pc-windows-msvc
cargo build --release
You can bypass embedded [Skia] compilation and jump strait to linking.
To do so, you have to set two environment variables:
SKIA_DIR
should point to a Skia directory that contains the include
directory.SKIA_LIB_DIR
should point to a Skia directory that contains skia.dll
.And then do the same steps as with embedded Skia.
The external Skia version should be the same as embedded one. Other versions are not supported right now, but pull requests are welcome.
skia-c
was originally written
by JaFenix for
[resvg]'s Skia backend. And was based on Qt bindings for resvg.
The same as used by Skia: New BSD License
This licence covers all directories except skia
. This one has its own licence.