diff --git a/gfx/thebes/gfxPlatform.cpp b/gfx/thebes/gfxPlatform.cpp index 458ac108762b..45c68e50adab 100644 --- a/gfx/thebes/gfxPlatform.cpp +++ b/gfx/thebes/gfxPlatform.cpp @@ -615,7 +615,6 @@ static void WebRenderDebugPrefChangeCallback(const char* aPrefName, void*) { GFX_WEBRENDER_DEBUG(".glyph-flashing", wr::DebugFlags::GLYPH_FLASHING) GFX_WEBRENDER_DEBUG(".disable-raster-root-scaling", wr::DebugFlags::DISABLE_RASTER_ROOT_SCALING) - GFX_WEBRENDER_DEBUG(".capture-profiler", wr::DebugFlags::PROFILER_CAPTURE) #undef GFX_WEBRENDER_DEBUG gfx::gfxVars::SetWebRenderDebugFlags(flags.bits); diff --git a/gfx/wr/webrender/src/profiler.rs b/gfx/wr/webrender/src/profiler.rs index d6ba65845abe..1bd0e839010c 100644 --- a/gfx/wr/webrender/src/profiler.rs +++ b/gfx/wr/webrender/src/profiler.rs @@ -69,7 +69,6 @@ pub enum ProfileStyle { Full, Compact, Smart, - NoDraw, } /// Defines the interface for hooking up an external profiler to WR. @@ -952,12 +951,10 @@ impl RendererProfileTimers { } } -#[derive(Debug)] struct GraphStats { min_value: f32, mean_value: f32, max_value: f32, - sum: f32, } struct ProfileGraph { @@ -997,17 +994,16 @@ impl ProfileGraph { min_value: f32::MAX, mean_value: 0.0, max_value: -f32::MAX, - sum: 0.0, }; for value in &self.values { stats.min_value = stats.min_value.min(*value); + stats.mean_value += *value; stats.max_value = stats.max_value.max(*value); - stats.sum += *value; } if !self.values.is_empty() { - stats.mean_value = stats.sum / self.values.len() as f32; + stats.mean_value /= self.values.len() as f32; } stats @@ -1854,22 +1850,8 @@ impl Profiler { 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 { diff --git a/gfx/wr/webrender/src/renderer.rs b/gfx/wr/webrender/src/renderer.rs index 97132a23ab2a..9462b4b7f2ac 100644 --- a/gfx/wr/webrender/src/renderer.rs +++ b/gfx/wr/webrender/src/renderer.rs @@ -3608,15 +3608,11 @@ impl Renderer { 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 { //TODO: take device/pixel ratio into equation? if let Some(debug_renderer) = self.debug.get_mut(&mut self.device) { - let style = if !self.debug_flags.contains(DebugFlags::PROFILER_DBG) { - // 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) { + let style = if self.debug_flags.contains(DebugFlags::SMART_PROFILER) { ProfileStyle::Smart } else if self.debug_flags.contains(DebugFlags::COMPACT_PROFILER) { ProfileStyle::Compact @@ -7519,15 +7515,6 @@ impl Renderer { self.device.reset_read_target(); 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."); } diff --git a/gfx/wr/webrender_api/src/api.rs b/gfx/wr/webrender_api/src/api.rs index 97317fcea36c..8dfa150a72ba 100644 --- a/gfx/wr/webrender_api/src/api.rs +++ b/gfx/wr/webrender_api/src/api.rs @@ -1425,8 +1425,6 @@ bitflags! { /// pictures that are too large (ie go back to old behavior that prevents those /// large pictures from establishing a raster root). 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 } } diff --git a/modules/libpref/init/all.js b/modules/libpref/init/all.js index 42d4c17d7c4c..66a910d81073 100644 --- a/modules/libpref/init/all.js +++ b/modules/libpref/init/all.js @@ -677,7 +677,6 @@ pref("gfx.webrender.debug.small-screen", false); pref("gfx.webrender.debug.obscure-images", false); pref("gfx.webrender.debug.glyph-flashing", false); pref("gfx.webrender.debug.disable-raster-root-scale", false); -pref("gfx.webrender.debug.capture-profiler", false); pref("accessibility.warn_on_browsewithcaret", true);