[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.19-706-ge5415e9

krit at webkit.org krit at webkit.org
Thu Feb 4 21:33:42 UTC 2010


The following commit has been merged in the webkit-1.1 branch:
commit c27355a06d03c903b29e3bfa5b4fadabe32333bc
Author: krit at webkit.org <krit at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Sun Jan 31 21:04:58 2010 +0000

    2010-01-31  Dirk Schulze  <krit at webkit.org>
    
            Reviewed by Simon Fraser.
    
            Add back an AffineTransform class for use by SVG
            https://bugs.webkit.org/show_bug.cgi?id=33750
    
            These are the first steps on reimplementing AffineTransform. Unlike
            the old affine code, this one is platform independent like TransformationMatrix.
            AffineTransform has the benefit, that it stores just 6 doubles instead of
            16 in TransformationMatrix. The calculations of transformations are not that
            complex and can improve the memory usage and speed of SVG.
            AffineTransform can be used by HTML Canvas3D or SVG, since they are 2D related (at
            least for the moment).
            HTML Canvas is the first that makes use of the new AffineTransform. Next patches
            will introduce the affine code to SVG.
    
            No new tests. The new AffineTransformation code is tested by fast/canvas.
    
            * Android.mk:
            * GNUmakefile.am:
            * WebCore.gypi:
            * WebCore.pro:
            * WebCore.vcproj/WebCore.vcproj:
            * WebCore.xcodeproj/project.pbxproj:
            * html/canvas/CanvasRenderingContext2D.cpp:
            (WebCore::CanvasRenderingContext2D::scale):
            (WebCore::CanvasRenderingContext2D::rotate):
            (WebCore::CanvasRenderingContext2D::translate):
            (WebCore::CanvasRenderingContext2D::transform):
            (WebCore::CanvasRenderingContext2D::setTransform):
            (WebCore::CanvasRenderingContext2D::isPointInPath):
            (WebCore::CanvasRenderingContext2D::willDraw):
            * html/canvas/CanvasRenderingContext2D.h:
            * platform/graphics/GraphicsContext.h:
            * platform/graphics/Path.h:
            * platform/graphics/cairo/GraphicsContextCairo.cpp:
            (WebCore::GraphicsContext::getAffineCTM):
            (WebCore::GraphicsContext::concatCTM):
            * platform/graphics/cairo/GraphicsContextPlatformPrivateCairo.h:
            (WebCore::GraphicsContextPlatformPrivate::concatCTM):
            * platform/graphics/cairo/PathCairo.cpp:
            (WebCore::Path::transform):
            * platform/graphics/cairo/TransformationMatrixCairo.cpp:
            (WebCore::AffineTransform::operator cairo_matrix_t):
            * platform/graphics/cg/GraphicsContextCG.cpp:
            (WebCore::GraphicsContext::concatCTM):
            (WebCore::GraphicsContext::getAffineCTM):
            * platform/graphics/cg/GraphicsContextPlatformPrivateCG.h:
            (WebCore::GraphicsContextPlatformPrivate::concatCTM):
            * platform/graphics/cg/PathCG.cpp:
            (WebCore::Path::transform):
            * platform/graphics/cg/TransformationMatrixCG.cpp:
            (WebCore::AffineTransform::operator CGAffineTransform):
            * platform/graphics/haiku/GraphicsContextHaiku.cpp:
            (WebCore::GraphicsContext::getAffineCTM):
            (WebCore::GraphicsContext::concatCTM):
            * platform/graphics/haiku/PathHaiku.cpp:
            (WebCore::Path::transform):
            * platform/graphics/qt/GraphicsContextQt.cpp:
            (WebCore::GraphicsContext::getAffineCTM):
            (WebCore::GraphicsContext::concatCTM):
            * platform/graphics/qt/PathQt.cpp:
            (WebCore::Path::transform):
            * platform/graphics/qt/TransformationMatrixQt.cpp:
            (WebCore::AffineTransform::operator QTransform):
            * platform/graphics/skia/GraphicsContextSkia.cpp:
            (WebCore::GraphicsContext::getAffineCTM):
            * platform/graphics/skia/PathSkia.cpp:
            (WebCore::Path::transform):
            * platform/graphics/skia/TransformationMatrixSkia.cpp:
            (WebCore::AffineTransform::operator SkMatrix):
            * platform/graphics/transforms/AffineTransform.cpp: Added.
            (WebCore::affineTransformDecompose):
            (WebCore::affineTransformCompose):
            (WebCore::AffineTransform::AffineTransform):
            (WebCore::AffineTransform::reset):
            (WebCore::AffineTransform::setMatrix):
            (WebCore::AffineTransform::isIdentity):
            (WebCore::AffineTransform::det):
            (WebCore::AffineTransform::isInvertible):
            (WebCore::AffineTransform::inverse):
            (WebCore::AffineTransform::multiply):
            (WebCore::AffineTransform::multLeft):
            (WebCore::AffineTransform::rotate):
            (WebCore::AffineTransform::scale):
            (WebCore::AffineTransform::translate):
            (WebCore::AffineTransform::scaleNonUniform):
            (WebCore::AffineTransform::rotateFromVector):
            (WebCore::AffineTransform::flipX):
            (WebCore::AffineTransform::flipY):
            (WebCore::AffineTransform::shear):
            (WebCore::AffineTransform::skew):
            (WebCore::AffineTransform::skewX):
            (WebCore::AffineTransform::skewY):
            (WebCore::makeMapBetweenRects):
            (WebCore::AffineTransform::map):
            (WebCore::AffineTransform::mapPoint):
            (WebCore::AffineTransform::mapRect):
            (WebCore::AffineTransform::blend):
            * platform/graphics/transforms/AffineTransform.h: Added.
            (WebCore::AffineTransform::a):
            (WebCore::AffineTransform::setA):
            (WebCore::AffineTransform::b):
            (WebCore::AffineTransform::setB):
            (WebCore::AffineTransform::c):
            (WebCore::AffineTransform::setC):
            (WebCore::AffineTransform::d):
            (WebCore::AffineTransform::setD):
            (WebCore::AffineTransform::e):
            (WebCore::AffineTransform::setE):
            (WebCore::AffineTransform::f):
            (WebCore::AffineTransform::setF):
            (WebCore::AffineTransform::operator== ):
            (WebCore::AffineTransform::operator!=):
            (WebCore::AffineTransform::operator*=):
            (WebCore::AffineTransform::operator*):
            (WebCore::AffineTransform::setMatrix):
            * platform/graphics/wince/GraphicsContextWince.cpp:
            (WebCore::GraphicsContext::concatCTM):
            (WebCore::GraphicsContext::getAffineCTM):
            * platform/graphics/wx/GraphicsContextWx.cpp:
            (WebCore::GraphicsContext::getAffineCTM):
            (WebCore::GraphicsContext::concatCTM):
            * platform/graphics/wx/PathWx.cpp:
            (WebCore::Path::transform):
            * platform/graphics/wx/TransformationMatrixWx.cpp:
            (WebCore::AffineTransform::operator wxGraphicsMatrix):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@54112 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/Android.mk b/WebCore/Android.mk
index bbb8b25..8cbc91d 100644
--- a/WebCore/Android.mk
+++ b/WebCore/Android.mk
@@ -466,6 +466,7 @@ LOCAL_SRC_FILES := $(LOCAL_SRC_FILES) \
 	platform/graphics/skia/SkiaUtils.cpp \
 	platform/graphics/skia/TransformationMatrixSkia.cpp \
 	\
+	platform/graphics/transforms/AffineTransform.cpp \
 	platform/graphics/transforms/Matrix3DTransformOperation.cpp \
 	platform/graphics/transforms/MatrixTransformOperation.cpp \
 	platform/graphics/transforms/PerspectiveTransformOperation.cpp \
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 2de68be..52ac692 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,132 @@
+2010-01-31  Dirk Schulze  <krit at webkit.org>
+
+        Reviewed by Simon Fraser.
+
+        Add back an AffineTransform class for use by SVG
+        https://bugs.webkit.org/show_bug.cgi?id=33750
+
+        These are the first steps on reimplementing AffineTransform. Unlike
+        the old affine code, this one is platform independent like TransformationMatrix.
+        AffineTransform has the benefit, that it stores just 6 doubles instead of
+        16 in TransformationMatrix. The calculations of transformations are not that
+        complex and can improve the memory usage and speed of SVG.
+        AffineTransform can be used by HTML Canvas3D or SVG, since they are 2D related (at
+        least for the moment).
+        HTML Canvas is the first that makes use of the new AffineTransform. Next patches
+        will introduce the affine code to SVG.
+
+        No new tests. The new AffineTransformation code is tested by fast/canvas.
+
+        * Android.mk:
+        * GNUmakefile.am:
+        * WebCore.gypi:
+        * WebCore.pro:
+        * WebCore.vcproj/WebCore.vcproj:
+        * WebCore.xcodeproj/project.pbxproj:
+        * html/canvas/CanvasRenderingContext2D.cpp:
+        (WebCore::CanvasRenderingContext2D::scale):
+        (WebCore::CanvasRenderingContext2D::rotate):
+        (WebCore::CanvasRenderingContext2D::translate):
+        (WebCore::CanvasRenderingContext2D::transform):
+        (WebCore::CanvasRenderingContext2D::setTransform):
+        (WebCore::CanvasRenderingContext2D::isPointInPath):
+        (WebCore::CanvasRenderingContext2D::willDraw):
+        * html/canvas/CanvasRenderingContext2D.h:
+        * platform/graphics/GraphicsContext.h:
+        * platform/graphics/Path.h:
+        * platform/graphics/cairo/GraphicsContextCairo.cpp:
+        (WebCore::GraphicsContext::getAffineCTM):
+        (WebCore::GraphicsContext::concatCTM):
+        * platform/graphics/cairo/GraphicsContextPlatformPrivateCairo.h:
+        (WebCore::GraphicsContextPlatformPrivate::concatCTM):
+        * platform/graphics/cairo/PathCairo.cpp:
+        (WebCore::Path::transform):
+        * platform/graphics/cairo/TransformationMatrixCairo.cpp:
+        (WebCore::AffineTransform::operator cairo_matrix_t):
+        * platform/graphics/cg/GraphicsContextCG.cpp:
+        (WebCore::GraphicsContext::concatCTM):
+        (WebCore::GraphicsContext::getAffineCTM):
+        * platform/graphics/cg/GraphicsContextPlatformPrivateCG.h:
+        (WebCore::GraphicsContextPlatformPrivate::concatCTM):
+        * platform/graphics/cg/PathCG.cpp:
+        (WebCore::Path::transform):
+        * platform/graphics/cg/TransformationMatrixCG.cpp:
+        (WebCore::AffineTransform::operator CGAffineTransform):
+        * platform/graphics/haiku/GraphicsContextHaiku.cpp:
+        (WebCore::GraphicsContext::getAffineCTM):
+        (WebCore::GraphicsContext::concatCTM):
+        * platform/graphics/haiku/PathHaiku.cpp:
+        (WebCore::Path::transform):
+        * platform/graphics/qt/GraphicsContextQt.cpp:
+        (WebCore::GraphicsContext::getAffineCTM):
+        (WebCore::GraphicsContext::concatCTM):
+        * platform/graphics/qt/PathQt.cpp:
+        (WebCore::Path::transform):
+        * platform/graphics/qt/TransformationMatrixQt.cpp:
+        (WebCore::AffineTransform::operator QTransform):
+        * platform/graphics/skia/GraphicsContextSkia.cpp:
+        (WebCore::GraphicsContext::getAffineCTM):
+        * platform/graphics/skia/PathSkia.cpp:
+        (WebCore::Path::transform):
+        * platform/graphics/skia/TransformationMatrixSkia.cpp:
+        (WebCore::AffineTransform::operator SkMatrix):
+        * platform/graphics/transforms/AffineTransform.cpp: Added.
+        (WebCore::affineTransformDecompose):
+        (WebCore::affineTransformCompose):
+        (WebCore::AffineTransform::AffineTransform):
+        (WebCore::AffineTransform::reset):
+        (WebCore::AffineTransform::setMatrix):
+        (WebCore::AffineTransform::isIdentity):
+        (WebCore::AffineTransform::det):
+        (WebCore::AffineTransform::isInvertible):
+        (WebCore::AffineTransform::inverse):
+        (WebCore::AffineTransform::multiply):
+        (WebCore::AffineTransform::multLeft):
+        (WebCore::AffineTransform::rotate):
+        (WebCore::AffineTransform::scale):
+        (WebCore::AffineTransform::translate):
+        (WebCore::AffineTransform::scaleNonUniform):
+        (WebCore::AffineTransform::rotateFromVector):
+        (WebCore::AffineTransform::flipX):
+        (WebCore::AffineTransform::flipY):
+        (WebCore::AffineTransform::shear):
+        (WebCore::AffineTransform::skew):
+        (WebCore::AffineTransform::skewX):
+        (WebCore::AffineTransform::skewY):
+        (WebCore::makeMapBetweenRects):
+        (WebCore::AffineTransform::map):
+        (WebCore::AffineTransform::mapPoint):
+        (WebCore::AffineTransform::mapRect):
+        (WebCore::AffineTransform::blend):
+        * platform/graphics/transforms/AffineTransform.h: Added.
+        (WebCore::AffineTransform::a):
+        (WebCore::AffineTransform::setA):
+        (WebCore::AffineTransform::b):
+        (WebCore::AffineTransform::setB):
+        (WebCore::AffineTransform::c):
+        (WebCore::AffineTransform::setC):
+        (WebCore::AffineTransform::d):
+        (WebCore::AffineTransform::setD):
+        (WebCore::AffineTransform::e):
+        (WebCore::AffineTransform::setE):
+        (WebCore::AffineTransform::f):
+        (WebCore::AffineTransform::setF):
+        (WebCore::AffineTransform::operator== ):
+        (WebCore::AffineTransform::operator!=):
+        (WebCore::AffineTransform::operator*=):
+        (WebCore::AffineTransform::operator*):
+        (WebCore::AffineTransform::setMatrix):
+        * platform/graphics/wince/GraphicsContextWince.cpp:
+        (WebCore::GraphicsContext::concatCTM):
+        (WebCore::GraphicsContext::getAffineCTM):
+        * platform/graphics/wx/GraphicsContextWx.cpp:
+        (WebCore::GraphicsContext::getAffineCTM):
+        (WebCore::GraphicsContext::concatCTM):
+        * platform/graphics/wx/PathWx.cpp:
+        (WebCore::Path::transform):
+        * platform/graphics/wx/TransformationMatrixWx.cpp:
+        (WebCore::AffineTransform::operator wxGraphicsMatrix):
+
 2010-01-31  Pavel Feldman  <pfeldman at chromium.org>
 
         Reviewed by Timothy Hatcher.
diff --git a/WebCore/GNUmakefile.am b/WebCore/GNUmakefile.am
index 7afe8d8..2680a80 100644
--- a/WebCore/GNUmakefile.am
+++ b/WebCore/GNUmakefile.am
@@ -1601,6 +1601,8 @@ webcore_sources += \
 	WebCore/platform/graphics/UnitBezier.h \
 	WebCore/platform/graphics/WidthIterator.cpp \
 	WebCore/platform/graphics/WidthIterator.h \
+	WebCore/platform/graphics/transforms/AffineTransform.cpp \
+	WebCore/platform/graphics/transforms/AffineTransform.h \
 	WebCore/platform/graphics/transforms/IdentityTransformOperation.h \
 	WebCore/platform/graphics/transforms/MatrixTransformOperation.cpp \
 	WebCore/platform/graphics/transforms/MatrixTransformOperation.h \
diff --git a/WebCore/WebCore.gypi b/WebCore/WebCore.gypi
index c4f64c7..fc5f70e 100644
--- a/WebCore/WebCore.gypi
+++ b/WebCore/WebCore.gypi
@@ -2136,6 +2136,8 @@
             'platform/graphics/skia/SkiaUtils.cpp',
             'platform/graphics/skia/SkiaUtils.h',
             'platform/graphics/skia/TransformationMatrixSkia.cpp',
+            'platform/graphics/transforms/AffineTransform.cpp',
+            'platform/graphics/transforms/AffineTransform.h',
             'platform/graphics/transforms/IdentityTransformOperation.h',
             'platform/graphics/transforms/Matrix3DTransformOperation.cpp',
             'platform/graphics/transforms/Matrix3DTransformOperation.h',
diff --git a/WebCore/WebCore.pro b/WebCore/WebCore.pro
index d7a8c79..7ada739 100644
--- a/WebCore/WebCore.pro
+++ b/WebCore/WebCore.pro
@@ -804,6 +804,7 @@ SOURCES += \
     platform/graphics/Pen.cpp \
     platform/graphics/SegmentedFontData.cpp \
     platform/graphics/SimpleFontData.cpp \
+    platform/graphics/transforms/AffineTransform.cpp \
     platform/graphics/transforms/TransformationMatrix.cpp \
     platform/graphics/transforms/MatrixTransformOperation.cpp \
     platform/graphics/transforms/Matrix3DTransformOperation.cpp \
diff --git a/WebCore/WebCore.vcproj/WebCore.vcproj b/WebCore/WebCore.vcproj/WebCore.vcproj
index 31a86de..b205c1d 100644
--- a/WebCore/WebCore.vcproj/WebCore.vcproj
+++ b/WebCore/WebCore.vcproj/WebCore.vcproj
@@ -24107,6 +24107,13 @@
 					Name="transforms"
 					>
 					<File
+						RelativePath="..\platform\graphics\transforms\AffineTransform.cpp"
+						>
+					</File>
+					<File
+						RelativePath="..\platform\graphics\transforms\AffineTransform.h"
+						>
+					<File
 						RelativePath="..\platform\graphics\transforms\IdentityTransformOperation.h"
 						>
 					</File>
diff --git a/WebCore/WebCore.xcodeproj/project.pbxproj b/WebCore/WebCore.xcodeproj/project.pbxproj
index 9e12721..6e23a81 100644
--- a/WebCore/WebCore.xcodeproj/project.pbxproj
+++ b/WebCore/WebCore.xcodeproj/project.pbxproj
@@ -1313,6 +1313,8 @@
 		84A81F3E0FC7DFF000955300 /* SourceAlpha.h in Headers */ = {isa = PBXBuildFile; fileRef = 84A81F3C0FC7DFF000955300 /* SourceAlpha.h */; };
 		84A81F410FC7E02700955300 /* SourceGraphic.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84A81F3F0FC7E02700955300 /* SourceGraphic.cpp */; };
 		84A81F420FC7E02700955300 /* SourceGraphic.h in Headers */ = {isa = PBXBuildFile; fileRef = 84A81F400FC7E02700955300 /* SourceGraphic.h */; };
