Skip to content

Commit

Permalink
servo: Merge #16030 - Expose a method to toggle wr profiler (from pau…
Browse files Browse the repository at this point in the history
…lrouget:toggle-wr-profiler); r=glennw

Source-Repo: https://github.com/servo/servo
Source-Revision: bea126fb7333ca4ffaa9e7556141bc68b01ffd53
  • Loading branch information
paulrouget committed Mar 20, 2017
1 parent 2e706c9 commit 56c8106
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions servo/components/compositing/compositor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
///
Expand Down
4 changes: 4 additions & 0 deletions servo/components/servo/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand Down

0 comments on commit 56c8106

Please sign in to comment.