🐛 Replace stale atlas pixels when zooming (#12884)

Copy finished tiles with BlendMode::Src so transparent pixels replace what the atlas slot held before
This commit is contained in:
Miguel de Benito Delgado 2026-11-09 14:28:13 +01:00 committed by GitHub
parent 33602b9114
commit 01191051c7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -27,8 +27,8 @@ const TILE_DRAWABLE_RECT: IRect = IRect {
};
const DOC_ATLAS_MAX_DIM: i32 = 4096;
/// GPU→GPU copy of `src` from `from` into `dst` on `to_canvas`, without
/// `image_snapshot` (avoids per-tile sync stalls on WebGL).
/// GPU→GPU copy of `src` from `from` into `dst`, replacing destination pixels,
/// including transparent pixels, within the current canvas clip.
fn draw_surface_src_rect_to_dst(
from: &mut skia::Surface,
to_canvas: &skia::Canvas,
@ -48,7 +48,9 @@ fn draw_surface_src_rect_to_dst(
to_canvas.translate((dst.left, dst.top));
to_canvas.scale((sx, sy));
to_canvas.translate((-src.left, -src.top));
from.draw(to_canvas, (0.0, 0.0), sampling, None);
let mut paint = skia::Paint::default();
paint.set_blend_mode(skia::BlendMode::Src);
from.draw(to_canvas, (0.0, 0.0), sampling, Some(&paint));
to_canvas.restore();
}