Add a sampling profiler and a script to generate profiles for use with Gecko tooling.

This commit is contained in:
Josh Matthews 2019-03-22 13:15:50 -04:00
parent db7bb2a510
commit 90f67c11e5
13 changed files with 379 additions and 28 deletions

View file

@ -16,6 +16,7 @@ use servo_url::ServoUrl;
use std::fmt::{Debug, Error, Formatter};
#[cfg(feature = "gl")]
use std::rc::Rc;
use std::time::Duration;
use style_traits::DevicePixel;
use webrender_api::{DeviceIntPoint, DeviceIntRect, DeviceIntSize, DevicePoint, ScrollLocation};
use webvr::VRServiceManager;
@ -91,6 +92,8 @@ pub enum WindowEvent {
ToggleWebRenderDebug(WebRenderDebugOption),
/// Capture current WebRender
CaptureWebRender,
/// Toggle sampling profiler with the given sampling rate
ToggleSamplingProfiler(Duration),
}
impl Debug for WindowEvent {
@ -118,6 +121,7 @@ impl Debug for WindowEvent {
WindowEvent::SelectBrowser(..) => write!(f, "SelectBrowser"),
WindowEvent::ToggleWebRenderDebug(..) => write!(f, "ToggleWebRenderDebug"),
WindowEvent::CaptureWebRender => write!(f, "CaptureWebRender"),
WindowEvent::ToggleSamplingProfiler(..) => write!(f, "ToggleSamplingProfiler"),
}
}
}