Bug 1518390 - Update webrender to commit ca28ae618d249976a755db5419e5ec7c36bbfd1c (WR PR #3481). r=kats
authorWR Updater Bot <graphics-team@mozilla.staktrace.com>
Tue, 08 Jan 2019 03:43:00 +0000
changeset 509905 275e1a2e1d91468d53642a12fbc41b2cb456cab7
parent 509904 37af3b328b15168bdbc185bdb52e344c3c551da0
child 509906 953e31ae0e5d51f97dcd7070bea05c0ffd7f1c2c
push id10547
push userffxbld-merge
push dateMon, 21 Jan 2019 13:03:58 +0000
treeherdermozilla-beta@24ec1916bffe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskats
bugs1518390
milestone66.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1518390 - Update webrender to commit ca28ae618d249976a755db5419e5ec7c36bbfd1c (WR PR #3481). r=kats https://github.com/servo/webrender/pull/3481 Differential Revision: https://phabricator.services.mozilla.com/D15895
gfx/webrender_bindings/revision.txt
gfx/wr/webrender/src/picture.rs
--- a/gfx/webrender_bindings/revision.txt
+++ b/gfx/webrender_bindings/revision.txt
@@ -1,1 +1,1 @@
-cce627620aeecbe9e39cc2b39481f10d26aef892
+ca28ae618d249976a755db5419e5ec7c36bbfd1c
--- a/gfx/wr/webrender/src/picture.rs
+++ b/gfx/wr/webrender/src/picture.rs
@@ -95,16 +95,32 @@ pub struct GlobalTransformInfo {
 #[derive(Debug)]
 pub struct OpacityBindingInfo {
     /// The current value retrieved from dynamic scene properties.
     value: f32,
     /// True if it was changed (or is new) since the last frame build.
     changed: bool,
 }
 
+/// Information stored in a tile descriptor for an opacity binding.
+#[derive(Debug, PartialEq, Clone)]
+pub enum OpacityBinding {
+    Value(f32),
+    Binding(PropertyBindingId),
+}
+
+impl From<PropertyBinding<f32>> for OpacityBinding {
+    fn from(binding: PropertyBinding<f32>) -> OpacityBinding {
+        match binding {
+            PropertyBinding::Binding(key, _) => OpacityBinding::Binding(key.id),
+            PropertyBinding::Value(value) => OpacityBinding::Value(value),
+        }
+    }
+}
+
 /// A stable ID for a given tile, to help debugging.
 #[derive(Debug, Copy, Clone)]
 struct TileId(usize);
 
 /// Information about a cached tile.
 #[derive(Debug)]
 pub struct Tile {
     /// The current world rect of thie tile.
@@ -190,17 +206,17 @@ pub struct TileDescriptor {
     /// transform between frames that the tile is invalidated.
     clip_vertices: ComparableVec<LayoutPoint>,
 
     /// List of image keys that this tile depends on.
     image_keys: ComparableVec<ImageKey>,
 
     /// The set of opacity bindings that this tile depends on.
     // TODO(gw): Ugh, get rid of all opacity binding support!
-    opacity_bindings: ComparableVec<PropertyBindingId>,
+    opacity_bindings: ComparableVec<OpacityBinding>,
 
     /// List of the required valid rectangles for each primitive.
     needed_rects: Vec<WorldRect>,
 
     /// List of the currently valid rectangles for each primitive.
     current_rects: Vec<WorldRect>,
 
     /// List of the (quantized) transforms that we care about
@@ -600,24 +616,26 @@ impl TileCache {
             for image_key in tile.descriptor.image_keys.items() {
                 if resource_cache.is_image_dirty(*image_key) {
                     tile.is_valid = false;
                     break;
                 }
             }
 
             // Invalidate the tile if any opacity bindings changed.
-            for id in tile.descriptor.opacity_bindings.items() {
-                let changed = match self.opacity_bindings.get(id) {
-                    Some(info) => info.changed,
-                    None => true,
-                };
-                if changed {
-                    tile.is_valid = false;
-                    break;
+            for binding in tile.descriptor.opacity_bindings.items() {
+                if let OpacityBinding::Binding(id) = binding {
+                    let changed = match self.opacity_bindings.get(id) {
+                        Some(info) => info.changed,
+                        None => true,
+                    };
+                    if changed {
+                        tile.is_valid = false;
+                        break;
+                    }
                 }
             }
 
             if self.needs_update {
                 // Clear any dependencies so that when we rebuild them we
                 // can compare if the tile has the same content.
                 tile.clear();
             }
@@ -695,17 +713,17 @@ impl TileCache {
         if world_rect.size.width <= 0.0 || world_rect.size.height <= 0.0 {
             return;
         }
 
         // Get the tile coordinates in the picture space.
         let (p0, p1) = self.get_tile_coords_for_rect(&world_rect);
 
         // Build the list of resources that this primitive has dependencies on.
-        let mut opacity_bindings: SmallVec<[PropertyBindingId; 4]> = SmallVec::new();
+        let mut opacity_bindings: SmallVec<[OpacityBinding; 4]> = SmallVec::new();
         let mut clip_chain_uids: SmallVec<[ItemUid; 8]> = SmallVec::new();
         let mut clip_vertices: SmallVec<[LayoutPoint; 8]> = SmallVec::new();
         let mut image_keys: SmallVec<[ImageKey; 8]> = SmallVec::new();
         let mut current_clip_chain_id = prim_instance.clip_chain_id;
         let mut clip_spatial_nodes = FastHashSet::default();
 
         // Some primitives can not be cached (e.g. external video images)
         let is_cacheable = prim_instance.is_cacheable(
@@ -724,46 +742,40 @@ impl TileCache {
         // rect eventually means it doesn't affect that tile).
         // TODO(gw): Get picture clips earlier (during the initial picture traversal
         //           pass) so that we can calculate these correctly.
         let include_clip_rect = match prim_instance.kind {
             PrimitiveInstanceKind::Picture { pic_index,.. } => {
                 // Pictures can depend on animated opacity bindings.
                 let pic = &pictures[pic_index.0];
                 if let Some(PictureCompositeMode::Filter(FilterOp::Opacity(binding, _))) = pic.requested_composite_mode {
-                    if let PropertyBinding::Binding(key, _) = binding {
-                        opacity_bindings.push(key.id);
-                    }
+                    opacity_bindings.push(binding.into());
                 }
 
                 false
             }
             PrimitiveInstanceKind::Rectangle { opacity_binding_index, .. } => {
                 if opacity_binding_index != OpacityBindingIndex::INVALID {
                     let opacity_binding = &opacity_binding_store[opacity_binding_index];
                     for binding in &opacity_binding.bindings {
-                        if let PropertyBinding::Binding(key, _) = binding {
-                            opacity_bindings.push(key.id);
-                        }
+                        opacity_bindings.push(OpacityBinding::from(*binding));
                     }
                 }
 
                 true
             }
             PrimitiveInstanceKind::Image { data_handle, image_instance_index, .. } => {
                 let image_data = &resources.image_data_store[data_handle].kind;
                 let image_instance = &image_instances[image_instance_index];
                 let opacity_binding_index = image_instance.opacity_binding_index;
 
                 if opacity_binding_index != OpacityBindingIndex::INVALID {
                     let opacity_binding = &opacity_binding_store[opacity_binding_index];
                     for binding in &opacity_binding.bindings {
-                        if let PropertyBinding::Binding(key, _) = binding {
-                            opacity_bindings.push(key.id);
-                        }
+                        opacity_bindings.push(OpacityBinding::from(*binding));
                     }
                 }
 
                 image_keys.push(image_data.key);
                 true
             }
             PrimitiveInstanceKind::YuvImage { data_handle, .. } => {
                 let yuv_image_data = &resources.yuv_image_data_store[data_handle].kind;