skia-rs-gpu 0.2.0

GPU backends for skia-rs
docs.rs failed to build skia-rs-gpu-0.2.0
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.
Visit the last successful build: skia-rs-gpu-0.1.0

skia-rs-gpu

GPU backends for skia-rs, a pure Rust implementation of the Skia 2D graphics library.

Features

  • wgpu backend: Cross-platform GPU rendering (default)
  • Vulkan backend: Native Vulkan support (planned)
  • OpenGL backend: OpenGL ES 2.0+ / OpenGL 3.0+ (planned)

Feature Flags

Feature Default Description
wgpu-backend wgpu cross-platform backend
vulkan Native Vulkan backend
opengl OpenGL/OpenGL ES backend

Usage

use skia_rs_gpu::{WgpuContext, WgpuSurface};

// Create a GPU context
let context = WgpuContext::new()?;

// Create a GPU-backed surface
let surface = WgpuSurface::new(&context, 800, 600)?;

// Draw on the canvas (same API as CPU)
let canvas = surface.canvas();
canvas.clear(Color::WHITE);
canvas.draw_rect(&rect, &paint);

// Present to screen
surface.present();

Status

⚠️ GPU backends are currently in development. The wgpu backend is functional for basic operations.

License

MIT OR Apache-2.0

See the main repository for more information.