Skip to content

Commit 6fb754a

Browse files
committed
Add API for tweaking debug options.
Right now, it's possible to toggle the profiler. In the future this can include options for subpixel AA, shader hot reload etc.
1 parent 49dfb69 commit 6fb754a

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

webrender/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,4 +110,4 @@ extern crate offscreen_gl_context;
110110
extern crate byteorder;
111111
extern crate rayon;
112112

113-
pub use renderer::{Renderer, RendererOptions};
113+
pub use renderer::{Renderer, RendererOptions, RendererOption};

webrender/src/renderer.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1668,6 +1668,19 @@ impl Renderer {
16681668
pub fn set_profiler_enabled(&mut self, enabled: bool) {
16691669
self.enable_profiler = enabled;
16701670
}
1671+
1672+
pub fn toggle_option(&mut self, option: RendererOption) {
1673+
match option {
1674+
RendererOption::Profiler => {
1675+
self.enable_profiler = !self.enable_profiler;
1676+
}
1677+
}
1678+
}
1679+
}
1680+
1681+
#[derive(Clone, Debug)]
1682+
pub enum RendererOption {
1683+
Profiler,
16711684
}
16721685

16731686
#[derive(Clone, Debug)]

0 commit comments

Comments
 (0)