# Copyright © SixtyFPS GmbH <info@slint.dev>
# SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.1 OR LicenseRef-Slint-commercial

[package]
name = "i-slint-renderer-skia"
description = "Skia based renderer for Slint"
authors.workspace = true
edition.workspace = true
homepage.workspace = true
license.workspace = true
repository.workspace = true
rust-version.workspace = true
version.workspace = true
build = "build.rs"

[lib]
path = "lib.rs"

# Note, these features need to be kept in sync (along with their defaults) in
# the C++ crate's CMakeLists.txt
[features]
wayland = ["glutin/wayland", "softbuffer/wayland", "softbuffer/wayland-dlopen"]
x11 = ["glutin/x11", "glutin/glx", "softbuffer/x11", "softbuffer/x11-dlopen"]
opengl = ["skia-safe/gl"]
vulkan = ["skia-safe/vulkan", "ash", "vulkano"]
kms = ["softbuffer/kms"]
default = []

[dependencies]
i-slint-core = { workspace = true, features = ["default", "box-shadow-cache"] }
i-slint-core-macros = { workspace = true, features = ["default"] }
i-slint-common = { workspace = true, features = ["default"] }

const-field-offset = { version = "0.1", path = "../../../helper_crates/const-field-offset" }
vtable = { version = "0.1.6", path = "../../../helper_crates/vtable" }

cfg-if = "1"
derive_more = "0.99.5"
lyon_path = "1.0"
once_cell = "1.5"
pin-weak = "1"
scoped-tls-hkt = "0.1"
raw-window-handle = { version = "0.5", features = ["std"] }

skia-safe = { version = "0.68.0", features = ["textlayout"] }
glow = { version = "0.13" }
unicode-segmentation = { version = "1.8.0" }

glutin = { workspace = true, default-features = false, features = ["egl", "wgl"] }

ash = { version = "^0.37.2", optional = true }
vulkano = { version = "0.34.0", optional = true, default-features = false }

[target.'cfg(not(target_os = "android"))'.dependencies]
# software renderer fallback
softbuffer = { workspace = true, default-features = false }
bytemuck = { workspace = true }

[target.'cfg(target_family = "windows")'.dependencies]
winapi = { version = "0.3", features = ["impl-default", "dwrite", "d3d12", "dxgi", "dxgi1_2", "dxgi1_3", "dxgi1_4", "d3d12sdklayers", "synchapi", "winbase"] }
skia-safe = { version = "0.68.0", features = ["d3d"] }
wio = { version = "0.2.2" }

[target.'cfg(target_os = "macos")'.dependencies]
cocoa = { version = "0.25.0" }
core-foundation = { version = "0.9.1" }
metal = { version = "0.27.0" }
# Use the same version of foreign-types as the metal crate uses.
foreign-types = { version = "0.5.0" }
objc = { version = "0.2.7" }
core-graphics-types = { version = "0.1.1" }
skia-safe = { version = "0.68.0", features = ["metal"] }

[target.'cfg(not(any(target_os = "macos", target_family = "windows")))'.dependencies]
skia-safe = { version = "0.68.0", features = ["gl"] }

[build-dependencies]
cfg_aliases = "0.1.0"
