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

Maintenance 2024 #172

Merged
merged 169 commits into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
169 commits
Select commit Hold shift + click to select a range
7f8417b
replace `glob` with `fast-glob` dependency
samizdatco Aug 27, 2024
1a53fa0
update dev dependencies
samizdatco Aug 27, 2024
6437f05
make some clippy-suggested syntax tweaks
samizdatco Oct 14, 2024
9ef50da
update skia to 0.75
samizdatco Oct 15, 2024
3e25ed7
update skia to 0.78.2
samizdatco Oct 15, 2024
37f13ef
update windowing routines (metal)
samizdatco Oct 16, 2024
1561430
update gpu renderer (metal)
samizdatco Oct 16, 2024
573d05e
add `skulpin-renderer` as vendored dependency
samizdatco Oct 16, 2024
3b183a0
update skulpin to use current skia version
samizdatco Oct 16, 2024
929b4b4
update gpu renderer (vulkan)
samizdatco Oct 16, 2024
e410439
use vulkano to build headless renderer
samizdatco Oct 17, 2024
0a02a8a
consolidate setup in VulkanEngine
samizdatco Oct 17, 2024
b94f939
clean up imports
samizdatco Oct 17, 2024
bab5f1c
fail gracefully if vulkan device not detected
samizdatco Oct 17, 2024
0e16d5c
update winit to 0.35.0
samizdatco Oct 17, 2024
52dfe89
refactor `event_loop` handler into App struct
samizdatco Oct 18, 2024
f00e1ba
add setter for init-status message
samizdatco Oct 18, 2024
03f072f
honor `fullscreen` Window init option
samizdatco Oct 19, 2024
5ffcf8e
reorganize `gui` module
samizdatco Oct 18, 2024
a908411
remove `framebufferOnly` from display CALayer
samizdatco Oct 19, 2024
77b6341
switch to the non-prerelease vulkano version
samizdatco Oct 21, 2024
1bd251d
replace skulpin with vulkano-based renderer
samizdatco Oct 22, 2024
8bf6ae7
drop window from renderer struct & condense methods
samizdatco Oct 22, 2024
66fa762
run rustfmt
samizdatco Oct 22, 2024
02b64ed
wait before recreating a suboptimal swapchain
samizdatco Oct 22, 2024
a72df3e
add compositing-mode selection logic
samizdatco Oct 22, 2024
1f6f605
clean up syntax and pare back documentation
samizdatco Oct 22, 2024
c7a8e10
move renderer's non-Send references to thread_locals
samizdatco Oct 22, 2024
56b3d8f
refactor helper functions into SkiaBackend
samizdatco Oct 22, 2024
851dc33
don't share queues across windows, just the instance
samizdatco Oct 23, 2024
999d8c5
create a distinct instance for each renderer
samizdatco Oct 23, 2024
d88e3f5
store the renderer's `SkiaBackend` directly
samizdatco Oct 23, 2024
83ededc
fix event loop timing and poll/wait mode selection
samizdatco Oct 23, 2024
0f7f9e0
make KeyboardEvent fields consistent with browser
samizdatco Oct 23, 2024
63e7af2
refactor MetalEngine and track mode/errors
samizdatco Oct 24, 2024
54638be
rename VulkanBackend to be consistent with metal
samizdatco Oct 24, 2024
85ea61d
track vulkan init status/errors
samizdatco Oct 24, 2024
89fa2e2
separate non-threadsafe portions of MetalRenderer
samizdatco Oct 24, 2024
9f16d92
add `canvas.engine` accessor with cpu/gpu status
samizdatco Oct 24, 2024
5571df6
only export App & Window if compiled with support
samizdatco Oct 24, 2024
8b51b8a
prevent gui launch without gpu support
samizdatco Oct 24, 2024
fe97e4e
set window opacity based on alpha of `background` arg
samizdatco Oct 24, 2024
79471e3
fix a race in metal engine's surface allocator
samizdatco Oct 24, 2024
215ae1c
make the `input` event consistent with browser
samizdatco Oct 24, 2024
025a573
update Input & KeyboardEvent attribute types
samizdatco Oct 24, 2024
ececc4e
whitespace & punctuation
samizdatco Oct 24, 2024
794f192
add recent changes
samizdatco Oct 24, 2024
36fa1c3
use corrected arrow key names in `keydown` example
samizdatco Oct 24, 2024
20035ca
properly set the `this` reference in Image.onload
samizdatco Oct 24, 2024
2be5b05
update/correct changelog
samizdatco Oct 25, 2024
4f096b3
fix posix/windows path handling in `FontLibrary.use`
samizdatco Oct 26, 2024
11bbffb
memoize `VulkanEngine::supported()` check
samizdatco Oct 26, 2024
b768d60
simplify surface creation
samizdatco Oct 26, 2024
fc9545e
fix hangs on macOS when window is fully obscured
samizdatco Oct 27, 2024
6890711
Fix exception in `canvas::draw_path()` when trying to draw a path wit…
mpaperno Oct 27, 2024
fbd13c2
add cleanup step to render loop
samizdatco Oct 27, 2024
f649c82
fix fallback font selection regression
samizdatco Oct 27, 2024
9d39866
add woff2 font test
samizdatco Oct 27, 2024
68f1f22
add woff/woff2 font support for windows
samizdatco Oct 28, 2024
d3c95f8
update changelog
samizdatco Oct 28, 2024
f6e8b80
Adds WEBP format as available input and output types, with doc & test…
mpaperno Oct 28, 2024
891d140
Fix issue in `Path2D::add_ellipse()` where trying to draw a complete …
mpaperno Oct 28, 2024
b0b5c6f
Fixed scaling issues with shadow blur when applied to a canvas transf…
mpaperno Oct 28, 2024
a9a93a6
move platform-specific feature selection into Makefile
samizdatco Oct 28, 2024
de6f105
update changelog
samizdatco Oct 28, 2024
a64e15d
use Paragraph's `get_path` for `outlineText()`
samizdatco Oct 28, 2024
82d20cf
Allow `.transform()` to take DOMMatrix or CSS `transform` strings as …
mpaperno Oct 30, 2024
b7eb9ff
Fix clipping not being applied to the source in `drawCanvas()` 9-argu…
mpaperno Oct 30, 2024
71c5cf0
update changelog
samizdatco Oct 30, 2024
bf94484
Adjust JS `Image` sizing properties to be more inline with standard. …
mpaperno Oct 31, 2024
45ef03b
Revert "Adjust JS `Image` sizing properties to be more inline with st…
samizdatco Nov 1, 2024
1af25f4
incorporate image-loading improvements
samizdatco Nov 1, 2024
e3654c2
replace inherited Image typedef
samizdatco Nov 1, 2024
6f515b3
add transitional `image_size` accessor
samizdatco Nov 1, 2024
6aec397
test dataURI loading in all supported formats
samizdatco Nov 1, 2024
d3d55ae
nudge for symmetry
samizdatco Nov 1, 2024
2d0a0d1
Support SVG image rendering (#180)
mpaperno Nov 2, 2024
a194fee
update changelog
samizdatco Nov 2, 2024
b3374a3
use single FontMgr and share references to it
samizdatco Nov 2, 2024
50a7e74
add mappings for generic font family names
samizdatco Nov 2, 2024
b1db78a
add support for dynamically loaded fonts in SVG images
samizdatco Nov 2, 2024
8e4530e
update debugging recipes
samizdatco Nov 2, 2024
714208f
make rebuilds lazier
samizdatco Nov 2, 2024
e1ccd1d
update changelog
samizdatco Nov 2, 2024
7465ff6
add `.letterSpacing` and `.wordSpacing` to Context
samizdatco Nov 2, 2024
1a7be3d
add `Image::default()`
samizdatco Nov 2, 2024
c3d6925
remove support for deprecated `.async` property
samizdatco Nov 2, 2024
ad9a966
remove non-standard `.textTracking` property
samizdatco Nov 2, 2024
4ef9bf7
update TextDrawingStyles types
samizdatco Nov 2, 2024
823d843
update changelog
samizdatco Nov 2, 2024
16d0706
fix typo
samizdatco Nov 2, 2024
778feb3
remove textTracking internals
samizdatco Nov 2, 2024
8198faa
add `.fontStretch`
samizdatco Nov 3, 2024
8802e7d
add types for valid .fontVariant settings
samizdatco Nov 3, 2024
42d790c
quiet output
samizdatco Nov 3, 2024
3737d8e
update changelog
samizdatco Nov 3, 2024
69b03c6
Fix TS validation errors in visual tests. (#184)
mpaperno Nov 3, 2024
d6a73f2
clean up css parsing
samizdatco Nov 3, 2024
5d486f7
Fix generic fonts initialization when `FontCollection.use()` is calle…
mpaperno Nov 5, 2024
d67387f
add `textDecoration` style to context
samizdatco Nov 5, 2024
d0e9d7c
remove `async` property
samizdatco Nov 5, 2024
7b05c0b
break FontLibrary out into its own file
samizdatco Nov 5, 2024
1a59bbd
merge spacing & text decoration into style at layout
samizdatco Nov 5, 2024
d20e043
expand wildcard imports
samizdatco Nov 5, 2024
e15dc0f
update changelog
samizdatco Nov 5, 2024
4e5cfa5
add docs
samizdatco Nov 5, 2024
1dbefd4
clean up links & direct them to /docs
samizdatco Nov 6, 2024
535a198
fix links and break out frontmatter
samizdatco Nov 6, 2024
e8ac2c7
slim readme down to just intro & links
samizdatco Nov 6, 2024
5df2b62
link directly to site
samizdatco Nov 6, 2024
dedeea2
drop unused assets
samizdatco Nov 6, 2024
c7e0ff5
docs cleanup
samizdatco Nov 6, 2024
16981f3
setting `fontVariant` overwrites all previous settings
samizdatco Nov 6, 2024
93e49b2
add IME support
samizdatco Nov 6, 2024
94a4e3c
repair historical `.async` links
samizdatco Nov 6, 2024
ac04889
add esmodule support for named imports
samizdatco Nov 6, 2024
6d522f3
use `import` in examples
samizdatco Nov 6, 2024
413d749
update build instructions
samizdatco Nov 6, 2024
d467790
add IME events to window docs
samizdatco Nov 6, 2024
330582b
Improve visual tests framework. (#185)
mpaperno Nov 6, 2024
16161fb
allow hit-testing of Path2D objects, not just ctx path
samizdatco Nov 6, 2024
f5150cf
update changelog
samizdatco Nov 6, 2024
36c70ba
update intro docs
samizdatco Nov 7, 2024
25b2c50
don't initialize GPU until it is used (or queried)
samizdatco Nov 7, 2024
fa58a33
update changelog
samizdatco Nov 7, 2024
79b9484
use rayon's threadpool for async exports
samizdatco Nov 8, 2024
4b6962f
provide better diagnostic info in `canvas.engine`
samizdatco Nov 8, 2024
91316d3
include `engine` in canvas's toString repr
samizdatco Nov 8, 2024
1367985
remove unused PdfDocument adapter
samizdatco Nov 8, 2024
7161072
upgrade to neon 1.0 (napi-8)
samizdatco Nov 8, 2024
6fa477c
remove canvas.async getter/setters
samizdatco Nov 10, 2024
ae63dd9
wrap metal allocations in autorelease pools
samizdatco Nov 10, 2024
6d1956f
drop vulkan contexts after a period of disuse
samizdatco Nov 10, 2024
8ef022c
skip gpu cleanup when using cpu renderer
samizdatco Nov 10, 2024
128c19c
rename autoreleasepool/runloop to gpu::cleanup
samizdatco Nov 10, 2024
a571523
separate per-thread context from engine
samizdatco Nov 10, 2024
0409792
add idle-watcher for metal contexts
samizdatco Nov 10, 2024
a22ffef
drop `foreign-types-shared` crate
samizdatco Nov 10, 2024
285bdd6
move all autorelease responsibilities into metal.rs
samizdatco Nov 10, 2024
075de6f
move `free_gpu_resources` into engine contexts
samizdatco Nov 10, 2024
b4a4fd0
include threadpool size in .engine
samizdatco Nov 10, 2024
200dd3b
add msaa config to gpu engines
samizdatco Nov 11, 2024
ed65f69
pack export options into struct
samizdatco Nov 11, 2024
5d91dc6
move gpu cleanup to idle-watcher
samizdatco Nov 11, 2024
365e9f4
add `msaa` option to export methods
samizdatco Nov 11, 2024
7d91bff
use a non-rayon thread for the idle-watcher
samizdatco Nov 11, 2024
33a1f1d
add `SKIA_CANVAS_THREADS` envvar to limit worker pool size
samizdatco Nov 12, 2024
8f0454a
replace `main` pointer so node-pre-gyp doesn't complain
samizdatco Nov 12, 2024
40e42a1
update signature on dummy engine's `with_surface`
samizdatco Nov 12, 2024
42902af
host svg test images on skia-canvas.org to get CORS access
samizdatco Nov 12, 2024
dc9477a
accept fractional numbers as well as `%` strings for ctx.filter
samizdatco Nov 12, 2024
32512f7
use sRGB colorspace for `drop-shadow` filters
samizdatco Nov 12, 2024
48a0332
prevent typesetter from faking weights & styles
samizdatco Nov 12, 2024
c3afd3b
ignore invalid assignments to `textDecoration`
samizdatco Nov 13, 2024
626b0e6
add docs for `.textDecoration` and `.engine`
samizdatco Nov 13, 2024
2064f8f
zap whitespace
samizdatco Nov 13, 2024
c16f729
fix Image constructor
samizdatco Nov 13, 2024
5864e82
version 1.1.0-rc1
samizdatco Nov 13, 2024
ad04c20
update changelog
samizdatco Nov 13, 2024
20f5f7c
remove default features
samizdatco Nov 13, 2024
18d8a9b
Improve handling of ‘raw’ pixel buffers and ImageData (#147)
Salmondx Nov 16, 2024
35050aa
Refactor js sources (#188)
samizdatco Nov 17, 2024
a326bcc
update skia to 0.80.0
samizdatco Nov 18, 2024
d04e2e7
scale width/height to match SVG aspect ratio if undefined
samizdatco Nov 18, 2024
901b158
install ninja
samizdatco Nov 18, 2024
9927b34
update containers
samizdatco Nov 20, 2024
ddae052
enable caching
samizdatco Nov 20, 2024
40410c4
update build rules
samizdatco Nov 20, 2024
f64c224
v2.0.0 RC1
samizdatco Nov 20, 2024
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
38 changes: 9 additions & 29 deletions .github/workflows/arch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,56 +3,36 @@ on:
workflow_dispatch:

jobs:
server:
build-container:
runs-on: ubuntu-latest
permissions: write-all
strategy:
matrix:
libc: [glibc, musl]

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3

- name: Login to GitHub Container Registry
uses: docker/login-action@v1
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.CR_PAT }}

- name: Build and push
uses: docker/build-push-action@v3
uses: docker/build-push-action@v6
with:
tags: ghcr.io/${{ github.repository }}-${{ matrix.libc }}:latest
context: arch/${{ matrix.libc }}
platforms: linux/amd64,linux/arm64
cache-from: type=gha
cache-to: type=gha,mode=max
push: true

pi:
runs-on: [self-hosted, linux, ARM]

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.CR_PAT }}

- name: Build and Push Docker Image
run: |
cd ${{ env.context }}
docker build . -t ${{ env.tag }}
docker push ${{ env.tag }}
env:
context: arch/arm
tag: ghcr.io/${{ github.repository }}-arm:latest
84 changes: 27 additions & 57 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,61 +6,52 @@ on:
- "v*"

jobs:

linux-x86:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
libc: [glibc, musl]

container:
image: ${{ format('ghcr.io/{0}-{1}:latest', github.repository, matrix.libc) }}
options: --user github

steps:
- name: Install rust
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
- name: Use Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable

- name: Checkout skia-canvas
uses: actions/checkout@v4
with:
path: skia-canvas

- name: Build module
run: |
cd skia-canvas
npm ci --ignore-scripts
npm run build -- --release --features vulkan,window,skia-safe/embed-freetype
mkdir -p $CARGO_HOME/registry
chown -R github $CARGO_HOME/registry
make optimized

- name: Package module
run: |
cd skia-canvas
npm test && npm run package

- name: Add to release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
curl -sL https://github.com/cli/cli/releases/download/v2.55.0/gh_2.55.0_linux_amd64.tar.gz | tar xz --strip-components=2
mv gh skia-canvas/node_modules/.bin
cd skia-canvas
npm run upload


linux-arm64:
runs-on:
- self-hosted
- linux
- ARM64
runs-on: [self-hosted, linux, ARM64]
strategy:
fail-fast: false
matrix:
libc: [glibc, musl]

container:
image: ${{ format('ghcr.io/{0}-{1}:latest', github.repository, matrix.libc) }}
options: --user 1000:1000
options: --user github

steps:
- name: Prepare workspace
Expand All @@ -72,57 +63,36 @@ jobs:
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
echo CARGO_TERM_COLOR=always >> $GITHUB_ENV

- name: Checkout skia-canvas
id: rust-skia
env:
SERVER: ${{ github.server_url }}
REPO: ${{ github.repository }}
REF: ${{ github.ref_name }}
run: |
git clone --depth 1 --branch ${GITHUB_REF_NAME} ${SERVER}/${REPO} skia-canvas
export TAG=$(make -sC skia-canvas skia-version)
make -sC skia-canvas with-local-skia
echo "VERSION=$TAG" >> $GITHUB_OUTPUT
echo REF ${GITHUB_REF_NAME}

- name: Checkout rust-skia
run: |
git clone --depth 1 --branch ${{ steps.rust-skia.outputs.VERSION }} https://github.com/rust-skia/rust-skia.git
cd rust-skia
git submodule update --init --depth 1 skia-bindings/skia
git submodule update --init --depth 1 skia-bindings/depot_tools

- name: Use system GN
if: ${{ matrix.libc == 'musl' }}
run: |
echo "#!/bin/true" > rust-skia/skia-bindings/skia/bin/fetch-gn
git clone --depth 1 --branch $REF ${SERVER}/${REPO} .

- name: Build module
run: |
cd skia-canvas
npm ci --ignore-scripts
npm run build -- --release --features vulkan,window,skia-safe/embed-freetype
make optimized

- name: Package module
run: |
cd skia-canvas
npm test && npm run package

- name: Add to release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
curl -sL https://github.com/cli/cli/releases/download/v2.55.0/gh_2.55.0_linux_arm64.tar.gz | tar xz --strip-components=2
mv gh skia-canvas/node_modules/.bin
cd skia-canvas
npm run upload

mac:
strategy:
fail-fast: false
matrix:
arch: [x86, arm64]
runs-on: ${{ matrix.arch == 'x86' && 'macos-13' || 'macos-latest' }}
runs-on: ${{ matrix.arch == 'x86' && 'macos-13' || 'macos-14' }}

steps:
- name: Checkout repository
Expand All @@ -138,16 +108,16 @@ jobs:
with:
toolchain: stable

- name: Use Ninja
uses: seanmiddleditch/gha-setup-ninja@master

- name: Build module
env:
MACOSX_DEPLOYMENT_TARGET: 10.13
run: |
npm ci --ignore-scripts
npm run build -- --release --features metal,window
MACOSX_DEPLOYMENT_TARGET: 10.14
run: make optimized

- name: Package module
run: |
npm test && npm run package
run: npm test && npm run package

- name: Add to release
env:
Expand All @@ -172,14 +142,14 @@ jobs:
with:
toolchain: stable

- name: Use Ninja
uses: seanmiddleditch/gha-setup-ninja@master

- name: Build module
run: |
npm ci --ignore-scripts
npm run build -- --release --features vulkan,window
run: make optimized

- name: Package module
run: |
npm test && npm run package
run: npm test && npm run package

- name: Add to release
env:
Expand Down
19 changes: 8 additions & 11 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,23 +29,20 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'

- name: Use Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable

- name: Build for Metal
if: ${{ matrix.os == 'macos-latest' }}
run: |
npm ci --ignore-scripts
npm run build -- --release --features metal,window
- name: Use Ninja
uses: seanmiddleditch/gha-setup-ninja@master

- name: Build for Vulkan
if: ${{ matrix.os != 'macos-latest' }}
run: |
npm ci --ignore-scripts
npm run build -- --release --features vulkan,window
- name: Build module
run: make optimized

- name: Run tests
run: npm test
run: |
npm test --verbose

Loading