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 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
312 { | 312 { |
313 return m13() == 0 && m14() == 0 && m23() == 0 && m24() == 0 | 313 return m13() == 0 && m14() == 0 && m23() == 0 && m24() == 0 |
314 && m31() == 0 && m32() == 0 && m33() == 1 && m34() == 0 && m43() == 0 && m44() == 1; | 314 && m31() == 0 && m32() == 0 && m33() == 1 && m34() == 0 && m43() == 0 && m44() == 1; |
315 } | 315 } |
316 | 316 |
317 // Throw away the non-affine parts of the matrix (lossy!) | 317 // Throw away the non-affine parts of the matrix (lossy!) |
318 void makeAffine(); | 318 void makeAffine(); |
319 | 319 |
320 AffineTransform toAffineTransform() const; | 320 AffineTransform toAffineTransform() const; |
321 | 321 |
322 // Flatten into a 2-D transformation (lossy!) | |
323 void flattenTo2d(); | |
chrishtr
2016/03/15 23:06:42
Add a note that this is the same as gfx::Transform
dmazzoni
2016/03/16 05:42:01
Done.
| |
324 | |
322 bool operator==(const TransformationMatrix& m2) const | 325 bool operator==(const TransformationMatrix& m2) const |
323 { | 326 { |
324 return m_matrix[0][0] == m2.m_matrix[0][0] | 327 return m_matrix[0][0] == m2.m_matrix[0][0] |
325 && m_matrix[0][1] == m2.m_matrix[0][1] | 328 && m_matrix[0][1] == m2.m_matrix[0][1] |
326 && m_matrix[0][2] == m2.m_matrix[0][2] | 329 && m_matrix[0][2] == m2.m_matrix[0][2] |
327 && m_matrix[0][3] == m2.m_matrix[0][3] | 330 && m_matrix[0][3] == m2.m_matrix[0][3] |
328 && m_matrix[1][0] == m2.m_matrix[1][0] | 331 && m_matrix[1][0] == m2.m_matrix[1][0] |
329 && m_matrix[1][1] == m2.m_matrix[1][1] | 332 && m_matrix[1][1] == m2.m_matrix[1][1] |
330 && m_matrix[1][2] == m2.m_matrix[1][2] | 333 && m_matrix[1][2] == m2.m_matrix[1][2] |
331 && m_matrix[1][3] == m2.m_matrix[1][3] | 334 && m_matrix[1][3] == m2.m_matrix[1][3] |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
419 Matrix4 m_matrix; | 422 Matrix4 m_matrix; |
420 }; | 423 }; |
421 | 424 |
422 // Redeclared here to avoid ODR issues. | 425 // Redeclared here to avoid ODR issues. |
423 // See platform/testing/TransformPrinters.h. | 426 // See platform/testing/TransformPrinters.h. |
424 void PrintTo(const TransformationMatrix&, std::ostream*); | 427 void PrintTo(const TransformationMatrix&, std::ostream*); |
425 | 428 |
426 } // namespace blink | 429 } // namespace blink |
427 | 430 |
428 #endif // TransformationMatrix_h | 431 #endif // TransformationMatrix_h |
OLD | NEW |