+		84D0C4041115F1D40018AA34 /* AffineTransform.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84D0C4031115F1D40018AA34 /* AffineTransform.cpp */; };
+		84D0C4061115F1EA0018AA34 /* AffineTransform.h in Headers */ = {isa = PBXBuildFile; fileRef = 84D0C4051115F1EA0018AA34 /* AffineTransform.h */; };
 		85004D940ACEEAEF00C438F6 /* DOMSVGDefsElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 85004D880ACEEAEF00C438F6 /* DOMSVGDefsElement.h */; };
 		85004D950ACEEAEF00C438F6 /* DOMSVGDefsElement.mm in Sources */ = {isa = PBXBuildFile; fileRef = 85004D890ACEEAEF00C438F6 /* DOMSVGDefsElement.mm */; };
 		85004D960ACEEAEF00C438F6 /* DOMSVGDescElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 85004D8A0ACEEAEF00C438F6 /* DOMSVGDescElement.h */; };
@@ -6716,6 +6718,8 @@
 		84B2B1F7056BEF3A00D2B771 /* WebCoreKeyGenerator.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebCoreKeyGenerator.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
 		84B2B1F8056BEF3A00D2B771 /* WebCoreKeyGenerator.m */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebCoreKeyGenerator.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
 		84B2B24F056BF15F00D2B771 /* SSLKeyGeneratorMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = SSLKeyGeneratorMac.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
+		84D0C4031115F1D40018AA34 /* AffineTransform.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AffineTransform.cpp; path = transforms/AffineTransform.cpp; sourceTree = "<group>"; };
+		84D0C4051115F1EA0018AA34 /* AffineTransform.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AffineTransform.h; path = transforms/AffineTransform.h; sourceTree = "<group>"; };
 		85004D880ACEEAEF00C438F6 /* DOMSVGDefsElement.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DOMSVGDefsElement.h; sourceTree = "<group>"; };
 		85004D890ACEEAEF00C438F6 /* DOMSVGDefsElement.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = DOMSVGDefsElement.mm; sourceTree = "<group>"; };
 		85004D8A0ACEEAEF00C438F6 /* DOMSVGDescElement.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DOMSVGDescElement.h; sourceTree = "<group>"; };
@@ -10899,6 +10903,8 @@
 		49E911B20EF86D27009D0CAF /* transforms */ = {
 			isa = PBXGroup;
 			children = (
+				84D0C4051115F1EA0018AA34 /* AffineTransform.h */,
+				84D0C4031115F1D40018AA34 /* AffineTransform.cpp */,
 				49E911B50EF86D47009D0CAF /* IdentityTransformOperation.h */,
 				49D5DC270F423A73008F20FD /* Matrix3DTransformOperation.cpp */,
 				49D5DC280F423A73008F20FD /* Matrix3DTransformOperation.h */,
@@ -18465,6 +18471,7 @@
 				93F199ED08245E59001E9ABC /* XSLTProcessor.h in Headers */,
 				E1BE512E0CF6C512002EA959 /* XSLTUnicodeSort.h in Headers */,
 				97DD4D870FDF4D6E00ECF9A4 /* XSSAuditor.h in Headers */,
+				84D0C4061115F1EA0018AA34 /* AffineTransform.h in Headers */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -20639,6 +20646,7 @@
 				93F19B0508245E59001E9ABC /* XSLTProcessorLibxslt.cpp in Sources */,
 				E1BE512D0CF6C512002EA959 /* XSLTUnicodeSort.cpp in Sources */,
 				97DD4D860FDF4D6E00ECF9A4 /* XSSAuditor.cpp in Sources */,
+				84D0C4041115F1D40018AA34 /* AffineTransform.cpp in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
diff --git a/WebCore/html/canvas/CanvasRenderingContext2D.cpp b/WebCore/html/canvas/CanvasRenderingContext2D.cpp
index 1e09534..8add19c 100644
--- a/WebCore/html/canvas/CanvasRenderingContext2D.cpp
+++ b/WebCore/html/canvas/CanvasRenderingContext2D.cpp
@@ -30,7 +30,7 @@
 #include "config.h"
 #include "CanvasRenderingContext2D.h"
 
-#include "TransformationMatrix.h"
+#include "AffineTransform.h"
 #include "CSSParser.h"
 #include "CachedImage.h"
 #include "CanvasGradient.h"
@@ -357,7 +357,7 @@ void CanvasRenderingContext2D::scale(float sx, float sy)
     if (!isfinite(sx) | !isfinite(sy))
         return;
 
-    TransformationMatrix newTransform = state().m_transform;
+    AffineTransform newTransform = state().m_transform;
     newTransform.scaleNonUniform(sx, sy);
     if (!newTransform.isInvertible()) {
         state().m_invertibleCTM = false;
@@ -366,7 +366,7 @@ void CanvasRenderingContext2D::scale(float sx, float sy)
 
     state().m_transform = newTransform;
     c->scale(FloatSize(sx, sy));
-    m_path.transform(TransformationMatrix().scaleNonUniform(1.0/sx, 1.0/sy));
+    m_path.transform(AffineTransform().scaleNonUniform(1.0 / sx, 1.0 / sy));
 }
 
 void CanvasRenderingContext2D::rotate(float angleInRadians)
@@ -380,7 +380,7 @@ void CanvasRenderingContext2D::rotate(float angleInRadians)
     if (!isfinite(angleInRadians))
         return;
 
-    TransformationMatrix newTransform = state().m_transform;
+    AffineTransform newTransform = state().m_transform;
     newTransform.rotate(angleInRadians / piDouble * 180.0);
     if (!newTransform.isInvertible()) {
         state().m_invertibleCTM = false;
@@ -389,7 +389,7 @@ void CanvasRenderingContext2D::rotate(float angleInRadians)
 
     state().m_transform = newTransform;
     c->rotate(angleInRadians);
-    m_path.transform(TransformationMatrix().rotate(-angleInRadians / piDouble * 180.0));
+    m_path.transform(AffineTransform().rotate(-angleInRadians / piDouble * 180.0));
 }
 
 void CanvasRenderingContext2D::translate(float tx, float ty)
@@ -403,7 +403,7 @@ void CanvasRenderingContext2D::translate(float tx, float ty)
     if (!isfinite(tx) | !isfinite(ty))
         return;
 
-    TransformationMatrix newTransform = state().m_transform;
+    AffineTransform newTransform = state().m_transform;
     newTransform.translate(tx, ty);
     if (!newTransform.isInvertible()) {
         state().m_invertibleCTM = false;
@@ -412,7 +412,7 @@ void CanvasRenderingContext2D::translate(float tx, float ty)
 
     state().m_transform = newTransform;
     c->translate(tx, ty);
-    m_path.transform(TransformationMatrix().translate(-tx, -ty));
+    m_path.transform(AffineTransform().translate(-tx, -ty));
 }
 
 void CanvasRenderingContext2D::transform(float m11, float m12, float m21, float m22, float dx, float dy)
@@ -427,8 +427,8 @@ void CanvasRenderingContext2D::transform(float m11, float m12, float m21, float
         !isfinite(m12) | !isfinite(m22) | !isfinite(dy))
         return;
 
-    TransformationMatrix transform(m11, m12, m21, m22, dx, dy);
-    TransformationMatrix newTransform = transform * state().m_transform;
+    AffineTransform transform(m11, m12, m21, m22, dx, dy);
+    AffineTransform newTransform = transform * state().m_transform;
     if (!newTransform.isInvertible()) {
         state().m_invertibleCTM = false;
         return;
@@ -449,7 +449,7 @@ void CanvasRenderingContext2D::setTransform(float m11, float m12, float m21, flo
         !isfinite(m12) | !isfinite(m22) | !isfinite(dy))
         return;
 
-    TransformationMatrix ctm = state().m_transform;
+    AffineTransform ctm = state().m_transform;
     if (!ctm.isInvertible())
         return;
     c->concatCTM(c->getCTM().inverse());
@@ -708,7 +708,7 @@ bool CanvasRenderingContext2D::isPointInPath(const float x, const float y)
         return false;
 
     FloatPoint point(x, y);
-    TransformationMatrix ctm = state().m_transform;
+    AffineTransform ctm = state().m_transform;
     FloatPoint transformedPoint = ctm.inverse().mapPoint(point);
     return m_path.contains(transformedPoint);
 }
@@ -1241,7 +1241,7 @@ void CanvasRenderingContext2D::willDraw(const FloatRect& r, unsigned options)
 
     FloatRect dirtyRect = r;
     if (options & CanvasWillDrawApplyTransform) {
-        TransformationMatrix ctm = state().m_transform;
+        AffineTransform ctm = state().m_transform;
         dirtyRect = ctm.mapRect(r);
     }
     
diff --git a/WebCore/html/canvas/CanvasRenderingContext2D.h b/WebCore/html/canvas/CanvasRenderingContext2D.h
index 283f92c..553ffd2 100644
--- a/WebCore/html/canvas/CanvasRenderingContext2D.h
+++ b/WebCore/html/canvas/CanvasRenderingContext2D.h
@@ -26,8 +26,8 @@
 #ifndef CanvasRenderingContext2D_h
 #define CanvasRenderingContext2D_h
 
+#include "AffineTransform.h"
 #include "CanvasRenderingContext.h"
-#include "TransformationMatrix.h"
 #include "FloatSize.h"
 #include "Font.h"
 #include "GraphicsTypes.h"
@@ -218,7 +218,7 @@ namespace WebCore {
             String m_shadowColor;
             float m_globalAlpha;
             CompositeOperator m_globalComposite;
-            TransformationMatrix m_transform;
+            AffineTransform m_transform;
             bool m_invertibleCTM;
             
             // Text state.
diff --git a/WebCore/platform/graphics/GraphicsContext.h b/WebCore/platform/graphics/GraphicsContext.h
index bc87649..ee9602f 100644
--- a/WebCore/platform/graphics/GraphicsContext.h
+++ b/WebCore/platform/graphics/GraphicsContext.h
@@ -111,6 +111,7 @@ namespace WebCore {
     const int cMisspellingLinePatternWidth = 4;
     const int cMisspellingLinePatternGapWidth = 1;
 
+    class AffineTransform;
     class Font;
     class Generator;
     class Gradient;
@@ -304,7 +305,9 @@ namespace WebCore {
         void setURLForRect(const KURL&, const IntRect&);
 
         void concatCTM(const TransformationMatrix&);
+        void concatCTM(const AffineTransform&);
         TransformationMatrix getCTM() const;
+        AffineTransform getAffineCTM() const;
 
 #if OS(WINCE) && !PLATFORM(QT)
         void setBitmap(PassRefPtr<SharedBitmap>);
diff --git a/WebCore/platform/graphics/Path.h b/WebCore/platform/graphics/Path.h
index 79d6cc4..aad6f3e 100644
--- a/WebCore/platform/graphics/Path.h
+++ b/WebCore/platform/graphics/Path.h
@@ -67,6 +67,7 @@ typedef PlatformPath* PlatformPathPtr;
 
 namespace WebCore {
 
+    class AffineTransform;
     class FloatPoint;
     class FloatRect;
     class FloatSize;
@@ -145,6 +146,7 @@ namespace WebCore {
         static Path createLine(const FloatPoint&, const FloatPoint&);
 
         void apply(void* info, PathApplierFunction) const;
+        void transform(const AffineTransform&);
         void transform(const TransformationMatrix&);
 
     private:
diff --git a/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp b/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp
index d866b6c..ccbbf3b 100644
--- a/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp
+++ b/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp
@@ -32,6 +32,7 @@
 
 #if PLATFORM(CAIRO)
 
+#include "AffineTransform.h"
 #include "CairoPath.h"
 #include "FEGaussianBlur.h"
 #include "FloatRect.h"
@@ -216,6 +217,14 @@ TransformationMatrix GraphicsContext::getCTM() const
     return TransformationMatrix(m.xx, m.yx, m.xy, m.yy, m.x0, m.y0);
 }
 
+AffineTransform GraphicsContext::getAffineCTM() const
+{
+    cairo_t* cr = platformContext();
+    cairo_matrix_t m;
+    cairo_get_matrix(cr, &m);
+    return AffineTransform(m.xx, m.yx, m.xy, m.yy, m.x0, m.y0);
+}
+
 cairo_t* GraphicsContext::platformContext() const
 {
     return m_data->cr;
@@ -802,6 +811,17 @@ void GraphicsContext::concatCTM(const TransformationMatrix& transform)
     m_data->concatCTM(transform);
 }
 
+void GraphicsContext::concatCTM(const AffineTransform& transform)
+{
+    if (paintingDisabled())
+        return;
+
+    cairo_t* cr = m_data->cr;
+    const cairo_matrix_t matrix = cairo_matrix_t(transform);
+    cairo_transform(cr, &matrix);
+    m_data->concatCTM(transform);
+}
+
 void GraphicsContext::addInnerRoundedRectClip(const IntRect& rect, int thickness)
 {
     if (paintingDisabled())
diff --git a/WebCore/platform/graphics/cairo/GraphicsContextPlatformPrivateCairo.h b/WebCore/platform/graphics/cairo/GraphicsContextPlatformPrivateCairo.h
index cedc684..5e38832 100644
--- a/WebCore/platform/graphics/cairo/GraphicsContextPlatformPrivateCairo.h
+++ b/WebCore/platform/graphics/cairo/GraphicsContextPlatformPrivateCairo.h
@@ -71,6 +71,7 @@ public:
     void scale(const FloatSize&);
     void rotate(float);
     void translate(float, float);
+    void concatCTM(const AffineTransform&);
     void concatCTM(const TransformationMatrix&);
     void beginTransparencyLayer() { m_transparencyCount++; }
     void endTransparencyLayer() { m_transparencyCount--; }
@@ -85,6 +86,7 @@ public:
     void scale(const FloatSize&) {}
     void rotate(float) {}
     void translate(float, float) {}
+    void concatCTM(const AffineTransform&) {}
     void concatCTM(const TransformationMatrix&) {}
     void beginTransparencyLayer() {}
     void endTransparencyLayer() {}
diff --git a/WebCore/platform/graphics/cairo/PathCairo.cpp b/WebCore/platform/graphics/cairo/PathCairo.cpp
index 8bde57e..a265937 100644
--- a/WebCore/platform/graphics/cairo/PathCairo.cpp
+++ b/WebCore/platform/graphics/cairo/PathCairo.cpp
@@ -25,6 +25,7 @@
 #include "config.h"
 #include "Path.h"
 
+#include "AffineTransform.h"
 #include "TransformationMatrix.h"
 #include "CairoPath.h"
 #include "FloatRect.h"
@@ -326,6 +327,14 @@ void Path::apply(void* info, PathApplierFunction function) const
     cairo_path_destroy(path);
 }
 
+void Path::transform(const AffineTransform& trans)
+{
+    cairo_t* m_cr = platformPath()->m_cr;
+    cairo_matrix_t c_matrix = cairo_matrix_t(trans);
+    cairo_matrix_invert(&c_matrix);
+    cairo_transform(m_cr, &c_matrix);
+}
+
 void Path::transform(const TransformationMatrix& trans)
 {
     cairo_t* m_cr = platformPath()->m_cr;
diff --git a/WebCore/platform/graphics/cairo/TransformationMatrixCairo.cpp b/WebCore/platform/graphics/cairo/TransformationMatrixCairo.cpp
index 1b83a29..c73dd02 100644
--- a/WebCore/platform/graphics/cairo/TransformationMatrixCairo.cpp
+++ b/WebCore/platform/graphics/cairo/TransformationMatrixCairo.cpp
@@ -23,6 +23,7 @@
  */
 
 #include "config.h"
+#include "AffineTransform.h"
 #include "TransformationMatrix.h"
 
 #include "IntRect.h"
@@ -46,6 +47,20 @@ TransformationMatrix::operator cairo_matrix_t() const
     return m;
 }
 
+AffineTransform::operator cairo_matrix_t() const
+{
+    cairo_matrix_t m;
+
+    cairo_matrix_init (&m,
+                       a(),
+                       b(),
+                       c(),
+                       d(),
+                       e(),
+                       f());
+    return m;
+}
+
 }
 
 // vim: ts=4 sw=4 et
