| Index: third_party/WebKit/Source/platform/transforms/AffineTransform.cpp
|
| diff --git a/third_party/WebKit/Source/platform/transforms/AffineTransform.cpp b/third_party/WebKit/Source/platform/transforms/AffineTransform.cpp
|
| index 3f08a99d8293c271b4edd0f4c4b327cbfcf434be..acea51b147d873ca25460bc8601387dfb1d83518 100644
|
| --- a/third_party/WebKit/Source/platform/transforms/AffineTransform.cpp
|
| +++ b/third_party/WebKit/Source/platform/transforms/AffineTransform.cpp
|
| @@ -32,6 +32,7 @@
|
| #include "platform/geometry/FloatRect.h"
|
| #include "platform/geometry/IntRect.h"
|
| #include "wtf/MathExtras.h"
|
| +#include "wtf/text/WTFString.h"
|
|
|
| namespace blink {
|
|
|
| @@ -400,4 +401,34 @@ void AffineTransform::recompose(const DecomposedType& decomp)
|
| this->scale(decomp.scaleX, decomp.scaleY);
|
| }
|
|
|
| +String AffineTransform::toString(bool asMatrix) const
|
| +{
|
| + if (asMatrix) {
|
| + // Return as a matrix in row-major order.
|
| + return String::format("[%lg,%lg,%lg,\n%lg,%lg,%lg]",
|
| + a(), c(), e(),
|
| + b(), d(), f());
|
| + }
|
| +
|
| + if (isIdentity())
|
| + return "identity";
|
| +
|
| + AffineTransform::DecomposedType decomposition;
|
| + decompose(decomposition);
|
| +
|
| + if (isIdentityOrTranslation())
|
| + return String::format("translation(%lg,%lg)", decomposition.translateX, decomposition.translateY);
|
| +
|
| + return String::format("translation(%lg,%lg), scale(%lg,%lg), angle(%lgdeg), remainder(%lg,%lg,%lg,%lg)",
|
| + decomposition.translateX,
|
| + decomposition.translateY,
|
| + decomposition.scaleX,
|
| + decomposition.scaleY,
|
| + rad2deg(decomposition.angle),
|
| + decomposition.remainderA,
|
| + decomposition.remainderB,
|
| + decomposition.remainderC,
|
| + decomposition.remainderD);
|
| +}
|
| +
|
| } // namespace blink
|
|
|