[culling] Add debug option to ignore clip rectangles
This commit is contained in:
parent
2615d1bce1
commit
f30b354f77
2 changed files with 22 additions and 3 deletions
|
@ -617,11 +617,21 @@ impl Context {
|
|||
|
||||
impl paint::PaintOptions {
|
||||
pub fn ui(&mut self, ui: &mut Ui) {
|
||||
let Self {
|
||||
anti_alias,
|
||||
aa_size: _,
|
||||
debug_paint_clip_rects,
|
||||
debug_ignore_clip_rects,
|
||||
} = self;
|
||||
use crate::widgets::*;
|
||||
ui.add(Checkbox::new(&mut self.anti_alias, "Antialias"));
|
||||
ui.add(Checkbox::new(anti_alias, "Antialias"));
|
||||
ui.add(Checkbox::new(
|
||||
&mut self.debug_paint_clip_rects,
|
||||
"Paint Clip Rects (debug)",
|
||||
debug_paint_clip_rects,
|
||||
"Paint clip rectangles (debug)",
|
||||
));
|
||||
ui.add(Checkbox::new(
|
||||
debug_ignore_clip_rects,
|
||||
"Ignore clip rectangles (debug)",
|
||||
));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -438,6 +438,8 @@ pub struct PaintOptions {
|
|||
pub aa_size: f32,
|
||||
/// Output the clip rectangles to be painted?
|
||||
pub debug_paint_clip_rects: bool,
|
||||
/// If true, no clipping will be done
|
||||
pub debug_ignore_clip_rects: bool,
|
||||
}
|
||||
|
||||
impl Default for PaintOptions {
|
||||
|
@ -446,6 +448,7 @@ impl Default for PaintOptions {
|
|||
anti_alias: true,
|
||||
aa_size: 1.0,
|
||||
debug_paint_clip_rects: false,
|
||||
debug_ignore_clip_rects: false,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -829,5 +832,11 @@ pub fn tessellate_paint_commands(
|
|||
}
|
||||
}
|
||||
|
||||
if options.debug_ignore_clip_rects {
|
||||
for (clip_rect, _) in &mut jobs {
|
||||
*clip_rect = Rect::everything();
|
||||
}
|
||||
}
|
||||
|
||||
jobs
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue