Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 12 additions & 20 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 11 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,14 @@ pollster = "0.4"
wasm-bindgen-futures = "0.4"

# Dev-dependencies
winit = { version = "0.30.2", features = ["rwh_06"] }
winit = { version = "0.30.2", features = ["rwh_06"] }
# TODO: remove once linebender/vello#1718 is released
[patch.crates-io]
vello = { git = "https://github.com/nicoburns/vello", branch = "inverse-blur-classic" }
vello_encoding = { git = "https://github.com/nicoburns/vello", branch = "inverse-blur-classic" }
vello_shaders = { 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" }
vello_gpu_shaders = { git = "https://github.com/nicoburns/vello", branch = "inverse-blur-classic" }
glifo = { git = "https://github.com/nicoburns/vello", branch = "inverse-blur-classic" }
5 changes: 1 addition & 4 deletions crates/anyrender_vello/src/scene.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,6 @@ impl PaintScene for VelloScenePainter<'_, '_> {
geometry.draw_unblurred(self, transform, color);
return;
}
if geometry.is_inset() {
geometry.draw_inset_with_layers(self, transform, color);
return;
}
// TODO: draw shadows with matching individual radii instead of averaging them
self.inner.draw_blurred_rounded_rect_in(
&geometry.area,
Expand All @@ -199,6 +195,7 @@ impl PaintScene for VelloScenePainter<'_, '_> {
color,
geometry.shadow.average_radius(),
geometry.std_dev,
geometry.is_inset(),
);
}
}
17 changes: 3 additions & 14 deletions crates/anyrender_vello_cpu/src/scene.rs
Original file line number Diff line number Diff line change
Expand Up @@ -279,25 +279,14 @@ impl PaintScene for VelloCpuScenePainter {
}
return;
}
if geometry.is_inset() {
geometry.draw_inset_with_layers(self, transform, color);
return;
}
// A single fill, so a non-isolated clip anti-aliases the clip edge only once.
let clip = geometry.needs_clip();
if clip {
self.render_ctx.push_clip_path(&geometry.area);
}
// TODO: draw shadows with matching individual radii instead of averaging them
self.render_ctx.fill_blurred_rounded_rect(
self.render_ctx.fill_blurred_rounded_rect_in(
&geometry.area,
&geometry.shadow.rect,
geometry.shadow.average_radius() as f32,
geometry.std_dev as f32,
false,
geometry.is_inset(),
);
if clip {
self.render_ctx.pop_clip();
}
}
}

Expand Down
17 changes: 3 additions & 14 deletions crates/anyrender_vello_hybrid/src/scene.rs
Original file line number Diff line number Diff line change
Expand Up @@ -389,24 +389,13 @@ impl PaintScene for VelloHybridScenePainter<'_> {
}
return;
}
if geometry.is_inset() {
geometry.draw_inset_with_layers(self, transform, color);
return;
}
// A single fill, so a non-isolated clip anti-aliases the clip edge only once.
let clip = geometry.needs_clip();
if clip {
self.scene.push_clip_path(&geometry.area);
}
// TODO: draw shadows with matching individual radii instead of averaging them
self.scene.fill_blurred_rounded_rect(
self.scene.fill_blurred_rounded_rect_in(
&geometry.area,
&geometry.shadow.rect,
geometry.shadow.average_radius() as f32,
geometry.std_dev as f32,
false,
geometry.is_inset(),
);
if clip {
self.scene.pop_clip();
}
}
}
17 changes: 3 additions & 14 deletions crates/anyrender_vello_hybrid/src/webgl_scene.rs
Original file line number Diff line number Diff line change
Expand Up @@ -291,24 +291,13 @@ impl PaintScene for WebGlScenePainter<'_> {
}
return;
}
if geometry.is_inset() {
geometry.draw_inset_with_layers(self, transform, color);
return;
}
// A single fill, so a non-isolated clip anti-aliases the clip edge only once.
let clip = geometry.needs_clip();
if clip {
self.scene.push_clip_path(&geometry.area);
}
// TODO: draw shadows with matching individual radii instead of averaging them
self.scene.fill_blurred_rounded_rect(
self.scene.fill_blurred_rounded_rect_in(
&geometry.area,
&geometry.shadow.rect,
geometry.shadow.average_radius() as f32,
geometry.std_dev as f32,
false,
geometry.is_inset(),
);
if clip {
self.scene.pop_clip();
}
}
}
Loading