🎉 Implement drawing with blend mode (single fill)

This commit is contained in:
Belén Albeza 2024-11-13 16:39:26 +01:00
parent 7458165e51
commit 966e942a7f
5 changed files with 87 additions and 15 deletions

View file

@ -141,7 +141,10 @@ fn render_single_shape(surface: &mut skia::Surface, shape: &Shape) {
surface.canvas().concat(&matrix);
// TODO: use blend mode for the shape as a whole, not in each fill
for fill in shape.fills().rev() {
surface.canvas().draw_rect(r, &fill.to_paint());
let mut p = fill.to_paint();
p.set_blend_mode(shape.blend_mode.into());
surface.canvas().draw_rect(r, &p);
}
}