# 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 = []
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 = { workspace = true }

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.71.0", features = ["textlayout", "gl"] }
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]
windows = { version = "0.52.0", features = ["Win32", "Win32_System_Com", "Win32_Graphics", "Win32_Graphics_Dxgi", "Win32_Graphics_Direct3D12", "Win32_Graphics_Direct3D", "Win32_Foundation", "Win32_Graphics_Dxgi_Common", "Win32_System_Threading", "Win32_Security"] }
skia-safe = { version = "0.71.0", features = ["d3d"] }

[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.71.0", features = ["metal"] }

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

[build-dependencies]
cfg_aliases = { workspace = true }
