Bug 1525642 - ensure that w~=1 when assuming a transform is just a translation. r=gw a=pascalc
authorAlexis Beingessner <a.beingessner@gmail.com>
Thu, 11 Apr 2019 20:52:21 +0000
changeset 526157 68224b37ba35a78be80382f9c2c52fba23a2c5df
parent 526156 626e61fede41425cdde82038435fb53d97786032
child 526158 37c5083230c5128f5c66ed88549e4471572d0e18
push id2032
push userffxbld-merge
push dateMon, 13 May 2019 09:36:57 +0000
treeherdermozilla-release@455c1065dcbe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgw, pascalc
bugs1525642
milestone67.0
Bug 1525642 - ensure that w~=1 when assuming a transform is just a translation. r=gw a=pascalc Differential Revision: https://phabricator.services.mozilla.com/D27163
gfx/wr/webrender/src/util.rs
gfx/wr/wrench/reftests/transforms/reftest.list
gfx/wr/wrench/reftests/transforms/strange-w-ref.yaml
gfx/wr/wrench/reftests/transforms/strange-w.yaml
testing/web-platform/meta/css/css-transforms/transform3d-matrix3d-005.html.ini
--- a/gfx/wr/webrender/src/util.rs
+++ b/gfx/wr/webrender/src/util.rs
@@ -354,17 +354,18 @@ impl<Src, Dst> MatrixHelpers<Src, Dst> f
         } else {
             TransformedRectKind::Complex
         }
     }
 
     fn is_simple_translation(&self) -> bool {
         if (self.m11 - 1.0).abs() > NEARLY_ZERO ||
             (self.m22 - 1.0).abs() > NEARLY_ZERO ||
-            (self.m33 - 1.0).abs() > NEARLY_ZERO {
+            (self.m33 - 1.0).abs() > NEARLY_ZERO ||
+            (self.m44 - 1.0).abs() > NEARLY_ZERO {
             return false;
         }
 
         self.m12.abs() < NEARLY_ZERO && self.m13.abs() < NEARLY_ZERO &&
             self.m14.abs() < NEARLY_ZERO && self.m21.abs() < NEARLY_ZERO &&
             self.m23.abs() < NEARLY_ZERO && self.m24.abs() < NEARLY_ZERO &&
             self.m31.abs() < NEARLY_ZERO && self.m32.abs() < NEARLY_ZERO &&
             self.m34.abs() < NEARLY_ZERO
--- a/gfx/wr/wrench/reftests/transforms/reftest.list
+++ b/gfx/wr/wrench/reftests/transforms/reftest.list
@@ -32,8 +32,9 @@ platform(linux,mac) fuzzy(9,348) == pers
 == snapped-preserve-3d.yaml snapped-preserve-3d-ref.yaml
 platform(linux,mac) fuzzy(1,122) == border-scale.yaml border-scale.png
 platform(linux,mac) fuzzy(1,16) == border-scale-2.yaml border-scale-2.png
 platform(linux,mac) fuzzy(1,69) == border-scale-3.yaml border-scale-3.png
 platform(linux,mac) fuzzy(1,74) == border-scale-4.yaml border-scale-4.png
 # Just make sure we aren't crashing here
 != large-raster-root.yaml blank.yaml
 == flatten-preserve-3d-root.yaml flatten-preserve-3d-root-ref.yaml
+== strange-w.yaml strange-w-ref.yaml
new file mode 100644
--- /dev/null
+++ b/gfx/wr/wrench/reftests/transforms/strange-w-ref.yaml
@@ -0,0 +1,12 @@
+---
+root:
+  items:
+    - type: stacking-context
+      bounds: [50, 50, 600, 600]
+      perspective: 20
+      items:
+        - type: stacking-context
+          items:
+            - type: rect
+              bounds: [25, 25, 50, 50]
+              color: red
new file mode 100644
--- /dev/null
+++ b/gfx/wr/wrench/reftests/transforms/strange-w.yaml
@@ -0,0 +1,15 @@
+# don't assume w=1 when checking if the transform is just a translation
+
+---
+root:
+  items:
+    - type: stacking-context
+      bounds: [50, 50, 600, 600]
+      perspective: 20
+      items:
+        - type: stacking-context
+          transform: [1,0,0,0, 0,1,0,0, 0,0,1,0, 0,0,0,2]
+          items:
+            - type: rect
+              bounds: [50, 50, 100, 100]
+              color: red
deleted file mode 100644
--- a/testing/web-platform/meta/css/css-transforms/transform3d-matrix3d-005.html.ini
+++ /dev/null
@@ -1,3 +0,0 @@
-[transform3d-matrix3d-005.html]
-  expected:
-    if webrender: FAIL