Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Skia Bindings #6794

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/actions/install-skia-dependencies/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright © SixtyFPS GmbH <[email protected]>
# SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0

---
name: Install Skia dependencies
description: Set up dependencies needed to build Skia

runs:
using: composite
steps:
- name: Install Ninja
if: runner.os == 'macOS'
run: brew install ninja
shell: bash
- name: Upgrade LLVM for Skia build on Windows
if: runner.os == 'Windows'
run: choco upgrade llvm
shell: bash
# See https://github.com/ilammy/msvc-dev-cmd?tab=readme-ov-file#caveats
- name: Remove GNU link.exe from GH actions
if: runner.os == 'Windows'
run: rm /usr/bin/link
shell: bash
4 changes: 2 additions & 2 deletions .github/actions/setup-rust/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ runs:
run: |
git config --system core.longpaths true
shell: powershell
- name: Move cargo home to the same drive as the build, so that relative paths from build to cargo source are without drive letter
- name: Move cargo home close to the target/$profile directory, so that relative paths from build to cargo source are without drive letter
if: runner.os == 'Windows'
run: |
echo "CARGO_HOME=\cargo" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "CARGO_HOME=${{ runner.workspace }}\cargo" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
shell: powershell
- name: Install Rust ${{ inputs.toolchain }}
uses: dtolnay/rust-toolchain@stable
Expand Down
9 changes: 3 additions & 6 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/install-linux-dependencies
- uses: ./.github/actions/install-skia-dependencies
- uses: ilammy/msvc-dev-cmd@v1
- uses: actions/setup-python@v5
with:
python-version: '3.10'
Expand All @@ -69,9 +71,6 @@ jobs:
- name: Install gstreamer and libunwind (Linux)
if: runner.os == 'Linux'
run: sudo apt-get install libunwind-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev gstreamer1.0-plugins-base gstreamer1.0-plugins-good
- name: Upgrade LLVM for Skia build on Windows
if: runner.os == 'Windows'
run: choco upgrade llvm
- name: Setup headless display
uses: pyvista/setup-headless-display-action@v3
- uses: ./.github/actions/setup-rust
Expand Down Expand Up @@ -116,9 +115,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/install-linux-dependencies
- name: Upgrade LLVM for Skia build on Windows
if: runner.os == 'Windows'
run: choco upgrade llvm
- uses: ./.github/actions/install-skia-dependencies
- name: Setup headless display
uses: pyvista/setup-headless-display-action@v3
- uses: actions/setup-node@v4
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/cpp_package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,6 @@ jobs:
- name: Prepare licenses
run: bash -x ../../scripts/prepare_binary_package.sh ${{ runner.workspace }}/cppbuild
working-directory: api/cpp/
# Pin Python version until https://github.com/slint-ui/slint/issues/6615 is fixed.
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- uses: ilammy/msvc-dev-cmd@v1
- name: Select MSVC (windows)
run: |
Expand Down
8 changes: 0 additions & 8 deletions .github/workflows/nightly_snapshot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,6 @@ jobs:
target: x86_64-apple-darwin
- name: Install cargo-bundle
run: cargo install --version=0.6.0 cargo-bundle
# Pin Python version until https://github.com/slint-ui/slint/issues/6615 is fixed.
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Build Main LSP Bundle
working-directory: tools/lsp
run: cargo bundle --release --features ${{ env.SLINT_BINARY_FEATURES }}
Expand All @@ -151,10 +147,6 @@ jobs:
- uses: ./.github/actions/setup-rust
with:
target: aarch64-apple-darwin
# Pin Python version until https://github.com/slint-ui/slint/issues/6615 is fixed.
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Build AArch64 LSP
run: cargo build --target aarch64-apple-darwin --features ${{ env.SLINT_BINARY_FEATURES }} --release -p slint-lsp
- name: Create artifact directory
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/publish_npm_package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,26 +71,26 @@ jobs:
- os: windows-2022
rust-target: x86_64-pc-windows-msvc
napi-rs-target: win32-x64-msvc
msvc-arch: x64
- os: windows-2022
rust-target: i686-pc-windows-msvc
napi-rs-target: win32-ia32-msvc
msvc-arch: x86
needs: determine_version
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/install-linux-dependencies
with:
old-ubuntu: true
- uses: ./.github/actions/install-skia-dependencies
- uses: ilammy/msvc-dev-cmd@v1
if: runner.os == 'Windows'
with:
arch: ${{ matrix.msvc-arch }}
- uses: ./.github/actions/setup-rust
with:
target: ${{ matrix.rust-target }}
- name: Upgrade LLVM for Skia build on Windows
if: runner.os == 'Windows'
run: choco upgrade llvm
# Pin Python version until https://github.com/slint-ui/slint/issues/6615 is fixed.
- uses: actions/setup-python@v5
with:
python-version: '3.12'
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v4
with:
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/slint_tool_binary.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,6 @@ jobs:
- uses: ./.github/actions/setup-rust
with:
target: aarch64-apple-darwin
# Pin Python version until https://github.com/slint-ui/slint/issues/6615 is fixed.
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- uses: baptiste0928/cargo-install@v3
with:
crate: cargo-about
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile.aarch64-unknown-linux-gnu
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ RUN dpkg --add-architecture arm64 && \
apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install --assume-yes libfontconfig1-dev:arm64 libxcb1-dev:arm64 libxcb-render0-dev:arm64 libxcb-shape0-dev:arm64 libxcb-xfixes0-dev:arm64 libxkbcommon-dev:arm64 libinput-dev:arm64 libgbm-dev:arm64 libssl-dev:arm64 python3 python3-pip \
libfontconfig1-dev \
clang libstdc++-10-dev:arm64
clang libstdc++-10-dev:arm64 ninja-build

