From e9d362397db06c2af7dda627536e02ba99ed0ea1 Mon Sep 17 00:00:00 2001 From: Nico Burns Date: Sat, 3 Oct 2026 17:43:26 +0000 Subject: [PATCH 01/10] Draw inset box shadows with draw_box_shadow's inset mode Replaces the layer + DestOut implementation of inset box shadows with a single draw_box_shadow call, and passes the shadow clip as the shape for outset shadows instead of pushing a clip layer. Temporarily patches anyrender to a local checkout and vello to the linebender/vello#1718 branch, and updates to wgpu 30 / vello 0.11. --- Cargo.lock | 399 +++++++++++++----- Cargo.toml | 48 ++- examples/paint_bench.rs | 22 +- packages/blitz-paint/src/layers.rs | 5 +- packages/blitz-paint/src/render/border.rs | 4 +- packages/blitz-paint/src/render/box_shadow.rs | 150 ++++--- packages/blitz-paint/src/render/mask.rs | 5 +- 7 files changed, 420 insertions(+), 213 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 26fffa026e..d8e73364a1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -294,9 +294,7 @@ checksum = "330a5ed07fa54e4702c9d6c4174f74427fc0ef6e214bbd677ae50a5099946470" [[package]] name = "anyrender" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e00e1af5c6ac9b1e8ed8e431529a1024b7386d5385dce2a83494da3d39a6bab5" +version = "0.14.0" dependencies = [ "kurbo", "peniko", @@ -307,9 +305,7 @@ dependencies = [ [[package]] name = "anyrender_serialize" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa3ca49ef372eb4477a70623b77f95d71eb5bdc40d71433459dc2dd9e00add82" +version = "0.8.0" dependencies = [ "anyrender", "image", @@ -326,9 +322,7 @@ dependencies = [ [[package]] name = "anyrender_skia" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57fd22e1d5b834ec2da56a85f9f27c578e00335f5b135a753ae8963828f0d460" +version = "0.12.0" dependencies = [ "anyrender", "ash", @@ -354,9 +348,7 @@ dependencies = [ [[package]] name = "anyrender_svg" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9a06a9cab20563ae5b392239db09d42222820fd3706fe483db7d3cb25546c24" +version = "0.15.0" dependencies = [ "anyrender", "image", @@ -367,9 +359,7 @@ dependencies = [ [[package]] name = "anyrender_vello" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1301d68b8d7a9333c242225bb026dc08f70a5b0ab096087866c06ceab227de5" +version = "0.15.0" dependencies = [ "anyrender", "debug_timer 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -380,15 +370,13 @@ dependencies = [ "rustc-hash 2.1.3", "vello", "wasm-bindgen-futures", - "wgpu", + "wgpu 30.0.1", "wgpu_context", ] [[package]] name = "anyrender_vello_cpu" -version = "0.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fb392bf738b1e50c50fc82824ff3f875f15632717ba732fe68e2fe6e1011e6c" +version = "0.18.0" dependencies = [ "anyrender", "bytemuck", @@ -405,9 +393,7 @@ dependencies = [ [[package]] name = "anyrender_vello_hybrid" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acface501bfa9d5b2abf9413ee5728ded41bd7f9c63b24162b9ea54f431d7e4f" +version = "0.11.0" dependencies = [ "anyrender", "debug_timer 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -418,9 +404,9 @@ dependencies = [ "pollster", "rustc-hash 2.1.3", "vello_common", - "vello_hybrid", + "vello_gpu", "wasm-bindgen-futures", - "wgpu", + "wgpu 30.0.1", "wgpu_context", ] @@ -831,6 +817,15 @@ dependencies = [ "bit-vec 0.9.1", ] +[[package]] +name = "bit-set" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2f926cc3060f09db9ebc5b52823d85268d24bb917e472c0c4bea35780a7d" +dependencies = [ + "bit-vec 0.9.1", +] + [[package]] name = "bit-vec" version = "0.8.0" @@ -969,8 +964,8 @@ dependencies = [ "vello", "vello_common", "vello_cpu", - "vello_hybrid", - "wgpu", + "vello_gpu", + "wgpu 30.0.1", "wgpu_context", ] @@ -3139,9 +3134,9 @@ dependencies = [ [[package]] name = "fearless_simd" -version = "0.4.1" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b97b65636e5b9ef369943878ac74335ba1c55c1cb6adbf1e2c293c624248d693" +checksum = "f4beca3cb2444e3304ac30843cc091f44ed58932353cd492ce740067bfce6b12" [[package]] name = "filetime" @@ -3575,9 +3570,8 @@ dependencies = [ [[package]] name = "glifo" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed4a1bb24121291d27230c1b1b44e07d6a9b28cefdb32fe1581dfb84e14f940a" +version = "0.4.0" +source = "git+https://github.com/nicoburns/vello?branch=inverse-blur-classic#56267c6744c589c99f38da897ff1577b9340d9b0" dependencies = [ "bytemuck", "foldhash 0.2.0", @@ -5171,6 +5165,44 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "naga" +version = "30.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a616d2fb8c89516ac2723a581f69d6c18576046bed761bd6b305e5618e6ae130" +dependencies = [ + "arrayvec", + "bit-set 0.10.0", + "bitflags 2.13.1", + "cfg-if", + "cfg_aliases", + "codespan-reporting", + "half", + "hashbrown 0.17.1", + "indexmap", + "libm", + "log", + "naga-types", + "num-traits", + "once_cell", + "rustc-hash 1.1.0", + "spirv", + "thiserror 2.0.20", + "unicode-ident", +] + +[[package]] +name = "naga-types" +version = "30.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "590afbf58a6f4f62873cd5cff4468061844bafa1cdf399cc954537c22d768d49" +dependencies = [ + "hashbrown 0.17.1", + "indexmap", + "rustc-hash 1.1.0", + "thiserror 2.0.20", +] + [[package]] name = "native-tls" version = "0.2.18" @@ -5712,6 +5744,7 @@ dependencies = [ "bitflags 2.13.1", "objc2 0.6.4", "objc2-core-foundation", + "objc2-core-graphics", "objc2-foundation 0.3.2", "objc2-metal 0.3.2", ] @@ -6178,14 +6211,12 @@ dependencies = [ "raw-window-handle", "thiserror 2.0.20", "ultraviolet", - "wgpu", + "wgpu 29.0.4", ] [[package]] name = "pixels_window_renderer" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "320b195ebb5b4513d7c538fc7686ebd4ee3fa1f945e5995c70338f6d78fb07de" +version = "0.9.0" dependencies = [ "anyrender", "debug_timer 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -7353,9 +7384,9 @@ dependencies = [ [[package]] name = "skia-bindings" -version = "0.99.0" +version = "0.153.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e2d1c3ebd697c0cbded0145e9204a38fa6b268446051b7196d0a096414ea7f3" +checksum = "eb325787c91b3f6c34a7c6f2b8a2297b20292d733ca53a08c233e5028aec49af" dependencies = [ "bindgen", "cc", @@ -7370,9 +7401,9 @@ dependencies = [ [[package]] name = "skia-safe" -version = "0.99.0" +version = "0.153.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f512ac418a64194842dd05566320805dad1c957c521039db2486fd6368865bc" +checksum = "c61cb643dac43067f3eb76c866635a74377ac0abca0ff2590674e1e295514c3d" dependencies = [ "bitflags 2.13.1", "skia-bindings", @@ -7536,9 +7567,7 @@ dependencies = [ [[package]] name = "softbuffer_window_renderer" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13ce2a1c61716161a23530df2c507a7dd3f132a149789c5700f24f2893a3a877" +version = "0.9.0" dependencies = [ "anyrender", "debug_timer 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -8784,9 +8813,8 @@ checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" [[package]] name = "vello" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af76ceb17b2869be23598baef40a9c8db4de86b87c60510c3bc245559275a617" +version = "0.11.0" +source = "git+https://github.com/nicoburns/vello?branch=inverse-blur-classic#56267c6744c589c99f38da897ff1577b9340d9b0" dependencies = [ "bytemuck", "futures-intrusive", @@ -8798,14 +8826,13 @@ dependencies = [ "thiserror 2.0.20", "vello_encoding", "vello_shaders", - "wgpu", + "wgpu 30.0.1", ] [[package]] name = "vello_common" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2e9aed918117e8152c9eddfd8362d73c465c23f26c44786aa331707b8a64fa2" +version = "0.3.0" +source = "git+https://github.com/nicoburns/vello?branch=inverse-blur-classic#56267c6744c589c99f38da897ff1577b9340d9b0" dependencies = [ "bytemuck", "fearless_simd", @@ -8819,9 +8846,8 @@ dependencies = [ [[package]] name = "vello_cpu" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac7349e1f55f6b801c7c277958df4ea53e7f20f21e8014910ad888b2ecda93ea" +version = "0.3.0" +source = "git+https://github.com/nicoburns/vello?branch=inverse-blur-classic#56267c6744c589c99f38da897ff1577b9340d9b0" dependencies = [ "bytemuck", "crossbeam-channel", @@ -8836,9 +8862,8 @@ dependencies = [ [[package]] name = "vello_encoding" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e31cd622201690d8dfe9fd8fea8d1ae59db1bfeea414856a617d1d03438418c" +version = "0.11.0" +source = "git+https://github.com/nicoburns/vello?branch=inverse-blur-classic#56267c6744c589c99f38da897ff1577b9340d9b0" dependencies = [ "bytemuck", "guillotiere", @@ -8848,10 +8873,9 @@ dependencies = [ ] [[package]] -name = "vello_hybrid" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02606e4115d3d31ce33111dffa623dfa79629558bca8485d5ff4dde14ff884f9" +name = "vello_gpu" +version = "0.3.0" +source = "git+https://github.com/nicoburns/vello?branch=inverse-blur-classic#56267c6744c589c99f38da897ff1577b9340d9b0" dependencies = [ "bytemuck", "glifo", @@ -8860,37 +8884,35 @@ dependencies = [ "log", "thiserror 2.0.20", "vello_common", - "vello_sparse_shaders", + "vello_gpu_shaders", "web-sys", - "wgpu", + "wgpu 30.0.1", +] + +[[package]] +name = "vello_gpu_shaders" +version = "0.3.0" +source = "git+https://github.com/nicoburns/vello?branch=inverse-blur-classic#56267c6744c589c99f38da897ff1577b9340d9b0" +dependencies = [ + "naga 30.0.1", + "wesl", + "wesl-macros", + "wgsl-parse", + "wgsl-types", ] [[package]] name = "vello_shaders" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abf943bd2920bfd22928a9c1bad39866f7ffcc1109b6ed924ab52773e3868a83" +version = "0.11.0" +source = "git+https://github.com/nicoburns/vello?branch=inverse-blur-classic#56267c6744c589c99f38da897ff1577b9340d9b0" dependencies = [ "bytemuck", "log", - "naga", + "naga 30.0.1", "thiserror 2.0.20", "vello_encoding", ] -[[package]] -name = "vello_sparse_shaders" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c92bcc433a5f64ae44d54f86541e65459d85d4fa2f879f35769009f608a877d8" -dependencies = [ - "naga", - "wesl", - "wesl-macros", - "wgsl-parse", - "wgsl-types", -] - [[package]] name = "version-compare" version = "0.2.1" @@ -9296,7 +9318,37 @@ dependencies = [ "hashbrown 0.16.1", "js-sys", "log", - "naga", + "naga 29.0.4", + "parking_lot", + "portable-atomic", + "profiling", + "raw-window-handle", + "smallvec", + "static_assertions", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "wgpu-core 29.0.4", + "wgpu-hal 29.0.4", + "wgpu-types 29.0.4", +] + +[[package]] +name = "wgpu" +version = "30.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "527ccdf43dd5b2e8676eed9984ce00e2bbb0a1b85b70c1969dcb6cd2eb55ab9e" +dependencies = [ + "arrayvec", + "bitflags 2.13.1", + "bytemuck", + "cfg-if", + "cfg_aliases", + "document-features", + "hashbrown 0.17.1", + "js-sys", + "log", + "naga 30.0.1", "parking_lot", "portable-atomic", "profiling", @@ -9306,9 +9358,9 @@ dependencies = [ "wasm-bindgen", "wasm-bindgen-futures", "web-sys", - "wgpu-core", - "wgpu-hal", - "wgpu-types", + "wgpu-core 30.0.1", + "wgpu-hal 30.0.1", + "wgpu-types 30.0.1", ] [[package]] @@ -9327,7 +9379,7 @@ dependencies = [ "hashbrown 0.16.1", "indexmap", "log", - "naga", + "naga 29.0.4", "once_cell", "parking_lot", "portable-atomic", @@ -9336,13 +9388,47 @@ dependencies = [ "rustc-hash 1.1.0", "smallvec", "thiserror 2.0.20", - "wgpu-core-deps-apple", - "wgpu-core-deps-emscripten", + "wgpu-core-deps-apple 29.0.4", + "wgpu-core-deps-emscripten 29.0.4", "wgpu-core-deps-wasm", - "wgpu-core-deps-windows-linux-android", - "wgpu-hal", - "wgpu-naga-bridge", - "wgpu-types", + "wgpu-core-deps-windows-linux-android 29.0.4", + "wgpu-hal 29.0.4", + "wgpu-naga-bridge 29.0.4", + "wgpu-types 29.0.4", +] + +[[package]] +name = "wgpu-core" +version = "30.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14c018fce9b6270aa203c2fdd56f3cce996713534bd757e4ea58c8560b121f14" +dependencies = [ + "arrayvec", + "bit-set 0.10.0", + "bit-vec 0.9.1", + "bitflags 2.13.1", + "bytemuck", + "cfg_aliases", + "document-features", + "hashbrown 0.17.1", + "indexmap", + "log", + "naga 30.0.1", + "naga-types", + "once_cell", + "parking_lot", + "portable-atomic", + "profiling", + "raw-window-handle", + "rustc-hash 1.1.0", + "smallvec", + "thiserror 2.0.20", + "wgpu-core-deps-apple 30.0.1", + "wgpu-core-deps-emscripten 30.0.1", + "wgpu-core-deps-windows-linux-android 30.0.1", + "wgpu-hal 30.0.1", + "wgpu-naga-bridge 30.0.1", + "wgpu-types 30.0.1", ] [[package]] @@ -9351,7 +9437,16 @@ version = "29.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f5e39e26c4c0e07589e67d18546cf79ff45383659fc72fca4dd293358a0347f3" dependencies = [ - "wgpu-hal", + "wgpu-hal 29.0.4", +] + +[[package]] +name = "wgpu-core-deps-apple" +version = "30.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "061f3d319a40d39d00b1ecc2c33b89fe21d4e6fe01859df3500a3a8ecccd6b68" +dependencies = [ + "wgpu-hal 30.0.1", ] [[package]] @@ -9360,7 +9455,16 @@ version = "29.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "01e09be551dc939498bdd5f6b2c66e55ab275dad25825267a08605a80fc9f0af" dependencies = [ - "wgpu-hal", + "wgpu-hal 29.0.4", +] + +[[package]] +name = "wgpu-core-deps-emscripten" +version = "30.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d98b86cf4abf524a902dd35f18ca6a3f08fc2ae9847c8f10b48e30491b1f0b86" +dependencies = [ + "wgpu-hal 30.0.1", ] [[package]] @@ -9369,7 +9473,7 @@ version = "29.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af1fb1798be2a912497d4c224f72d39bb0cb34af50e8bcc29865bc339c943059" dependencies = [ - "wgpu-hal", + "wgpu-hal 29.0.4", ] [[package]] @@ -9378,7 +9482,16 @@ version = "29.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4e592c1bbef6ad047647ae6e666ebd8cee7a32bb4544d9700ec96cbf73230257" dependencies = [ - "wgpu-hal", + "wgpu-hal 29.0.4", +] + +[[package]] +name = "wgpu-core-deps-windows-linux-android" +version = "30.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7586165fd5f6d881cb9ce4bb71f40d6caab2c0f1837e3fc1d9788a197fb6004f" +dependencies = [ + "wgpu-hal 30.0.1", ] [[package]] @@ -9406,10 +9519,65 @@ dependencies = [ "libc", "libloading", "log", - "naga", + "naga 29.0.4", + "ndk-sys", + "objc2 0.6.4", + "objc2-core-foundation", + "objc2-foundation 0.3.2", + "objc2-metal 0.3.2", + "objc2-quartz-core 0.3.2", + "once_cell", + "ordered-float", + "parking_lot", + "portable-atomic", + "portable-atomic-util", + "profiling", + "range-alloc", + "raw-window-handle", + "raw-window-metal 1.1.0", + "renderdoc-sys", + "smallvec", + "thiserror 2.0.20", + "wasm-bindgen", + "wayland-sys", + "web-sys", + "wgpu-naga-bridge 29.0.4", + "wgpu-types 29.0.4", + "windows", + "windows-core", + "windows-result", +] + +[[package]] +name = "wgpu-hal" +version = "30.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6b7fb58561a792bc237628ba0792e332de418fefe145f13b5ed8201e6d52f58" +dependencies = [ + "android_system_properties", + "arrayvec", + "ash", + "bit-set 0.10.0", + "bitflags 2.13.1", + "block2 0.6.2", + "bytemuck", + "cfg-if", + "cfg_aliases", + "glow", + "glutin_wgl_sys", + "gpu-allocator", + "hashbrown 0.17.1", + "js-sys", + "khronos-egl", + "libc", + "libloading", + "log", + "naga 30.0.1", + "naga-types", "ndk-sys", "objc2 0.6.4", "objc2-core-foundation", + "objc2-core-graphics", "objc2-foundation 0.3.2", "objc2-metal 0.3.2", "objc2-quartz-core 0.3.2", @@ -9424,12 +9592,13 @@ dependencies = [ "raw-window-metal 1.1.0", "renderdoc-sys", "smallvec", + "static_assertions", "thiserror 2.0.20", "wasm-bindgen", "wayland-sys", "web-sys", - "wgpu-naga-bridge", - "wgpu-types", + "wgpu-naga-bridge 30.0.1", + "wgpu-types 30.0.1", "windows", "windows-core", "windows-result", @@ -9441,8 +9610,18 @@ version = "29.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95226013f547544b223281cd16a4fb549aa9dcb562adbda0faae4c73ffbbc161" dependencies = [ - "naga", - "wgpu-types", + "naga 29.0.4", + "wgpu-types 29.0.4", +] + +[[package]] +name = "wgpu-naga-bridge" +version = "30.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2f62e73117bb7a62bfd9c5a5841438a823f6566c6442a808ee269d2d055c081" +dependencies = [ + "naga 30.0.1", + "wgpu-types 30.0.1", ] [[package]] @@ -9460,13 +9639,27 @@ dependencies = [ ] [[package]] -name = "wgpu_context" -version = "0.9.0" +name = "wgpu-types" +version = "30.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d6c2553d5b114dfd941fa3372c7df1e1cde7bd81800e89aa13b7e3af2e4be9b" +checksum = "99dad6f1fbdbbdb4c278a6508b059d44688f5cebddf78d005a46a31340269286" +dependencies = [ + "bitflags 2.13.1", + "bytemuck", + "js-sys", + "log", + "naga-types", + "raw-window-handle", + "static_assertions", + "web-sys", +] + +[[package]] +name = "wgpu_context" +version = "0.10.0" dependencies = [ "futures-intrusive", - "wgpu", + "wgpu 30.0.1", ] [[package]] @@ -9486,7 +9679,7 @@ dependencies = [ "dioxus-native", "peniko", "pollster", - "wgpu", + "wgpu 30.0.1", "wgpu_context", ] diff --git a/Cargo.toml b/Cargo.toml index 8cd284cd06..4872a8139b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -114,21 +114,21 @@ skrifa = { version = "0.44", default-features = false, features = [ ] } # Should match parley and vello versions # AnyRender -anyrender = { version = "0.13.0" } -anyrender_serialize = { version = "0.7.0" } -anyrender_skia = { version = "0.11.0" } -anyrender_vello = { version = "0.14.0" } -anyrender_vello_cpu = { version = "0.17.0" } -anyrender_vello_hybrid = { version = "0.10.0" } -anyrender_svg = { version = "0.14.0" } -wgpu_context = { version = "0.9.0" } +anyrender = { version = "0.14.0" } +anyrender_serialize = { version = "0.8.0" } +anyrender_skia = { version = "0.12.0" } +anyrender_vello = { version = "0.15.0" } +anyrender_vello_cpu = { version = "0.18.0" } +anyrender_vello_hybrid = { version = "0.11.0" } +anyrender_svg = { version = "0.15.0" } +wgpu_context = { version = "0.10.0" } # Linebender + Fontations + WGPU + SVG color = "0.3" linebender_resource_handle = "0.1" peniko = "0.6.0" kurbo = "0.13.1" -wgpu = "29" +wgpu = "30" usvg = "0.48.1" svgtypes = "0.16.1" # Should match usvg's version @@ -281,22 +281,28 @@ peniko = { workspace = true } color = { workspace = true } env_logger = "0.11" tracing-subscriber = "0.3" -vello = "0.10" -vello_cpu = "0.1" -vello_hybrid = "0.1" -vello_common = "0.1" +vello = "0.11" +vello_cpu = "0.3" +vello_hybrid = { package = "vello_gpu", version = "0.3" } +vello_common = "0.3" wgpu = { workspace = true } wgpu_context = { workspace = true } rustc-hash = { workspace = true } -# [patch.crates-io] -# anyrender = { path = "../anyrender/crates/anyrender" } -# anyrender_skia = { path = "../anyrender/crates/anyrender_skia" } -# anyrender_vello = { path = "../anyrender/crates/anyrender_vello" } -# anyrender_vello_cpu = { path = "../anyrender/crates/anyrender_vello_cpu" } -# anyrender_vello_hybrid = { path = "../anyrender/crates/anyrender_vello_hybrid" } -# anyrender_svg = { path = "../anyrender/crates/anyrender_svg" } -# wgpu_context = { path = "../anyrender/crates/wgpu_context" } +[patch.crates-io] +anyrender = { path = "../anyrender/crates/anyrender" } +anyrender_serialize = { path = "../anyrender/crates/anyrender_serialize" } +anyrender_skia = { path = "../anyrender/crates/anyrender_skia" } +anyrender_vello = { path = "../anyrender/crates/anyrender_vello" } +anyrender_vello_cpu = { path = "../anyrender/crates/anyrender_vello_cpu" } +anyrender_vello_hybrid = { path = "../anyrender/crates/anyrender_vello_hybrid" } +anyrender_svg = { path = "../anyrender/crates/anyrender_svg" } +wgpu_context = { path = "../anyrender/crates/wgpu_context" } +vello = { git = "https://github.com/nicoburns/vello", branch = "inverse-blur-classic" } +vello_common = { git = "https://github.com/nicoburns/vello", branch = "inverse-blur-classic" } +vello_cpu = { git = "https://github.com/nicoburns/vello", branch = "inverse-blur-classic" } +vello_gpu = { git = "https://github.com/nicoburns/vello", branch = "inverse-blur-classic" } +glifo = { git = "https://github.com/nicoburns/vello", branch = "inverse-blur-classic" } # vello = { path = "../vello/vello" } # vello_cpu = { path = "../vello/sparse_strips/vello_cpu" } diff --git a/examples/paint_bench.rs b/examples/paint_bench.rs index 92dcc37ead..bc3df8fc69 100644 --- a/examples/paint_bench.rs +++ b/examples/paint_bench.rs @@ -217,15 +217,22 @@ async fn main() { .await .expect("Failed to create wgpu device"); - let mut renderer = vello_hybrid::Renderer::new( + let (mut renderer, mut resources) = vello_hybrid::Renderer::new( &device_handle.device, &vello_hybrid::RenderTargetConfig { format: wgpu::TextureFormat::Bgra8Unorm, - width: render_width, - height: render_height, + width: render_width as u16, + height: render_height as u16, }, ); - let mut resources = vello_hybrid::Resources::new(); + let render_size = vello_hybrid::RenderSize { + width: render_width as u16, + height: render_height as u16, + }; + let depth_texture_view = vello_hybrid::Renderer::create_depth_texture_view( + &device_handle.device, + &render_size, + ); let mut scene = vello_hybrid::Scene::new(render_width as u16, render_height as u16); let mut image_cache = FxHashMap::default(); let mut texture_bindings = FxHashMap::default(); @@ -296,12 +303,11 @@ async fn main() { &device_handle.device, &device_handle.queue, &mut encoder, - &vello_hybrid::RenderSize { - width: render_width, - height: render_height, - }, + &render_size, &target_texture_view, + Some(&depth_texture_view), &hybrid_texture_bindings, + vello_hybrid::TargetInit::Clear(vello_hybrid::ClearSettings::default()), ) .expect("Failed to render to texture"); device_handle.queue.submit([encoder.finish()]); diff --git a/packages/blitz-paint/src/layers.rs b/packages/blitz-paint/src/layers.rs index 65e480f9e0..bd1b4e7eeb 100644 --- a/packages/blitz-paint/src/layers.rs +++ b/packages/blitz-paint/src/layers.rs @@ -1,6 +1,6 @@ use anyrender::{Filter, PaintScene}; use kurbo::{Affine, Shape}; -use peniko::Mix; +use peniko::{Fill, Mix}; use std::{cell::Cell, sync::Arc}; const LAYER_LIMIT: u32 = 1024; @@ -65,9 +65,10 @@ impl LayerManager { // Actually push the layer if opacity == 1.0 && filter.is_none() && backdrop_filter.is_none() { - scene.push_clip_layer(transform, shape); + scene.push_clip_layer(Fill::NonZero, transform, shape); } else { scene.push_layer( + Fill::NonZero, Mix::Normal, opacity, transform, diff --git a/packages/blitz-paint/src/render/border.rs b/packages/blitz-paint/src/render/border.rs index 81c207235c..c7ecb2ef74 100644 --- a/packages/blitz-paint/src/render/border.rs +++ b/packages/blitz-paint/src/render/border.rs @@ -431,7 +431,7 @@ impl ElementCx<'_, '_> { .with_caps(Cap::Butt) .with_dashes(0.0, [dash, gap]); let clip = self.frame.border_edge_shape(edge); - scene.push_clip_layer(self.transform, &clip); + scene.push_clip_layer(Fill::NonZero, self.transform, &clip); scene.stroke(&stroke, self.transform, color, None, ¢erline); scene.pop_layer(); } @@ -504,7 +504,7 @@ impl ElementCx<'_, '_> { } let clip = self.frame.border_edge_shape(edge); - scene.push_clip_layer(self.transform, &clip); + scene.push_clip_layer(Fill::NonZero, self.transform, &clip); scene.fill(Fill::NonZero, self.transform, color, None, &path); scene.pop_layer(); } diff --git a/packages/blitz-paint/src/render/box_shadow.rs b/packages/blitz-paint/src/render/box_shadow.rs index 8b130f4108..13134d11f3 100644 --- a/packages/blitz-paint/src/render/box_shadow.rs +++ b/packages/blitz-paint/src/render/box_shadow.rs @@ -1,8 +1,8 @@ use super::ElementCx; use crate::color::{Color, ToColorColor as _}; use anyrender::PaintScene; -use kurbo::{Rect, Vec2}; -use peniko::{Compose, Fill, Mix}; +use kurbo::{Rect, Shape as _, Vec2}; +use peniko::Fill; impl ElementCx<'_, '_> { pub(super) fn draw_outset_box_shadow(&self, scene: &mut impl PaintScene) { @@ -35,55 +35,71 @@ impl ElementCx<'_, '_> { prev.union(rect) }); - self.context.layer_manager.maybe_with_layer( - scene, - needs_clip, - 1.0, - self.transform, - &self.frame.shadow_clip(max_shadow_rect), - None, - None, - |scene| { - for shadow in box_shadow.iter().filter(|s| !s.inset).rev() { - let shadow_color = shadow - .base - .color - .resolve_to_absolute(¤t_color) - .as_srgb_color(); - - let alpha = shadow_color.components[3]; - if alpha != 0.0 { - let transform = self.transform.then_translate(Vec2 { - x: shadow.base.horizontal.px() as f64 * self.scale, - y: shadow.base.vertical.px() as f64 * self.scale, - }); - - let spread = shadow.spread.px() as f64 * self.scale; - let blur = shadow.base.blur.px() as f64; - - // Without blur or spread the shadow is exactly the element's shape, - // so fill the border box path directly (preserving individual radii) - if blur == 0.0 && spread == 0.0 { - scene.fill( - Fill::NonZero, - transform, - shadow_color, - None, - &self.frame.border_box_path(), - ); - continue; - } - - // TODO draw shadows with matching individual radii instead of averaging - let radius = self.frame.border_radii.average(); - let rect = self.frame.border_box.inflate(spread, spread); - - // Fill the color - scene.draw_box_shadow(transform, rect, shadow_color, radius, blur); - } - } - }, - ) + for shadow in box_shadow.iter().filter(|s| !s.inset).rev() { + let shadow_color = shadow + .base + .color + .resolve_to_absolute(¤t_color) + .as_srgb_color(); + + let alpha = shadow_color.components[3]; + if alpha == 0.0 { + continue; + } + + let offset = Vec2 { + x: shadow.base.horizontal.px() as f64 * self.scale, + y: shadow.base.vertical.px() as f64 * self.scale, + }; + let spread = shadow.spread.px() as f64 * self.scale; + let blur = shadow.base.blur.px() as f64; + + // Without blur or spread the shadow is exactly the element's shape, + // so fill the border box path directly (preserving individual radii) + if blur == 0.0 && spread == 0.0 { + self.context.layer_manager.maybe_with_layer( + scene, + needs_clip, + 1.0, + self.transform, + &self.frame.shadow_clip(max_shadow_rect), + None, + None, + |scene| { + scene.fill( + Fill::NonZero, + self.transform.pre_translate(offset), + shadow_color, + None, + &self.frame.border_box_path(), + ); + }, + ); + continue; + } + + // TODO draw shadows with matching individual radii instead of averaging + let radius = self.frame.border_radii.average(); + let rect = self.frame.border_box.inflate(spread, spread) + offset; + + // Only paint the shadow outside of the border box if it could otherwise be seen + // through the element + let shape = if needs_clip { + self.frame.shadow_clip(max_shadow_rect) + } else { + max_shadow_rect.to_path(0.1) + }; + + scene.draw_box_shadow( + self.transform, + &shape, + rect, + shadow_color, + radius, + blur, + false, + ); + } } pub(super) fn draw_inset_box_shadow(&self, scene: &mut impl PaintScene) { @@ -108,41 +124,23 @@ impl ElementCx<'_, '_> { // TODO draw shadows with matching individual radii instead of averaging let radius = self.frame.border_radii.average(); - let transform = self.transform.then_translate(Vec2 { + let offset = Vec2 { x: shadow.base.horizontal.px() as f64, y: shadow.base.vertical.px() as f64, - }); - - scene.push_layer(Mix::Normal, 1.0, self.transform, &padding_box, None, None); - scene.fill( - Fill::NonZero, - self.transform, - shadow_color, - None, - &padding_box, - ); + }; - scene.push_layer( - Compose::DestOut, - 1.0, - self.transform, - &padding_box, - None, - None, - ); // The unshadowed area is the padding box shrunk by the spread radius let spread = shadow.spread.px() as f64 * self.scale; - let hole = self.frame.padding_box.inflate(-spread, -spread); + let hole = self.frame.padding_box.inflate(-spread, -spread) + offset; scene.draw_box_shadow( - transform, + self.transform, + &padding_box, hole, - Color::WHITE, + shadow_color, radius, shadow.base.blur.px() as f64 * self.scale, + true, ); - - scene.pop_layer(); - scene.pop_layer(); } } } diff --git a/packages/blitz-paint/src/render/mask.rs b/packages/blitz-paint/src/render/mask.rs index 420b7ec8bb..81f065fd3e 100644 --- a/packages/blitz-paint/src/render/mask.rs +++ b/packages/blitz-paint/src/render/mask.rs @@ -19,7 +19,7 @@ use crate::render::background::get_cyclic; use super::ElementCx; use super::background::ImageLayerStyles; use anyrender::PaintScene; -use peniko::{BlendMode, Compose, Mix}; +use peniko::{BlendMode, Compose, Fill, Mix}; use style::properties::generated::longhands::mask_composite::single_value::computed_value::T as StyloMaskComposite; use style::values::generics::image::GenericImage; @@ -56,6 +56,7 @@ impl ElementCx<'_, '_> { // Content outside of the mask painting area (at largest the border box) has // a mask alpha of 0, so we can clip the isolation layer to the border box. scene.push_layer( + Fill::NonZero, Mix::Normal, ALMOST_OPAQUE, self.transform, @@ -75,6 +76,7 @@ impl ElementCx<'_, '_> { } scene.push_layer( + Fill::NonZero, BlendMode::new(Mix::Normal, Compose::DestIn), 1.0, self.transform, @@ -127,6 +129,7 @@ impl ElementCx<'_, '_> { // which draw nothing) as compositing a transparent black layer with e.g. // `intersect` clears the mask built up so far. scene.push_layer( + Fill::NonZero, BlendMode::new(Mix::Normal, compose), 1.0, self.transform, From 59f57329abd2d8d416dc300eab2c110373db46fd Mon Sep 17 00:00:00 2001 From: Nico Burns Date: Sat, 3 Oct 2026 17:44:18 +0000 Subject: [PATCH 02/10] Point anyrender patch at the anyrender PR branch --- Cargo.lock | 10 ++++++++++ Cargo.toml | 16 ++++++++-------- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d8e73364a1..5996b2d1ef 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -295,6 +295,7 @@ checksum = "330a5ed07fa54e4702c9d6c4174f74427fc0ef6e214bbd677ae50a5099946470" [[package]] name = "anyrender" version = "0.14.0" +source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#380f92545f137576b2edd45c2f56ffc9bb580762" dependencies = [ "kurbo", "peniko", @@ -306,6 +307,7 @@ dependencies = [ [[package]] name = "anyrender_serialize" version = "0.8.0" +source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#380f92545f137576b2edd45c2f56ffc9bb580762" dependencies = [ "anyrender", "image", @@ -323,6 +325,7 @@ dependencies = [ [[package]] name = "anyrender_skia" version = "0.12.0" +source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#380f92545f137576b2edd45c2f56ffc9bb580762" dependencies = [ "anyrender", "ash", @@ -349,6 +352,7 @@ dependencies = [ [[package]] name = "anyrender_svg" version = "0.15.0" +source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#380f92545f137576b2edd45c2f56ffc9bb580762" dependencies = [ "anyrender", "image", @@ -360,6 +364,7 @@ dependencies = [ [[package]] name = "anyrender_vello" version = "0.15.0" +source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#380f92545f137576b2edd45c2f56ffc9bb580762" dependencies = [ "anyrender", "debug_timer 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -377,6 +382,7 @@ dependencies = [ [[package]] name = "anyrender_vello_cpu" version = "0.18.0" +source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#380f92545f137576b2edd45c2f56ffc9bb580762" dependencies = [ "anyrender", "bytemuck", @@ -394,6 +400,7 @@ dependencies = [ [[package]] name = "anyrender_vello_hybrid" version = "0.11.0" +source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#380f92545f137576b2edd45c2f56ffc9bb580762" dependencies = [ "anyrender", "debug_timer 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -6217,6 +6224,7 @@ dependencies = [ [[package]] name = "pixels_window_renderer" version = "0.9.0" +source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#380f92545f137576b2edd45c2f56ffc9bb580762" dependencies = [ "anyrender", "debug_timer 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -7568,6 +7576,7 @@ dependencies = [ [[package]] name = "softbuffer_window_renderer" version = "0.9.0" +source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#380f92545f137576b2edd45c2f56ffc9bb580762" dependencies = [ "anyrender", "debug_timer 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -9657,6 +9666,7 @@ dependencies = [ [[package]] name = "wgpu_context" version = "0.10.0" +source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#380f92545f137576b2edd45c2f56ffc9bb580762" dependencies = [ "futures-intrusive", "wgpu 30.0.1", diff --git a/Cargo.toml b/Cargo.toml index 4872a8139b..ee66221f84 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -290,14 +290,14 @@ wgpu_context = { workspace = true } rustc-hash = { workspace = true } [patch.crates-io] -anyrender = { path = "../anyrender/crates/anyrender" } -anyrender_serialize = { path = "../anyrender/crates/anyrender_serialize" } -anyrender_skia = { path = "../anyrender/crates/anyrender_skia" } -anyrender_vello = { path = "../anyrender/crates/anyrender_vello" } -anyrender_vello_cpu = { path = "../anyrender/crates/anyrender_vello_cpu" } -anyrender_vello_hybrid = { path = "../anyrender/crates/anyrender_vello_hybrid" } -anyrender_svg = { path = "../anyrender/crates/anyrender_svg" } -wgpu_context = { path = "../anyrender/crates/wgpu_context" } +anyrender = { git = "https://github.com/DioxusLabs/anyrender", branch = "devin/1791048554-box-shadow-shape-inset" } +anyrender_serialize = { git = "https://github.com/DioxusLabs/anyrender", branch = "devin/1791048554-box-shadow-shape-inset" } +anyrender_skia = { git = "https://github.com/DioxusLabs/anyrender", branch = "devin/1791048554-box-shadow-shape-inset" } +anyrender_vello = { git = "https://github.com/DioxusLabs/anyrender", branch = "devin/1791048554-box-shadow-shape-inset" } +anyrender_vello_cpu = { git = "https://github.com/DioxusLabs/anyrender", branch = "devin/1791048554-box-shadow-shape-inset" } +anyrender_vello_hybrid = { git = "https://github.com/DioxusLabs/anyrender", branch = "devin/1791048554-box-shadow-shape-inset" } +anyrender_svg = { git = "https://github.com/DioxusLabs/anyrender", branch = "devin/1791048554-box-shadow-shape-inset" } +wgpu_context = { git = "https://github.com/DioxusLabs/anyrender", branch = "devin/1791048554-box-shadow-shape-inset" } vello = { git = "https://github.com/nicoburns/vello", branch = "inverse-blur-classic" } vello_common = { git = "https://github.com/nicoburns/vello", branch = "inverse-blur-classic" } vello_cpu = { git = "https://github.com/nicoburns/vello", branch = "inverse-blur-classic" } From 00a5847587e3affe1f98e8351521a9692ec32151 Mon Sep 17 00:00:00 2001 From: Nico Burns Date: Sat, 3 Oct 2026 19:08:34 +0000 Subject: [PATCH 03/10] Pass CSS boxes to anyrender as NonUniformRoundedRect instead of BezPath --- Cargo.lock | 20 ++++----- packages/blitz-paint/src/kurbo_css/css_box.rs | 42 +++++++++++++++++++ packages/blitz-paint/src/render.rs | 4 +- packages/blitz-paint/src/render/background.rs | 14 +++---- packages/blitz-paint/src/render/box_shadow.rs | 4 +- packages/blitz-paint/src/render/mask.rs | 4 +- 6 files changed, 65 insertions(+), 23 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5996b2d1ef..c649a292a2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -295,7 +295,7 @@ checksum = "330a5ed07fa54e4702c9d6c4174f74427fc0ef6e214bbd677ae50a5099946470" [[package]] name = "anyrender" version = "0.14.0" -source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#380f92545f137576b2edd45c2f56ffc9bb580762" +source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#b86f87cf87d609a03bbafcba50dc1474790a59a6" dependencies = [ "kurbo", "peniko", @@ -307,7 +307,7 @@ dependencies = [ [[package]] name = "anyrender_serialize" version = "0.8.0" -source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#380f92545f137576b2edd45c2f56ffc9bb580762" +source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#b86f87cf87d609a03bbafcba50dc1474790a59a6" dependencies = [ "anyrender", "image", @@ -325,7 +325,7 @@ dependencies = [ [[package]] name = "anyrender_skia" version = "0.12.0" -source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#380f92545f137576b2edd45c2f56ffc9bb580762" +source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#b86f87cf87d609a03bbafcba50dc1474790a59a6" dependencies = [ "anyrender", "ash", @@ -352,7 +352,7 @@ dependencies = [ [[package]] name = "anyrender_svg" version = "0.15.0" -source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#380f92545f137576b2edd45c2f56ffc9bb580762" +source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#b86f87cf87d609a03bbafcba50dc1474790a59a6" dependencies = [ "anyrender", "image", @@ -364,7 +364,7 @@ dependencies = [ [[package]] name = "anyrender_vello" version = "0.15.0" -source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#380f92545f137576b2edd45c2f56ffc9bb580762" +source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#b86f87cf87d609a03bbafcba50dc1474790a59a6" dependencies = [ "anyrender", "debug_timer 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -382,7 +382,7 @@ dependencies = [ [[package]] name = "anyrender_vello_cpu" version = "0.18.0" -source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#380f92545f137576b2edd45c2f56ffc9bb580762" +source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#b86f87cf87d609a03bbafcba50dc1474790a59a6" dependencies = [ "anyrender", "bytemuck", @@ -400,7 +400,7 @@ dependencies = [ [[package]] name = "anyrender_vello_hybrid" version = "0.11.0" -source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#380f92545f137576b2edd45c2f56ffc9bb580762" +source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#b86f87cf87d609a03bbafcba50dc1474790a59a6" dependencies = [ "anyrender", "debug_timer 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -6224,7 +6224,7 @@ dependencies = [ [[package]] name = "pixels_window_renderer" version = "0.9.0" -source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#380f92545f137576b2edd45c2f56ffc9bb580762" +source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#b86f87cf87d609a03bbafcba50dc1474790a59a6" dependencies = [ "anyrender", "debug_timer 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -7576,7 +7576,7 @@ dependencies = [ [[package]] name = "softbuffer_window_renderer" version = "0.9.0" -source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#380f92545f137576b2edd45c2f56ffc9bb580762" +source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#b86f87cf87d609a03bbafcba50dc1474790a59a6" dependencies = [ "anyrender", "debug_timer 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -9666,7 +9666,7 @@ dependencies = [ [[package]] name = "wgpu_context" version = "0.10.0" -source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#380f92545f137576b2edd45c2f56ffc9bb580762" +source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#b86f87cf87d609a03bbafcba50dc1474790a59a6" dependencies = [ "futures-intrusive", "wgpu 30.0.1", diff --git a/packages/blitz-paint/src/kurbo_css/css_box.rs b/packages/blitz-paint/src/kurbo_css/css_box.rs index 321077fe00..52d0d6ae86 100644 --- a/packages/blitz-paint/src/kurbo_css/css_box.rs +++ b/packages/blitz-paint/src/kurbo_css/css_box.rs @@ -1,3 +1,4 @@ +use anyrender::NonUniformRoundedRect; use kurbo::{Arc, BezPath, Insets, PathEl, Point, Rect, Shape as _, Vec2}; use std::{f64::consts::FRAC_PI_2, f64::consts::PI}; @@ -209,6 +210,47 @@ impl CssBox { path } + /// The frame's border box as a shape that backends can recognise as a (rounded) rect + pub fn border_box_shape(&self) -> NonUniformRoundedRect { + self.box_shape(CssBoxKind::BorderBox) + } + + /// The frame's padding box as a shape that backends can recognise as a (rounded) rect + pub fn padding_box_shape(&self) -> NonUniformRoundedRect { + self.box_shape(CssBoxKind::PaddingBox) + } + + /// The frame's content box as a shape that backends can recognise as a (rounded) rect + pub fn content_box_shape(&self) -> NonUniformRoundedRect { + self.box_shape(CssBoxKind::ContentBox) + } + + fn box_shape(&self, kind: CssBoxKind) -> NonUniformRoundedRect { + use Corner::*; + let rect = match kind { + CssBoxKind::OutlineBox => self.outline_box, + CssBoxKind::BorderBox => self.border_box, + CssBoxKind::PaddingBox => self.padding_box, + CssBoxKind::ContentBox => self.content_box, + }; + let radii = |corner| { + if self.is_sharp(corner, kind) { + Vec2::ZERO + } else { + self.ellipse(corner, kind).1 + } + }; + NonUniformRoundedRect::new( + rect, + anyrender::NonUniformRoundedRectRadii { + top_left: radii(TopLeft), + top_right: radii(TopRight), + bottom_right: radii(BottomRight), + bottom_left: radii(BottomLeft), + }, + ) + } + /// Construct a bezpath drawing the frame border pub fn border_box_path(&self) -> BezPath { let mut path = BezPath::new(); diff --git a/packages/blitz-paint/src/render.rs b/packages/blitz-paint/src/render.rs index c91d00b98c..d2d376b4f1 100644 --- a/packages/blitz-paint/src/render.rs +++ b/packages/blitz-paint/src/render.rs @@ -535,9 +535,9 @@ impl<'dom, 'a> BlitzDomPainter<'dom, 'a> { // TODO: allow layers with opacity to be unclipped (overflow: visible) let clip = if is_text_input { - &cx.frame.content_box_path() + &cx.frame.content_box_shape() } else { - &cx.frame.padding_box_path() + &cx.frame.padding_box_shape() }; // Clip layer if box requires clipping. Opacity set to 1.0 diff --git a/packages/blitz-paint/src/render/background.rs b/packages/blitz-paint/src/render/background.rs index ba7e5b072d..4ee4361886 100644 --- a/packages/blitz-paint/src/render/background.rs +++ b/packages/blitz-paint/src/render/background.rs @@ -1,10 +1,10 @@ use super::{ElementCx, to_image_quality, to_peniko_image}; use crate::color::{Color, ToColorColor}; use crate::gradient::to_peniko_gradient; -use anyrender::PaintScene; +use anyrender::{NonUniformRoundedRect, PaintScene}; use blitz_dom::NodeId; use blitz_dom::node::{ImageData, ImageResourceData, SpecialElementData}; -use kurbo::{self, Affine, BezPath, Point, Rect, Shape, Size, Vec2}; +use kurbo::{self, Affine, Point, Rect, Shape, Size, Vec2}; use peniko::{self, Fill}; use style::{ computed_values::border_collapse::T as BorderCollapse, @@ -169,11 +169,11 @@ impl ElementCx<'_, '_> { } /// The path of the given CSS box model box for this element - pub(super) fn box_path(&self, css_box: BoxModelBox) -> BezPath { + pub(super) fn box_path(&self, css_box: BoxModelBox) -> NonUniformRoundedRect { match css_box { - BoxModelBox::BorderBox => self.frame.border_box_path(), - BoxModelBox::PaddingBox => self.frame.padding_box_path(), - BoxModelBox::ContentBox => self.frame.content_box_path(), + BoxModelBox::BorderBox => self.frame.border_box_shape(), + BoxModelBox::PaddingBox => self.frame.padding_box_shape(), + BoxModelBox::ContentBox => self.frame.content_box_shape(), } } @@ -330,7 +330,7 @@ impl ElementCx<'_, '_> { } } - fn draw_solid_bg(&self, scene: &mut impl PaintScene, shape: &BezPath) { + fn draw_solid_bg(&self, scene: &mut impl PaintScene, shape: &impl Shape) { let current_color = self.style.clone_color(); let background_color = &self.style.get_background().background_color; let bg_color = background_color diff --git a/packages/blitz-paint/src/render/box_shadow.rs b/packages/blitz-paint/src/render/box_shadow.rs index 13134d11f3..d6062189f8 100644 --- a/packages/blitz-paint/src/render/box_shadow.rs +++ b/packages/blitz-paint/src/render/box_shadow.rs @@ -71,7 +71,7 @@ impl ElementCx<'_, '_> { self.transform.pre_translate(offset), shadow_color, None, - &self.frame.border_box_path(), + &self.frame.border_box_shape(), ); }, ); @@ -110,7 +110,7 @@ impl ElementCx<'_, '_> { return; } - let padding_box = self.frame.padding_box_path(); + let padding_box = self.frame.padding_box_shape(); for shadow in box_shadow.iter().filter(|s| s.inset) { let shadow_color = shadow diff --git a/packages/blitz-paint/src/render/mask.rs b/packages/blitz-paint/src/render/mask.rs index 81f065fd3e..1760f6eb11 100644 --- a/packages/blitz-paint/src/render/mask.rs +++ b/packages/blitz-paint/src/render/mask.rs @@ -60,7 +60,7 @@ impl ElementCx<'_, '_> { Mix::Normal, ALMOST_OPAQUE, self.transform, - &self.frame.border_box_path(), + &self.frame.border_box_shape(), None, None, ); @@ -80,7 +80,7 @@ impl ElementCx<'_, '_> { BlendMode::new(Mix::Normal, Compose::DestIn), 1.0, self.transform, - &self.frame.border_box_path(), + &self.frame.border_box_shape(), None, None, ); From 684c266ced20ffb1534c6e6000af0bbb940b5251 Mon Sep 17 00:00:00 2001 From: Nico Burns Date: Sat, 3 Oct 2026 19:28:11 +0000 Subject: [PATCH 04/10] Bump anyrender patch to non-allocating NonUniformRoundedRect path iterator --- Cargo.lock | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 33e0bb9ab4..16e8bd4e19 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -295,7 +295,7 @@ checksum = "330a5ed07fa54e4702c9d6c4174f74427fc0ef6e214bbd677ae50a5099946470" [[package]] name = "anyrender" version = "0.14.0" -source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#b86f87cf87d609a03bbafcba50dc1474790a59a6" +source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#690bd3c3ab5c32b8227b21bf8c06d7a68743a51d" dependencies = [ "kurbo", "peniko", @@ -307,7 +307,7 @@ dependencies = [ [[package]] name = "anyrender_serialize" version = "0.8.0" -source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#b86f87cf87d609a03bbafcba50dc1474790a59a6" +source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#690bd3c3ab5c32b8227b21bf8c06d7a68743a51d" dependencies = [ "anyrender", "image", @@ -325,7 +325,7 @@ dependencies = [ [[package]] name = "anyrender_skia" version = "0.12.0" -source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#b86f87cf87d609a03bbafcba50dc1474790a59a6" +source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#690bd3c3ab5c32b8227b21bf8c06d7a68743a51d" dependencies = [ "anyrender", "ash", @@ -352,7 +352,7 @@ dependencies = [ [[package]] name = "anyrender_svg" version = "0.15.0" -source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#b86f87cf87d609a03bbafcba50dc1474790a59a6" +source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#690bd3c3ab5c32b8227b21bf8c06d7a68743a51d" dependencies = [ "anyrender", "image", @@ -364,7 +364,7 @@ dependencies = [ [[package]] name = "anyrender_vello" version = "0.15.0" -source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#b86f87cf87d609a03bbafcba50dc1474790a59a6" +source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#690bd3c3ab5c32b8227b21bf8c06d7a68743a51d" dependencies = [ "anyrender", "debug_timer 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -382,7 +382,7 @@ dependencies = [ [[package]] name = "anyrender_vello_cpu" version = "0.18.0" -source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#b86f87cf87d609a03bbafcba50dc1474790a59a6" +source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#690bd3c3ab5c32b8227b21bf8c06d7a68743a51d" dependencies = [ "anyrender", "bytemuck", @@ -400,7 +400,7 @@ dependencies = [ [[package]] name = "anyrender_vello_hybrid" version = "0.11.0" -source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#b86f87cf87d609a03bbafcba50dc1474790a59a6" +source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#690bd3c3ab5c32b8227b21bf8c06d7a68743a51d" dependencies = [ "anyrender", "debug_timer 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -6224,7 +6224,7 @@ dependencies = [ [[package]] name = "pixels_window_renderer" version = "0.9.0" -source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#b86f87cf87d609a03bbafcba50dc1474790a59a6" +source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#690bd3c3ab5c32b8227b21bf8c06d7a68743a51d" dependencies = [ "anyrender", "debug_timer 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -7576,7 +7576,7 @@ dependencies = [ [[package]] name = "softbuffer_window_renderer" version = "0.9.0" -source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#b86f87cf87d609a03bbafcba50dc1474790a59a6" +source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#690bd3c3ab5c32b8227b21bf8c06d7a68743a51d" dependencies = [ "anyrender", "debug_timer 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -9666,7 +9666,7 @@ dependencies = [ [[package]] name = "wgpu_context" version = "0.10.0" -source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#b86f87cf87d609a03bbafcba50dc1474790a59a6" +source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#690bd3c3ab5c32b8227b21bf8c06d7a68743a51d" dependencies = [ "futures-intrusive", "wgpu 30.0.1", From 91b11a4170c7da40b323a0a0f5fb72b3683a80f4 Mon Sep 17 00:00:00 2001 From: Nico Burns Date: Sat, 3 Oct 2026 20:34:54 +0000 Subject: [PATCH 05/10] Bump anyrender patch to include the rect fast paths from anyrender#114 --- Cargo.lock | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 16e8bd4e19..a38d652057 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -295,7 +295,7 @@ checksum = "330a5ed07fa54e4702c9d6c4174f74427fc0ef6e214bbd677ae50a5099946470" [[package]] name = "anyrender" version = "0.14.0" -source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#690bd3c3ab5c32b8227b21bf8c06d7a68743a51d" +source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#28e925643b2b3313b50aceb482d9f3d837d4d3be" dependencies = [ "kurbo", "peniko", @@ -307,7 +307,7 @@ dependencies = [ [[package]] name = "anyrender_serialize" version = "0.8.0" -source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#690bd3c3ab5c32b8227b21bf8c06d7a68743a51d" +source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#28e925643b2b3313b50aceb482d9f3d837d4d3be" dependencies = [ "anyrender", "image", @@ -325,7 +325,7 @@ dependencies = [ [[package]] name = "anyrender_skia" version = "0.12.0" -source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#690bd3c3ab5c32b8227b21bf8c06d7a68743a51d" +source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#28e925643b2b3313b50aceb482d9f3d837d4d3be" dependencies = [ "anyrender", "ash", @@ -352,7 +352,7 @@ dependencies = [ [[package]] name = "anyrender_svg" version = "0.15.0" -source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#690bd3c3ab5c32b8227b21bf8c06d7a68743a51d" +source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#28e925643b2b3313b50aceb482d9f3d837d4d3be" dependencies = [ "anyrender", "image", @@ -364,7 +364,7 @@ dependencies = [ [[package]] name = "anyrender_vello" version = "0.15.0" -source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#690bd3c3ab5c32b8227b21bf8c06d7a68743a51d" +source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#28e925643b2b3313b50aceb482d9f3d837d4d3be" dependencies = [ "anyrender", "debug_timer 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -382,7 +382,7 @@ dependencies = [ [[package]] name = "anyrender_vello_cpu" version = "0.18.0" -source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#690bd3c3ab5c32b8227b21bf8c06d7a68743a51d" +source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#28e925643b2b3313b50aceb482d9f3d837d4d3be" dependencies = [ "anyrender", "bytemuck", @@ -400,7 +400,7 @@ dependencies = [ [[package]] name = "anyrender_vello_hybrid" version = "0.11.0" -source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#690bd3c3ab5c32b8227b21bf8c06d7a68743a51d" +source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#28e925643b2b3313b50aceb482d9f3d837d4d3be" dependencies = [ "anyrender", "debug_timer 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -6224,7 +6224,7 @@ dependencies = [ [[package]] name = "pixels_window_renderer" version = "0.9.0" -source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#690bd3c3ab5c32b8227b21bf8c06d7a68743a51d" +source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#28e925643b2b3313b50aceb482d9f3d837d4d3be" dependencies = [ "anyrender", "debug_timer 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -7576,7 +7576,7 @@ dependencies = [ [[package]] name = "softbuffer_window_renderer" version = "0.9.0" -source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#690bd3c3ab5c32b8227b21bf8c06d7a68743a51d" +source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#28e925643b2b3313b50aceb482d9f3d837d4d3be" dependencies = [ "anyrender", "debug_timer 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -9666,7 +9666,7 @@ dependencies = [ [[package]] name = "wgpu_context" version = "0.10.0" -source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#690bd3c3ab5c32b8227b21bf8c06d7a68743a51d" +source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#28e925643b2b3313b50aceb482d9f3d837d4d3be" dependencies = [ "futures-intrusive", "wgpu 30.0.1", From e2ead67441cc71d686fc414eda4c5e86905a36e3 Mon Sep 17 00:00:00 2001 From: Nico Burns Date: Sat, 3 Oct 2026 21:00:15 +0000 Subject: [PATCH 06/10] Bump anyrender patch to include anyrender#115 --- Cargo.lock | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a38d652057..529554feda 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -295,7 +295,7 @@ checksum = "330a5ed07fa54e4702c9d6c4174f74427fc0ef6e214bbd677ae50a5099946470" [[package]] name = "anyrender" version = "0.14.0" -source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#28e925643b2b3313b50aceb482d9f3d837d4d3be" +source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#9575578a08edcaf0aa7f2e025fdaa6f223d0547a" dependencies = [ "kurbo", "peniko", @@ -307,7 +307,7 @@ dependencies = [ [[package]] name = "anyrender_serialize" version = "0.8.0" -source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#28e925643b2b3313b50aceb482d9f3d837d4d3be" +source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#9575578a08edcaf0aa7f2e025fdaa6f223d0547a" dependencies = [ "anyrender", "image", @@ -325,7 +325,7 @@ dependencies = [ [[package]] name = "anyrender_skia" version = "0.12.0" -source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#28e925643b2b3313b50aceb482d9f3d837d4d3be" +source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#9575578a08edcaf0aa7f2e025fdaa6f223d0547a" dependencies = [ "anyrender", "ash", @@ -352,7 +352,7 @@ dependencies = [ [[package]] name = "anyrender_svg" version = "0.15.0" -source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#28e925643b2b3313b50aceb482d9f3d837d4d3be" +source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#9575578a08edcaf0aa7f2e025fdaa6f223d0547a" dependencies = [ "anyrender", "image", @@ -364,7 +364,7 @@ dependencies = [ [[package]] name = "anyrender_vello" version = "0.15.0" -source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#28e925643b2b3313b50aceb482d9f3d837d4d3be" +source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#9575578a08edcaf0aa7f2e025fdaa6f223d0547a" dependencies = [ "anyrender", "debug_timer 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -382,7 +382,7 @@ dependencies = [ [[package]] name = "anyrender_vello_cpu" version = "0.18.0" -source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#28e925643b2b3313b50aceb482d9f3d837d4d3be" +source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#9575578a08edcaf0aa7f2e025fdaa6f223d0547a" dependencies = [ "anyrender", "bytemuck", @@ -400,7 +400,7 @@ dependencies = [ [[package]] name = "anyrender_vello_hybrid" version = "0.11.0" -source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#28e925643b2b3313b50aceb482d9f3d837d4d3be" +source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#9575578a08edcaf0aa7f2e025fdaa6f223d0547a" dependencies = [ "anyrender", "debug_timer 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -6224,7 +6224,7 @@ dependencies = [ [[package]] name = "pixels_window_renderer" version = "0.9.0" -source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#28e925643b2b3313b50aceb482d9f3d837d4d3be" +source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#9575578a08edcaf0aa7f2e025fdaa6f223d0547a" dependencies = [ "anyrender", "debug_timer 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -7576,7 +7576,7 @@ dependencies = [ [[package]] name = "softbuffer_window_renderer" version = "0.9.0" -source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#28e925643b2b3313b50aceb482d9f3d837d4d3be" +source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#9575578a08edcaf0aa7f2e025fdaa6f223d0547a" dependencies = [ "anyrender", "debug_timer 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -9666,7 +9666,7 @@ dependencies = [ [[package]] name = "wgpu_context" version = "0.10.0" -source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#28e925643b2b3313b50aceb482d9f3d837d4d3be" +source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#9575578a08edcaf0aa7f2e025fdaa6f223d0547a" dependencies = [ "futures-intrusive", "wgpu 30.0.1", From 3eb7edb66798eef6e718aca7b309e3636cb6b408 Mon Sep 17 00:00:00 2001 From: Nico Burns Date: Sat, 3 Oct 2026 21:36:39 +0000 Subject: [PATCH 07/10] Bump anyrender patch for NonUniformRoundedRect fixes --- Cargo.lock | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 529554feda..44ba22353a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -295,7 +295,7 @@ checksum = "330a5ed07fa54e4702c9d6c4174f74427fc0ef6e214bbd677ae50a5099946470" [[package]] name = "anyrender" version = "0.14.0" -source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#9575578a08edcaf0aa7f2e025fdaa6f223d0547a" +source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#9359437915765bddb73ee69ec56da4b51261ea11" dependencies = [ "kurbo", "peniko", @@ -307,7 +307,7 @@ dependencies = [ [[package]] name = "anyrender_serialize" version = "0.8.0" -source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#9575578a08edcaf0aa7f2e025fdaa6f223d0547a" +source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#9359437915765bddb73ee69ec56da4b51261ea11" dependencies = [ "anyrender", "image", @@ -325,7 +325,7 @@ dependencies = [ [[package]] name = "anyrender_skia" version = "0.12.0" -source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#9575578a08edcaf0aa7f2e025fdaa6f223d0547a" +source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#9359437915765bddb73ee69ec56da4b51261ea11" dependencies = [ "anyrender", "ash", @@ -352,7 +352,7 @@ dependencies = [ [[package]] name = "anyrender_svg" version = "0.15.0" -source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#9575578a08edcaf0aa7f2e025fdaa6f223d0547a" +source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#9359437915765bddb73ee69ec56da4b51261ea11" dependencies = [ "anyrender", "image", @@ -364,7 +364,7 @@ dependencies = [ [[package]] name = "anyrender_vello" version = "0.15.0" -source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#9575578a08edcaf0aa7f2e025fdaa6f223d0547a" +source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#9359437915765bddb73ee69ec56da4b51261ea11" dependencies = [ "anyrender", "debug_timer 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -382,7 +382,7 @@ dependencies = [ [[package]] name = "anyrender_vello_cpu" version = "0.18.0" -source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#9575578a08edcaf0aa7f2e025fdaa6f223d0547a" +source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#9359437915765bddb73ee69ec56da4b51261ea11" dependencies = [ "anyrender", "bytemuck", @@ -400,7 +400,7 @@ dependencies = [ [[package]] name = "anyrender_vello_hybrid" version = "0.11.0" -source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#9575578a08edcaf0aa7f2e025fdaa6f223d0547a" +source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#9359437915765bddb73ee69ec56da4b51261ea11" dependencies = [ "anyrender", "debug_timer 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -6224,7 +6224,7 @@ dependencies = [ [[package]] name = "pixels_window_renderer" version = "0.9.0" -source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#9575578a08edcaf0aa7f2e025fdaa6f223d0547a" +source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#9359437915765bddb73ee69ec56da4b51261ea11" dependencies = [ "anyrender", "debug_timer 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -7576,7 +7576,7 @@ dependencies = [ [[package]] name = "softbuffer_window_renderer" version = "0.9.0" -source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#9575578a08edcaf0aa7f2e025fdaa6f223d0547a" +source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#9359437915765bddb73ee69ec56da4b51261ea11" dependencies = [ "anyrender", "debug_timer 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -9666,7 +9666,7 @@ dependencies = [ [[package]] name = "wgpu_context" version = "0.10.0" -source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#9575578a08edcaf0aa7f2e025fdaa6f223d0547a" +source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#9359437915765bddb73ee69ec56da4b51261ea11" dependencies = [ "futures-intrusive", "wgpu 30.0.1", From a6cb970e1cad0c94f81eb9980e83c84bc08d1fdc Mon Sep 17 00:00:00 2001 From: Nico Burns Date: Sat, 3 Oct 2026 22:30:04 +0000 Subject: [PATCH 08/10] Use draw_box_shadow's box/offset/spread API; scale blur and offsets correctly --- Cargo.lock | 20 +-- packages/blitz-paint/src/kurbo_css/css_box.rs | 47 ----- .../src/kurbo_css/non_uniform_radii.rs | 14 -- packages/blitz-paint/src/render/box_shadow.rs | 163 ++++++------------ 4 files changed, 61 insertions(+), 183 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 44ba22353a..566b94fb5e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -295,7 +295,7 @@ checksum = "330a5ed07fa54e4702c9d6c4174f74427fc0ef6e214bbd677ae50a5099946470" [[package]] name = "anyrender" version = "0.14.0" -source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#9359437915765bddb73ee69ec56da4b51261ea11" +source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#ae6ca1a30b6cf75482032d292f548a7d58663ca4" dependencies = [ "kurbo", "peniko", @@ -307,7 +307,7 @@ dependencies = [ [[package]] name = "anyrender_serialize" version = "0.8.0" -source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#9359437915765bddb73ee69ec56da4b51261ea11" +source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#ae6ca1a30b6cf75482032d292f548a7d58663ca4" dependencies = [ "anyrender", "image", @@ -325,7 +325,7 @@ dependencies = [ [[package]] name = "anyrender_skia" version = "0.12.0" -source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#9359437915765bddb73ee69ec56da4b51261ea11" +source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#ae6ca1a30b6cf75482032d292f548a7d58663ca4" dependencies = [ "anyrender", "ash", @@ -352,7 +352,7 @@ dependencies = [ [[package]] name = "anyrender_svg" version = "0.15.0" -source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#9359437915765bddb73ee69ec56da4b51261ea11" +source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#ae6ca1a30b6cf75482032d292f548a7d58663ca4" dependencies = [ "anyrender", "image", @@ -364,7 +364,7 @@ dependencies = [ [[package]] name = "anyrender_vello" version = "0.15.0" -source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#9359437915765bddb73ee69ec56da4b51261ea11" +source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#ae6ca1a30b6cf75482032d292f548a7d58663ca4" dependencies = [ "anyrender", "debug_timer 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -382,7 +382,7 @@ dependencies = [ [[package]] name = "anyrender_vello_cpu" version = "0.18.0" -source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#9359437915765bddb73ee69ec56da4b51261ea11" +source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#ae6ca1a30b6cf75482032d292f548a7d58663ca4" dependencies = [ "anyrender", "bytemuck", @@ -400,7 +400,7 @@ dependencies = [ [[package]] name = "anyrender_vello_hybrid" version = "0.11.0" -source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#9359437915765bddb73ee69ec56da4b51261ea11" +source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#ae6ca1a30b6cf75482032d292f548a7d58663ca4" dependencies = [ "anyrender", "debug_timer 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -6224,7 +6224,7 @@ dependencies = [ [[package]] name = "pixels_window_renderer" version = "0.9.0" -source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#9359437915765bddb73ee69ec56da4b51261ea11" +source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#ae6ca1a30b6cf75482032d292f548a7d58663ca4" dependencies = [ "anyrender", "debug_timer 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -7576,7 +7576,7 @@ dependencies = [ [[package]] name = "softbuffer_window_renderer" version = "0.9.0" -source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#9359437915765bddb73ee69ec56da4b51261ea11" +source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#ae6ca1a30b6cf75482032d292f548a7d58663ca4" dependencies = [ "anyrender", "debug_timer 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -9666,7 +9666,7 @@ dependencies = [ [[package]] name = "wgpu_context" version = "0.10.0" -source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#9359437915765bddb73ee69ec56da4b51261ea11" +source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#ae6ca1a30b6cf75482032d292f548a7d58663ca4" dependencies = [ "futures-intrusive", "wgpu 30.0.1", diff --git a/packages/blitz-paint/src/kurbo_css/css_box.rs b/packages/blitz-paint/src/kurbo_css/css_box.rs index 52d0d6ae86..dc21a90c1b 100644 --- a/packages/blitz-paint/src/kurbo_css/css_box.rs +++ b/packages/blitz-paint/src/kurbo_css/css_box.rs @@ -328,42 +328,6 @@ impl CssBox { } } - /// Construct a bezpath drawing the frame - pub fn shadow_clip(&self, shadow_rect: Rect) -> BezPath { - let mut path = BezPath::new(); - self.shadow_clip_shape(&mut path, shadow_rect); - path - } - - fn shadow_clip_shape(&self, path: &mut BezPath, shadow_rect: Rect) { - use Corner::*; - - for corner in [TopLeft, TopRight, BottomRight, BottomLeft] { - path.insert_point(self.shadow_clip_corner(corner, shadow_rect)); - } - - if self.is_sharp(TopLeft, CssBoxKind::BorderBox) { - path.move_to(self.corner(TopLeft, CssBoxKind::BorderBox)); - } else { - const TOLERANCE: f64 = 0.1; - let arc = self.corner_arc(TopLeft, CssBoxKind::BorderBox, Direction::Anticlockwise); - let elements = arc.path_elements(TOLERANCE); - path.extend(elements); - } - - for corner in [/*TopLeft, */ BottomLeft, BottomRight, TopRight] { - if self.is_sharp(corner, CssBoxKind::BorderBox) { - path.insert_point(self.corner(corner, CssBoxKind::BorderBox)); - } else { - path.insert_arc(self.corner_arc( - corner, - CssBoxKind::BorderBox, - Direction::Anticlockwise, - )); - } - } - } - fn corner(&self, corner: Corner, css_box: CssBoxKind) -> Point { let Rect { x0, y0, x1, y1 } = match css_box { CssBoxKind::OutlineBox => self.outline_box, @@ -379,17 +343,6 @@ impl CssBox { } } - fn shadow_clip_corner(&self, corner: Corner, shadow_rect: Rect) -> Point { - let (x, y) = match corner { - Corner::TopLeft => (shadow_rect.x0, shadow_rect.y0), - Corner::TopRight => (shadow_rect.x1, shadow_rect.y0), - Corner::BottomRight => (shadow_rect.x1, shadow_rect.y1), - Corner::BottomLeft => (shadow_rect.x0, shadow_rect.y1), - }; - - Point { x, y } - } - /// Check if the corner width is smaller than the radius. /// If it is, we need to fill in the gap with an arc fn corner_needs_infill(&self, corner: Corner) -> bool { diff --git a/packages/blitz-paint/src/kurbo_css/non_uniform_radii.rs b/packages/blitz-paint/src/kurbo_css/non_uniform_radii.rs index ac8a4bcd16..1fb80aa77a 100644 --- a/packages/blitz-paint/src/kurbo_css/non_uniform_radii.rs +++ b/packages/blitz-paint/src/kurbo_css/non_uniform_radii.rs @@ -23,20 +23,6 @@ pub struct NonUniformRoundedRectRadii { pub bottom_left: Vec2, } -impl NonUniformRoundedRectRadii { - pub fn average(&self) -> f64 { - (self.top_left.x - + self.top_left.y - + self.top_right.x - + self.top_right.y - + self.bottom_left.x - + self.bottom_left.y - + self.bottom_right.x - + self.bottom_right.y) - / 8.0 - } -} - impl Mul for NonUniformRoundedRectRadii { type Output = Self; diff --git a/packages/blitz-paint/src/render/box_shadow.rs b/packages/blitz-paint/src/render/box_shadow.rs index d6062189f8..e6bcf6bbff 100644 --- a/packages/blitz-paint/src/render/box_shadow.rs +++ b/packages/blitz-paint/src/render/box_shadow.rs @@ -1,14 +1,13 @@ use super::ElementCx; use crate::color::{Color, ToColorColor as _}; -use anyrender::PaintScene; -use kurbo::{Rect, Shape as _, Vec2}; -use peniko::Fill; +use anyrender::{BoxShadowKind, NonUniformRoundedRect, PaintScene}; +use kurbo::Vec2; +use style::values::computed::BoxShadow; impl ElementCx<'_, '_> { pub(super) fn draw_outset_box_shadow(&self, scene: &mut impl PaintScene) { let box_shadow = &self.style.get_effects().box_shadow.0; - let has_outset_shadow = box_shadow.iter().any(|s| !s.inset); - if !has_outset_shadow { + if !box_shadow.iter().any(|s| !s.inset) { return; } @@ -20,127 +19,67 @@ impl ElementCx<'_, '_> { .background_color .resolve_to_absolute(¤t_color) .as_srgb_color(); + // Only paint the shadow outside of the border box if it could otherwise be seen + // through the element let bg_is_opaque = bg_color.components[3] >= 1.0; - let needs_clip = opacity < 1.0 || !bg_is_opaque; - - let max_shadow_rect = box_shadow.iter().fold(Rect::ZERO, |prev, shadow| { - let x = shadow.base.horizontal.px() as f64 * self.scale; - let y = shadow.base.vertical.px() as f64 * self.scale; - let blur = shadow.base.blur.px() as f64 * self.scale; - let spread = shadow.spread.px() as f64 * self.scale; - let offset = spread + blur * 2.5; - - let rect = self.frame.border_box.inflate(offset, offset) + Vec2::new(x, y); - - prev.union(rect) - }); + let clip_to_box = opacity < 1.0 || !bg_is_opaque; + let border_box = self.frame.border_box_shape(); for shadow in box_shadow.iter().filter(|s| !s.inset).rev() { - let shadow_color = shadow - .base - .color - .resolve_to_absolute(¤t_color) - .as_srgb_color(); - - let alpha = shadow_color.components[3]; - if alpha == 0.0 { - continue; - } - - let offset = Vec2 { - x: shadow.base.horizontal.px() as f64 * self.scale, - y: shadow.base.vertical.px() as f64 * self.scale, - }; - let spread = shadow.spread.px() as f64 * self.scale; - let blur = shadow.base.blur.px() as f64; - - // Without blur or spread the shadow is exactly the element's shape, - // so fill the border box path directly (preserving individual radii) - if blur == 0.0 && spread == 0.0 { - self.context.layer_manager.maybe_with_layer( - scene, - needs_clip, - 1.0, - self.transform, - &self.frame.shadow_clip(max_shadow_rect), - None, - None, - |scene| { - scene.fill( - Fill::NonZero, - self.transform.pre_translate(offset), - shadow_color, - None, - &self.frame.border_box_shape(), - ); - }, - ); - continue; - } - - // TODO draw shadows with matching individual radii instead of averaging - let radius = self.frame.border_radii.average(); - let rect = self.frame.border_box.inflate(spread, spread) + offset; - - // Only paint the shadow outside of the border box if it could otherwise be seen - // through the element - let shape = if needs_clip { - self.frame.shadow_clip(max_shadow_rect) - } else { - max_shadow_rect.to_path(0.1) - }; - - scene.draw_box_shadow( - self.transform, - &shape, - rect, - shadow_color, - radius, - blur, - false, + self.draw_box_shadow( + scene, + shadow, + &border_box, + BoxShadowKind::Outset { clip_to_box }, ); } } pub(super) fn draw_inset_box_shadow(&self, scene: &mut impl PaintScene) { - let current_color = self.style.clone_color(); let box_shadow = &self.style.get_effects().box_shadow.0; - let has_inset_shadow = box_shadow.iter().any(|s| s.inset); - if !has_inset_shadow { + if !box_shadow.iter().any(|s| s.inset) { return; } let padding_box = self.frame.padding_box_shape(); + for shadow in box_shadow.iter().filter(|s| s.inset).rev() { + self.draw_box_shadow(scene, shadow, &padding_box, BoxShadowKind::Inset); + } + } - for shadow in box_shadow.iter().filter(|s| s.inset) { - let shadow_color = shadow - .base - .color - .resolve_to_absolute(¤t_color) - .as_srgb_color(); - if shadow_color == Color::TRANSPARENT { - return; - } - - // TODO draw shadows with matching individual radii instead of averaging - let radius = self.frame.border_radii.average(); - let offset = Vec2 { - x: shadow.base.horizontal.px() as f64, - y: shadow.base.vertical.px() as f64, - }; - - // The unshadowed area is the padding box shrunk by the spread radius - let spread = shadow.spread.px() as f64 * self.scale; - let hole = self.frame.padding_box.inflate(-spread, -spread) + offset; - scene.draw_box_shadow( - self.transform, - &padding_box, - hole, - shadow_color, - radius, - shadow.base.blur.px() as f64 * self.scale, - true, - ); + fn draw_box_shadow( + &self, + scene: &mut impl PaintScene, + shadow: &BoxShadow, + box_shape: &NonUniformRoundedRect, + kind: BoxShadowKind, + ) { + let shadow_color = shadow + .base + .color + .resolve_to_absolute(&self.style.clone_color()) + .as_srgb_color(); + if shadow_color.components[3] == 0.0 { + return; } + let shadow_color: Color = shadow_color; + + let offset = Vec2::new( + shadow.base.horizontal.px() as f64, + shadow.base.vertical.px() as f64, + ) * self.scale; + let spread = shadow.spread.px() as f64 * self.scale; + // The standard deviation of a CSS shadow's blur is half of its blur radius + let std_dev = shadow.base.blur.px() as f64 * self.scale / 2.0; + + scene.draw_box_shadow( + self.transform, + box_shape, + offset, + spread, + std_dev, + shadow_color, + kind, + ); } } From 8a990b2688682c530bc46814698d85e81db15237 Mon Sep 17 00:00:00 2001 From: Nico Burns Date: Sat, 3 Oct 2026 22:50:21 +0000 Subject: [PATCH 09/10] Bump anyrender patch for non-isolated unblurred shadow clips --- Cargo.lock | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 566b94fb5e..000e6cf81f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -295,7 +295,7 @@ checksum = "330a5ed07fa54e4702c9d6c4174f74427fc0ef6e214bbd677ae50a5099946470" [[package]] name = "anyrender" version = "0.14.0" -source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#ae6ca1a30b6cf75482032d292f548a7d58663ca4" +source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#03c2bfe5657ebac1fdd05cc7d9561b26f022a565" dependencies = [ "kurbo", "peniko", @@ -307,7 +307,7 @@ dependencies = [ [[package]] name = "anyrender_serialize" version = "0.8.0" -source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#ae6ca1a30b6cf75482032d292f548a7d58663ca4" +source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#03c2bfe5657ebac1fdd05cc7d9561b26f022a565" dependencies = [ "anyrender", "image", @@ -325,7 +325,7 @@ dependencies = [ [[package]] name = "anyrender_skia" version = "0.12.0" -source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#ae6ca1a30b6cf75482032d292f548a7d58663ca4" +source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#03c2bfe5657ebac1fdd05cc7d9561b26f022a565" dependencies = [ "anyrender", "ash", @@ -352,7 +352,7 @@ dependencies = [ [[package]] name = "anyrender_svg" version = "0.15.0" -source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#ae6ca1a30b6cf75482032d292f548a7d58663ca4" +source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#03c2bfe5657ebac1fdd05cc7d9561b26f022a565" dependencies = [ "anyrender", "image", @@ -364,7 +364,7 @@ dependencies = [ [[package]] name = "anyrender_vello" version = "0.15.0" -source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#ae6ca1a30b6cf75482032d292f548a7d58663ca4" +source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#03c2bfe5657ebac1fdd05cc7d9561b26f022a565" dependencies = [ "anyrender", "debug_timer 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -382,7 +382,7 @@ dependencies = [ [[package]] name = "anyrender_vello_cpu" version = "0.18.0" -source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#ae6ca1a30b6cf75482032d292f548a7d58663ca4" +source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#03c2bfe5657ebac1fdd05cc7d9561b26f022a565" dependencies = [ "anyrender", "bytemuck", @@ -400,7 +400,7 @@ dependencies = [ [[package]] name = "anyrender_vello_hybrid" version = "0.11.0" -source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#ae6ca1a30b6cf75482032d292f548a7d58663ca4" +source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#03c2bfe5657ebac1fdd05cc7d9561b26f022a565" dependencies = [ "anyrender", "debug_timer 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -6224,7 +6224,7 @@ dependencies = [ [[package]] name = "pixels_window_renderer" version = "0.9.0" -source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#ae6ca1a30b6cf75482032d292f548a7d58663ca4" +source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#03c2bfe5657ebac1fdd05cc7d9561b26f022a565" dependencies = [ "anyrender", "debug_timer 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -7576,7 +7576,7 @@ dependencies = [ [[package]] name = "softbuffer_window_renderer" version = "0.9.0" -source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#ae6ca1a30b6cf75482032d292f548a7d58663ca4" +source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#03c2bfe5657ebac1fdd05cc7d9561b26f022a565" dependencies = [ "anyrender", "debug_timer 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -9666,7 +9666,7 @@ dependencies = [ [[package]] name = "wgpu_context" version = "0.10.0" -source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#ae6ca1a30b6cf75482032d292f548a7d58663ca4" +source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#03c2bfe5657ebac1fdd05cc7d9561b26f022a565" dependencies = [ "futures-intrusive", "wgpu 30.0.1", From ffe24cb955ee8b2d1921d030a953402a10f6a13d Mon Sep 17 00:00:00 2001 From: Nico Burns Date: Sat, 3 Oct 2026 23:05:16 +0000 Subject: [PATCH 10/10] Point anyrender patch at the box shadow API branch (anyrender#117) and drop the vello patches --- Cargo.lock | 44 ++++++++++++++++++++++++++------------------ Cargo.toml | 21 ++++++++------------- 2 files changed, 34 insertions(+), 31 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 000e6cf81f..dd5b2165b8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -295,7 +295,7 @@ checksum = "330a5ed07fa54e4702c9d6c4174f74427fc0ef6e214bbd677ae50a5099946470" [[package]] name = "anyrender" version = "0.14.0" -source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#03c2bfe5657ebac1fdd05cc7d9561b26f022a565" +source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791068178-box-shadow-api#5863bc787e2101cfac98028d954cbcc92b32c789" dependencies = [ "kurbo", "peniko", @@ -307,7 +307,7 @@ dependencies = [ [[package]] name = "anyrender_serialize" version = "0.8.0" -source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#03c2bfe5657ebac1fdd05cc7d9561b26f022a565" +source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791068178-box-shadow-api#5863bc787e2101cfac98028d954cbcc92b32c789" dependencies = [ "anyrender", "image", @@ -325,7 +325,7 @@ dependencies = [ [[package]] name = "anyrender_skia" version = "0.12.0" -source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#03c2bfe5657ebac1fdd05cc7d9561b26f022a565" +source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791068178-box-shadow-api#5863bc787e2101cfac98028d954cbcc92b32c789" dependencies = [ "anyrender", "ash", @@ -352,7 +352,7 @@ dependencies = [ [[package]] name = "anyrender_svg" version = "0.15.0" -source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#03c2bfe5657ebac1fdd05cc7d9561b26f022a565" +source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791068178-box-shadow-api#5863bc787e2101cfac98028d954cbcc92b32c789" dependencies = [ "anyrender", "image", @@ -364,7 +364,7 @@ dependencies = [ [[package]] name = "anyrender_vello" version = "0.15.0" -source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#03c2bfe5657ebac1fdd05cc7d9561b26f022a565" +source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791068178-box-shadow-api#5863bc787e2101cfac98028d954cbcc92b32c789" dependencies = [ "anyrender", "debug_timer 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -382,7 +382,7 @@ dependencies = [ [[package]] name = "anyrender_vello_cpu" version = "0.18.0" -source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#03c2bfe5657ebac1fdd05cc7d9561b26f022a565" +source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791068178-box-shadow-api#5863bc787e2101cfac98028d954cbcc92b32c789" dependencies = [ "anyrender", "bytemuck", @@ -400,7 +400,7 @@ dependencies = [ [[package]] name = "anyrender_vello_hybrid" version = "0.11.0" -source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#03c2bfe5657ebac1fdd05cc7d9561b26f022a565" +source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791068178-box-shadow-api#5863bc787e2101cfac98028d954cbcc92b32c789" dependencies = [ "anyrender", "debug_timer 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3578,7 +3578,8 @@ dependencies = [ [[package]] name = "glifo" version = "0.4.0" -source = "git+https://github.com/nicoburns/vello?branch=inverse-blur-classic#56267c6744c589c99f38da897ff1577b9340d9b0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f1218dedd5348c1b166ec3b8b3cbca49d2f527bd43b3fa072ea5123c523ed3f" dependencies = [ "bytemuck", "foldhash 0.2.0", @@ -6224,7 +6225,7 @@ dependencies = [ [[package]] name = "pixels_window_renderer" version = "0.9.0" -source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#03c2bfe5657ebac1fdd05cc7d9561b26f022a565" +source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791068178-box-shadow-api#5863bc787e2101cfac98028d954cbcc92b32c789" dependencies = [ "anyrender", "debug_timer 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -7576,7 +7577,7 @@ dependencies = [ [[package]] name = "softbuffer_window_renderer" version = "0.9.0" -source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#03c2bfe5657ebac1fdd05cc7d9561b26f022a565" +source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791068178-box-shadow-api#5863bc787e2101cfac98028d954cbcc92b32c789" dependencies = [ "anyrender", "debug_timer 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -8823,7 +8824,8 @@ checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" [[package]] name = "vello" version = "0.11.0" -source = "git+https://github.com/nicoburns/vello?branch=inverse-blur-classic#56267c6744c589c99f38da897ff1577b9340d9b0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "913abde56cab6131b62c0cc69b1a93b671d3c34b3097beb3714fd1dc93be8115" dependencies = [ "bytemuck", "futures-intrusive", @@ -8841,7 +8843,8 @@ dependencies = [ [[package]] name = "vello_common" version = "0.3.0" -source = "git+https://github.com/nicoburns/vello?branch=inverse-blur-classic#56267c6744c589c99f38da897ff1577b9340d9b0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73c2fbe53548bcd25c8ff42f75a93770a8611a16b37bee56d7ef7b44e36027f1" dependencies = [ "bytemuck", "fearless_simd", @@ -8856,7 +8859,8 @@ dependencies = [ [[package]] name = "vello_cpu" version = "0.3.0" -source = "git+https://github.com/nicoburns/vello?branch=inverse-blur-classic#56267c6744c589c99f38da897ff1577b9340d9b0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed1fec424fbba6acf6cbc78bb526447eb77590d95f40419d598870fe37535212" dependencies = [ "bytemuck", "crossbeam-channel", @@ -8872,7 +8876,8 @@ dependencies = [ [[package]] name = "vello_encoding" version = "0.11.0" -source = "git+https://github.com/nicoburns/vello?branch=inverse-blur-classic#56267c6744c589c99f38da897ff1577b9340d9b0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1fb9548d2b46b0f79137b5b1d208ecbd76d432f74e7a2ba838615d117f11532" dependencies = [ "bytemuck", "guillotiere", @@ -8884,7 +8889,8 @@ dependencies = [ [[package]] name = "vello_gpu" version = "0.3.0" -source = "git+https://github.com/nicoburns/vello?branch=inverse-blur-classic#56267c6744c589c99f38da897ff1577b9340d9b0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0e01b02c55094a3bcfbf80d736221a74bc3f8914b566298b4ad3c9f05e7ac08" dependencies = [ "bytemuck", "glifo", @@ -8901,7 +8907,8 @@ dependencies = [ [[package]] name = "vello_gpu_shaders" version = "0.3.0" -source = "git+https://github.com/nicoburns/vello?branch=inverse-blur-classic#56267c6744c589c99f38da897ff1577b9340d9b0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccf14e175813d9ddefdf52d9430d075de46c1d72560e917575857c97d6fc74cc" dependencies = [ "naga 30.0.1", "wesl", @@ -8913,7 +8920,8 @@ dependencies = [ [[package]] name = "vello_shaders" version = "0.11.0" -source = "git+https://github.com/nicoburns/vello?branch=inverse-blur-classic#56267c6744c589c99f38da897ff1577b9340d9b0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e653222cee49f2571729c3e4b0fa99bc4f826c6bb9487dbb88b825d552b3a27" dependencies = [ "bytemuck", "log", @@ -9666,7 +9674,7 @@ dependencies = [ [[package]] name = "wgpu_context" version = "0.10.0" -source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791048554-box-shadow-shape-inset#03c2bfe5657ebac1fdd05cc7d9561b26f022a565" +source = "git+https://github.com/DioxusLabs/anyrender?branch=devin%2F1791068178-box-shadow-api#5863bc787e2101cfac98028d954cbcc92b32c789" dependencies = [ "futures-intrusive", "wgpu 30.0.1", diff --git a/Cargo.toml b/Cargo.toml index 1f92aae909..3a638dfa03 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -290,19 +290,14 @@ wgpu_context = { workspace = true } rustc-hash = { workspace = true } [patch.crates-io] -anyrender = { git = "https://github.com/DioxusLabs/anyrender", branch = "devin/1791048554-box-shadow-shape-inset" } -anyrender_serialize = { git = "https://github.com/DioxusLabs/anyrender", branch = "devin/1791048554-box-shadow-shape-inset" } -anyrender_skia = { git = "https://github.com/DioxusLabs/anyrender", branch = "devin/1791048554-box-shadow-shape-inset" } -anyrender_vello = { git = "https://github.com/DioxusLabs/anyrender", branch = "devin/1791048554-box-shadow-shape-inset" } -anyrender_vello_cpu = { git = "https://github.com/DioxusLabs/anyrender", branch = "devin/1791048554-box-shadow-shape-inset" } -anyrender_vello_hybrid = { git = "https://github.com/DioxusLabs/anyrender", branch = "devin/1791048554-box-shadow-shape-inset" } -anyrender_svg = { git = "https://github.com/DioxusLabs/anyrender", branch = "devin/1791048554-box-shadow-shape-inset" } -wgpu_context = { git = "https://github.com/DioxusLabs/anyrender", branch = "devin/1791048554-box-shadow-shape-inset" } -vello = { git = "https://github.com/nicoburns/vello", branch = "inverse-blur-classic" } -vello_common = { git = "https://github.com/nicoburns/vello", branch = "inverse-blur-classic" } -vello_cpu = { git = "https://github.com/nicoburns/vello", branch = "inverse-blur-classic" } -vello_gpu = { git = "https://github.com/nicoburns/vello", branch = "inverse-blur-classic" } -glifo = { git = "https://github.com/nicoburns/vello", branch = "inverse-blur-classic" } +anyrender = { git = "https://github.com/DioxusLabs/anyrender", branch = "devin/1791068178-box-shadow-api" } +anyrender_serialize = { git = "https://github.com/DioxusLabs/anyrender", branch = "devin/1791068178-box-shadow-api" } +anyrender_skia = { git = "https://github.com/DioxusLabs/anyrender", branch = "devin/1791068178-box-shadow-api" } +anyrender_vello = { git = "https://github.com/DioxusLabs/anyrender", branch = "devin/1791068178-box-shadow-api" } +anyrender_vello_cpu = { git = "https://github.com/DioxusLabs/anyrender", branch = "devin/1791068178-box-shadow-api" } +anyrender_vello_hybrid = { git = "https://github.com/DioxusLabs/anyrender", branch = "devin/1791068178-box-shadow-api" } +anyrender_svg = { git = "https://github.com/DioxusLabs/anyrender", branch = "devin/1791068178-box-shadow-api" } +wgpu_context = { git = "https://github.com/DioxusLabs/anyrender", branch = "devin/1791068178-box-shadow-api" } # vello = { path = "../vello/vello" } # vello_cpu = { path = "../vello/sparse_strips/vello_cpu" }