--- a/layout/style/StyleAnimationValue.cpp
+++ b/layout/style/StyleAnimationValue.cpp
@@ -710,29 +710,23 @@ AddTransformLists(double aCoeff1, const
static double
ComputeTransform2DMatrixDistance(const Matrix& aMatrix1,
const Matrix& aMatrix2)
{
Point3D scale1(1, 1, 1);
Point3D translate1;
gfxQuaternion rotate1;
- nsStyleTransformMatrix::ShearArray shear1;
- for (auto&& s : shear1) {
- s = 0.0f;
- }
+ nsStyleTransformMatrix::ShearArray shear1{0.0f, 0.0f, 0.0f};
Decompose2DMatrix(aMatrix1, scale1, shear1, rotate1, translate1);
Point3D scale2(1, 1, 1);
Point3D translate2;
gfxQuaternion rotate2;
- nsStyleTransformMatrix::ShearArray shear2;
- for (auto&& s : shear2) {
- s = 0.0f;
- }
+ nsStyleTransformMatrix::ShearArray shear2{0.0f, 0.0f, 0.0f};
Decompose2DMatrix(aMatrix2, scale2, shear2, rotate2, translate2);
// Note:
// 1. Shear factor is the tangent value of shear angle, so we need to
// call atan() to get the angle. For 2D transform, we only have XYSHEAR.
// 2. The quaternion vector of the decomposed 2d matrix is got by
// "gfxQuaternion(0, 0, sin(rotate/2), cos(rotate/2))"
// ^^^^^^^^^^^^^ ^^^^^^^^^^^^^
@@ -767,31 +761,25 @@ ComputeTransform2DMatrixDistance(const M
static double
ComputeTransform3DMatrixDistance(const Matrix4x4& aMatrix1,
const Matrix4x4& aMatrix2)
{
Point3D scale1(1, 1, 1);
Point3D translate1;
Point4D perspective1(0, 0, 0, 1);
gfxQuaternion rotate1;
- nsStyleTransformMatrix::ShearArray shear1;
- for (auto&& s : shear1) {
- s = 0.0f;
- }
+ nsStyleTransformMatrix::ShearArray shear1{0.0f, 0.0f, 0.0f};
Decompose3DMatrix(aMatrix1, scale1, shear1, rotate1, translate1,
perspective1);
Point3D scale2(1, 1, 1);
Point3D translate2;
Point4D perspective2(0, 0, 0, 1);
gfxQuaternion rotate2;
- nsStyleTransformMatrix::ShearArray shear2;
- for (auto&& s : shear2) {
- s = 0.0f;
- }
+ nsStyleTransformMatrix::ShearArray shear2{0.0f, 0.0f, 0.0f};
Decompose3DMatrix(aMatrix2, scale2, shear2, rotate2, translate2,
perspective2);
// Note:
// 1. Shear factor is the tangent value of shear angle, so we need to
// call atan() to get the angle.
// 2. We use the same way to get the rotate angle of two quaternion vectors as
// what we do for rotate3d.
@@ -1787,28 +1775,22 @@ StyleAnimationValue::InterpolateTransfor
double aProgress)
{
// Decompose both matrices
// TODO: What do we do if one of these returns false (singular matrix)
Point3D scale1(1, 1, 1), translate1;
Point4D perspective1(0, 0, 0, 1);
gfxQuaternion rotate1;
- nsStyleTransformMatrix::ShearArray shear1;
- for (auto&& s : shear1) {
- s = 0.0f;
- }
+ nsStyleTransformMatrix::ShearArray shear1{0.0f, 0.0f, 0.0f};
Point3D scale2(1, 1, 1), translate2;
Point4D perspective2(0, 0, 0, 1);
gfxQuaternion rotate2;
- nsStyleTransformMatrix::ShearArray shear2;
- for (auto&& s : shear2) {
- s = 0.0f;
- }
+ nsStyleTransformMatrix::ShearArray shear2{0.0f, 0.0f, 0.0f};
Matrix matrix2d1, matrix2d2;
if (aMatrix1.Is2D(&matrix2d1) && aMatrix2.Is2D(&matrix2d2)) {
Decompose2DMatrix(matrix2d1, scale1, shear1, rotate1, translate1);
Decompose2DMatrix(matrix2d2, scale2, shear2, rotate2, translate2);
} else {
Decompose3DMatrix(aMatrix1, scale1, shear1,
rotate1, translate1, perspective1);