Skip to content

Commit 4d55e61

Browse files
authored
Merge pull request samizdatco#105 from samizdatco/gpu
Render bitmaps on the GPU by default
2 parents c6a7420 + 5e68fa1 commit 4d55e61

File tree

23 files changed

+1017
-378
lines changed

23 files changed

+1017
-378
lines changed

.github/workflows/arch.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build containers
1+
name: Rebuild containers
22
on:
33
workflow_dispatch:
44

.github/workflows/build.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
- name: Determine current upstream version
3131
id: rust-skia
3232
run: |
33-
export TAG=$(awk '/\[dependencies.skia-safe\]/{getline; print}' skia-canvas/Cargo.toml | egrep -o '[0-9\.]+')
33+
export TAG=$(make -sC skia-canvas skia-version)
3434
echo "::set-output name=VERSION::$TAG"
3535
3636
- name: Checkout rust-skia
@@ -46,7 +46,7 @@ jobs:
4646
if: ${{ matrix.libc == 'musl' }}
4747
run: |
4848
patch -p0 < /code/alpine-build.patch
49-
perl -0777 -pi.bak -e 's/(\[dependencies.skia-safe\]\n)version.*/$1path = "..\/rust-skia\/skia-safe"/m' skia-canvas/Cargo.toml
49+
make -sC skia-canvas with-local-skia
5050
5151
- name: Build module
5252
run: |
@@ -100,8 +100,8 @@ jobs:
100100
REPO: ${{ github.repository }}
101101
run: |
102102
git clone --depth 1 ${SERVER}/${REPO} skia-canvas
103-
export TAG=$(awk '/\[dependencies.skia-safe\]/{getline; print}' skia-canvas/Cargo.toml | egrep -o '[0-9\.]+')
104-
perl -0777 -pi.bak -e 's/(\[dependencies.skia-safe\]\n)version.*/$1path = "..\/rust-skia\/skia-safe"/m' skia-canvas/Cargo.toml
103+
export TAG=$(make -sC skia-canvas skia-version)
104+
make -sC skia-canvas with-local-skia
105105
echo "::set-output name=VERSION::$TAG"
106106
107107
- name: Checkout rust-skia
@@ -173,7 +173,7 @@ jobs:
173173
- name: Determine current upstream version
174174
id: rust-skia
175175
run: |
176-
export TAG=$(awk '/skia-safe/{getline; print}' skia-canvas/Cargo.toml | egrep -o '[0-9\.]+')
176+
export TAG=$(make -sC skia-canvas skia-version)
177177
echo "::set-output name=VERSION::$TAG"
178178
179179
- name: Checkout rust-skia
@@ -186,7 +186,7 @@ jobs:
186186

187187
- name: Patch sources
188188
run: |
189-
perl -0777 -pi.bak -e 's/(\[dependencies.skia-safe\]\n)version.*/$1path = "..\/rust-skia\/skia-safe"/m' skia-canvas/Cargo.toml
189+
make -sC skia-canvas with-local-skia
190190
191191
- name: Use system GN
192192
run: |

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,19 @@
22

33
## 🥚 ⟩ [Unreleased]
44

5+
### New Features
6+
- Rendering now occurs on the GPU by default and can be configured using the **Canvas**'s [`.gpu`][canvas_gpu] property. If the platform supports hardware-accelerated rendering (using Metal on macOS and Vulkan on Linux & Windows), the property will be `true` by default and can be set to `false` to use the software renderer.
7+
58
### Bugfixes
69
- The `FontLibrary.reset()` method didn't actually remove previously installed fonts that had already been drawn with (and thus cached). It now clears those caches, which also means previously used fonts can now be replaced by calling `.use()` again with the same family name.
10+
- The [`.drawCanvas()`][drawCanvas] routine now applies filter effects and shadows consistent with the current resolution and transformation state.
11+
12+
### Misc. Improvements
13+
- The [`.filter`][filter] property's `"blur(…)"` and `"drop-shadow(…)"` effects now match browser behavior much more closely and scale appropriately with the `density` export option.
14+
- Antialiasing is smoother, particularly when down-scaling images, thanks to the use of mipmaps rather than Skia's (apparently buggy?) implementation of bucubic interpolation.
15+
16+
[canvas_gpu]: https://github.com/samizdatco/skia-canvas#gpu
17+
[filter]: https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/filter
718

819
## 📦 ⟩ [v0.9.30] ⟩ Jun 7, 2022
920

0 commit comments

Comments
 (0)