Backed out changeset 0d50962a0bb9 (bug 1656071) for wrench failures. CLOSED TREE

This commit is contained in:
Butkovits Atila 2020-07-31 20:50:31 +03:00
Родитель 4e75d26bd3
Коммит 9f220fdcc4
5 изменённых файлов: 4 добавлений и 39 удалений

Просмотреть файл

@ -615,7 +615,6 @@ static void WebRenderDebugPrefChangeCallback(const char* aPrefName, void*) {
GFX_WEBRENDER_DEBUG(".glyph-flashing", wr::DebugFlags::GLYPH_FLASHING) GFX_WEBRENDER_DEBUG(".glyph-flashing", wr::DebugFlags::GLYPH_FLASHING)
GFX_WEBRENDER_DEBUG(".disable-raster-root-scaling", GFX_WEBRENDER_DEBUG(".disable-raster-root-scaling",
wr::DebugFlags::DISABLE_RASTER_ROOT_SCALING) wr::DebugFlags::DISABLE_RASTER_ROOT_SCALING)
GFX_WEBRENDER_DEBUG(".capture-profiler", wr::DebugFlags::PROFILER_CAPTURE)
#undef GFX_WEBRENDER_DEBUG #undef GFX_WEBRENDER_DEBUG
gfx::gfxVars::SetWebRenderDebugFlags(flags.bits); gfx::gfxVars::SetWebRenderDebugFlags(flags.bits);

Просмотреть файл

@ -69,7 +69,6 @@ pub enum ProfileStyle {
Full, Full,
Compact, Compact,
Smart, Smart,
NoDraw,
} }
/// Defines the interface for hooking up an external profiler to WR. /// Defines the interface for hooking up an external profiler to WR.
@ -952,12 +951,10 @@ impl RendererProfileTimers {
} }
} }
#[derive(Debug)]
struct GraphStats { struct GraphStats {
min_value: f32, min_value: f32,
mean_value: f32, mean_value: f32,
max_value: f32, max_value: f32,
sum: f32,
} }
struct ProfileGraph { struct ProfileGraph {
@ -997,17 +994,16 @@ impl ProfileGraph {
min_value: f32::MAX, min_value: f32::MAX,
mean_value: 0.0, mean_value: 0.0,
max_value: -f32::MAX, max_value: -f32::MAX,
sum: 0.0,
}; };
for value in &self.values { for value in &self.values {
stats.min_value = stats.min_value.min(*value); stats.min_value = stats.min_value.min(*value);
stats.mean_value += *value;
stats.max_value = stats.max_value.max(*value); stats.max_value = stats.max_value.max(*value);
stats.sum += *value;
} }
if !self.values.is_empty() { if !self.values.is_empty() {
stats.mean_value = stats.sum / self.values.len() as f32; stats.mean_value /= self.values.len() as f32;
} }
stats stats
@ -1854,24 +1850,10 @@ impl Profiler {
debug_renderer, debug_renderer,
); );
} }
ProfileStyle::NoDraw => {
// Don't draw anything. We just care about collecting samples.
} }
} }
} }
pub fn dump_stats(&self, sink: &mut dyn std::io::Write) -> std::io::Result<()> {
writeln!(sink, "Backend (ms) {:?}", self.backend_graph.stats())?;
writeln!(sink, "Renderer (ms) {:?}", self.renderer_graph.stats())?;
writeln!(sink, "GPU (ms) {:?}", self.gpu_graph.stats())?;
writeln!(sink, "IPC (ms) {:?}", self.ipc_graph.stats())?;
writeln!(sink, "DisplayList builder (ms) {:?}", self.display_list_build_graph.stats())?;
writeln!(sink, "Scene build (ms) {:?}", self.scene_build_graph.stats())?;
writeln!(sink, "Rasterized blob (px) {:?}", self.blob_raster_graph.stats())?;
Ok(())
}
}
pub struct ChangeIndicator { pub struct ChangeIndicator {
counter: u32, counter: u32,
} }

Просмотреть файл

@ -3608,15 +3608,11 @@ impl Renderer {
self.cpu_profiles.push_back(cpu_profile); self.cpu_profiles.push_back(cpu_profile);
} }
if self.debug_flags.intersects(DebugFlags::PROFILER_DBG | DebugFlags::PROFILER_CAPTURE) { if self.debug_flags.contains(DebugFlags::PROFILER_DBG) {
if let Some(device_size) = device_size { if let Some(device_size) = device_size {
//TODO: take device/pixel ratio into equation? //TODO: take device/pixel ratio into equation?
if let Some(debug_renderer) = self.debug.get_mut(&mut self.device) { if let Some(debug_renderer) = self.debug.get_mut(&mut self.device) {
let style = if !self.debug_flags.contains(DebugFlags::PROFILER_DBG) { let style = if self.debug_flags.contains(DebugFlags::SMART_PROFILER) {
// Don't draw the profiler, but collect samples for captures
assert!(self.debug_flags.contains(DebugFlags::PROFILER_CAPTURE));
ProfileStyle::NoDraw
} else if self.debug_flags.contains(DebugFlags::SMART_PROFILER) {
ProfileStyle::Smart ProfileStyle::Smart
} else if self.debug_flags.contains(DebugFlags::COMPACT_PROFILER) { } else if self.debug_flags.contains(DebugFlags::COMPACT_PROFILER) {
ProfileStyle::Compact ProfileStyle::Compact
@ -7519,15 +7515,6 @@ impl Renderer {
self.device.reset_read_target(); self.device.reset_read_target();
self.device.end_frame(); self.device.end_frame();
let mut stats_file = fs::File::create(config.root.join("profiler-stats.txt"))
.expect(&format!("Unable to create profiler-stats.txt"));
if self.debug_flags.intersects(DebugFlags::PROFILER_DBG | DebugFlags::PROFILER_CAPTURE) {
self.profiler.dump_stats(&mut stats_file).unwrap();
} else {
writeln!(stats_file, "Turn on PROFILER_DBG or PROFILER_CAPTURE to get stats here!").unwrap();
}
info!("done."); info!("done.");
} }

Просмотреть файл

@ -1425,8 +1425,6 @@ bitflags! {
/// pictures that are too large (ie go back to old behavior that prevents those /// pictures that are too large (ie go back to old behavior that prevents those
/// large pictures from establishing a raster root). /// large pictures from establishing a raster root).
const DISABLE_RASTER_ROOT_SCALING = 1 << 30; const DISABLE_RASTER_ROOT_SCALING = 1 << 30;
/// Collect and dump profiler statistics to captures.
const PROFILER_CAPTURE = (1 as u32) << 31; // need "as u32" until we have cbindgen#556
} }
} }

Просмотреть файл

@ -677,7 +677,6 @@ pref("gfx.webrender.debug.small-screen", false);
pref("gfx.webrender.debug.obscure-images", false); pref("gfx.webrender.debug.obscure-images", false);
pref("gfx.webrender.debug.glyph-flashing", false); pref("gfx.webrender.debug.glyph-flashing", false);
pref("gfx.webrender.debug.disable-raster-root-scale", false); pref("gfx.webrender.debug.disable-raster-root-scale", false);
pref("gfx.webrender.debug.capture-profiler", false);
pref("accessibility.warn_on_browsewithcaret", true); pref("accessibility.warn_on_browsewithcaret", true);