Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reset segment clip tasks each frame. #2568

Merged
merged 1 commit into from Mar 26, 2018
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Reset segment clip tasks each frame.

Clipping can change each frame. Clearing the segment clip tasks avoids invalidated state from previous frames from leaking into new ones. Fixes #2531.
  • Loading branch information
nical committed Mar 26, 2018
commit a7ec9ec1e2ef1c0358e81c03745e816eea1652ac
@@ -1543,6 +1543,18 @@ impl PrimitiveStore {
true
}

fn reset_clip_task(&mut self, prim_index: PrimitiveIndex) {
let metadata = &mut self.cpu_metadata[prim_index.0];
metadata.clip_task_id = None;
if metadata.prim_kind == PrimitiveKind::Brush {
if let Some(ref mut desc) = self.cpu_brushes[metadata.cpu_prim_index.0].segment_desc {
for segment in &mut desc.segments {
segment.clip_task_id = None;
}
}
}
}

fn update_clip_task(
&mut self,
prim_index: PrimitiveIndex,
@@ -1552,7 +1564,8 @@ impl PrimitiveStore {
frame_context: &FrameBuildingContext,
frame_state: &mut FrameBuildingState,
) -> bool {
self.cpu_metadata[prim_index.0].clip_task_id = None;
// Reset clips from previous frames since we may clip differently each frame.
self.reset_clip_task(prim_index);

let prim_screen_rect = match prim_screen_rect.intersection(&frame_context.screen_rect) {
Some(rect) => rect,
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.