From b8bb282f5c5763d77e96dd9da4ef056e27691c4f Mon Sep 17 00:00:00 2001 From: Kartikaya Gupta Date: Thu, 5 Jul 2018 21:42:16 -0400 Subject: [PATCH] Copy all the pipeline epoch information to the new scene. Without this patch, the pipeline_epoch info on the new scene contains just the pipelines that were "built" as part of the scene build, plus pipelines on for which update_epoch was called. This is kind of random, and there doesn't appear to be any real reason to omit some of the pipelines. For gecko it is desirable to the epoch information for all pipelines, even the ones that weren't built, and for consistency we can just always propagate the epoch info over to the new scene during the scene build. --- webrender/src/display_list_flattener.rs | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/webrender/src/display_list_flattener.rs b/webrender/src/display_list_flattener.rs index 50c31621b9..57c9cd06e6 100644 --- a/webrender/src/display_list_flattener.rs +++ b/webrender/src/display_list_flattener.rs @@ -5,7 +5,7 @@ use api::{AlphaType, BorderDetails, BorderDisplayItem, BuiltDisplayListIter, ClipAndScrollInfo}; use api::{ClipId, ColorF, ComplexClipRegion, DeviceIntPoint, DeviceIntRect, DeviceIntSize}; -use api::{DevicePixelScale, DeviceUintRect, DisplayItemRef, Epoch, ExtendMode, ExternalScrollId}; +use api::{DevicePixelScale, DeviceUintRect, DisplayItemRef, ExtendMode, ExternalScrollId}; use api::{FilterOp, FontInstanceKey, GlyphInstance, GlyphOptions, GlyphRasterSpace, GradientStop}; use api::{IframeDisplayItem, ImageKey, ImageRendering, ItemRange, LayoutPoint}; use api::{LayoutPrimitiveInfo, LayoutRect, LayoutSize, LayoutTransform, LayoutVector2D}; @@ -150,9 +150,6 @@ pub struct DisplayListFlattener<'a> { /// The map of all font instances. font_instances: FontInstanceMap, - /// Used to track the latest flattened epoch for each pipeline. - pipeline_epochs: Vec<(PipelineId, Epoch)>, - /// A set of pipelines that the caller has requested be made available as /// output textures. output_pipelines: &'a FastHashSet, @@ -207,8 +204,6 @@ impl<'a> DisplayListFlattener<'a> { let root_pipeline_id = scene.root_pipeline_id.unwrap(); let root_pipeline = scene.pipelines.get(&root_pipeline_id).unwrap(); - let root_epoch = scene.pipeline_epochs[&root_pipeline_id]; - let background_color = root_pipeline .background_color .and_then(|color| if color.a > 0.0 { Some(color) } else { None }); @@ -218,7 +213,6 @@ impl<'a> DisplayListFlattener<'a> { clip_scroll_tree, font_instances, config: *frame_builder_config, - pipeline_epochs: Vec::new(), output_pipelines, id_to_index_mapper: ClipIdToIndexMapper::default(), hit_testing_runs: recycle_vec(old_builder.hit_testing_runs), @@ -243,8 +237,7 @@ impl<'a> DisplayListFlattener<'a> { debug_assert!(flattener.picture_stack.is_empty()); new_scene.root_pipeline_id = Some(root_pipeline_id); - new_scene.pipeline_epochs.insert(root_pipeline_id, root_epoch); - new_scene.pipeline_epochs.extend(flattener.pipeline_epochs.drain(..)); + new_scene.pipeline_epochs = scene.pipeline_epochs.clone(); new_scene.pipelines = scene.pipelines.clone(); FrameBuilder::with_display_list_flattener( @@ -529,9 +522,6 @@ impl<'a> DisplayListFlattener<'a> { ), ); - let epoch = self.scene.pipeline_epochs[&iframe_pipeline_id]; - self.pipeline_epochs.push((iframe_pipeline_id, epoch)); - let bounds = item.rect(); let origin = *reference_frame_relative_offset + bounds.origin.to_vector(); self.push_reference_frame(