servo: Merge #17789 - stylo: Fix Y scale computation while decomposing a 3D matrix (from chenpighead:stylo-fix-decompose_3d_matrix); r=hiro
authorJeremy Chen <jeremychen@mozilla.com>
Wed, 19 Jul 2017 20:07:26 -0700
changeset 418537 eb19a789a45562a03f9a105c874425cf8dac510e
parent 418536 747035414236731b91080e801f393be22017a5b8
child 418538 9043cd8fdee3f628f26d68ceae6c8d3de2936ffe
push id7566
push usermtabara@mozilla.com
push dateWed, 02 Aug 2017 08:25:16 +0000
treeherdermozilla-beta@86913f512c3c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewershiro
bugs17789, 1381196
milestone56.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
servo: Merge #17789 - stylo: Fix Y scale computation while decomposing a 3D matrix (from chenpighead:stylo-fix-decompose_3d_matrix); r=hiro While decomposing a 3D matrix, we should normalize the 2nd row right after the Y scale computation. However, we accidentally use the length of the 1st row to do the normalization. This causes the wrong Scale3D function while decomposing, and then leads to the wrong decomposed 3D matrix. Here, we correct it by using the right value (the length of the 2nd row). r=hiro https://bugzilla.mozilla.org/show_bug.cgi?id=1381196 Source-Repo: https://github.com/servo/servo Source-Revision: a9b748f17a37bfbd8265f003ac6c240755b5a920
servo/components/style/properties/helpers/animated_properties.mako.rs
--- a/servo/components/style/properties/helpers/animated_properties.mako.rs
+++ b/servo/components/style/properties/helpers/animated_properties.mako.rs
@@ -2141,17 +2141,17 @@ fn decompose_3d_matrix(mut matrix: Compu
     let mut scale = Scale3D(row0len, 0.0, 0.0);
     row[0] = [row[0][0] / row0len, row[0][1] / row0len, row[0][2] / row0len];
 
     // Compute XY shear factor and make 2nd row orthogonal to 1st.
     let mut skew = Skew(dot(row[0], row[1]), 0.0, 0.0);
     row[1] = combine(row[1], row[0], 1.0, -skew.0);
 
     // Now, compute Y scale and normalize 2nd row.
-    let row1len = (row[0][0] * row[0][0] + row[0][1] * row[0][1] + row[0][2] * row[0][2]).sqrt();
+    let row1len = (row[1][0] * row[1][0] + row[1][1] * row[1][1] + row[1][2] * row[1][2]).sqrt();
     scale.1 = row1len;
     row[1] = [row[1][0] / row1len, row[1][1] / row1len, row[1][2] / row1len];
     skew.0 /= scale.1;
 
     // Compute XZ and YZ shears, orthogonalize 3rd row
     skew.1 = dot(row[0], row[2]);
     row[2] = combine(row[2], row[0], 1.0, -skew.1);
     skew.2 = dot(row[1], row[2]);