Bug 1525642 - ensure that w~=1 when assuming a transform is just a translation. r=gw
authorAlexis Beingessner <a.beingessner@gmail.com>
Thu, 11 Apr 2019 20:52:21 +0000
changeset 469083 4febe6f32b23f8d40d597b6a6a9675ba989835bb
parent 469082 0b26cd4c1c21b14cd42032ec08b13ffcdc7f5866
child 469084 0078d5355d9a2dc39e3933a9cd0287ffd638e034
push id35856
push usercsabou@mozilla.com
push dateFri, 12 Apr 2019 03:19:48 +0000
treeherdermozilla-central@940684cd1065 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgw
bugs1525642
milestone68.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 1525642 - ensure that w~=1 when assuming a transform is just a translation. r=gw 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