1[package]
2name = "skia-safe"
3
4description = "Safe Skia Bindings for Rust"
5homepage = "https://github.com/rust-skia/rust-skia"
6repository = "https://github.com/rust-skia/rust-skia"
7documentation = "https://rust-skia.github.io/doc/skia_safe"
8readme = "README.md"
9# 5 max
10keywords = ["skia", "rust-bindings", "vulkan", "opengl", "pdf"]
11# 6 max
12categories = [
13 "api-bindings",
14 "graphics",
15 "multimedia::images",
16 "rendering::graphics-api",
17 "visualization",
18]
19license = "MIT"
20
21version = "0.84.0"
22authors = ["Armin Sander <armin@replicator.org>"]
23edition = "2021"
24rust-version.workspace = true
25
26[lib]
27doctest = false
28
29[features]
30default = ["binary-cache", "embed-icudtl"]
31all-linux = ["gl", "egl", "vulkan", "x11", "wayland", "textlayout", "svg", "webp"]
32all-windows = ["gl", "vulkan", "d3d", "textlayout", "svg", "webp"]
33all-macos = ["gl", "vulkan", "metal", "textlayout", "svg", "webp"]
34gl = ["gpu", "skia-bindings/gl"]
35egl = ["gl", "skia-bindings/egl"]
36x11 = ["gl", "skia-bindings/x11"]
37wayland = ["egl", "skia-bindings/wayland"]
38vulkan = ["gpu", "skia-bindings/vulkan"]
39metal = ["gpu", "skia-bindings/metal"]
40d3d = ["gpu", "windows", "skia-bindings/d3d"]
41textlayout = ["skia-bindings/textlayout"]
42svg = ["skia-bindings/svg", "dep:base64", "dep:percent-encoding", "skia-svg-macros"]
43ureq = ["dep:ureq"]
44webp = ["webp-encode", "webp-decode"]
45webp-encode = ["skia-bindings/webp-encode"]
46webp-decode = ["skia-bindings/webp-decode"]
47use-system-jpeg-turbo = ["skia-bindings/use-system-jpeg-turbo"]
48binary-cache = ["skia-bindings/binary-cache"]
49embed-icudtl = ["skia-bindings/embed-icudtl"]
50embed-freetype = ["skia-bindings/embed-freetype"]
51freetype-woff2 = ["skia-bindings/freetype-woff2"]
52# test only
53save-svg-images = []
54
55# implied only, do not use
56gpu = []
57shaper = ["textlayout", "skia-bindings/shaper"]
58
59# vulkan-window example
60vulkan-window = ["dep:ash", "dep:vulkano", "winit/rwh_05"]
61
62[dependencies]
63bitflags = "2.0"
64lazy_static = "1.4"
65skia-bindings = { version = "=0.84.0", path = "../skia-bindings", default-features = false }
66
67# vulkan-window example
68ash = { version = "^0.38.0", optional = true }
69vulkano = { version = "0.35", optional = true }
70
71# D3D types & ComPtr
72windows = { version = "0.61.1", features = [
73 "Win32",
74 "Win32_Graphics",
75 "Win32_Graphics_Dxgi",
76 "Win32_Graphics_Direct3D12",
77 "Win32_Graphics_Direct3D",
78 "Win32_Foundation",
79 "Win32_Graphics_Dxgi_Common",
80], optional = true }
81
82# svg
83ureq = { version = "3.0.4", optional = true }
84base64 = { version = "0.22.0", optional = true }
85percent-encoding = { version = "2.3.1", optional = true }
86skia-svg-macros = { version = "0.1.0", path = "../skia-svg-macros", optional = true }
87
88[dev-dependencies]
89serial_test = "3.0"
90static_assertions = "1.1"
91winit = "0.30.2"
92
93# gl-window
94[target.'cfg(all(not(target_os = "android"), not(target_os = "emscripten"), not(target_os = "ios")))'.dev-dependencies]
95glutin = "0.32.0"
96glutin-winit = "0.5.0"
97raw-window-handle = "0.6.0"
98gl-rs = { version = "0.14.0", package = "gl" }
99
100# metal-window
101[target.'cfg(target_os = "macos")'.dev-dependencies]
102metal-rs = { package = "metal", version = "0.24.0" }
103raw-window-handle = "0.6.0"
104objc = "0.2.7"
105cocoa = "0.26.0"
106core-graphics-types = "0.1.1"
107foreign-types-shared = "0.1.1"
108
109# d3d-window
110[target.'cfg(target_os = "windows")'.dev-dependencies]
111anyhow = { version = "1.0.75" }
112windows = { version = "0.61.1", features = [
113 "Win32",
114 "Win32_Graphics",
115 "Win32_Graphics_Dxgi",
116 "Win32_Graphics_Direct3D12",
117 "Win32_Graphics_Direct3D",
118 "Win32_Foundation",
119 "Win32_Graphics_Dxgi_Common",
120] }
121