Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Imaging Skia
Skia backend for the imaging command stream.
Skia backend for imaging.
This crate provides a CPU raster renderer that consumes imaging::record::Scene or native
Skia draw targets and produces an RGBA8 image buffer using Skia.
Render A Recorded Scene
Record commands into imaging::record::Scene, then hand the scene to SkiaCpuRenderer.
use ;
use SkiaCpuRenderer;
use Rect;
use ;
Draw Into An Existing Canvas
If you already have a Skia canvas, wrap it with SkCanvasSink and stream commands directly.
use Painter;
use SkCanvasSink;
use Rect;
use ;
use surfaces;
Record A SkPicture
Use SkPictureRecorderSink when you want Skia's native retained recording format.
use Painter;
use SkPictureRecorderSink;
use Rect;
use ;
Render A Native SkPicture
If you already have a recorded picture, hand it directly to SkiaCpuRenderer.
use Painter;
use ;
use Rect;
use ;
GPU Rendering
Enable the gpu feature when you want Skia Ganesh rendering through app-owned wgpu
handles. SkiaRenderer reuses the current backend selected by wgpu and renders
native skia_safe::Picture values into caller-owned wgpu::Texture targets while also
supporting RGBA8 image output.
use ;
use SkiaRenderer;
use Rect;
use ;
let mut scene = new;
let mut renderer = new?;
let picture = renderer.encode_scene?;
renderer.render_picture_to_texture?;
Building
skia-safe / skia-bindings normally download prebuilt Skia binaries at build time. In offline
or sandboxed environments, set SKIA_BINARIES_URL to a local tar.gz downloaded ahead of time:
SKIA_BINARIES_URL='file:///absolute/path/to/skia-binaries-....tar.gz'
Minimum supported Rust Version (MSRV)
This crate has been verified to compile with Rust 1.92 and later.
License
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0), or
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT),
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
Contribution
Contributions are welcome by pull request. The Rust code of conduct applies. Please feel free to add your name to the AUTHORS file in any substantive pull request.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.