Skip to content

Commit

Permalink
Allow explicit indication of which missing pipelines are acceptable
Browse files Browse the repository at this point in the history
In some cases Gecko includes iframes for pipelines that are in other
content processes, and the order in which the display lists reach the
compositor is not deterministic. So it would be better if we could just
have WebRender ignore those pipeline references. In all other cases we
can assert.
  • Loading branch information
staktrace committed May 16, 2018
1 parent 23fa751 commit 96e10c5
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion webrender/examples/iframe.rs
Expand Up @@ -74,7 +74,7 @@ impl Example for App {
);
// red rect under the iframe: if this is visible, things have gone wrong
builder.push_rect(&info, ColorF::new(1.0, 0.0, 0.0, 1.0));
builder.push_iframe(&info, sub_pipeline_id);
builder.push_iframe(&info, sub_pipeline_id, false);
builder.pop_stacking_context();
}
}
Expand Down
3 changes: 1 addition & 2 deletions webrender/src/display_list_flattener.rs
Expand Up @@ -556,8 +556,7 @@ impl<'a> DisplayListFlattener<'a> {
let pipeline = match self.scene.pipelines.get(&iframe_pipeline_id) {
Some(pipeline) => pipeline,
None => {
//TODO: assert/debug_assert?
error!("Unknown pipeline used for iframe {:?}", info);
debug_assert!(info.ignore_missing_pipeline);
return
},
};
Expand Down
1 change: 1 addition & 0 deletions webrender_api/src/display_item.rs
Expand Up @@ -543,6 +543,7 @@ pub enum FilterOp {
pub struct IframeDisplayItem {
pub clip_id: ClipId,
pub pipeline_id: PipelineId,
pub ignore_missing_pipeline: bool,
}

#[derive(Clone, Copy, Debug, Deserialize, PartialEq, Serialize)]
Expand Down
8 changes: 7 additions & 1 deletion webrender_api/src/display_list.rs
Expand Up @@ -1491,10 +1491,16 @@ impl DisplayListBuilder {
assert!(!self.clip_stack.is_empty());
}

pub fn push_iframe(&mut self, info: &LayoutPrimitiveInfo, pipeline_id: PipelineId) {
pub fn push_iframe(
&mut self,
info: &LayoutPrimitiveInfo,
pipeline_id: PipelineId,
ignore_missing_pipeline: bool)
{
let item = SpecificDisplayItem::Iframe(IframeDisplayItem {
clip_id: self.generate_clip_id(),
pipeline_id,
ignore_missing_pipeline,
});
self.push_item(item, info);
}
Expand Down
3 changes: 2 additions & 1 deletion wrench/src/yaml_frame_reader.rs
Expand Up @@ -1243,7 +1243,8 @@ impl YamlFrameReader {
) {
info.rect = item["bounds"].as_rect().expect("iframe must have bounds");
let pipeline_id = item["id"].as_pipeline_id().unwrap();
dl.push_iframe(&info, pipeline_id);
let ignore = item["ignore_missing_pipeline"].as_bool().unwrap_or(true);
dl.push_iframe(&info, pipeline_id, ignore);
}

pub fn get_complex_clip_for_item(&mut self, yaml: &Yaml) -> Option<ComplexClipRegion> {
Expand Down
1 change: 1 addition & 0 deletions wrench/src/yaml_frame_writer.rs
Expand Up @@ -1013,6 +1013,7 @@ impl YamlFrameWriter {
Iframe(item) => {
str_node(&mut v, "type", "iframe");
u32_vec_node(&mut v, "id", &[item.pipeline_id.0, item.pipeline_id.1]);
bool_node(&mut v, "ignore_missing_pipeline", item.ignore_missing_pipeline);
}
PushStackingContext(item) => {
str_node(&mut v, "type", "stacking-context");
Expand Down

0 comments on commit 96e10c5

Please sign in to comment.