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 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 | 229 |
230 TransformationMatrix& flipX(); | 230 TransformationMatrix& flipX(); |
231 TransformationMatrix& flipY(); | 231 TransformationMatrix& flipY(); |
232 TransformationMatrix& skew(double angleX, double angleY); | 232 TransformationMatrix& skew(double angleX, double angleY); |
233 TransformationMatrix& skewX(double angle) { return skew(angle, 0); } | 233 TransformationMatrix& skewX(double angle) { return skew(angle, 0); } |
234 TransformationMatrix& skewY(double angle) { return skew(0, angle); } | 234 TransformationMatrix& skewY(double angle) { return skew(0, angle); } |
235 | 235 |
236 TransformationMatrix& applyPerspective(double p); | 236 TransformationMatrix& applyPerspective(double p); |
237 bool hasPerspective() const { return m_matrix[2][3] != 0.0f; } | 237 bool hasPerspective() const { return m_matrix[2][3] != 0.0f; } |
238 | 238 |
239 // returns a transformation that maps a rect to a rect | |
240 static TransformationMatrix rectToRect(const FloatRect&, const FloatRect&); | |
241 | |
242 bool isInvertible() const; | 239 bool isInvertible() const; |
243 | 240 |
244 // This method returns the identity matrix if it is not invertible. | 241 // This method returns the identity matrix if it is not invertible. |
245 // Use isInvertible() before calling this if you need to know. | 242 // Use isInvertible() before calling this if you need to know. |
246 TransformationMatrix inverse() const; | 243 TransformationMatrix inverse() const; |
247 | 244 |
248 // decompose the matrix into its component parts | 245 // decompose the matrix into its component parts |
249 typedef struct { | 246 typedef struct { |
250 double scaleX, scaleY, scaleZ; | 247 double scaleX, scaleY, scaleZ; |
251 double skewXY, skewXZ, skewYZ; | 248 double skewXY, skewXZ, skewYZ; |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
360 if (m && m != m_matrix) | 357 if (m && m != m_matrix) |
361 memcpy(m_matrix, m, sizeof(Matrix4)); | 358 memcpy(m_matrix, m, sizeof(Matrix4)); |
362 } | 359 } |
363 | 360 |
364 Matrix4 m_matrix; | 361 Matrix4 m_matrix; |
365 }; | 362 }; |
366 | 363 |
367 } // namespace blink | 364 } // namespace blink |
368 | 365 |
369 #endif // TransformationMatrix_h | 366 #endif // TransformationMatrix_h |
OLD | NEW |