diff --git a/WebCore/platform/graphics/cg/GraphicsContextCG.cpp b/WebCore/platform/graphics/cg/GraphicsContextCG.cpp
index b11ba66..a339982 100644
--- a/WebCore/platform/graphics/cg/GraphicsContextCG.cpp
+++ b/WebCore/platform/graphics/cg/GraphicsContextCG.cpp
@@ -28,6 +28,7 @@
 #include "config.h"
 #include "GraphicsContext.h"
 
+#include "AffineTransform.h"
 #include "FloatConversion.h"
 #include "GraphicsContextPlatformPrivateCG.h"
 #include "GraphicsContextPrivate.h"
@@ -958,6 +959,15 @@ void GraphicsContext::translate(float x, float y)
     m_data->m_userToDeviceTransformKnownToBeIdentity = false;
 }
 
+void GraphicsContext::concatCTM(const AffineTransform& transform)
+{
+    if (paintingDisabled())
+        return;
+    CGContextConcatCTM(platformContext(), transform);
+    m_data->concatCTM(transform);
+    m_data->m_userToDeviceTransformKnownToBeIdentity = false;
+}
+
 void GraphicsContext::concatCTM(const TransformationMatrix& transform)
 {
     if (paintingDisabled())
@@ -967,6 +977,12 @@ void GraphicsContext::concatCTM(const TransformationMatrix& transform)
     m_data->m_userToDeviceTransformKnownToBeIdentity = false;
 }
 
+AffineTransform GraphicsContext::getAffineCTM() const
+{
+    CGAffineTransform t = CGContextGetCTM(platformContext());
+    return AffineTransform(t.a, t.b, t.c, t.d, t.tx, t.ty);
+}
+
 TransformationMatrix GraphicsContext::getCTM() const
 {
     CGAffineTransform t = CGContextGetCTM(platformContext());
diff --git a/WebCore/platform/graphics/cg/GraphicsContextPlatformPrivateCG.h b/WebCore/platform/graphics/cg/GraphicsContextPlatformPrivateCG.h
index ff1816f..7b80d5b 100644
--- a/WebCore/platform/graphics/cg/GraphicsContextPlatformPrivateCG.h
+++ b/WebCore/platform/graphics/cg/GraphicsContextPlatformPrivateCG.h
@@ -73,6 +73,7 @@ public:
     void scale(const FloatSize&) {}
     void rotate(float) {}
     void translate(float, float) {}
+    void concatCTM(const AffineTransform&) {}
     void concatCTM(const TransformationMatrix&) {}
     void beginTransparencyLayer() {}
     void endTransparencyLayer() {}
@@ -88,6 +89,7 @@ public:
     void scale(const FloatSize&);
     void rotate(float);
     void translate(float, float);
+    void concatCTM(const AffineTransform&);
     void concatCTM(const TransformationMatrix&);
     void beginTransparencyLayer() { m_transparencyCount++; }
     void endTransparencyLayer() { m_transparencyCount--; }
diff --git a/WebCore/platform/graphics/cg/PathCG.cpp b/WebCore/platform/graphics/cg/PathCG.cpp
index 3b05641..01680df 100644
--- a/WebCore/platform/graphics/cg/PathCG.cpp
+++ b/WebCore/platform/graphics/cg/PathCG.cpp
@@ -29,6 +29,7 @@
 
 #if PLATFORM(CG)
 
+#include "AffineTransform.h"
 #include "TransformationMatrix.h"
 #include <ApplicationServices/ApplicationServices.h>
 #include "FloatRect.h"
@@ -346,6 +347,15 @@ void Path::apply(void* info, PathApplierFunction function) const
     CGPathApply(m_path, &pinfo, CGPathApplierToPathApplier);
 }
 
+void Path::transform(const AffineTransform& transform)
+{
+    CGMutablePathRef path = CGPathCreateMutable();
+    CGAffineTransform transformCG = transform;
+    CGPathAddPath(path, &transformCG, m_path);
+    CGPathRelease(m_path);
+    m_path = path;
+}
+
 void Path::transform(const TransformationMatrix& transform)
 {
     CGMutablePathRef path = CGPathCreateMutable();
diff --git a/WebCore/platform/graphics/cg/TransformationMatrixCG.cpp b/WebCore/platform/graphics/cg/TransformationMatrixCG.cpp
index 568a6b3..5fe2122 100644
--- a/WebCore/platform/graphics/cg/TransformationMatrixCG.cpp
+++ b/WebCore/platform/graphics/cg/TransformationMatrixCG.cpp
@@ -24,6 +24,7 @@
  */
 
 #include "config.h"
+#include "AffineTransform.h"
 #include "TransformationMatrix.h"
 
 #if PLATFORM(CG)
@@ -43,6 +44,16 @@ TransformationMatrix::operator CGAffineTransform() const
                                  narrowPrecisionToCGFloat(f()));
 }
 
+AffineTransform::operator CGAffineTransform() const
+{
+    return CGAffineTransformMake(narrowPrecisionToCGFloat(a()),
+                                 narrowPrecisionToCGFloat(b()),
+                                 narrowPrecisionToCGFloat(c()),
+                                 narrowPrecisionToCGFloat(d()),
+                                 narrowPrecisionToCGFloat(e()),
+                                 narrowPrecisionToCGFloat(f()));
+}
+
 }
 
 #endif // PLATFORM(CG)
diff --git a/WebCore/platform/graphics/haiku/GraphicsContextHaiku.cpp b/WebCore/platform/graphics/haiku/GraphicsContextHaiku.cpp
index 6038c6a..3970ebc 100644
--- a/WebCore/platform/graphics/haiku/GraphicsContextHaiku.cpp
+++ b/WebCore/platform/graphics/haiku/GraphicsContextHaiku.cpp
@@ -28,6 +28,7 @@
 #include "config.h"
 #include "GraphicsContext.h"
 
+#include "AffineTransform.h"
 #include "CString.h"
 #include "Color.h"
 #include "Font.h"
@@ -391,6 +392,12 @@ void GraphicsContext::clipToImageBuffer(const FloatRect&, const ImageBuffer*)
     notImplemented();
 }
 
