OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2005, 2006 Apple Computer, Inc. All rights reserved. | 2 * Copyright (C) 2005, 2006 Apple Computer, Inc. All rights reserved. |
3 * Copyright (C) 2009 Torch Mobile, Inc. | 3 * Copyright (C) 2009 Torch Mobile, Inc. |
4 * Copyright (C) 2013 Google Inc. All rights reserved. | 4 * Copyright (C) 2013 Google Inc. All rights reserved. |
5 * | 5 * |
6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
8 * are met: | 8 * are met: |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 1248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1259 } | 1259 } |
1260 | 1260 |
1261 TransformationMatrix& TransformationMatrix::applyTransformOrigin(double x, | 1261 TransformationMatrix& TransformationMatrix::applyTransformOrigin(double x, |
1262 double y, | 1262 double y, |
1263 double z) { | 1263 double z) { |
1264 translateRight3d(x, y, z); | 1264 translateRight3d(x, y, z); |
1265 translate3d(-x, -y, -z); | 1265 translate3d(-x, -y, -z); |
1266 return *this; | 1266 return *this; |
1267 } | 1267 } |
1268 | 1268 |
| 1269 TransformationMatrix& TransformationMatrix::zoom(double zoomFactor) { |
| 1270 m_matrix[0][3] /= zoomFactor; |
| 1271 m_matrix[1][3] /= zoomFactor; |
| 1272 m_matrix[2][3] /= zoomFactor; |
| 1273 m_matrix[3][0] *= zoomFactor; |
| 1274 m_matrix[3][1] *= zoomFactor; |
| 1275 m_matrix[3][2] *= zoomFactor; |
| 1276 return *this; |
| 1277 } |
| 1278 |
1269 // Calculates *this = *this * mat. | 1279 // Calculates *this = *this * mat. |
1270 // Note: A * B means that the transforms represented by A happen first, and | 1280 // Note: A * B means that the transforms represented by A happen first, and |
1271 // then the transforms represented by B. That is, the matrix A * B corresponds | 1281 // then the transforms represented by B. That is, the matrix A * B corresponds |
1272 // to a CSS transform list <transform-function-A> <transform-function-B>. | 1282 // to a CSS transform list <transform-function-A> <transform-function-B>. |
1273 // Some branches of this function may make use of the fact that | 1283 // Some branches of this function may make use of the fact that |
1274 // transpose(A * B) == transpose(B) * transpose(A); remember that | 1284 // transpose(A * B) == transpose(B) * transpose(A); remember that |
1275 // m_matrix[a][b] is matrix element row b, col a. | 1285 // m_matrix[a][b] is matrix element row b, col a. |
1276 // FIXME: As of 2016-05-04, the ARM64 branch is NOT triggered by tests on the CQ | 1286 // FIXME: As of 2016-05-04, the ARM64 branch is NOT triggered by tests on the CQ |
1277 // bots, see crbug.com/477892 and crbug.com/584508. | 1287 // bots, see crbug.com/477892 and crbug.com/584508. |
1278 TransformationMatrix& TransformationMatrix::multiply( | 1288 TransformationMatrix& TransformationMatrix::multiply( |
(...skipping 642 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1921 decomposition.translateZ, decomposition.scaleX, decomposition.scaleY, | 1931 decomposition.translateZ, decomposition.scaleX, decomposition.scaleY, |
1922 decomposition.scaleZ, decomposition.skewXY, decomposition.skewXZ, | 1932 decomposition.scaleZ, decomposition.skewXY, decomposition.skewXZ, |
1923 decomposition.skewYZ, decomposition.quaternionX, | 1933 decomposition.skewYZ, decomposition.quaternionX, |
1924 decomposition.quaternionY, decomposition.quaternionZ, | 1934 decomposition.quaternionY, decomposition.quaternionZ, |
1925 decomposition.quaternionW, decomposition.perspectiveX, | 1935 decomposition.quaternionW, decomposition.perspectiveX, |
1926 decomposition.perspectiveY, decomposition.perspectiveZ, | 1936 decomposition.perspectiveY, decomposition.perspectiveZ, |
1927 decomposition.perspectiveW); | 1937 decomposition.perspectiveW); |
1928 } | 1938 } |
1929 | 1939 |
1930 } // namespace blink | 1940 } // namespace blink |
OLD | NEW |