# Work around the Skia source build requiring a newer git version (that supports --path-format=relative with rev-parse, as needed by git-sync-deps.py),
# as well as a disabling of the directory safety checks (https://github.blog/2022-04-12-git-security-vulnerability-announced/#cve-2022-24765) as
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile.armv7-unknown-linux-gnueabihf
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ RUN dpkg --add-architecture armhf && \
apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install --assume-yes libfontconfig1-dev:armhf libxcb1-dev:armhf libxcb-render0-dev:armhf libxcb-shape0-dev:armhf libxcb-xfixes0-dev:armhf libxkbcommon-dev:armhf libinput-dev:armhf libgbm-dev:armhf libssl-dev:armhf python3 python3-pip \
libfontconfig1-dev \
clang libstdc++-10-dev:armhf
clang libstdc++-10-dev:armhf ninja-build

# Work around the Skia source build requiring a newer git version (that supports --path-format=relative with rev-parse, as needed by git-sync-deps.py),
# as well as a disabling of the directory safety checks (https://github.blog/2022-04-12-git-security-vulnerability-announced/#cve-2022-24765) as
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile.riscv64gc-unknown-linux-gnu
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ RUN dpkg --add-architecture riscv64 && \
apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install --assume-yes libfontconfig1-dev:riscv64 libxcb1-dev:riscv64 libxcb-render0-dev:riscv64 libxcb-shape0-dev:riscv64 libxcb-xfixes0-dev:riscv64 libxkbcommon-dev:riscv64 libinput-dev:riscv64 libgbm-dev:riscv64 python3 python3-pip \
libfontconfig1-dev \
clang libstdc++-10-dev:riscv64
clang libstdc++-10-dev:riscv64 ninja-build

# Work around the Skia source build requiring a newer git version (that supports --path-format=relative with rev-parse, as needed by git-sync-deps.py),
# as well as a disabling of the directory safety checks (https://github.blog/2022-04-12-git-security-vulnerability-announced/#cve-2022-24765) as
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile.torizon-demos
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ ENV CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_LINKER=arm-linux-gnueabihf-gcc

