Bug 1487588. Update webrender to commit 6415faa7f6acd412d4cc6b745cf802204690611c

--HG--
extra : rebase_source : c9058427a80b467eddd16d4c4e31b02309d8f9bf
This commit is contained in:
Jeff Muizelaar 2018-08-30 23:47:47 -04:00
Родитель 1155dedeb1
Коммит 904458d734
6 изменённых файлов: 37 добавлений и 81 удалений

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

@ -732,10 +732,7 @@ impl<'a> DisplayListFlattener<'a> {
unreachable!("Should have returned in parent method.")
}
SpecificDisplayItem::PushShadow(shadow) => {
let mut prim_info = prim_info.clone();
prim_info.rect = LayoutRect::zero();
self
.push_shadow(shadow, clip_and_scroll, &prim_info);
self.push_shadow(shadow, clip_and_scroll);
}
SpecificDisplayItem::PopAllShadows => {
self.pop_all_shadows();
@ -1014,7 +1011,7 @@ impl<'a> DisplayListFlattener<'a> {
let prim_index = self.prim_store.add_primitive(
&LayoutRect::zero(),
&max_clip,
is_backface_visible,
true,
clip_chain_id,
spatial_node_index,
None,
@ -1064,7 +1061,7 @@ impl<'a> DisplayListFlattener<'a> {
let src_prim_index = self.prim_store.add_primitive(
&LayoutRect::zero(),
&max_clip,
is_backface_visible,
true,
clip_chain_id,
spatial_node_index,
None,
@ -1095,7 +1092,7 @@ impl<'a> DisplayListFlattener<'a> {
let src_prim_index = self.prim_store.add_primitive(
&LayoutRect::zero(),
&max_clip,
is_backface_visible,
true,
clip_chain_id,
spatial_node_index,
None,
@ -1153,7 +1150,7 @@ impl<'a> DisplayListFlattener<'a> {
let sc_prim_index = self.prim_store.add_primitive(
&LayoutRect::zero(),
&max_clip,
is_backface_visible,
true,
clip_chain_id,
spatial_node_index,
None,
@ -1363,7 +1360,6 @@ impl<'a> DisplayListFlattener<'a> {
&mut self,
shadow: Shadow,
clip_and_scroll: ScrollNodeAndClipChain,
info: &LayoutPrimitiveInfo,
) {
let pipeline_id = self.sc_stack.last().unwrap().pipeline_id;
let max_clip = LayoutRect::max_rect();
@ -1397,7 +1393,7 @@ impl<'a> DisplayListFlattener<'a> {
let shadow_prim_index = self.prim_store.add_primitive(
&LayoutRect::zero(),
&max_clip,
info.is_backface_visible,
true,
clip_and_scroll.clip_chain_id,
clip_and_scroll.spatial_node_index,
None,

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

@ -17,7 +17,8 @@ use api::CapturedDocument;
use clip_scroll_tree::{SpatialNodeIndex, ClipScrollTree};
#[cfg(feature = "debugger")]
use debug_server;
use display_list_flattener::DisplayListFlattener;
#[cfg(feature = "replay")]
use display_list_flattener::build_scene;
use frame_builder::{FrameBuilder, FrameBuilderConfig};
use gpu_cache::GpuCache;
use hit_test::{HitTest, HitTester};
@ -260,60 +261,6 @@ impl Document {
}
}
// TODO: We will probably get rid of this soon and always forward to the scene building thread.
fn build_scene(&mut self, resource_cache: &mut ResourceCache, scene_id: u64) {
let max_texture_size = resource_cache.max_texture_size();
if self.view.window_size.width > max_texture_size ||
self.view.window_size.height > max_texture_size {
error!("ERROR: Invalid window dimensions {}x{}. Please call api.set_window_size()",
self.view.window_size.width,
self.view.window_size.height,
);
return;
}
let old_builder = self.frame_builder.take().unwrap_or_else(FrameBuilder::empty);
let root_pipeline_id = match self.pending.scene.root_pipeline_id {
Some(root_pipeline_id) => root_pipeline_id,
None => return,
};
if !self.pending.scene.pipelines.contains_key(&root_pipeline_id) {
return;
}
// The DisplayListFlattener re-create the up-to-date current scene's pipeline epoch
// map and clip scroll tree from the information in the pending scene.
self.current.scene.pipeline_epochs.clear();
let old_scrolling_states = self.clip_scroll_tree.drain();
let frame_builder = DisplayListFlattener::create_frame_builder(
old_builder,
&self.pending.scene,
&mut self.clip_scroll_tree,
resource_cache.get_font_instances(),
&self.view,
&self.output_pipelines,
&self.frame_builder_config,
&mut self.current.scene,
scene_id,
);
self.clip_scroll_tree.finalize_and_apply_pending_scroll_offsets(old_scrolling_states);
if !self.current.removed_pipelines.is_empty() {
warn!("Built the scene several times without rendering it.");
}
self.current.removed_pipelines.extend(self.pending.removed_pipelines.drain(..));
self.frame_builder = Some(frame_builder);
// Advance to the next frame.
self.frame_id.0 += 1;
}
fn forward_transaction_to_scene_builder(
&mut self,
transaction_msg: TransactionMsg,
@ -924,9 +871,13 @@ impl RenderBackend {
// Set for any existing documents.
for (_, doc) in &mut self.documents {
doc.frame_builder_config .dual_source_blending_is_enabled = enable;
doc.frame_builder_config.dual_source_blending_is_enabled = enable;
}
self.scene_tx.send(SceneBuilderRequest::SetFrameBuilderConfig(
self.frame_config.clone()
)).unwrap();
// We don't want to forward this message to the renderer.
return true;
}
@ -1025,7 +976,7 @@ impl RenderBackend {
);
}
if transaction_msg.use_scene_builder_thread {
if !has_built_scene && (op.build || transaction_msg.use_scene_builder_thread) {
let scene_id = self.make_unique_scene_id();
let doc = self.documents.get_mut(&document_id).unwrap();
@ -1047,15 +998,6 @@ impl RenderBackend {
&mut profile_counters.resources,
);
if op.build {
let scene_id = self.make_unique_scene_id();
let doc = self.documents.get_mut(&document_id).unwrap();
let _timer = profile_counters.total_time.timer();
profile_scope!("build scene");
doc.build_scene(&mut self.resource_cache, scene_id);
}
// If we have a sampler, get more frame ops from it and add them
// to the transaction. This is a hook to allow the WR user code to
// fiddle with things after a potentially long scene build, but just
@ -1114,7 +1056,7 @@ impl RenderBackend {
&mut self.resource_cache,
&mut self.gpu_cache,
&mut profile_counters.resources,
op.build || has_built_scene,
has_built_scene,
);
debug!("generated frame for document {:?} with {} passes",
@ -1431,7 +1373,7 @@ impl RenderBackend {
scene,
removed_pipelines: Vec::new(),
},
view,
view: view.clone(),
clip_scroll_tree: ClipScrollTree::new(),
frame_id: FrameId(0),
frame_builder_config: self.frame_config.clone(),
@ -1450,7 +1392,15 @@ impl RenderBackend {
}
None => {
last_scene_id += 1;
doc.build_scene(&mut self.resource_cache, last_scene_id);
let built_scene = build_scene(&self.frame_config, SceneRequest {
scene: doc.pending.scene.clone(),
view,
font_instances: self.resource_cache.get_font_instances(),
output_pipelines: doc.output_pipelines.clone(),
removed_pipelines: Vec::new(),
scene_id: last_scene_id,
});
doc.new_async_scene_ready(built_scene);
doc.render(
&mut self.resource_cache,
&mut self.gpu_cache,

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

@ -29,6 +29,7 @@ pub enum SceneBuilderRequest {
},
WakeUp,
Flush(MsgSender<()>),
SetFrameBuilderConfig(FrameBuilderConfig),
Stop
}
@ -215,6 +216,9 @@ impl SceneBuilder {
// get the Stop when the RenderBackend loop is exiting.
return false;
}
SceneBuilderRequest::SetFrameBuilderConfig(cfg) => {
self.config = cfg;
}
}
true

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

@ -65,7 +65,7 @@ impl Transaction {
frame_ops: Vec::new(),
resource_updates: Vec::new(),
payloads: Vec::new(),
use_scene_builder_thread: false, // TODO: make this true by default.
use_scene_builder_thread: true,
generate_frame: false,
}
}
@ -978,6 +978,10 @@ impl RenderApi {
/// Load a capture of the current frame state for debugging.
pub fn load_capture(&self, path: PathBuf) -> Vec<CapturedDocument> {
// First flush the scene builder otherwise async scenes might clobber
// the capture we are about to load.
self.flush_scene_builder();
let (tx, rx) = channel::msg_channel().unwrap();
let msg = ApiMsg::DebugCommand(DebugCommand::LoadCapture(path, tx));
self.send_message(msg);

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

@ -1 +1 @@
69dae1fe743bf3656d532672366e7193b041b6f7
6415faa7f6acd412d4cc6b745cf802204690611c

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

@ -486,6 +486,8 @@ impl<'a> ReftestHarness<'a> {
reader.allow_mipmaps(allow_mipmaps);
reader.do_frame(self.wrench);
self.wrench.api.flush_scene_builder();
// wait for the frame
self.rx.recv().unwrap();
let stats = self.wrench.render();