Skip to main content

skia_rs_gpu/
lib.rs

1//! GPU backends for skia-rs.
2//!
3//! This crate provides hardware-accelerated rendering:
4//! - Vulkan backend (via ash)
5//! - OpenGL backend (via glow)
6//! - Metal backend (via metal-rs)
7//! - WebGPU/cross-platform backend (via wgpu)
8//!
9//! ## Features
10//!
11//! - **Pipeline State Management**: Render and compute pipeline configuration
12//! - **Shader Compilation**: WGSL shader compilation and caching
13//! - **Command Buffer Recording**: Efficient command batching and submission
14//! - **Path Tessellation**: Convert paths to GPU-friendly triangle meshes
15//! - **Stencil-Then-Cover**: Complex path rendering with correct winding rules
16//! - **Atlas Management**: Efficient batching of small elements
17//! - **Glyph Cache**: Fast text rendering with cached glyphs
18//! - **Gradient Textures**: Generate gradient lookup textures
19//! - **Image Tiling**: Tile modes for image rendering
20//! - **MSAA Support**: Multi-sample anti-aliasing
21//! - **SDF Rendering**: Signed distance field for resolution-independent shapes
22
23#![warn(missing_docs)]
24#![warn(clippy::all)]
25
26pub mod atlas;
27pub mod command;
28pub mod context;
29pub mod debug;
30pub mod glyph_cache;
31pub mod gradient;
32pub mod msaa;
33pub mod paint_bridge;
34pub mod pipeline;
35pub mod sdf;
36pub mod shader;
37pub mod stencil_cover;
38pub mod surface;
39pub mod tessellation;
40pub mod texture;
41pub mod tiling;
42
43#[cfg(feature = "wgpu-backend")]
44pub mod wgpu_backend;
45
46#[cfg(feature = "vulkan")]
47pub mod vulkan_backend;
48
49#[cfg(feature = "opengl")]
50pub mod opengl_backend;
51
52// The metal crate only compiles on Apple targets, so gate the backend
53// module on both the feature and the target family.
54#[cfg(all(feature = "metal", any(target_os = "macos", target_os = "ios")))]
55pub mod metal_backend;
56
57pub use atlas::*;
58pub use command::*;
59pub use context::*;
60pub use glyph_cache::*;
61pub use gradient::*;
62pub use msaa::*;
63pub use pipeline::*;
64pub use sdf::*;
65pub use shader::*;
66pub use stencil_cover::*;
67pub use surface::*;
68pub use tessellation::*;
69pub use texture::*;
70pub use tiling::*;
71
72#[cfg(feature = "wgpu-backend")]
73pub use wgpu_backend::*;
74
75#[cfg(feature = "vulkan")]
76pub use vulkan_backend::*;
77
78#[cfg(feature = "opengl")]
79pub use opengl_backend::*;
80
81#[cfg(all(feature = "metal", any(target_os = "macos", target_os = "ios")))]
82pub use metal_backend::*;