| 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 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 387 | 387 |
| 388 // If this transformation is identity or 2D translation, returns the | 388 // If this transformation is identity or 2D translation, returns the |
| 389 // translation. | 389 // translation. |
| 390 FloatSize to2DTranslation() const; | 390 FloatSize to2DTranslation() const; |
| 391 | 391 |
| 392 typedef float FloatMatrix4[16]; | 392 typedef float FloatMatrix4[16]; |
| 393 void toColumnMajorFloatArray(FloatMatrix4& result) const; | 393 void toColumnMajorFloatArray(FloatMatrix4& result) const; |
| 394 | 394 |
| 395 static SkMatrix44 toSkMatrix44(const TransformationMatrix&); | 395 static SkMatrix44 toSkMatrix44(const TransformationMatrix&); |
| 396 | 396 |
| 397 // If |asMatrix|, return the matrix in row-major order. Otherwise, return |
| 398 // the transform's decomposition which shows the translation, scale, etc. |
| 399 String toString(bool asMatrix = false) const; |
| 400 |
| 397 private: | 401 private: |
| 398 // multiply passed 2D point by matrix (assume z=0) | 402 // multiply passed 2D point by matrix (assume z=0) |
| 399 void multVecMatrix(double x, double y, double& dstX, double& dstY) const; | 403 void multVecMatrix(double x, double y, double& dstX, double& dstY) const; |
| 400 FloatPoint internalMapPoint(const FloatPoint& sourcePoint) const | 404 FloatPoint internalMapPoint(const FloatPoint& sourcePoint) const |
| 401 { | 405 { |
| 402 double resultX; | 406 double resultX; |
| 403 double resultY; | 407 double resultY; |
| 404 multVecMatrix(sourcePoint.x(), sourcePoint.y(), resultX, resultY); | 408 multVecMatrix(sourcePoint.x(), sourcePoint.y(), resultX, resultY); |
| 405 return FloatPoint(static_cast<float>(resultX), static_cast<float>(result
Y)); | 409 return FloatPoint(static_cast<float>(resultX), static_cast<float>(result
Y)); |
| 406 } | 410 } |
| (...skipping 27 matching lines...) Expand all Loading... |
| 434 Matrix4 m_matrix; | 438 Matrix4 m_matrix; |
| 435 }; | 439 }; |
| 436 | 440 |
| 437 // Redeclared here to avoid ODR issues. | 441 // Redeclared here to avoid ODR issues. |
| 438 // See platform/testing/TransformPrinters.h. | 442 // See platform/testing/TransformPrinters.h. |
| 439 void PrintTo(const TransformationMatrix&, std::ostream*); | 443 void PrintTo(const TransformationMatrix&, std::ostream*); |
| 440 | 444 |
| 441 } // namespace blink | 445 } // namespace blink |
| 442 | 446 |
| 443 #endif // TransformationMatrix_h | 447 #endif // TransformationMatrix_h |
| OLD | NEW |