# Install Slint build dependencies (libxcb, etc.)
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install --assume-yes --allow-change-held-packages pkg-config libfontconfig1-dev:$TOOLCHAIN_ARCH libxcb1-dev:$TOOLCHAIN_ARCH libxcb-render0-dev:$TOOLCHAIN_ARCH libxcb-shape0-dev:$TOOLCHAIN_ARCH libxcb-xfixes0-dev:$TOOLCHAIN_ARCH libxkbcommon-dev:$TOOLCHAIN_ARCH libinput-dev:$TOOLCHAIN_ARCH libudev-dev:$TOOLCHAIN_ARCH libgbm-dev:$TOOLCHAIN_ARCH libdrm2:$TOOLCHAIN_ARCH libdrm2- libdrm-amdgpu1- python3 clang libstdc++-11-dev:$TOOLCHAIN_ARCH && \
DEBIAN_FRONTEND=noninteractive apt-get install --assume-yes --allow-change-held-packages pkg-config libfontconfig1-dev:$TOOLCHAIN_ARCH libxcb1-dev:$TOOLCHAIN_ARCH libxcb-render0-dev:$TOOLCHAIN_ARCH libxcb-shape0-dev:$TOOLCHAIN_ARCH libxcb-xfixes0-dev:$TOOLCHAIN_ARCH libxkbcommon-dev:$TOOLCHAIN_ARCH libinput-dev:$TOOLCHAIN_ARCH libudev-dev:$TOOLCHAIN_ARCH libgbm-dev:$TOOLCHAIN_ARCH libdrm2:$TOOLCHAIN_ARCH libdrm2- libdrm-amdgpu1- python3 clang libstdc++-11-dev:$TOOLCHAIN_ARCH ninja-build && \
rm -rf /var/lib/apt/lists/*

# Don't require font-config when the compiler runs
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile.x86_64-unknown-linux-gnu
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ FROM ghcr.io/slint-ui/cross-x86_64-base:1.0
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install --assume-yes libfontconfig1-dev libxcb1-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libxkbcommon-dev libinput-dev libgbm-dev python3 \
python3-pip libfontconfig1-dev \
clang libstdc++-10-dev
clang libstdc++-10-dev ninja-build

# Work around the Skia source build requiring a newer git version (that supports --path-format=relative with rev-parse, as needed by git-sync-deps.py),
# as well as a disabling of the directory safety checks (https://github.blog/2022-04-12-git-security-vulnerability-announced/#cve-2022-24765) as
Expand Down
8 changes: 4 additions & 4 deletions internal/renderers/skia/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ pin-weak = "1"
scoped-tls-hkt = "0.1"
raw-window-handle = { version = "0.6", features = ["std"] }

skia-safe = { version = "0.78.0", features = ["textlayout", "gl"] }
skia-safe = { version = "0.81.0", features = ["textlayout", "gl"] }
glow = { workspace = true }
unicode-segmentation = { workspace = true }

Expand All @@ -58,19 +58,19 @@ bytemuck = { workspace = true }

[target.'cfg(target_family = "windows")'.dependencies]
windows = { version = "0.58.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.78.0", features = ["d3d"] }
skia-safe = { version = "0.81.0", features = ["d3d"] }

[target.'cfg(target_vendor = "apple")'.dependencies]
objc2 = { version = "0.5.2" }
objc2-metal = { version = "0.2.2", features = ["MTLCommandQueue", "MTLCommandBuffer"] }
objc2-foundation = { version = "0.2.2"}
objc2-quartz-core = { version = "0.2.2" }
objc2-app-kit = { version = "0.2.2" }
skia-safe = { version = "0.78.0", features = ["metal"] }
skia-safe = { version = "0.81.0", features = ["metal"] }
raw-window-metal = "1.0"

[target.'cfg(not(any(target_vendor = "apple", target_family = "windows")))'.dependencies]
skia-safe = { version = "0.78.0", features = ["gl"] }
skia-safe = { version = "0.81.0", features = ["gl"] }

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