mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Expose a method to toggle wr profiler
This commit is contained in:
parent
ae1a7cc7b8
commit
b8cd715b3e
2 changed files with 9 additions and 0 deletions
|
@ -1702,6 +1702,11 @@ impl<Window: WindowMethods> IOCompositor<Window> {
|
|||
self.shutdown_state != ShutdownState::FinishedShuttingDown
|
||||
}
|
||||
|
||||
pub fn set_webrender_profiler_enabled(&mut self, enabled: bool) {
|
||||
self.webrender.set_profiler_enabled(enabled);
|
||||
self.webrender_api.generate_frame(None);
|
||||
}
|
||||
|
||||
/// Repaints and recomposites synchronously. You must be careful when calling this, as if a
|
||||
/// paint is not scheduled the compositor will hang forever.
|
||||
///
|
||||
|
|
|
@ -242,6 +242,10 @@ impl<Window> Browser<Window> where Window: WindowMethods + 'static {
|
|||
self.compositor.handle_events(events)
|
||||
}
|
||||
|
||||
pub fn set_webrender_profiler_enabled(&mut self, enabled: bool) {
|
||||
self.compositor.set_webrender_profiler_enabled(enabled);
|
||||
}
|
||||
|
||||
pub fn repaint_synchronously(&mut self) {
|
||||
self.compositor.repaint_synchronously()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue