[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
zimmermann at webkit.org
zimmermann at webkit.org
Wed Dec 22 13:57:22 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 3766ee9e869bd3248154a534fc593b1e3bf90f60
Author: zimmermann at webkit.org <zimmermann at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Thu Sep 30 11:51:47 2010 +0000
2010-09-30 Nikolas Zimmermann <nzimmermann at rim.com>
Reviewed by Dirk Schulze.
AffineTransform should expose methods calculating the x/y scale factors
https://bugs.webkit.org/show_bug.cgi?id=46887
Expose methods calculating the x/y scale factors for an AffineTransform.
* platform/graphics/transforms/AffineTransform.cpp:
(WebCore::affineTransformDecompose): Move xScale / yScale calculations in their own functions.
(WebCore::AffineTransform::xScale):
(WebCore::AffineTransform::yScale):
* platform/graphics/transforms/AffineTransform.h:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@68773 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 31fd45d..2faabbb 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,18 @@
+2010-09-30 Nikolas Zimmermann <nzimmermann at rim.com>
+
+ Reviewed by Dirk Schulze.
+
+ AffineTransform should expose methods calculating the x/y scale factors
+ https://bugs.webkit.org/show_bug.cgi?id=46887
+
+ Expose methods calculating the x/y scale factors for an AffineTransform.
+
+ * platform/graphics/transforms/AffineTransform.cpp:
+ (WebCore::affineTransformDecompose): Move xScale / yScale calculations in their own functions.
+ (WebCore::AffineTransform::xScale):
+ (WebCore::AffineTransform::yScale):
+ * platform/graphics/transforms/AffineTransform.h:
+
2010-09-30 Tor Arne Vestbø <tor.arne.vestbo at nokia.com>
Reviewed by Simon Hausmann.
diff --git a/WebCore/platform/graphics/transforms/AffineTransform.cpp b/WebCore/platform/graphics/transforms/AffineTransform.cpp
index be18e07..f275526 100644
--- a/WebCore/platform/graphics/transforms/AffineTransform.cpp
+++ b/WebCore/platform/graphics/transforms/AffineTransform.cpp
@@ -41,8 +41,8 @@ static void affineTransformDecompose(const AffineTransform& matrix, double sr[9]
AffineTransform m(matrix);
// Compute scaling factors
- double sx = sqrt(m.a() * m.a() + m.b() * m.b());
- double sy = sqrt(m.c() * m.c() + m.d() * m.d());
+ double sx = matrix.xScale();
+ double sy = matrix.yScale();
// Compute cross product of transformed unit vectors. If negative,
// one axis was flipped.
@@ -119,6 +119,16 @@ bool AffineTransform::isIdentity() const
&& m_transform[4] == 0 && m_transform[5] == 0);
}
+double AffineTransform::xScale() const
+{
+ return sqrt(m_transform[0] * m_transform[0] + m_transform[1] * m_transform[1]);
+}
+
+double AffineTransform::yScale() const
+{
+ return sqrt(m_transform[2] * m_transform[2] + m_transform[3] * m_transform[3]);
+}
+
double AffineTransform::det() const
{
return m_transform[0] * m_transform[3] - m_transform[1] * m_transform[2];
diff --git a/WebCore/platform/graphics/transforms/AffineTransform.h b/WebCore/platform/graphics/transforms/AffineTransform.h
index 289ec54..baee102 100644
--- a/WebCore/platform/graphics/transforms/AffineTransform.h
+++ b/WebCore/platform/graphics/transforms/AffineTransform.h
@@ -110,7 +110,10 @@ public:
AffineTransform& skew(double angleX, double angleY);
AffineTransform& skewX(double angle);
AffineTransform& skewY(double angle);
-
+
+ double xScale() const;
+ double yScale() const;
+
double det() const;
bool isInvertible() const;
AffineTransform inverse() const;
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list