mirror of
https://github.com/penpot/penpot.git
synced 2026-07-29 09:26:14 +00:00
🐛 Fix rendering artifacts from previous frames
This commit is contained in:
parent
c66ee1803f
commit
9d7a8eaeda
@ -907,6 +907,14 @@ impl RenderState {
|
||||
|
||||
pub fn reset_canvas(&mut self) {
|
||||
self.surfaces.reset(self.background_color);
|
||||
self.surfaces.clear_backbuffer(self.background_color);
|
||||
self.surfaces.clear_target(self.background_color);
|
||||
}
|
||||
|
||||
/// Drop cached tile textures before a one-shot `render_sync_shape` render.
|
||||
pub fn prepare_sync_shape_render(&mut self) {
|
||||
self.surfaces.clear_tile_atlas();
|
||||
self.surfaces.invalidate_tile_cache();
|
||||
}
|
||||
|
||||
/// NOTE:
|
||||
@ -1085,11 +1093,6 @@ impl RenderState {
|
||||
self.include_filter.is_some()
|
||||
}
|
||||
|
||||
fn reset_viewer_masked_surfaces(&mut self) {
|
||||
self.surfaces.clear_backbuffer(self.background_color);
|
||||
self.surfaces.clear_tile_atlas();
|
||||
}
|
||||
|
||||
/// True when the shape or any descendant is whitelisted.
|
||||
pub fn shape_visible_in_include_filter(&self, shape_id: &Uuid, tree: ShapesPoolRef) -> bool {
|
||||
let Some(ref include) = self.include_filter else {
|
||||
@ -2192,13 +2195,6 @@ impl RenderState {
|
||||
self.interactive_target_seeded = false;
|
||||
}
|
||||
|
||||
// Viewer fixed-scroll passes reuse the same WASM context; `reset` does not
|
||||
// clear Backbuffer, so pass 2 would otherwise keep pass-1 pixels in regions
|
||||
// that render no shapes for the current mask. Target is cleared in present_frame.
|
||||
if self.viewer_masked_pass() {
|
||||
self.reset_viewer_masked_surfaces();
|
||||
}
|
||||
|
||||
let surface_ids = SurfaceId::Strokes as u32
|
||||
| SurfaceId::Fills as u32
|
||||
| SurfaceId::InnerShadows as u32
|
||||
|
||||
@ -80,7 +80,9 @@ impl State {
|
||||
}
|
||||
|
||||
pub fn render_sync_shape(&mut self, id: &Uuid, timestamp: i32) -> Result<FrameType> {
|
||||
get_render_state().start_render_loop(Some(id), &self.shapes, timestamp, true)
|
||||
let render_state = get_render_state();
|
||||
render_state.prepare_sync_shape_render();
|
||||
render_state.start_render_loop(Some(id), &self.shapes, timestamp, true)
|
||||
}
|
||||
|
||||
pub fn render_shape_pixels(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user