Bug 1513682 - Update webrender to commit b5f190951f27dd04067489b9fbbeb87f55765f57 (WR PR #3401). r=kats
authorWR Updater Bot <graphics-team@mozilla.staktrace.com>
Thu, 13 Dec 2018 00:55:13 +0000
changeset 450366 1da261b7f019321c54677afcefe19da35dec68e0
parent 450365 606d75702c5cc63ea9f2cefcdac7d49aa53dabe6
child 450367 4a0097b6b670cd2b850b656c6d4192e4ae9b2049
push id110479
push usercsabou@mozilla.com
push dateThu, 13 Dec 2018 04:02:11 +0000
treeherdermozilla-inbound@3ecc407c0cc8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskats
bugs1513682
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 1513682 - Update webrender to commit b5f190951f27dd04067489b9fbbeb87f55765f57 (WR PR #3401). r=kats https://github.com/servo/webrender/pull/3401 Differential Revision: https://phabricator.services.mozilla.com/D14353
gfx/webrender_bindings/revision.txt
gfx/wr/Cargo.lock
gfx/wr/examples/animation.rs
gfx/wr/examples/iframe.rs
gfx/wr/webrender/src/clip_scroll_tree.rs
gfx/wr/webrender/src/display_list_flattener.rs
gfx/wr/webrender/src/spatial_node.rs
gfx/wr/webrender/src/util.rs
gfx/wr/webrender_api/src/display_item.rs
gfx/wr/webrender_api/src/display_list.rs
gfx/wr/wrench/reftests/transforms/nested-rotate-x-flat.png
gfx/wr/wrench/reftests/transforms/nested-rotate-x-flat.yaml
gfx/wr/wrench/reftests/transforms/nested-rotate-x.png
gfx/wr/wrench/reftests/transforms/nested-rotate-x.yaml
gfx/wr/wrench/reftests/transforms/reftest.list
gfx/wr/wrench/src/yaml_frame_reader.rs
--- a/gfx/webrender_bindings/revision.txt
+++ b/gfx/webrender_bindings/revision.txt
@@ -1,1 +1,1 @@
-ed1fb8952062da154f8f6b391e6807115fc74d50
+b5f190951f27dd04067489b9fbbeb87f55765f57
--- a/gfx/wr/Cargo.lock
+++ b/gfx/wr/Cargo.lock
@@ -329,17 +329,17 @@ source = "registry+https://github.com/ru
 dependencies = [
  "generic-array 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "direct-composition"
 version = "0.1.0"
 dependencies = [
- "euclid 0.19.3 (registry+https://github.com/rust-lang/crates.io-index)",
+ "euclid 0.19.4 (registry+https://github.com/rust-lang/crates.io-index)",
  "gleam 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)",
  "mozangle 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
  "webrender 0.57.2",
  "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
  "winit 0.16.2 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
@@ -386,17 +386,17 @@ dependencies = [
  "humantime 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "regex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "termcolor 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "euclid"
-version = "0.19.3"
+version = "0.19.4"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "num-traits 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
  "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "expat-sys"
@@ -723,17 +723,17 @@ dependencies = [
 ]
 
 [[package]]
 name = "lyon_geom"
 version = "0.12.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)",
- "euclid 0.19.3 (registry+https://github.com/rust-lang/crates.io-index)",
+ "euclid 0.19.4 (registry+https://github.com/rust-lang/crates.io-index)",
  "num-traits 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "lyon_path"
 version = "0.12.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
@@ -948,45 +948,45 @@ dependencies = [
 [[package]]
 name = "pathfinder_font_renderer"
 version = "0.5.0"
 source = "git+https://github.com/pcwalton/pathfinder?branch=webrender#e8805413321edf85870deee5678751746ed61316"
 dependencies = [
  "app_units 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "core-graphics 0.17.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "core-text 13.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "euclid 0.19.3 (registry+https://github.com/rust-lang/crates.io-index)",
+ "euclid 0.19.4 (registry+https://github.com/rust-lang/crates.io-index)",
  "freetype 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
  "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
  "lyon_path 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)",
  "serde_derive 1.0.80 (git+https://github.com/servo/serde?branch=deserialize_from_enums9)",
  "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "pathfinder_gfx_utils"
 version = "0.2.0"
 source = "git+https://github.com/pcwalton/pathfinder?branch=webrender#e8805413321edf85870deee5678751746ed61316"
 dependencies = [
- "euclid 0.19.3 (registry+https://github.com/rust-lang/crates.io-index)",
+ "euclid 0.19.4 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "pathfinder_partitioner"
 version = "0.2.0"
 source = "git+https://github.com/pcwalton/pathfinder?branch=webrender#e8805413321edf85870deee5678751746ed61316"
 dependencies = [
  "arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)",
  "bincode 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "bit-vec 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)",
  "byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
  "env_logger 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)",
- "euclid 0.19.3 (registry+https://github.com/rust-lang/crates.io-index)",
+ "euclid 0.19.4 (registry+https://github.com/rust-lang/crates.io-index)",
  "half 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
  "lyon_geom 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "lyon_path 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "pathfinder_path_utils 0.2.0 (git+https://github.com/pcwalton/pathfinder?branch=webrender)",
  "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)",
  "serde_derive 1.0.80 (git+https://github.com/servo/serde?branch=deserialize_from_enums9)",
 ]
@@ -1013,17 +1013,17 @@ version = "0.3.11"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 
 [[package]]
 name = "plane-split"
 version = "0.13.3"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "binary-space-partition 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "euclid 0.19.3 (registry+https://github.com/rust-lang/crates.io-index)",
+ "euclid 0.19.4 (registry+https://github.com/rust-lang/crates.io-index)",
  "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "num-traits 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "png"
 version = "0.12.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -1570,17 +1570,17 @@ dependencies = [
 ]
 
 [[package]]
 name = "webrender-examples"
 version = "0.1.0"
 dependencies = [
  "app_units 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "env_logger 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)",
- "euclid 0.19.3 (registry+https://github.com/rust-lang/crates.io-index)",
+ "euclid 0.19.4 (registry+https://github.com/rust-lang/crates.io-index)",
  "gleam 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)",
  "glutin 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "rayon 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "webrender 0.57.2",
  "winit 0.16.2 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
@@ -1589,17 +1589,17 @@ version = "0.57.2"
 dependencies = [
  "app_units 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "bincode 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
  "byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
  "core-foundation 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "core-graphics 0.17.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "dwrote 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "euclid 0.19.3 (registry+https://github.com/rust-lang/crates.io-index)",
+ "euclid 0.19.4 (registry+https://github.com/rust-lang/crates.io-index)",
  "ipc-channel 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)",
  "serde_bytes 0.10.4 (registry+https://github.com/rust-lang/crates.io-index)",
  "serde_derive 1.0.80 (git+https://github.com/servo/serde?branch=deserialize_from_enums9)",
  "time 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
@@ -1669,17 +1669,17 @@ dependencies = [
  "bincode 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
  "clap 2.31.2 (registry+https://github.com/rust-lang/crates.io-index)",
  "core-foundation 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "core-graphics 0.17.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "crossbeam 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)",
  "dwrote 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)",
  "env_logger 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)",
- "euclid 0.19.3 (registry+https://github.com/rust-lang/crates.io-index)",
+ "euclid 0.19.4 (registry+https://github.com/rust-lang/crates.io-index)",
  "font-loader 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "gleam 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)",
  "glutin 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "image 0.20.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "mozangle 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
  "osmesa-src 0.1.1 (git+https://github.com/servo/osmesa-src)",
@@ -1798,17 +1798,17 @@ dependencies = [
 "checksum deflate 0.7.18 (registry+https://github.com/rust-lang/crates.io-index)" = "32c8120d981901a9970a3a1c97cf8b630e0fa8c3ca31e75b6fd6fd5f9f427b31"
 "checksum digest 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)" = "03b072242a8cbaf9c145665af9d250c59af3b958f83ed6824e13533cf76d5b90"
 "checksum dlib 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "77e51249a9d823a4cb79e3eca6dcd756153e8ed0157b6c04775d04bf1b13b76a"
 "checksum downcast-rs 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "18df8ce4470c189d18aa926022da57544f31e154631eb4cfe796aea97051fe6c"
 "checksum dtoa 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "09c3753c3db574d215cba4ea76018483895d7bff25a31b49ba45db21c48e50ab"
 "checksum dwrote 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7b46afd0d0bbbea88fc083ea293e40865e26a75ec9d38cf5d05a23ac3e2ffe02"
 "checksum either 1.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3be565ca5c557d7f59e7cfcf1844f9e3033650c929c6566f511e8005f205c1d0"
 "checksum env_logger 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)" = "0e6e40ebb0e66918a37b38c7acab4e10d299e0463fe2af5d29b9cc86710cfd2a"
-"checksum euclid 0.19.3 (registry+https://github.com/rust-lang/crates.io-index)" = "600657e7e5c03bfbccdc68721bc3b5abcb761553973387124eae9c9e4f02c210"
+"checksum euclid 0.19.4 (registry+https://github.com/rust-lang/crates.io-index)" = "dbbf962bb6f877239a34491f2e0a12c6b824f389bc789eb90f1d70d4780b0727"
 "checksum expat-sys 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "c470ccb972f2088549b023db8029ed9da9426f5affbf9b62efff7009ab8ed5b1"
 "checksum fake-simd 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed"
 "checksum fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "2fad85553e09a6f881f739c29f0b00b0f01357c743266d478b68951ce23285f3"
 "checksum font-loader 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fd330f40acb3016432cbfa4c54b3d6e6e893a538df79d8df8fd8c26e21c36aaa"
 "checksum foreign-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1"
 "checksum foreign-types-shared 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b"
 "checksum freetype 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b659e75b7a7338fe75afd7f909fc2b71937845cffb6ebe54ba2e50f13d8e903d"
 "checksum fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82"
--- a/gfx/wr/examples/animation.rs
+++ b/gfx/wr/examples/animation.rs
@@ -43,16 +43,17 @@ impl App {
         property_key: PropertyBindingKey<LayoutTransform>,
     ) {
         let filters = [
             FilterOp::Opacity(PropertyBinding::Binding(self.opacity_key, self.opacity), self.opacity),
         ];
 
         let reference_frame_id = builder.push_reference_frame(
             &LayoutPrimitiveInfo::new(LayoutRect::new(bounds.origin, LayoutSize::zero())),
+            TransformStyle::Flat,
             Some(PropertyBinding::Binding(property_key, LayoutTransform::identity())),
             None,
         );
 
         builder.push_clip_id(reference_frame_id);
 
         builder.push_stacking_context(
             &LayoutPrimitiveInfo::new(LayoutRect::zero()),
--- a/gfx/wr/examples/iframe.rs
+++ b/gfx/wr/examples/iframe.rs
@@ -58,16 +58,17 @@ impl Example for App {
             sub_builder.finalize(),
             true,
         );
         api.send_transaction(document_id, txn);
 
         let info = LayoutPrimitiveInfo::new(sub_bounds);
         let reference_frame_id = builder.push_reference_frame(
             &info,
+            TransformStyle::Flat,
             Some(PropertyBinding::Binding(PropertyBindingKey::new(42), LayoutTransform::identity())),
             None,
         );
         builder.push_clip_id(reference_frame_id);
 
 
         // And this is for the root pipeline
         builder.push_stacking_context(
--- a/gfx/wr/webrender/src/clip_scroll_tree.rs
+++ b/gfx/wr/webrender/src/clip_scroll_tree.rs
@@ -1,15 +1,15 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 use api::{ExternalScrollId, LayoutPoint, LayoutRect, LayoutVector2D};
 use api::{PipelineId, ScrollClamping, ScrollNodeState, ScrollLocation};
-use api::{LayoutSize, LayoutTransform, PropertyBinding, ScrollSensitivity, WorldPoint};
+use api::{TransformStyle, LayoutSize, LayoutTransform, PropertyBinding, ScrollSensitivity, WorldPoint};
 use gpu_types::TransformPalette;
 use internal_types::{FastHashMap, FastHashSet};
 use print_tree::{PrintTree, PrintTreePrinter};
 use scene::SceneProperties;
 use smallvec::SmallVec;
 use spatial_node::{ScrollFrameInfo, SpatialNode, SpatialNodeType, StickyFrameInfo, ScrollFrameKind};
 use util::{LayoutToWorldFastTransform, ScaleOffset};
 
@@ -338,23 +338,25 @@ impl ClipScrollTree {
             frame_kind,
         );
         self.add_spatial_node(node)
     }
 
     pub fn add_reference_frame(
         &mut self,
         parent_index: Option<SpatialNodeIndex>,
+        transform_style: TransformStyle,
         source_transform: Option<PropertyBinding<LayoutTransform>>,
         source_perspective: Option<LayoutTransform>,
         origin_in_parent_reference_frame: LayoutVector2D,
         pipeline_id: PipelineId,
     ) -> SpatialNodeIndex {
         let node = SpatialNode::new_reference_frame(
             parent_index,
+            transform_style,
             source_transform,
             source_perspective,
             origin_in_parent_reference_frame,
             pipeline_id,
         );
         self.add_spatial_node(node)
     }
 
@@ -490,16 +492,17 @@ impl ClipScrollTree {
 fn add_reference_frame(
     cst: &mut ClipScrollTree,
     parent: Option<SpatialNodeIndex>,
     transform: LayoutTransform,
     origin_in_parent_reference_frame: LayoutVector2D,
 ) -> SpatialNodeIndex {
     cst.add_reference_frame(
         parent,
+        TransformStyle::Preserve3D,
         Some(PropertyBinding::Value(transform)),
         None,
         origin_in_parent_reference_frame,
         PipelineId::dummy(),
     )
 }
 
 #[cfg(test)]
--- a/gfx/wr/webrender/src/display_list_flattener.rs
+++ b/gfx/wr/webrender/src/display_list_flattener.rs
@@ -585,16 +585,17 @@ impl<'a> DisplayListFlattener<'a> {
         clip_and_scroll_ids: &ClipAndScrollInfo,
         reference_frame_relative_offset: LayoutVector2D,
     ) {
         self.push_reference_frame(
             reference_frame.id,
             Some(clip_and_scroll_ids.scroll_node_id),
             clip_and_scroll_ids.clip_node_id,
             pipeline_id,
+            reference_frame.transform_style,
             reference_frame.transform,
             reference_frame.perspective,
             reference_frame_relative_offset + item.rect().origin.to_vector(),
         );
 
         self.flatten_items(traversal, pipeline_id, LayoutVector2D::zero());
     }
 
@@ -671,16 +672,17 @@ impl<'a> DisplayListFlattener<'a> {
 
         let bounds = item.rect();
         let origin = *reference_frame_relative_offset + bounds.origin.to_vector();
         self.push_reference_frame(
             ClipId::root_reference_frame(iframe_pipeline_id),
             Some(info.clip_id),
             None,
             iframe_pipeline_id,
+            TransformStyle::Flat,
             None,
             None,
             origin,
         );
 
         let iframe_rect = LayoutRect::new(LayoutPoint::zero(), bounds.size);
         self.add_scroll_frame(
             ClipId::root_scroll_node(iframe_pipeline_id),
@@ -1563,23 +1565,25 @@ impl<'a> DisplayListFlattener<'a> {
     }
 
     pub fn push_reference_frame(
         &mut self,
         reference_frame_id: ClipId,
         parent_scroll_id: Option<ClipId>,
         parent_clip_id: Option<ClipId>,
         pipeline_id: PipelineId,
+        transform_style: TransformStyle,
         source_transform: Option<PropertyBinding<LayoutTransform>>,
         source_perspective: Option<LayoutTransform>,
         origin_in_parent_reference_frame: LayoutVector2D,
     ) -> SpatialNodeIndex {
         let parent_index = parent_scroll_id.map(|id| self.id_to_index_mapper.get_spatial_node_index(id));
         let index = self.clip_scroll_tree.add_reference_frame(
             parent_index,
+            transform_style,
             source_transform,
             source_perspective,
             origin_in_parent_reference_frame,
             pipeline_id,
         );
         self.id_to_index_mapper.map_spatial_node(reference_frame_id, index);
 
         match parent_clip_id.or(parent_scroll_id) {
@@ -1601,16 +1605,17 @@ impl<'a> DisplayListFlattener<'a> {
             register_prim_chase_id(id);
         }
 
         self.push_reference_frame(
             ClipId::root_reference_frame(pipeline_id),
             None,
             None,
             pipeline_id,
+            TransformStyle::Flat,
             None,
             None,
             LayoutVector2D::zero(),
         );
 
         self.add_scroll_frame(
             ClipId::root_scroll_node(pipeline_id),
             ClipId::root_reference_frame(pipeline_id),
--- a/gfx/wr/webrender/src/spatial_node.rs
+++ b/gfx/wr/webrender/src/spatial_node.rs
@@ -1,16 +1,16 @@
 
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 use api::{ExternalScrollId, LayoutPixel, LayoutPoint, LayoutRect, LayoutSize, LayoutTransform};
 use api::{LayoutVector2D, PipelineId, PropertyBinding, ScrollClamping, ScrollLocation};
-use api::{ScrollSensitivity, StickyOffsetBounds};
+use api::{TransformStyle, ScrollSensitivity, StickyOffsetBounds};
 use clip_scroll_tree::{CoordinateSystem, CoordinateSystemId, SpatialNodeIndex, TransformUpdateState};
 use euclid::SideOffsets2D;
 use gpu_types::TransformPalette;
 use scene::SceneProperties;
 use util::{LayoutFastTransform, LayoutToWorldFastTransform, ScaleOffset, TransformedRectKind};
 
 #[derive(Clone, Debug)]
 pub enum SpatialNodeType {
@@ -110,25 +110,27 @@ impl SpatialNode {
             )
         );
 
         Self::new(pipeline_id, Some(parent_index), node_type)
     }
 
     pub fn new_reference_frame(
         parent_index: Option<SpatialNodeIndex>,
+        transform_style: TransformStyle,
         source_transform: Option<PropertyBinding<LayoutTransform>>,
         source_perspective: Option<LayoutTransform>,
         origin_in_parent_reference_frame: LayoutVector2D,
         pipeline_id: PipelineId,
     ) -> Self {
         let identity = LayoutTransform::identity();
         let source_perspective = source_perspective.map_or_else(
             LayoutFastTransform::identity, |perspective| perspective.into());
         let info = ReferenceFrameInfo {
+            transform_style,
             source_transform: source_transform.unwrap_or(PropertyBinding::Value(identity)),
             source_perspective,
             origin_in_parent_reference_frame,
             invertible: true,
         };
         Self::new(pipeline_id, parent_index, SpatialNodeType:: ReferenceFrame(info))
     }
 
@@ -251,16 +253,17 @@ impl SpatialNode {
         state: &mut TransformUpdateState,
         coord_systems: &mut Vec<CoordinateSystem>,
         scene_properties: &SceneProperties,
     ) {
         match self.node_type {
             SpatialNodeType::ReferenceFrame(ref mut info) => {
                 // Resolve the transform against any property bindings.
                 let source_transform = scene_properties.resolve_layout_transform(&info.source_transform);
+
                 // Do a change-basis operation on the perspective matrix using
                 // the scroll offset.
                 let scrolled_perspective = info.source_perspective
                     .pre_translate(&state.parent_accumulated_scroll_offset)
                     .post_translate(-state.parent_accumulated_scroll_offset);
                 let resolved_transform =
                     LayoutFastTransform::with_vector(info.origin_in_parent_reference_frame)
                     .pre_mul(&source_transform.into())
@@ -269,16 +272,17 @@ impl SpatialNode {
                 // The transformation for this viewport in world coordinates is the transformation for
                 // our parent reference frame, plus any accumulated scrolling offsets from nodes
                 // between our reference frame and this node. Finally, we also include
                 // whatever local transformation this reference frame provides.
                 let relative_transform = resolved_transform
                     .post_translate(state.parent_accumulated_scroll_offset)
                     .to_transform()
                     .with_destination::<LayoutPixel>();
+
                 self.world_viewport_transform =
                     state.parent_reference_frame_transform.pre_mul(&relative_transform.into());
                 self.world_content_transform = self.world_viewport_transform;
 
                 info.invertible = self.world_viewport_transform.is_invertible();
 
                 if info.invertible {
                     // Try to update our compatible coordinate system transform. If we cannot, start a new
@@ -480,16 +484,25 @@ impl SpatialNode {
             }
             SpatialNodeType::ScrollFrame(ref scrolling) => {
                 state.parent_accumulated_scroll_offset += scrolling.offset;
                 state.nearest_scrolling_ancestor_offset = scrolling.offset;
                 state.nearest_scrolling_ancestor_viewport = scrolling.viewport_rect;
             }
             SpatialNodeType::ReferenceFrame(ref info) => {
                 state.parent_reference_frame_transform = self.world_viewport_transform;
+
+                let should_flatten =
+                    info.transform_style == TransformStyle::Flat &&
+                    info.source_perspective.is_identity();
+
+                if should_flatten {
+                    state.parent_reference_frame_transform = state.parent_reference_frame_transform.project_to_2d();
+                }
+
                 state.parent_accumulated_scroll_offset = LayoutVector2D::zero();
                 state.coordinate_system_relative_scale_offset = self.coordinate_system_relative_scale_offset;
                 let translation = -info.origin_in_parent_reference_frame;
                 state.nearest_scrolling_ancestor_viewport =
                     state.nearest_scrolling_ancestor_viewport
                        .translate(&translation);
             }
         }
@@ -639,16 +652,17 @@ impl ScrollFrameInfo {
 /// Contains information about reference frames.
 #[derive(Copy, Clone, Debug)]
 pub struct ReferenceFrameInfo {
     /// The source transform and perspective matrices provided by the stacking context
     /// that forms this reference frame. We maintain the property binding information
     /// here so that we can resolve the animated transform and update the tree each
     /// frame.
     pub source_transform: PropertyBinding<LayoutTransform>,
+    pub transform_style: TransformStyle,
     pub source_perspective: LayoutFastTransform,
 
     /// The original, not including the transform and relative to the parent reference frame,
     /// origin of this reference frame. This is already rolled into the `transform' property, but
     /// we also store it here to properly transform the viewport for sticky positioning.
     pub origin_in_parent_reference_frame: LayoutVector2D,
 
     /// True if the resolved transform is invertible.
--- a/gfx/wr/webrender/src/util.rs
+++ b/gfx/wr/webrender/src/util.rs
@@ -551,29 +551,37 @@ impl<U> MaxRect for TypedRect<f32, U> {
             TypedPoint2D::new(-MAX_COORD, -MAX_COORD),
             TypedSize2D::new(2.0 * MAX_COORD, 2.0 * MAX_COORD),
         )
     }
 }
 
 /// An enum that tries to avoid expensive transformation matrix calculations
 /// when possible when dealing with non-perspective axis-aligned transformations.
-#[derive(Debug, Clone, Copy)]
+#[derive(Debug)]
 pub enum FastTransform<Src, Dst> {
     /// A simple offset, which can be used without doing any matrix math.
     Offset(TypedVector2D<f32, Src>),
 
     /// A 2D transformation with an inverse.
     Transform {
         transform: TypedTransform3D<f32, Src, Dst>,
         inverse: Option<TypedTransform3D<f32, Dst, Src>>,
         is_2d: bool,
     },
 }
 
+impl<Src, Dst> Clone for FastTransform<Src, Dst> {
+    fn clone(&self) -> Self {
+        *self
+    }
+}
+
+impl<Src, Dst> Copy for FastTransform<Src, Dst> { }
+
 impl<Src, Dst> FastTransform<Src, Dst> {
     pub fn identity() -> Self {
         FastTransform::Offset(TypedVector2D::zero())
     }
 
     pub fn with_vector(offset: TypedVector2D<f32, Src>) -> Self {
         FastTransform::Offset(offset)
     }
@@ -647,16 +655,24 @@ impl<Src, Dst> FastTransform<Src, Dst> {
             FastTransform::Offset(ref offset) =>
                 FastTransform::Offset(*offset + *other_offset),
             FastTransform::Transform { transform, .. } =>
                 FastTransform::with_transform(transform.pre_translate(other_offset.to_3d()))
         }
     }
 
     #[inline(always)]
+    pub fn project_to_2d(&self) -> Self {
+        match *self {
+            FastTransform::Offset(..) => self.clone(),
+            FastTransform::Transform { ref transform, .. } => FastTransform::with_transform(transform.project_to_2d()),
+        }
+    }
+
+    #[inline(always)]
     pub fn is_backface_visible(&self) -> bool {
         match *self {
             FastTransform::Offset(..) => false,
             FastTransform::Transform { inverse: None, .. } => false,
             //TODO: fix this properly by taking "det|M33| * det|M34| > 0"
             // see https://www.w3.org/Bugs/Public/show_bug.cgi?id=23014
             FastTransform::Transform { inverse: Some(ref inverse), .. } => inverse.m33 < 0.0,
         }
--- a/gfx/wr/webrender_api/src/display_item.rs
+++ b/gfx/wr/webrender_api/src/display_item.rs
@@ -524,16 +524,17 @@ pub struct PushReferenceFrameDisplayList
 /// Provides a hint to WR that it should try to cache the items
 /// within a cache marker context in an off-screen surface.
 #[derive(Clone, Copy, Debug, Deserialize, PartialEq, Serialize)]
 pub struct CacheMarkerDisplayItem {
 }
 
 #[derive(Clone, Copy, Debug, Deserialize, PartialEq, Serialize)]
 pub struct ReferenceFrame {
+    pub transform_style: TransformStyle,
     pub transform: Option<PropertyBinding<LayoutTransform>>,
     pub perspective: Option<LayoutTransform>,
     pub id: ClipId,
 }
 
 #[derive(Clone, Copy, Debug, Deserialize, PartialEq, Serialize)]
 pub struct PushStackingContextDisplayItem {
     pub stacking_context: StackingContext,
--- a/gfx/wr/webrender_api/src/display_list.rs
+++ b/gfx/wr/webrender_api/src/display_list.rs
@@ -1245,22 +1245,24 @@ impl DisplayListBuilder {
         });
 
         self.push_item(&item, info);
     }
 
     pub fn push_reference_frame(
         &mut self,
         info: &LayoutPrimitiveInfo,
+        transform_style: TransformStyle,
         transform: Option<PropertyBinding<LayoutTransform>>,
         perspective: Option<LayoutTransform>,
     ) -> ClipId {
         let id = self.generate_spatial_index();
         let item = SpecificDisplayItem::PushReferenceFrame(PushReferenceFrameDisplayListItem {
             reference_frame: ReferenceFrame {
+                transform_style,
                 transform,
                 perspective,
                 id,
             },
         });
         self.push_item(&item, info);
         id
     }
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..2134a8ff77d885f7d7cb0edea81f137051ff54b6
GIT binary patch
literal 4593
zc%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>vYssd!j3Bqw`8G+dB^Cz?5=k`;~|Lq`oF#Gzi
zh#x;U!(FELKYYJGTZBHP5%y<Kf2(ylsS$=+R#7LyP|H+eBh2Paa$@#sszzAlpB??J
zlP8ntlAr(f_P0u#lUzGZ=Rf}c_qVs-fpy}?$Jgv?Ui7Qp+n1Z0z1lwP#{K-aN4tTQ
z{maYO`uct)w|@S7?cKe%{i^@|?cOSHANGHb_&cDI%gcdE{{FsZW(HJp_wKd0y|4OJ
z=h^4KeXzhj%)&PJ?Zd-B1=rSI+gJ0l|Nf5J-CNhk1DhfJ^3l~FfGTd>%X@ovHc-XW
z)7QRz0~+!8@wIt2FZ)&B-OYacW{rK=jvX=A*Khy!I{g1(q51aP%bxqyui3Ek=B?f3
zzy`wW>ucY>`Es1Ay?w21^)-2Ko2o0fPI}g_Dfq}Qop<j|zp7qc+z)l2KUW`eI}xk;
zWSvk^IH%=56=0GMO;m<(fh`M}`boqVS))RuLZd=hg|5^yHh!J**;ljl7XuJ@y85}S
Ib4q9e0D5i7p#T5?
new file mode 100644
--- /dev/null
+++ b/gfx/wr/wrench/reftests/transforms/nested-rotate-x-flat.yaml
@@ -0,0 +1,27 @@
+# This is the same as nested-rotate-x.yaml but without the preserve-3d.
+---
+root:
+  items:
+    -
+      bounds: [260, 260, 231, 231]
+      "clip-rect": [260, 260, 231, 231]
+      type: border
+      width: 3
+      "border-type": normal
+      color: 0 0 255 1.0000
+      style: dashed
+    -
+      bounds: [300, 300, 0, 0]
+      "clip-rect": [300, 300, 0, 0]
+      type: "stacking-context"
+      transform: [1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 75, -75, 1]
+      items:
+        -
+          type: "stacking-context"
+          transform: [1, 0, 0, 0, 0, 0.8660254, -0.5, 0, 0, 0.5, 0.8660254, 0, 0, 10.048096, 37.5, 1]
+          items:
+            -
+              bounds: [0, 0, 150, 150]
+              "clip-rect": [0, 0, 150, 150]
+              type: rect
+              color: 255 255 0 0.4000
index dba46d8899047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)Q&5$6`@m8UdYi?)>4$4jt+COvUmjlwY)!kc!Y|N
z=N(Sfu<Hc;;N#{!tL15@k9kV}P37KQhAS!g^75Iw#)9cK1DCAC-7L^;IjO^>ln|mq
z<!PRB+`TwB_k`0~F+w(C3s+!ad@P$f<b`a(BgB5Q5eZxq@+|cj_(rwD>R71`zm#=w
zPnx0BAsp{8lQp|K5c`dPBZ1(ZpX-o%+kP=EbnXgVRCm)XYx89tB(egcjNIalriTHh
zu-smSrNd;nE>O;>bkt#8xHBIcK;qwbm_Z+``+q}N?huKo^qqBi-Q1}$&Rv76`d(L#
zB<V<M@53v|?ugmCog+Fka#e?k_+i?t>_=CJ6jAbMYOnm{D-In!NA=1ITvYeEa=dQm
z1#NfcBi*Gv3|ZID^rR4uR?+zVqIcetUJN3E;P7y{Cz<RkS!fPPH|mTiwW$=1?d30J
zb)%$v2eNG?Z!gSdK?0-mp1CZnnpGp<Z`}3Ho2AXdKGaqHc%~=0a9eowv?0fFntk6m
z`kZs``GBQ^G4?ZoN_W`Id!^y_JRd*;?WUrc9{{JZ1+GOJB|JneF9sEqpzjQwlB9-V
z!R9rg>H6jzdq<DmraGbp;G@KJebWU1Y!+2?0RUMxv6z&cfieksh(_I61uhtO(}aoD
zt>A*xpiyh;01(rJp$q`(voz|z?gDTpRme8A!jz*{1`VcwD@b{gIHNy`Gknx`f<}M=
zs5&Cf7>MQ!8?2eM<s<-ZMT;l;cLIwTQ8$OK@2s+4-mI0-^uL`2V#fPa1&Cg-c|=3g
zH}U}(>s5)80C<#d8Kc()o7^N66o_47mvC}GZAFl`J%z`~)xn_Y4Gnw$<ajva1sHhq
f4!^sLq=~dX;&2)7%JRM7zbzE`X>_<~JC*kj(I@Ux
--- a/gfx/wr/wrench/reftests/transforms/nested-rotate-x.yaml
+++ b/gfx/wr/wrench/reftests/transforms/nested-rotate-x.yaml
@@ -9,16 +9,17 @@ root:
       "border-type": normal
       color: 0 0 255 1.0000
       style: dashed
     -
       bounds: [300, 300, 0, 0]
       "clip-rect": [300, 300, 0, 0]
       type: "stacking-context"
       transform: [1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 75, -75, 1]
+      transform-style: preserve-3d
       items:
         -
           type: "stacking-context"
           transform: [1, 0, 0, 0, 0, 0.8660254, -0.5, 0, 0, 0.5, 0.8660254, 0, 0, 10.048096, 37.5, 1]
           items:
             -
               bounds: [0, 0, 150, 150]
               "clip-rect": [0, 0, 150, 150]
--- a/gfx/wr/wrench/reftests/transforms/reftest.list
+++ b/gfx/wr/wrench/reftests/transforms/reftest.list
@@ -12,16 +12,18 @@ platform(linux,mac) fuzzy(1,156) == prim
 platform(linux,mac) == content-offset.yaml content-offset.png
 platform(linux,mac) == coord-system.yaml coord-system.png
 platform(linux,mac) fuzzy(1,5) zoom(4) == border-zoom.yaml border-zoom.png
 platform(linux) fuzzy(1,520) == perspective-origin.yaml perspective-origin.png
 platform(linux,mac) color_targets(2) alpha_targets(0) fuzzy(1,180) == screen-space-blit.yaml screen-space-blit.png
 platform(linux,mac) fuzzy(1,331) color_targets(1) alpha_targets(0) == screen-space-blit-trivial.yaml screen-space-blit-trivial.png
 platform(linux) fuzzy(11,4592) == screen-space-blur.yaml screen-space-blur.png
 platform(linux,mac) == nested-rotate-x.yaml nested-rotate-x.png
+platform(linux,mac) != nested-rotate-x.yaml nested-rotate-x-flat.yaml
+platform(linux,mac) == nested-rotate-x-flat.yaml nested-rotate-x-flat.png
 platform(linux,mac) == nested-preserve-3d.yaml nested-preserve-3d.png
 platform(linux,mac) fuzzy(1,283) == near-plane-clip.yaml near-plane-clip.png
 platform(linux,mac) == perspective-mask.yaml perspective-mask.png
 rotate-clip.yaml rotate-clip-ref.yaml
 clip-translate.yaml clip-translate-ref.yaml
 platform(linux,mac) == perspective-clip.yaml perspective-clip.png
 platform(linux,mac) == perspective-clip-1.yaml perspective-clip-1.png
 platform(linux,mac) fuzzy(1,2) == perspective-shadow.yaml perspective-shadow.png
--- a/gfx/wr/wrench/src/yaml_frame_reader.rs
+++ b/gfx/wr/wrench/src/yaml_frame_reader.rs
@@ -1550,16 +1550,20 @@ impl YamlFrameReader {
         let bounds = yaml["bounds"].as_rect().unwrap_or(default_bounds);
         let default_transform_origin = LayoutPoint::new(
             bounds.origin.x + bounds.size.width * 0.5,
             bounds.origin.y + bounds.size.height * 0.5,
         );
 
         info.rect = bounds;
 
+        let transform_style = yaml["transform-style"]
+            .as_transform_style()
+            .unwrap_or(TransformStyle::Flat);
+
         let transform_origin = yaml["transform-origin"]
             .as_point()
             .unwrap_or(default_transform_origin);
 
         let perspective_origin = yaml["perspective-origin"]
             .as_point()
             .unwrap_or(default_transform_origin);
 
@@ -1570,17 +1574,22 @@ impl YamlFrameReader {
         let perspective = match yaml["perspective"].as_f32() {
             Some(value) if value != 0.0 => {
                 Some(make_perspective(perspective_origin, value as f32))
             }
             Some(_) => None,
             _ => yaml["perspective"].as_matrix4d(),
         };
 
-        let reference_frame_id = dl.push_reference_frame(info, transform.into(), perspective);
+        let reference_frame_id = dl.push_reference_frame(
+            info,
+            transform_style,
+            transform.into(),
+            perspective,
+        );
 
         let numeric_id = yaml["id"].as_i64();
         if let Some(numeric_id) = numeric_id {
             self.add_clip_id_mapping(numeric_id as u64, reference_frame_id);
         }
 
         reference_frame_id
     }