Skip to content

Commit 6ff43d4

Browse files
committed
Enable use of Skia backend in mini-dxn and todomvc example
1 parent a730f1e commit 6ff43d4

File tree

6 files changed

+76
-97
lines changed

6 files changed

+76
-97
lines changed

Cargo.lock

Lines changed: 51 additions & 92 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/todomvc/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ publish = false
99
default = ["gpu"]
1010
gpu = ["mini-dxn/gpu"]
1111
hybrid = ["mini-dxn/hybrid"]
12+
skia = ["mini-dxn/skia"]
1213
cpu = ["cpu-pixels"]
1314
cpu-pixels = ["mini-dxn/cpu-pixels"]
1415
cpu-softbuffer = ["mini-dxn/cpu-softbuffer"]

justfile

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
2+
## Build/lint commands
3+
14
check:
25
cargo check --workspace
36

@@ -7,9 +10,16 @@ clippy:
710
fmt:
811
cargo fmt --all
912

13+
small:
14+
cargo build --profile small -p counter --no-default-features --features cpu,system_fonts
15+
16+
## WPT test runner
17+
1018
wpt *ARGS:
1119
cargo run --release --package wpt {{ARGS}}
1220

21+
## Browser
22+
1323
screenshot *ARGS:
1424
cargo run --release --example screenshot {{ARGS}}
1525

@@ -31,11 +41,15 @@ hybrid *ARGS:
3141
skia *ARGS:
3242
cargo run --release --package readme --no-default-features --features skia,comrak,incremental,log_frame_times,log_phase_times {{ARGS}}
3343

34-
bump *ARGS:
35-
cargo run --release --package bump {{ARGS}}
44+
## TodoMVC commands
3645

3746
todomvc *ARGS:
3847
cargo run --release --package todomvc {{ARGS}}
3948

40-
small:
41-
cargo build --profile small -p counter --no-default-features --features cpu,system_fonts
49+
todoskia *ARGS:
50+
cargo run --release --package todomvc {{ARGS}} --no-default-features --features skia
51+
52+
## Ops
53+
54+
bump *ARGS:
55+
cargo run --release --package bump {{ARGS}}

packages/mini-dxn/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ incremental = ["blitz-dom/incremental"]
2626
hot-reload = ["dep:dioxus-cli-config", "dep:dioxus-devtools"]
2727
gpu = ["dep:anyrender_vello", "dep:wgpu"]
2828
hybrid = ["dep:anyrender_vello_hybrid"]
29+
skia = ["dep:anyrender_skia"]
2930
cpu = ["cpu-pixels"]
3031
cpu-pixels = ["cpu-base", "anyrender_vello_cpu/pixels_window_renderer"]
3132
cpu-softbuffer = ["cpu-base", "anyrender_vello_cpu/softbuffer_window_renderer"]
@@ -38,6 +39,7 @@ log_phase_times = ["blitz-dom/log_phase_times"]
3839
anyrender = { workspace = true }
3940
anyrender_vello = { workspace = true, optional = true }
4041
anyrender_vello_hybrid = { workspace = true, optional = true }
42+
anyrender_skia = { workspace = true, optional = true }
4143
anyrender_vello_cpu = { workspace = true, features = ["multithreading"], optional = true }
4244
blitz-paint = { workspace = true }
4345
blitz-dom = { workspace = true, features = ["parallel-construct"] }

packages/mini-dxn/src/dioxus_renderer.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ use anyrender_vello_cpu::VelloCpuWindowRenderer as InnerRenderer;
1616
#[cfg(feature = "hybrid")]
1717
use anyrender_vello_hybrid::VelloHybridWindowRenderer as InnerRenderer;
1818

19+
#[cfg(feature = "skia")]
20+
use anyrender_skia::SkiaWindowRenderer as InnerRenderer;
21+
1922
#[cfg(feature = "gpu")]
2023
pub fn use_wgpu<T: CustomPaintSource>(create_source: impl FnOnce() -> T) -> u64 {
2124
use dioxus_core::{consume_context, use_hook_with_cleanup};

0 commit comments

Comments
 (0)