servo: Merge #16030 - Expose a method to toggle wr profiler (from paulrouget:toggle-wr-profiler); r=glennw
authorPaul Rouget <me@paulrouget.com>
Sun, 19 Mar 2017 17:42:16 -0700
changeset 348385 a15183cf83068238ed9da8d5e0286db788908c29
parent 348384 07c39d53f45c6c670351069bf00bc5abbf769c47
child 348386 51c124a0f50b6484c40fe47878430a1a79a618bf
push id39136
push userservo-vcs-sync@mozilla.com
push dateMon, 20 Mar 2017 01:22:47 +0000
treeherderautoland@a15183cf8306 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglennw
milestone55.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
servo: Merge #16030 - Expose a method to toggle wr profiler (from paulrouget:toggle-wr-profiler); r=glennw Source-Repo: https://github.com/servo/servo Source-Revision: bea126fb7333ca4ffaa9e7556141bc68b01ffd53
servo/components/compositing/compositor.rs
servo/components/servo/lib.rs
--- a/servo/components/compositing/compositor.rs
+++ b/servo/components/compositing/compositor.rs
@@ -1697,16 +1697,21 @@ impl<Window: WindowMethods> IOCompositor
 
         if !self.pending_scroll_zoom_events.is_empty() && !self.waiting_for_results_of_scroll {
             self.process_pending_scroll_events()
         }
 
         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.
     ///
     /// This is used when resizing the window.
     pub fn repaint_synchronously(&mut self) {
         while self.shutdown_state != ShutdownState::ShuttingDown {
             let msg = self.port.recv_compositor_msg();
             let need_recomposite = match msg {
--- a/servo/components/servo/lib.rs
+++ b/servo/components/servo/lib.rs
@@ -237,16 +237,20 @@ impl<Window> Browser<Window> where Windo
             constellation_chan: constellation_chan,
         }
     }
 
     pub fn handle_events(&mut self, events: Vec<WindowEvent>) -> bool {
         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()
     }
 
     pub fn pinch_zoom_level(&self) -> f32 {
         self.compositor.pinch_zoom_level()
     }