From 479d19bd4ad03e83a5d34df3cab0d368c21bcbcf Mon Sep 17 00:00:00 2001 From: Putta Khunchalee Date: Sun, 1 Dec 2024 18:49:01 +0700 Subject: [PATCH] Switches GUI backend to Skia (#1152) --- .github/workflows/ci-mac.yml | 19 +++++ Cargo.lock | 133 ++--------------------------------- gui/Cargo.toml | 2 +- 3 files changed, 25 insertions(+), 129 deletions(-) diff --git a/.github/workflows/ci-mac.yml b/.github/workflows/ci-mac.yml index 21875489d..f8a0841ec 100644 --- a/.github/workflows/ci-mac.yml +++ b/.github/workflows/ci-mac.yml @@ -14,6 +14,19 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v4 + - name: Use Python 3.12 # https://github.com/slint-ui/slint/issues/6615 + uses: actions/setup-python@v5 + with: + python-version: '3.12' + - name: Generate cache keys + run: | + echo "target=${{ runner.os }}-${{ runner.arch }}-target" >> $GITHUB_OUTPUT + id: cache-keys + - name: Restore target directory + uses: actions/cache/restore@v4 + with: + path: target + key: ${{ steps.cache-keys.outputs.target }} - name: Update Rust run: rustup update stable - name: Install Rust nightly @@ -33,3 +46,9 @@ jobs: with: name: obliteration-mac-m1 path: Obliteration.dmg + - name: Cache target directory + uses: actions/cache/save@v4 + with: + path: target + key: ${{ steps.cache-keys.outputs.target }}-${{ github.run_id }} + if: startsWith(github.ref, 'refs/heads/') diff --git a/Cargo.lock b/Cargo.lock index 4413b3ccf..e33e18104 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -519,12 +519,6 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" -[[package]] -name = "byteorder-lite" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f1fe948ff07f4bd06c30984e69f5b4899c516a3ef74f34df92a2df2ab535495" - [[package]] name = "bytes" version = "1.8.0" @@ -917,18 +911,6 @@ dependencies = [ "libc", ] -[[package]] -name = "core-text" -version = "20.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9d2790b5c08465d49f8dc05c8bcae9fea467855947db39b0f8145c091aaced5" -dependencies = [ - "core-foundation 0.9.4", - "core-graphics 0.23.2", - "foreign-types", - "libc", -] - [[package]] name = "countme" version = "3.0.1" @@ -1100,20 +1082,6 @@ dependencies = [ "linux-raw-sys 0.6.5", ] -[[package]] -name = "dwrote" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70182709525a3632b2ba96b6569225467b18ecb4a77f46d255f713a6bebf05fd" -dependencies = [ - "lazy_static", - "libc", - "serde", - "serde_derive", - "winapi", - "wio", -] - [[package]] name = "either" version = "1.13.0" @@ -1223,28 +1191,6 @@ dependencies = [ "simd-adler32", ] -[[package]] -name = "femtovg" -version = "0.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47921d14afc4daad9bedc926099bc6edcaa23e37a957448f86cdefcbafe2f632" -dependencies = [ - "bitflags 2.6.0", - "fnv", - "glow", - "image 0.25.5", - "imgref", - "log", - "lru", - "rgb", - "rustybuzz", - "slotmap", - "unicode-bidi", - "unicode-segmentation", - "wasm-bindgen", - "web-sys", -] - [[package]] name = "field-offset" version = "0.3.6" @@ -1283,12 +1229,6 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "98de4bbd547a563b716d8dfa9aad1cb19bfab00f4fa09a6a4ed21dbcf44ce9c4" -[[package]] -name = "fnv" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" - [[package]] name = "fontconfig-parser" version = "0.5.7" @@ -1721,8 +1661,9 @@ dependencies = [ "glutin", "i-slint-common", "i-slint-core", - "i-slint-renderer-femtovg", + "i-slint-renderer-skia", "input", + "memmap2", "nix", "raw-window-handle", "xkbcommon", @@ -1758,7 +1699,6 @@ dependencies = [ "i-slint-common", "i-slint-core", "i-slint-core-macros", - "i-slint-renderer-femtovg", "i-slint-renderer-skia", "lyon_path", "once_cell", @@ -1796,7 +1736,7 @@ dependencies = [ "derive_more", "fontdue", "i-slint-common", - "image 0.24.9", + "image", "itertools 0.13.0", "linked_hash_set", "lyon_extra", @@ -1829,7 +1769,7 @@ dependencies = [ "euclid", "i-slint-common", "i-slint-core-macros", - "image 0.24.9", + "image", "integer-sqrt", "lyon_algorithms", "lyon_extra", @@ -1867,37 +1807,6 @@ dependencies = [ "syn", ] -[[package]] -name = "i-slint-renderer-femtovg" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a450bd34e9493cb8694dbe5998346a84f180fae14ad26ae7d8c385fa0c039f4" -dependencies = [ - "cfg-if", - "const-field-offset", - "core-foundation 0.9.4", - "core-text", - "derive_more", - "dwrote", - "femtovg", - "glow", - "i-slint-common", - "i-slint-core", - "i-slint-core-macros", - "imgref", - "lyon_path", - "once_cell", - "pin-weak", - "rgb", - "scoped-tls-hkt", - "ttf-parser 0.21.1", - "unicode-script", - "unicode-segmentation", - "wasm-bindgen", - "web-sys", - "winapi", -] - [[package]] name = "i-slint-renderer-skia" version = "1.8.0" @@ -2113,29 +2022,12 @@ dependencies = [ "tiff", ] -[[package]] -name = "image" -version = "0.25.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd6f44aed642f18953a158afeb30206f4d50da59fbc66ecb53c66488de73563b" -dependencies = [ - "bytemuck", - "byteorder-lite", - "num-traits", -] - [[package]] name = "imagesize" version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "029d73f573d8e8d63e6d5020011d3255b28c3ba85d6cf870a07184ed23de9284" -[[package]] -name = "imgref" -version = "1.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0263a3d970d5c054ed9312c0057b4f3bde9c0b33836d3637361d4a9e6e7a408" - [[package]] name = "indexmap" version = "2.5.0" @@ -2415,12 +2307,6 @@ version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" -[[package]] -name = "lru" -version = "0.12.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "234cf4f4a04dc1f57e24b96cc0cd600cf2af460d4161ac5ecdd0af8e1f3b2a38" - [[package]] name = "lyon_algorithms" version = "1.0.4" @@ -3548,7 +3434,6 @@ dependencies = [ "const-field-offset", "i-slint-backend-selector", "i-slint-core", - "i-slint-renderer-femtovg", "num-traits", "once_cell", "pin-weak", @@ -3661,6 +3546,7 @@ dependencies = [ "bytemuck", "cfg_aliases", "core-graphics 0.24.0", + "drm", "fastrand", "foreign-types", "js-sys", @@ -4786,15 +4672,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "wio" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d129932f4644ac2396cb456385cbf9e63b5b30c6e8dc4820bdca4eb082037a5" -dependencies = [ - "winapi", -] - [[package]] name = "write16" version = "1.0.0" diff --git a/gui/Cargo.toml b/gui/Cargo.toml index f23d56435..47c40e7f9 100644 --- a/gui/Cargo.toml +++ b/gui/Cargo.toml @@ -32,7 +32,7 @@ features = [ "backend-winit", "compat-1-2", "raw-window-handle-06", - "renderer-femtovg", + "renderer-skia", "std", ] default-features = false