[package]
name = "skia-safe"

description = "Safe Skia Bindings for Rust"
homepage = "https://github.com/rust-skia/rust-skia"
repository = "https://github.com/rust-skia/rust-skia"
documentation = "https://rust-skia.github.io/doc/skia_safe"
readme = "README.md"
# 5 max
keywords = ["skia", "rust-bindings", "vulkan", "opengl", "pdf"]
# 6 max
categories = [
    "api-bindings",
    "graphics",
    "multimedia::images",
    "rendering::graphics-api",
    "visualization",
]
license = "MIT"

version = "0.97.0"
authors = ["Armin Sander <armin@replicator.org>"]
edition = "2021"
rust-version.workspace = true

[lib]
doctest = false

[features]
default = ["binary-cache", "embed-icudtl", "pdf", "jpeg"]
all-linux = ["gl", "egl", "vulkan", "x11", "wayland", "textlayout", "svg", "skottie", "webp"]
all-windows = ["gl", "vulkan", "d3d", "textlayout", "svg", "skottie", "webp"]
all-macos = ["gl", "vulkan", "metal", "textlayout", "svg", "skottie", "webp"]
gl = ["gpu", "skia-bindings/gl"]
egl = ["gl", "skia-bindings/egl"]
x11 = ["gl", "skia-bindings/x11"]
wayland = ["egl", "skia-bindings/wayland"]
vulkan = ["gpu", "skia-bindings/vulkan"]
metal = ["gpu", "skia-bindings/metal"]
d3d = ["gpu", "windows", "skia-bindings/d3d"]
textlayout = ["skia-bindings/textlayout"]
svg = ["skia-bindings/svg", "dep:base64", "dep:percent-encoding", "skia-svg-macros"]
skottie = ["skia-bindings/skottie", "textlayout", "dep:base64", "dep:percent-encoding"]
pdf = ["skia-bindings/pdf", "jpeg"]
jpeg = ["skia-bindings/jpeg"]
ureq = ["dep:ureq"]
webp = ["webp-encode", "webp-decode"]
webp-encode = ["skia-bindings/webp-encode"]
webp-decode = ["skia-bindings/webp-decode"]
use-system-jpeg-turbo = ["skia-bindings/use-system-jpeg-turbo"]
binary-cache = ["skia-bindings/binary-cache"]
embed-icudtl = ["skia-bindings/embed-icudtl"]
embed-freetype = ["skia-bindings/embed-freetype"]
freetype-woff2 = ["skia-bindings/freetype-woff2"]
no-compile = ["skia-bindings/no-compile"]
# test only
save-svg-images = []

# implied only, do not use
gpu = []

[dependencies]
bitflags = "2.0"
skia-bindings = { version = "=0.97.0", path = "../skia-bindings", default-features = false }


# D3D types & ComPtr
windows = { version = "0.62.0", features = [
    "Win32",
    "Win32_Graphics",
    "Win32_Graphics_Dxgi",
    "Win32_Graphics_Direct3D12",
    "Win32_Graphics_Direct3D",
    "Win32_Foundation",
    "Win32_Graphics_Dxgi_Common",
], optional = true }

# svg
ureq = { version = "3.0.4", optional = true }
base64 = { version = "0.22.0", optional = true }
percent-encoding = { version = "2.3.1", optional = true }
skia-svg-macros = { version = "0.1.0", path = "../skia-svg-macros", optional = true }

[dev-dependencies]

serial_test = "3.0"
static_assertions = "1.1"
winit = "0.30.2"

# gl-window & vulkan-window
[target.'cfg(all(not(target_os = "android"), not(target_os = "emscripten"), not(target_os = "ios")))'.dev-dependencies]
glutin = "0.32.0"
glutin-winit = "0.5.0"
raw-window-handle = "0.6.0"
gl-rs = { version = "0.14.0", package = "gl" }

# vulkan-window example
ash = { version = "^0.38.0" }
vulkano = { version = "0.35" }

# metal-window
[target.'cfg(any(target_os = "macos", target_os = "ios"))'.dev-dependencies]
objc2 = { version = "0.6.3", default-features = false }
objc2-core-foundation = { version = "0.3.2", default-features = false }
objc2-metal = { version = "0.3.2", default-features = false, features = ["MTLCommandBuffer", "MTLCommandQueue", "MTLDrawable", "MTLPixelFormat"] }
objc2-quartz-core = { version = "0.3.2", default-features = false, features = ["objc2-core-foundation", "objc2-metal", "CAMetalLayer"] }
raw-window-handle = "0.6.0"

# metal-window (macOS)
[target.'cfg(target_os = "macos")'.dev-dependencies]
objc2-app-kit = { version = "0.3.2", default-features = false, features = ["objc2-quartz-core", "NSView", "NSResponder"] }

# metal-window (iOS)
[target.'cfg(target_os = "ios")'.dev-dependencies]
objc2-ui-kit = { version = "0.3.2", default-features = false, features = ["objc2-quartz-core", "UIView", "UIResponder"] }

# d3d-window
[target.'cfg(target_os = "windows")'.dev-dependencies]
anyhow = { version = "1.0.75" }
windows = { version = "0.62.0", features = [
    "Win32",
    "Win32_Graphics",
    "Win32_Graphics_Dxgi",
    "Win32_Graphics_Direct3D12",
    "Win32_Graphics_Direct3D",
    "Win32_Foundation",
    "Win32_Graphics_Dxgi_Common",
] }

# dotlottie example
[dev-dependencies.zip]
version = "8.1"

[dev-dependencies.serde]
version = "1.0"
features = ["derive"]

[dev-dependencies.serde_json]
version = "1.0"