+AffineTransform GraphicsContext::getAffineCTM() const
+{
+    notImplemented();
+    return AffineTransform();
+}
+
 TransformationMatrix GraphicsContext::getCTM() const
 {
     notImplemented();
@@ -451,6 +458,14 @@ void GraphicsContext::addInnerRoundedRectClip(const IntRect& rect, int thickness
     notImplemented();
 }
 
+void GraphicsContext::concatCTM(const AffineTransform& transform)
+{
+    if (paintingDisabled())
+        return;
+
+    notImplemented();
+}
+
 void GraphicsContext::concatCTM(const TransformationMatrix& transform)
 {
     if (paintingDisabled())
diff --git a/WebCore/platform/graphics/haiku/PathHaiku.cpp b/WebCore/platform/graphics/haiku/PathHaiku.cpp
index d0da025..70dad29 100644
--- a/WebCore/platform/graphics/haiku/PathHaiku.cpp
+++ b/WebCore/platform/graphics/haiku/PathHaiku.cpp
@@ -28,6 +28,7 @@
 #include "config.h"
 #include "Path.h"
 
+#include "AffineTransform.h"
 #include "FloatRect.h"
 #include "NotImplemented.h"
 #include "PlatformString.h"
@@ -146,6 +147,11 @@ void Path::apply(void* info, PathApplierFunction function) const
     notImplemented();
 }
 
+void Path::transform(const AffineTransform& transform)
+{
+    notImplemented();
+}
+
 void Path::transform(const TransformationMatrix& transform)
 {
     notImplemented();
diff --git a/WebCore/platform/graphics/qt/GraphicsContextQt.cpp b/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
index b78a6e8..9046449 100644
--- a/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
+++ b/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
@@ -40,6 +40,7 @@
 #include <windows.h>
 #endif
 
+#include "AffineTransform.h"
 #include "Color.h"
 #include "FloatConversion.h"
 #include "Font.h"
@@ -275,6 +276,13 @@ PlatformGraphicsContext* GraphicsContext::platformContext() const
     return m_data->p();
 }
 
+AffineTransform GraphicsContext::getAffineCTM() const
+{
+    QTransform matrix(platformContext()->combinedTransform());
+    return AffineTransform(matrix.m11(), matrix.m12(), matrix.m21(),
+                           matrix.m22(), matrix.dx(), matrix.dy());
+}
+
 TransformationMatrix GraphicsContext::getCTM() const
 {
     QTransform matrix(platformContext()->combinedTransform());
@@ -1188,6 +1196,24 @@ void GraphicsContext::addInnerRoundedRectClip(const IntRect& rect,
     p->setRenderHint(QPainter::Antialiasing, antiAlias);
 }
 
+void GraphicsContext::concatCTM(const AffineTransform& transform)
+{
+    if (paintingDisabled())
+        return;
+
+    m_data->p()->setWorldTransform(transform, true);
+
+    // Transformations to the context shouldn't transform the currentPath.
+    // We have to undo every change made to the context from the currentPath
+    // to avoid wrong drawings.
+    if (!m_data->currentPath.isEmpty() && transform.isInvertible()) {
+        QTransform matrix = transform.inverse();
+        m_data->currentPath = m_data->currentPath * matrix;
+        m_common->state.pathTransform.multiply(transform.toTransformationMatrix());
+    }
+}
+
+
 void GraphicsContext::concatCTM(const TransformationMatrix& transform)
 {
     if (paintingDisabled())
diff --git a/WebCore/platform/graphics/qt/PathQt.cpp b/WebCore/platform/graphics/qt/PathQt.cpp
index 4716d32..2721984 100644
--- a/WebCore/platform/graphics/qt/PathQt.cpp
+++ b/WebCore/platform/graphics/qt/PathQt.cpp
@@ -1,7 +1,7 @@
 /*
  * Copyright (C) 2006 Zack Rusin   <zack at kde.org>
  *               2006 Rob Buis     <buis at kde.org>
- *               2009 Dirk Schulze <krit at webkit.org>
+ *               2009, 2010 Dirk Schulze <krit at webkit.org>
  *
  * All rights reserved.
  *
@@ -30,12 +30,13 @@
 #include "config.h"
 #include "Path.h"
 
-#include "TransformationMatrix.h"
+#include "AffineTransform.h"
 #include "FloatRect.h"
 #include "GraphicsContext.h"
 #include "ImageBuffer.h"
 #include "PlatformString.h"
 #include "StrokeStyleApplier.h"
+#include "TransformationMatrix.h"
 #include <QPainterPath>
 #include <QTransform>
 #include <QString>
@@ -379,6 +380,11 @@ void Path::apply(void* info, PathApplierFunction function) const
     }
 }
 
+void Path::transform(const AffineTransform& transform)
+{
+    m_path = QTransform(transform).map(m_path);
+}
+
 void Path::transform(const TransformationMatrix& transform)
 {
     m_path = QTransform(transform).map(m_path);
diff --git a/WebCore/platform/graphics/qt/TransformationMatrixQt.cpp b/WebCore/platform/graphics/qt/TransformationMatrixQt.cpp
index 37b86f3..a5bc3c3 100644
--- a/WebCore/platform/graphics/qt/TransformationMatrixQt.cpp
+++ b/WebCore/platform/graphics/qt/TransformationMatrixQt.cpp
@@ -24,6 +24,7 @@
  */
 
 #include "config.h"
+#include "AffineTransform.h"
 #include "TransformationMatrix.h"
 
 #include "IntRect.h"
@@ -36,6 +37,11 @@ TransformationMatrix::operator QTransform() const
     return QTransform(m11(), m12(), m14(), m21(), m22(), m24(), m41(), m42(), m44());
 }
 
+AffineTransform::operator QTransform() const
+{
+    return QTransform(a(), b(), c(), d(), e(), f());
+}
+
 }
 
 // vim: ts=4 sw=4 et
diff --git a/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp b/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp
index 985442c..08b27cf 100644
--- a/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp
+++ b/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp
@@ -31,6 +31,7 @@
 #include "config.h"
 #include "GraphicsContext.h"
 
+#include "AffineTransform.h"
 #include "Color.h"
 #include "FloatRect.h"
 #include "Gradient.h"
@@ -439,6 +440,13 @@ void GraphicsContext::clipToImageBuffer(const FloatRect& rect,
 #endif
 }
 
+void GraphicsContext::concatCTM(const AffineTransform& affine)
+{
+    if (paintingDisabled())
+        return;
+    platformContext()->canvas()->concat(affine);
+}
+
 void GraphicsContext::concatCTM(const TransformationMatrix& xform)
 {
     if (paintingDisabled())
@@ -805,6 +813,17 @@ void GraphicsContext::fillRoundedRect(const IntRect& rect,
     platformContext()->canvas()->drawPath(path, paint);
 }
 
+AffineTransform GraphicsContext::getAffineCTM() const
+{
+    const SkMatrix& m = platformContext()->canvas()->getTotalMatrix();
+    return AffineTransform(SkScalarToDouble(m.getScaleX()),      // a
+                           SkScalarToDouble(m.getSkewY()),       // b
+                           SkScalarToDouble(m.getSkewX()),       // c
+                           SkScalarToDouble(m.getScaleY()),      // d
+                           SkScalarToDouble(m.getTranslateX()),  // e
+                           SkScalarToDouble(m.getTranslateY())); // f
+}
+
 TransformationMatrix GraphicsContext::getCTM() const
 {
     const SkMatrix& m = platformContext()->canvas()->getTotalMatrix();
diff --git a/WebCore/platform/graphics/skia/PathSkia.cpp b/WebCore/platform/graphics/skia/PathSkia.cpp
index 2cbb759..fe4c3d0 100644
--- a/WebCore/platform/graphics/skia/PathSkia.cpp
+++ b/WebCore/platform/graphics/skia/PathSkia.cpp
@@ -30,6 +30,7 @@
 #include "config.h"
 #include "Path.h"
 
+#include "AffineTransform.h"
 #include "FloatRect.h"
 #include "ImageBuffer.h"
 #include "StrokeStyleApplier.h"
@@ -214,6 +215,11 @@ void Path::apply(void* info, PathApplierFunction function) const
     }
 }
 
+void Path::transform(const AffineTransform& xform)
+{
+    m_path->transform(xform);
+}
+
 void Path::transform(const TransformationMatrix& xform)
 {
     m_path->transform(xform);
diff --git a/WebCore/platform/graphics/skia/TransformationMatrixSkia.cpp b/WebCore/platform/graphics/skia/TransformationMatrixSkia.cpp
index 2d0f9f8..dc610d7 100644
--- a/WebCore/platform/graphics/skia/TransformationMatrixSkia.cpp
+++ b/WebCore/platform/graphics/skia/TransformationMatrixSkia.cpp
@@ -28,6 +28,7 @@
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 #include "config.h"
+#include "AffineTransform.h"
 #include "TransformationMatrix.h"
 
 #include "SkiaUtils.h"
@@ -54,4 +55,24 @@ TransformationMatrix::operator SkMatrix() const
     return result;
 }
 
+AffineTransform::operator SkMatrix() const
+{
+    SkMatrix result;
+
+    result.setScaleX(WebCoreDoubleToSkScalar(a()));
+    result.setSkewX(WebCoreDoubleToSkScalar(c()));
+    result.setTranslateX(WebCoreDoubleToSkScalar(e()));
+
+    result.setScaleY(WebCoreDoubleToSkScalar(d()));
+    result.setSkewY(WebCoreDoubleToSkScalar(b()));
+    result.setTranslateY(WebCoreDoubleToSkScalar(f()));
+
+    // FIXME: Set perspective properly.
+    result.setPerspX(0);
+    result.setPerspY(0);
+    result.set(SkMatrix::kMPersp2, SK_Scalar1);
+
+    return result;
+}
+
 } // namespace WebCore
