This commit is contained in:
2026-07-13 06:40:14 +03:00
parent a70bedd6bb
commit 356fac571d
18 changed files with 2360 additions and 471 deletions
+3 -7
View File
@@ -127,9 +127,9 @@ impl Engine {
tip.density,
);
layer.dirty = true;
// Effects are expensive (33MB clone + apply_layer_effects on 4K).
// Only mark the layer as needing an effects pass if it actually
// has any effects or editable styles.
// Mark effects_dirty so the effects pipeline re-runs after the
// stroke ends. This is safe because apply_effects_and_sync_tiles
// no longer modifies layer.pixels — it only updates effects_cache.
if !layer.effects.is_empty() || !layer.styles.is_empty() {
layer.effects_dirty.store(true, std::sync::atomic::Ordering::Release);
}
@@ -166,8 +166,6 @@ impl Engine {
self.stroke_before_buf.as_deref(),
);
layer.dirty = true;
// Avoid triggering the expensive effects pass for layers that
// have no effects/styles.
if !layer.effects.is_empty() || !layer.styles.is_empty() {
layer.effects_dirty.store(true, std::sync::atomic::Ordering::Release);
}
@@ -200,8 +198,6 @@ impl Engine {
let px_color = [color[0], color[1], color[2], (color[3] as f32 * tip.opacity * pressure).round() as u8];
draw_line(layer, x0, y0, x1, y1, px_color, tip.size, mask_ref);
layer.dirty = true;
// Only request an effects re-render if the layer actually has
// effects or editable styles.
if !layer.effects.is_empty() || !layer.styles.is_empty() {
layer.effects_dirty.store(true, std::sync::atomic::Ordering::Release);
}