From a15f9174ec95f704c5555c025996595572b7d8f3 Mon Sep 17 00:00:00 2001 From: Csoregi Natalia Date: Fri, 21 Feb 2020 01:31:33 +0200 Subject: [PATCH] Backed out changeset 3a8d5795c985 (bug 1616335) for tidy bustage on display_list.rs. CLOSED TREE --- gfx/layers/wr/WebRenderLayerManager.cpp | 5 ----- gfx/webrender_bindings/WebRenderAPI.cpp | 4 ---- gfx/webrender_bindings/WebRenderAPI.h | 1 - gfx/webrender_bindings/src/bindings.rs | 5 ----- gfx/wr/webrender_api/src/display_list.rs | 24 ++++++------------------ modules/libpref/init/StaticPrefList.yaml | 5 ----- 6 files changed, 6 insertions(+), 38 deletions(-) diff --git a/gfx/layers/wr/WebRenderLayerManager.cpp b/gfx/layers/wr/WebRenderLayerManager.cpp index aa06e2725827..ecdf546cfb73 100644 --- a/gfx/layers/wr/WebRenderLayerManager.cpp +++ b/gfx/layers/wr/WebRenderLayerManager.cpp @@ -334,11 +334,6 @@ void WebRenderLayerManager::EndTransactionWithoutLayer( printf_stderr("-- WebRender display list build --\n"); } - if (XRE_IsContentProcess() && - StaticPrefs::gfx_webrender_dl_dump_content_serialized()) { - builder.DumpSerializedDisplayList(); - } - if (aDisplayList) { MOZ_ASSERT(aDisplayListBuilder && !aBackground); // Record the time spent "layerizing". WR doesn't actually layerize but diff --git a/gfx/webrender_bindings/WebRenderAPI.cpp b/gfx/webrender_bindings/WebRenderAPI.cpp index 6a11d27b3c7e..82aa8683ff8e 100644 --- a/gfx/webrender_bindings/WebRenderAPI.cpp +++ b/gfx/webrender_bindings/WebRenderAPI.cpp @@ -938,10 +938,6 @@ usize DisplayListBuilder::Dump(usize aIndent, const Maybe& aStart, aEnd.ptrOr(nullptr)); } -void DisplayListBuilder::DumpSerializedDisplayList() { - wr_dump_serialized_display_list(mWrState); -} - void DisplayListBuilder::Finalize(wr::LayoutSize& aOutContentSize, BuiltDisplayList& aOutDisplayList) { wr_api_finalize_builder(mWrState, &aOutContentSize, &aOutDisplayList.dl_desc, diff --git a/gfx/webrender_bindings/WebRenderAPI.h b/gfx/webrender_bindings/WebRenderAPI.h index f228a9465b63..37149ce46b90 100644 --- a/gfx/webrender_bindings/WebRenderAPI.h +++ b/gfx/webrender_bindings/WebRenderAPI.h @@ -405,7 +405,6 @@ class DisplayListBuilder final { usize Dump(usize aIndent, const Maybe& aStart, const Maybe& aEnd); - void DumpSerializedDisplayList(); void Finalize(wr::LayoutSize& aOutContentSizes, wr::BuiltDisplayList& aOutDisplayList); diff --git a/gfx/webrender_bindings/src/bindings.rs b/gfx/webrender_bindings/src/bindings.rs index 90d9c47d383a..dbd2bbeb1d22 100644 --- a/gfx/webrender_bindings/src/bindings.rs +++ b/gfx/webrender_bindings/src/bindings.rs @@ -3613,11 +3613,6 @@ pub extern "C" fn wr_dump_display_list(state: &mut WrState, index } -#[no_mangle] -pub extern "C" fn wr_dump_serialized_display_list(state: &mut WrState) { - state.frame_builder.dl_builder.dump_serialized_display_list(); -} - #[no_mangle] pub unsafe extern "C" fn wr_api_finalize_builder(state: &mut WrState, content_size: &mut LayoutSize, diff --git a/gfx/wr/webrender_api/src/display_list.rs b/gfx/wr/webrender_api/src/display_list.rs index 3203781f30db..773378a5cb9c 100644 --- a/gfx/wr/webrender_api/src/display_list.rs +++ b/gfx/wr/webrender_api/src/display_list.rs @@ -10,7 +10,7 @@ use serde::de::Deserializer; #[cfg(feature = "serialize")] use serde::ser::{Serializer, SerializeSeq}; use serde::{Deserialize, Serialize}; -use std::io::Write; +use std::io::{stdout, Write}; use std::marker::PhantomData; use std::ops::Range; use std::mem; @@ -925,7 +925,6 @@ pub struct DisplayListBuilder { save_state: Option, cache_size: usize, - serialized_content_buffer: Option, } impl DisplayListBuilder { @@ -955,7 +954,6 @@ impl DisplayListBuilder { content_size, save_state: None, cache_size: 0, - serialized_content_buffer: None, } } @@ -997,6 +995,11 @@ impl DisplayListBuilder { self.save_state.take().expect("No save to clear in DisplayListBuilder"); } + /// Print the display items in the list to stdout. + pub fn print_display_list(&mut self) { + self.emit_display_list(0, Range { start: None, end: None }, stdout()); + } + /// Emits a debug representation of display items in the list, for debugging /// purposes. If the range's start parameter is specified, only display /// items starting at that index (inclusive) will be printed. If the range's @@ -1043,11 +1046,6 @@ impl DisplayListBuilder { } } - /// Print the display items in the list to stdout. - pub fn dump_serialized_display_list(&mut self) { - self.serialized_content_buffer = Some(String::new()); - } - /// Add an item to the display list. /// /// NOTE: It is usually preferable to use the specialized methods to push @@ -1056,11 +1054,6 @@ impl DisplayListBuilder { #[inline] pub fn push_item(&mut self, item: &di::DisplayItem) { poke_into_vec(item, self.active_buffer()); - - if let Some(ref mut content) = self.serialized_content_buffer { - use std::fmt::Write; - write!(content, "{:?}\n", item).expect("DL dump write failed."); - } } fn push_iter_impl(data: &mut Vec, iter_source: I) @@ -1761,11 +1754,6 @@ impl DisplayListBuilder { pub fn finalize(mut self) -> (PipelineId, LayoutSize, BuiltDisplayList) { assert!(self.save_state.is_none(), "Finalized DisplayListBuilder with a pending save"); - if let Some(content) = self.serialized_content_buffer.take() { - println!("-- WebRender display list for {:?} --\n{}", - self.pipeline_id, content); - } - // Add `DisplayItem::max_size` zone of zeroes to the end of display list // so there is at least this amount available in the display list during // serialization. diff --git a/modules/libpref/init/StaticPrefList.yaml b/modules/libpref/init/StaticPrefList.yaml index 9dd5f7cc235a..3f571c39dd52 100644 --- a/modules/libpref/init/StaticPrefList.yaml +++ b/modules/libpref/init/StaticPrefList.yaml @@ -3860,11 +3860,6 @@ value: false mirror: always -- name: gfx.webrender.dl.dump-content-serialized - type: RelaxedAtomicBool - value: false - mirror: always - # Also expose a pref to allow users to force-disable WR. This is exposed # on all channels because WR can be enabled on qualified hardware on all # channels.