diff --git a/WebCore/platform/graphics/transforms/AffineTransform.cpp b/WebCore/platform/graphics/transforms/AffineTransform.cpp
new file mode 100644
index 0000000..f26bcb7
--- /dev/null
+++ b/WebCore/platform/graphics/transforms/AffineTransform.cpp
@@ -0,0 +1,325 @@
+/*
+ * Copyright (C) 2005, 2006 Apple Computer, Inc.  All rights reserved.
+ *               2010 Dirk Schulze <krit at webkit.org>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#include "config.h"
+#include "AffineTransform.h"
+
+#include "FloatConversion.h"
+#include "FloatQuad.h"
+#include "FloatRect.h"
+#include "IntRect.h"
+
+#include <wtf/MathExtras.h>
+
+namespace WebCore {
+
+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());
+
+    // Compute cross product of transformed unit vectors. If negative,
+    // one axis was flipped.
+    if (m.a() * m.d() - m.c() * m.b() < 0.0) {
+        // Flip axis with minimum unit vector dot product
+        if (m.a() < m.d())
+            sx = -sx;
+        else
+            sy = -sy;
+    }
+
+    // Remove scale from matrix
+    m.scale(1.0 / sx, 1.0 / sy);
+
+    // Compute rotation
+    double angle = atan2(m.b(), m.a());
+
+    // Remove rotation from matrix
+    m.rotate(rad2deg(-angle));
+
+    // Return results
+    sr[0] = sx;
+    sr[1] = sy;
+    sr[2] = angle;
+    sr[3] = m.a();
+    sr[4] = m.b();
+    sr[5] = m.c();
+    sr[6] = m.d();
+    sr[7] = m.e();
+    sr[8] = m.f();
+}
+
+static void affineTransformCompose(AffineTransform& m, const double sr[9])
+{
+    m.setA(sr[3]);
+    m.setB(sr[4]);
+    m.setC(sr[5]);
+    m.setD(sr[6]);
+    m.setE(sr[7]);
+    m.setF(sr[8]);
+    m.rotate(rad2deg(sr[2]));
+    m.scale(sr[0], sr[1]);
+}
+
+AffineTransform::AffineTransform()
+{
+    setMatrix(1, 0, 0, 1, 0, 0);
+}
+
+AffineTransform::AffineTransform(double a, double b, double c, double d, double e, double f)
+{
+    setMatrix(a, b, c, d, e, f);
+}
+
+void AffineTransform::reset()
+{
+    setMatrix(1, 0, 0, 1, 0, 0);
+}
+
+void AffineTransform::setMatrix(double a, double b, double c, double d, double e, double f)
+{
+    m_transform[0] = a;
+    m_transform[1] = b;
+    m_transform[2] = c;
+    m_transform[3] = d;
+    m_transform[4] = e;
+    m_transform[5] = f;
+}
+
+bool AffineTransform::isIdentity() const
+{
+    return (m_transform[0] == 1 && m_transform[1] == 0
+         && m_transform[2] == 0 && m_transform[3] == 1
+         && m_transform[4] == 0 && m_transform[5] == 0);
+}
+
+double AffineTransform::det() const
+{
+    return m_transform[0] * m_transform[3] - m_transform[1] * m_transform[2];
+}
+
+bool AffineTransform::isInvertible() const
+{
+    return det() != 0.0;
+}
+
+AffineTransform AffineTransform::inverse() const
+{
+    double determinant = det();
+    if (determinant == 0.0)
+        return AffineTransform();
+
+    AffineTransform result;
+    result.m_transform[0] = m_transform[3] / determinant;
+    result.m_transform[1] = -m_transform[1] / determinant;
+    result.m_transform[2] = -m_transform[2] / determinant;
+    result.m_transform[3] = m_transform[0] / determinant;
+    result.m_transform[4] = (m_transform[2] * m_transform[5]
+                           - m_transform[3] * m_transform[4]) / determinant;
+    result.m_transform[5] = (m_transform[1] * m_transform[4]
+                           - m_transform[0] * m_transform[5]) / determinant;
+
+    return result;
+}
+
+AffineTransform& AffineTransform::multiply(const AffineTransform& other)
+{
+    return (*this) *= other;
+}
+
+AffineTransform& AffineTransform::multLeft(const AffineTransform& other)
+{
+    AffineTransform trans;
+    
+    trans.m_transform[0] = other.m_transform[0] * m_transform[0] + other.m_transform[1] * m_transform[2];
+    trans.m_transform[1] = other.m_transform[0] * m_transform[1] + other.m_transform[1] * m_transform[3];
+    trans.m_transform[2] = other.m_transform[2] * m_transform[0] + other.m_transform[3] * m_transform[2];
+    trans.m_transform[3] = other.m_transform[2] * m_transform[1] + other.m_transform[3] * m_transform[3];
+    trans.m_transform[4] = other.m_transform[4] * m_transform[0] + other.m_transform[5] * m_transform[2] + m_transform[4];
+    trans.m_transform[5] = other.m_transform[4] * m_transform[1] + other.m_transform[5] * m_transform[3] + m_transform[5];
+
+    setMatrix(trans.m_transform);
+    return *this;
+}
+
+AffineTransform& AffineTransform::rotate(double a)
+{
+    // angle is in degree. Switch to radian
+    a = deg2rad(a);
+    double cosAngle = cos(a);
+    double sinAngle = sin(a);
+    AffineTransform rot(cosAngle, sinAngle, -sinAngle, cosAngle, 0, 0);
+
+    multLeft(rot);
+    return *this;
+}
+
+AffineTransform& AffineTransform::scale(double s)
+{
+    return scale(s, s);
+}
+
+AffineTransform& AffineTransform::scale(double sx, double sy)
+{
+    m_transform[0] *= sx;
+    m_transform[3] *= sy;
+    return *this;
+}
+
+AffineTransform& AffineTransform::translate(double tx, double ty)
+{
+    m_transform[4] += tx;
+    m_transform[5] += ty;
+    return *this;
+}
+
+AffineTransform& AffineTransform::scaleNonUniform(double sx, double sy)
+{
+    return scale(sx, sy);
+}
+
+AffineTransform& AffineTransform::rotateFromVector(double x, double y)
+{
+    return rotate(rad2deg(atan2(y, x)));
+}
+
+AffineTransform& AffineTransform::flipX()
+{
+    return scale(-1, 1);
+}
+
+AffineTransform& AffineTransform::flipY()
+{
+    return scale(1, -1);
+}
+
+AffineTransform& AffineTransform::shear(double sx, double sy)
+{
+    AffineTransform shear(1, sy, sx, 1, 0, 0);
+
+    multLeft(shear);
+    return *this;
+}
+
+AffineTransform& AffineTransform::skew(double angleX, double angleY)
+{
+    return shear(tan(deg2rad(angleX)), tan(deg2rad(angleY)));
+}
+
+AffineTransform& AffineTransform::skewX(double angle)
+{
+    return shear(tan(deg2rad(angle)), 0);
+}
+
+AffineTransform& AffineTransform::skewY(double angle)
+{
+    return shear(0, tan(deg2rad(angle)));
+}
+
+AffineTransform makeMapBetweenRects(const FloatRect& source, const FloatRect& dest)
+{
+    AffineTransform transform;
+    transform.translate(dest.x() - source.x(), dest.y() - source.y());
+    transform.scale(dest.width() / source.width(), dest.height() / source.height());
+    return transform;
+}
+
+void AffineTransform::map(double x, double y, double* x2, double* y2) const
+{
+    *x2 = (m_transform[0] * x + m_transform[2] * y + m_transform[4]);
+    *y2 = (m_transform[1] * x + m_transform[3] * y + m_transform[5]);
+}
+
+IntPoint AffineTransform::mapPoint(const IntPoint& point) const
+{
+    double x2, y2;
+    map(point.x(), point.y(), &x2, &y2);
+    
+    // Round the point.
+    return IntPoint(lround(x2), lround(y2));
+}
+
+FloatPoint AffineTransform::mapPoint(const FloatPoint& point) const
+{
+    double x2, y2;
+    map(point.x(), point.y(), &x2, &y2);
+
+    return FloatPoint(narrowPrecisionToFloat(x2), narrowPrecisionToFloat(y2));
+}
+
+FloatRect AffineTransform::mapRect(const FloatRect& rect) const
+{
+    FloatQuad q(rect);
+
+    FloatQuad result;
+    result.setP1(mapPoint(q.p1()));
+    result.setP2(mapPoint(q.p2()));
+    result.setP3(mapPoint(q.p3()));
+    result.setP4(mapPoint(q.p4()));
+    return result.boundingBox();
+}
+
+void AffineTransform::blend(const AffineTransform& from, double progress)
+{
+    double srA[9], srB[9];
+
+    affineTransformDecompose(from, srA);
+    affineTransformDecompose(*this, srB);
+
+    // If x-axis of one is flipped, and y-axis of the other, convert to an unflipped rotation.
+    if ((srA[0] < 0 && srB[1] < 0) || (srA[1] < 0 &&  srB[0] < 0)) {
+        srA[0] = -srA[0];
+        srA[1] = -srA[1];
+        srA[2] += srA[2] < 0 ? piDouble : -piDouble;
+    }
+
+    // Don't rotate the long way around.
+    srA[2] = fmod(srA[2], 2.0 * piDouble);
+    srB[2] = fmod(srB[2], 2.0 * piDouble);
+
+    if (fabs(srA[2] - srB[2]) > piDouble) {
+        if (srA[2] > srB[2])
+            srA[2] -= piDouble * 2.0;
+        else
+            srB[2] -= piDouble * 2.0;
+    }
+
+    for (int i = 0; i < 9; i++)
+        srA[i] = srA[i] + progress * (srB[i] - srA[i]);
+
+    affineTransformCompose(*this, srA);
+}
+
+TransformationMatrix AffineTransform::toTransformationMatrix() const
+{
+    return TransformationMatrix(m_transform[0], m_transform[1], m_transform[2],
+                                m_transform[3], m_transform[4], m_transform[5]);
+}
+
+}
diff --git a/WebCore/platform/graphics/transforms/AffineTransform.h b/WebCore/platform/graphics/transforms/AffineTransform.h
new file mode 100644
index 0000000..49add18
--- /dev/null
+++ b/WebCore/platform/graphics/transforms/AffineTransform.h
@@ -0,0 +1,170 @@
+/*
+ * Copyright (C) 2005, 2006 Apple Computer, Inc.  All rights reserved.
+ *               2010 Dirk Schulze <krit at webkit.org>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#ifndef AffineTransform_h
+#define AffineTransform_h
+
+#include "TransformationMatrix.h"
+
+#include <string.h> // for memcpy
+#include <wtf/FastAllocBase.h>
+
+#if PLATFORM(CG)
+#include <CoreGraphics/CGAffineTransform.h>
+#elif PLATFORM(CAIRO)
+#include <cairo.h>
+#elif PLATFORM(QT)
+#include <QTransform>
+#elif PLATFORM(SKIA)
+#include <SkMatrix.h>
+#elif PLATFORM(WX) && USE(WXGC)
+#include <wx/graphics.h>
+#endif
+
+namespace WebCore {
+
+class FloatPoint;
+class FloatQuad;
+class FloatRect;
+class IntPoint;
+class IntRect;
+
+class AffineTransform : public FastAllocBase {
+public:
+    typedef double Transform[6];
+
+    AffineTransform();
+    AffineTransform(double a, double b, double c, double d, double e, double f);
+
+    void setMatrix(double a, double b, double c, double d, double e, double f);
+
+    void map(double x, double y, double* x2, double* y2) const;
+
+    // Rounds the mapped point to the nearest integer value.
+    IntPoint mapPoint(const IntPoint&) const;
+
+    FloatPoint mapPoint(const FloatPoint&) const;
+
+    // Rounds the resulting mapped rectangle out. This is helpful for bounding
+    // box computations but may not be what is wanted in other contexts.
+    IntRect mapRect(const IntRect&) const;
+
+    FloatRect mapRect(const FloatRect&) const;
+
+    bool isIdentity() const;
+
+    double a() const { return m_transform[0]; }
+    void setA(double a) { m_transform[0] = a; }
+    double b() const { return m_transform[1]; }
+    void setB(double b) { m_transform[1] = b; }
+    double c() const { return m_transform[2]; }
+    void setC(double c) { m_transform[2] = c; }
+    double d() const { return m_transform[3]; }
+    void setD(double d) { m_transform[3] = d; }
+    double e() const { return m_transform[4]; }
+    void setE(double e) { m_transform[4] = e; }
+    double f() const { return m_transform[5]; }
+    void setF(double f) { m_transform[5] = f; }
+
+    void reset();
+
+    AffineTransform& multiply(const AffineTransform&);
+    AffineTransform& multLeft(const AffineTransform&);
+    AffineTransform& scale(double); 
+    AffineTransform& scale(double sx, double sy); 
+    AffineTransform& scaleNonUniform(double sx, double sy);
+    AffineTransform& rotate(double d);
+    AffineTransform& rotateFromVector(double x, double y);
+    AffineTransform& translate(double tx, double ty);
+    AffineTransform& shear(double sx, double sy);
+    AffineTransform& flipX();
+    AffineTransform& flipY();
+    AffineTransform& skew(double angleX, double angleY);
+    AffineTransform& skewX(double angle);
+    AffineTransform& skewY(double angle);
+ 
+    double det() const;
+    bool isInvertible() const;
+    AffineTransform inverse() const;
+
+    void blend(const AffineTransform& from, double progress);
+
+    TransformationMatrix toTransformationMatrix() const;
+
+    bool operator== (const AffineTransform& m2) const
+    {
+        return (m_transform[0] == m2.m_transform[0]
+             && m_transform[1] == m2.m_transform[1]
+             && m_transform[2] == m2.m_transform[2]
+             && m_transform[3] == m2.m_transform[3]
+             && m_transform[4] == m2.m_transform[4]
+             && m_transform[5] == m2.m_transform[5]);
+    }
+
+    bool operator!=(const AffineTransform& other) const { return !(*this == other); }
+
+    // *this = *this * t (i.e., a multRight)
+    AffineTransform& operator*=(const AffineTransform& t)
+    {
+        *this = *this * t;
+        return *this;
+    }
+    
+    // result = *this * t (i.e., a multRight)
+    AffineTransform operator*(const AffineTransform& t) const
+    {
+        AffineTransform result = t;
+        result.multLeft(*this);
+        return result;
+    }
+
+#if PLATFORM(CG)
+    operator CGAffineTransform() const;
+#elif PLATFORM(CAIRO)
+    operator cairo_matrix_t() const;
+#elif PLATFORM(QT)
+    operator QTransform() const;
+#elif PLATFORM(SKIA)
+    operator SkMatrix() const;
+#elif PLATFORM(WX) && USE(WXGC)
+    operator wxGraphicsMatrix() const;
+#endif
+
+private:
+    void setMatrix(const Transform m)
+    {
+        if (m && m != m_transform)
+            memcpy(m_transform, m, sizeof(Transform));
+    }
+
+    Transform m_transform;
+};
+
+AffineTransform makeMapBetweenRects(const FloatRect& source, const FloatRect& dest);
+
+}
+
+#endif
diff --git a/WebCore/platform/graphics/wince/GraphicsContextWince.cpp b/WebCore/platform/graphics/wince/GraphicsContextWince.cpp
index 0e387f5..410aeb1 100644
--- a/WebCore/platform/graphics/wince/GraphicsContextWince.cpp
+++ b/WebCore/platform/graphics/wince/GraphicsContextWince.cpp
@@ -21,6 +21,7 @@
 #include "config.h"
 #include "GraphicsContext.h"
 
+#include "AffineTransform.h"
 #include "CharacterNames.h"
 #include "GlyphBuffer.h"
 #include "Gradient.h"
@@ -1143,6 +1144,11 @@ void GraphicsContext::endTransparencyLayer()
     m_data->restore();
 }
 
+void GraphicsContext::concatCTM(const AffineTransform& transform)
+{
+    m_data->concatCTM(transform);
+}
+
 void GraphicsContext::concatCTM(const TransformationMatrix& transform)
 {
     m_data->concatCTM(transform);
@@ -1531,6 +1537,11 @@ void GraphicsContext::fillRect(const FloatRect& r, const Gradient* gradient)
     GradientFill(dc, tv.data(), tv.size(), mesh.data(), mesh.size(), vertical ? GRADIENT_FILL_RECT_V : GRADIENT_FILL_RECT_H);
 }
 
+AffineTransform GraphicsContext::getAffineCTM() const
+{
+    return m_data->m_transform;
+}
+
 TransformationMatrix GraphicsContext::getCTM() const
 {
     return m_data->m_transform;
diff --git a/WebCore/platform/graphics/wx/GraphicsContextWx.cpp b/WebCore/platform/graphics/wx/GraphicsContextWx.cpp
index 839bc59..e35334e 100644
--- a/WebCore/platform/graphics/wx/GraphicsContextWx.cpp
+++ b/WebCore/platform/graphics/wx/GraphicsContextWx.cpp
@@ -26,6 +26,7 @@
 #include "config.h"
 #include "GraphicsContext.h"
 
+#include "AffineTransform.h"
 #include "TransformationMatrix.h"
 #include "FloatRect.h"
 #include "Font.h"
@@ -359,6 +360,12 @@ void GraphicsContext::clipToImageBuffer(const FloatRect&, const ImageBuffer*)
     notImplemented();
 }
 
+AffineTransform GraphicsContext::getAffineCTM() const
+{ 
+    notImplemented();
+    return AffineTransform();
+}
+
 TransformationMatrix GraphicsContext::getCTM() const
 { 
     notImplemented();
@@ -471,6 +478,15 @@ void GraphicsContext::setPlatformFillColor(const Color& color, ColorSpace colorS
         m_data->context->SetBrush(wxBrush(color));
 }
 
+void GraphicsContext::concatCTM(const AffineTransform& transform)
+{
+    if (paintingDisabled())
+        return;
+
+    notImplemented();
+    return;
+}
+
 void GraphicsContext::concatCTM(const TransformationMatrix& transform)
 {
     if (paintingDisabled())
diff --git a/WebCore/platform/graphics/wx/PathWx.cpp b/WebCore/platform/graphics/wx/PathWx.cpp
index cebc05a..21693c9 100644
--- a/WebCore/platform/graphics/wx/PathWx.cpp
+++ b/WebCore/platform/graphics/wx/PathWx.cpp
@@ -26,6 +26,7 @@
 #include "config.h"
 #include "Path.h"
 
+#include "AffineTransform.h"
 #include "TransformationMatrix.h"
 #include "FloatPoint.h"
 #include "FloatRect.h"
@@ -202,6 +203,14 @@ void Path::addEllipse(const FloatRect& rect)
 #endif
 }
 
+void Path::transform(const AffineTransform& transform) 
+{
+#if USE(WXGC)
+    if (m_path)
+        m_path->Transform(transform);
+#endif
+}
+
 void Path::transform(const TransformationMatrix& transform) 
 {
 #if USE(WXGC)
diff --git a/WebCore/platform/graphics/wx/TransformationMatrixWx.cpp b/WebCore/platform/graphics/wx/TransformationMatrixWx.cpp
index 9684a3c..1937986 100644
--- a/WebCore/platform/graphics/wx/TransformationMatrixWx.cpp
+++ b/WebCore/platform/graphics/wx/TransformationMatrixWx.cpp
@@ -24,6 +24,7 @@
  */
 
 #include "config.h"
+#include "AffineTransform.h"
 #include "TransformationMatrix.h"
 
 #include "Assertions.h"
@@ -45,6 +46,15 @@ TransformationMatrix::operator wxGraphicsMatrix() const
     wxGraphicsMatrix matrix = renderer->CreateMatrix(a(), b(), c(), d(), e(), f());
     return matrix;
 }
+
+AffineTransform::operator wxGraphicsMatrix() const
+{
+    wxGraphicsRenderer* renderer = wxGraphicsRenderer::GetDefaultRenderer();
+    ASSERT(renderer);
+    
+    wxGraphicsMatrix matrix = renderer->CreateMatrix(a(), b(), c(), d(), e(), f());
+    return matrix;
+}
 #endif
 
 }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list