Commit 0cf2dc9d authored by dino@apple.com's avatar dino@apple.com

2009-01-05 Dean Jackson <dino@apple.com>

        Reviewed by Darin Adler.

        Rename AffineTransform to TransformationMatrix in
        preparation for future enhancements (non-affine matrices)

        https://bugs.webkit.org/show_bug.cgi?id=22943

        * GNUmakefile.am:
        * WebCore.pro:
        * WebCore.scons:
        * WebCore.vcproj/WebCore.vcproj:
        * WebCore.xcodeproj/project.pbxproj:
        * WebCoreSources.bkl:
        * platform/graphics/transforms/AffineTransform.cpp: Removed.
        * platform/graphics/transforms/AffineTransform.h: Removed.
        * platform/graphics/transforms/TransformationMatrix.cpp: Copied from WebCore/platform/graphics/transforms/AffineTransform.cpp.
        * platform/graphics/transforms/TransformationMatrix.h: Copied from WebCore/platform/graphics/transforms/AffineTransform.h.
        * lots of other files with s/AffineTransform/TransformationMatrix/g



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@39635 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 563bd1f6
2009-01-05 Dean Jackson <dino@apple.com>
Reviewed by Darin Adler.
Rename AffineTransform to TransformationMatrix in
preparation for future enhancements (non-affine matrices)
https://bugs.webkit.org/show_bug.cgi?id=22943
* GNUmakefile.am:
* WebCore.pro:
* WebCore.scons:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.xcodeproj/project.pbxproj:
* WebCoreSources.bkl:
* platform/graphics/transforms/AffineTransform.cpp: Removed.
* platform/graphics/transforms/AffineTransform.h: Removed.
* platform/graphics/transforms/TransformationMatrix.cpp: Copied from WebCore/platform/graphics/transforms/AffineTransform.cpp.
* platform/graphics/transforms/TransformationMatrix.h: Copied from WebCore/platform/graphics/transforms/AffineTransform.h.
* lots of other files with s/AffineTransform/TransformationMatrix/g
2008-01-05 Dean Jackson <dino@apple.com>
Reviewed by David Hyatt.
......@@ -1334,8 +1334,8 @@ webcore_sources += \
WebCore/platform/graphics/filters/FEColorMatrix.h \
WebCore/platform/graphics/filters/FEComponentTransfer.h \
WebCore/platform/graphics/filters/FEComposite.h \
WebCore/platform/graphics/transforms/AffineTransform.cpp \
WebCore/platform/graphics/transforms/AffineTransform.h \
WebCore/platform/graphics/transforms/TransformationMatrix.cpp \
WebCore/platform/graphics/transforms/TransformationMatrix.h \
WebCore/platform/graphics/transforms/IdentityTransformOperation.h \
WebCore/platform/graphics/transforms/MatrixTransformOperation.cpp \
WebCore/platform/graphics/transforms/MatrixTransformOperation.h \
......
......@@ -879,7 +879,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/RotateTransformOperation.cpp \
platform/graphics/transforms/ScaleTransformOperation.cpp \
......
......@@ -724,7 +724,7 @@ sources['platform/sql'] = [
'platform/sql/SQLValue.cpp'
]
sources['platform/graphics'] = [
'platform/graphics/AffineTransform.cpp',
'platform/graphics/TransformationMatrix.cpp',
'platform/graphics/BitmapImage.cpp',
'platform/graphics/Color.cpp',
'platform/graphics/FloatPoint.cpp',
......
......@@ -5408,11 +5408,11 @@
Name="transforms"
>
<File
RelativePath="..\platform\graphics\transforms\AffineTransform.cpp"
RelativePath="..\platform\graphics\transforms\TransformationMatrix.cpp"
>
</File>
<File
RelativePath="..\platform\graphics\transforms\AffineTransform.h"
RelativePath="..\platform\graphics\transforms\TransformationMatrix.h"
>
</File>
<File
......
......@@ -593,8 +593,8 @@
46F9D5DD0B0D60170028EE36 /* aliasCursor.png in Resources */ = {isa = PBXBuildFile; fileRef = 46F9D5DA0B0D60170028EE36 /* aliasCursor.png */; };
46F9D5DE0B0D60170028EE36 /* noDropCursor.png in Resources */ = {isa = PBXBuildFile; fileRef = 46F9D5DB0B0D60170028EE36 /* noDropCursor.png */; };
46F9D5DF0B0D60170028EE36 /* progressCursor.png in Resources */ = {isa = PBXBuildFile; fileRef = 46F9D5DC0B0D60170028EE36 /* progressCursor.png */; };
49E911C30EF86D47009D0CAF /* AffineTransform.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49E911B30EF86D47009D0CAF /* AffineTransform.cpp */; };
49E911C40EF86D47009D0CAF /* AffineTransform.h in Headers */ = {isa = PBXBuildFile; fileRef = 49E911B40EF86D47009D0CAF /* AffineTransform.h */; settings = {ATTRIBUTES = (Private, ); }; };
49E911C30EF86D47009D0CAF /* TransformationMatrix.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49E911B30EF86D47009D0CAF /* TransformationMatrix.cpp */; };
49E911C40EF86D47009D0CAF /* TransformationMatrix.h in Headers */ = {isa = PBXBuildFile; fileRef = 49E911B40EF86D47009D0CAF /* TransformationMatrix.h */; settings = {ATTRIBUTES = (Private, ); }; };
49E911C50EF86D47009D0CAF /* IdentityTransformOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = 49E911B50EF86D47009D0CAF /* IdentityTransformOperation.h */; };
49E911C60EF86D47009D0CAF /* MatrixTransformOperation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49E911B60EF86D47009D0CAF /* MatrixTransformOperation.cpp */; };
49E911C70EF86D47009D0CAF /* MatrixTransformOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = 49E911B70EF86D47009D0CAF /* MatrixTransformOperation.h */; };
......@@ -5443,8 +5443,8 @@
46F9D5DA0B0D60170028EE36 /* aliasCursor.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = aliasCursor.png; sourceTree = "<group>"; };
46F9D5DB0B0D60170028EE36 /* noDropCursor.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = noDropCursor.png; sourceTree = "<group>"; };
46F9D5DC0B0D60170028EE36 /* progressCursor.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = progressCursor.png; sourceTree = "<group>"; };
49E911B30EF86D47009D0CAF /* AffineTransform.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AffineTransform.cpp; path = transforms/AffineTransform.cpp; sourceTree = "<group>"; };
49E911B40EF86D47009D0CAF /* AffineTransform.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AffineTransform.h; path = transforms/AffineTransform.h; sourceTree = "<group>"; };
49E911B30EF86D47009D0CAF /* TransformationMatrix.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TransformationMatrix.cpp; path = transforms/TransformationMatrix.cpp; sourceTree = "<group>"; };
49E911B40EF86D47009D0CAF /* TransformationMatrix.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TransformationMatrix.h; path = transforms/TransformationMatrix.h; sourceTree = "<group>"; };
49E911B50EF86D47009D0CAF /* IdentityTransformOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IdentityTransformOperation.h; path = transforms/IdentityTransformOperation.h; sourceTree = "<group>"; };
49E911B60EF86D47009D0CAF /* MatrixTransformOperation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MatrixTransformOperation.cpp; path = transforms/MatrixTransformOperation.cpp; sourceTree = "<group>"; };
49E911B70EF86D47009D0CAF /* MatrixTransformOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MatrixTransformOperation.h; path = transforms/MatrixTransformOperation.h; sourceTree = "<group>"; };
......@@ -9583,8 +9583,8 @@
49E911B20EF86D27009D0CAF /* transforms */ = {
isa = PBXGroup;
children = (
49E911B30EF86D47009D0CAF /* AffineTransform.cpp */,
49E911B40EF86D47009D0CAF /* AffineTransform.h */,
49E911B30EF86D47009D0CAF /* TransformationMatrix.cpp */,
49E911B40EF86D47009D0CAF /* TransformationMatrix.h */,
49E911B50EF86D47009D0CAF /* IdentityTransformOperation.h */,
49E911B60EF86D47009D0CAF /* MatrixTransformOperation.cpp */,
49E911B70EF86D47009D0CAF /* MatrixTransformOperation.h */,
......@@ -14323,7 +14323,7 @@
29AAC51F0E53963B008F9B3B /* AccessibilityTableHeaderContainer.h in Headers */,
29800C950E524C8B00025536 /* AccessibilityTableRow.h in Headers */,
E1C4DE690EA75C1E0023CCD6 /* ActiveDOMObject.h in Headers */,
49E911C40EF86D47009D0CAF /* AffineTransform.h in Headers */,
49E911C40EF86D47009D0CAF /* TransformationMatrix.h in Headers */,
49E912AB0EFAC906009D0CAF /* Animation.h in Headers */,
316FE1120E6E1DA700BF6088 /* AnimationBase.h in Headers */,
316FE1140E6E1DA700BF6088 /* AnimationController.h in Headers */,
......@@ -16771,7 +16771,7 @@
29AAC5200E53963B008F9B3B /* AccessibilityTableHeaderContainer.cpp in Sources */,
29800C960E524C8B00025536 /* AccessibilityTableRow.cpp in Sources */,
E1C4DE6E0EA75C650023CCD6 /* ActiveDOMObject.cpp in Sources */,
49E911C30EF86D47009D0CAF /* AffineTransform.cpp in Sources */,
49E911C30EF86D47009D0CAF /* TransformationMatrix.cpp in Sources */,
B27535580B053814002CE64F /* AffineTransformCG.cpp in Sources */,
49E912AA0EFAC906009D0CAF /* Animation.cpp in Sources */,
316FE1110E6E1DA700BF6088 /* AnimationBase.cpp in Sources */,
......@@ -763,7 +763,7 @@ This file contains the list of files needed to build WebCore.
platform/graphics/PathTraversalState.cpp
platform/graphics/Pattern.cpp
platform/graphics/Pen.cpp
platform/graphics/transforms/AffineTransform.cpp
platform/graphics/transforms/TransformationMatrix.cpp
platform/graphics/transforms/MatrixTransformOperation.cpp
platform/graphics/transforms/RotateTransformOperation.cpp
platform/graphics/transforms/ScaleTransformOperation.cpp
......
......@@ -22,7 +22,7 @@
#if ENABLE(SVG)
#include "JSSVGMatrix.h"
#include "AffineTransform.h"
#include "TransformationMatrix.h"
#include "SVGException.h"
using namespace JSC;
......@@ -31,16 +31,16 @@ namespace WebCore {
JSValue* JSSVGMatrix::multiply(ExecState* exec, const ArgList& args)
{
AffineTransform imp(*impl());
TransformationMatrix imp(*impl());
AffineTransform secondMatrix = toSVGMatrix(args.at(exec, 0));
return toJS(exec, JSSVGStaticPODTypeWrapper<AffineTransform>::create(imp.multiply(secondMatrix)).get(), m_context.get());
TransformationMatrix secondMatrix = toSVGMatrix(args.at(exec, 0));
return toJS(exec, JSSVGStaticPODTypeWrapper<TransformationMatrix>::create(imp.multiply(secondMatrix)).get(), m_context.get());
}
JSValue* JSSVGMatrix::inverse(ExecState* exec, const ArgList&)
{
AffineTransform imp(*impl());
JSC::JSValue* result = toJS(exec, JSSVGStaticPODTypeWrapper<AffineTransform>::create(imp.inverse()).get(), m_context.get());
TransformationMatrix imp(*impl());
JSC::JSValue* result = toJS(exec, JSSVGStaticPODTypeWrapper<TransformationMatrix>::create(imp.inverse()).get(), m_context.get());
if (!imp.isInvertible())
setDOMException(exec, SVGException::SVG_MATRIX_NOT_INVERTABLE);
......@@ -50,48 +50,48 @@ JSValue* JSSVGMatrix::inverse(ExecState* exec, const ArgList&)
JSValue* JSSVGMatrix::translate(ExecState* exec, const ArgList& args)
{
AffineTransform imp(*impl());
TransformationMatrix imp(*impl());
float x = args.at(exec, 0)->toFloat(exec);
float y = args.at(exec, 1)->toFloat(exec);
return toJS(exec, JSSVGStaticPODTypeWrapper<AffineTransform>::create(imp.translate(x, y)).get(), m_context.get());
return toJS(exec, JSSVGStaticPODTypeWrapper<TransformationMatrix>::create(imp.translate(x, y)).get(), m_context.get());
}
JSValue* JSSVGMatrix::scale(ExecState* exec, const ArgList& args)
{
AffineTransform imp(*impl());
TransformationMatrix imp(*impl());
float scaleFactor = args.at(exec, 0)->toFloat(exec);
return toJS(exec, JSSVGStaticPODTypeWrapper<AffineTransform>::create(imp.scale(scaleFactor)).get(), m_context.get());
return toJS(exec, JSSVGStaticPODTypeWrapper<TransformationMatrix>::create(imp.scale(scaleFactor)).get(), m_context.get());
}
JSValue* JSSVGMatrix::scaleNonUniform(ExecState* exec, const ArgList& args)
{
AffineTransform imp(*impl());
TransformationMatrix imp(*impl());
float scaleFactorX = args.at(exec, 0)->toFloat(exec);
float scaleFactorY = args.at(exec, 1)->toFloat(exec);
return toJS(exec, JSSVGStaticPODTypeWrapper<AffineTransform>::create(imp.scaleNonUniform(scaleFactorX, scaleFactorY)).get(), m_context.get());
return toJS(exec, JSSVGStaticPODTypeWrapper<TransformationMatrix>::create(imp.scaleNonUniform(scaleFactorX, scaleFactorY)).get(), m_context.get());
}
JSValue* JSSVGMatrix::rotate(ExecState* exec, const ArgList& args)
{
AffineTransform imp(*impl());
TransformationMatrix imp(*impl());
float angle = args.at(exec, 0)->toFloat(exec);
return toJS(exec, JSSVGStaticPODTypeWrapper<AffineTransform>::create(imp.rotate(angle)).get(), m_context.get());
return toJS(exec, JSSVGStaticPODTypeWrapper<TransformationMatrix>::create(imp.rotate(angle)).get(), m_context.get());
}
JSValue* JSSVGMatrix::rotateFromVector(ExecState* exec, const ArgList& args)
{
AffineTransform imp(*impl());
TransformationMatrix imp(*impl());
float x = args.at(exec, 0)->toFloat(exec);
float y = args.at(exec, 1)->toFloat(exec);
JSC::JSValue* result = toJS(exec, JSSVGStaticPODTypeWrapper<AffineTransform>::create(imp.rotateFromVector(x, y)).get(), m_context.get());
JSC::JSValue* result = toJS(exec, JSSVGStaticPODTypeWrapper<TransformationMatrix>::create(imp.rotateFromVector(x, y)).get(), m_context.get());
if (x == 0.0 || y == 0.0)
setDOMException(exec, SVGException::SVG_INVALID_VALUE_ERR);
......@@ -101,30 +101,30 @@ JSValue* JSSVGMatrix::rotateFromVector(ExecState* exec, const ArgList& args)
JSValue* JSSVGMatrix::flipX(ExecState* exec, const ArgList&)
{
AffineTransform imp(*impl());
return toJS(exec, JSSVGStaticPODTypeWrapper<AffineTransform>::create(imp.flipX()).get(), m_context.get());
TransformationMatrix imp(*impl());
return toJS(exec, JSSVGStaticPODTypeWrapper<TransformationMatrix>::create(imp.flipX()).get(), m_context.get());
}
JSValue* JSSVGMatrix::flipY(ExecState* exec, const ArgList&)
{
AffineTransform imp(*impl());
return toJS(exec, JSSVGStaticPODTypeWrapper<AffineTransform>::create(imp.flipY()).get(), m_context.get());
TransformationMatrix imp(*impl());
return toJS(exec, JSSVGStaticPODTypeWrapper<TransformationMatrix>::create(imp.flipY()).get(), m_context.get());
}
JSValue* JSSVGMatrix::skewX(ExecState* exec, const ArgList& args)
{
AffineTransform imp(*impl());
TransformationMatrix imp(*impl());
float angle = args.at(exec, 0)->toFloat(exec);
return toJS(exec, JSSVGStaticPODTypeWrapper<AffineTransform>::create(imp.skewX(angle)).get(), m_context.get());
return toJS(exec, JSSVGStaticPODTypeWrapper<TransformationMatrix>::create(imp.skewX(angle)).get(), m_context.get());
}
JSValue* JSSVGMatrix::skewY(ExecState* exec, const ArgList& args)
{
AffineTransform imp(*impl());
TransformationMatrix imp(*impl());
float angle = args.at(exec, 0)->toFloat(exec);
return toJS(exec, JSSVGStaticPODTypeWrapper<AffineTransform>::create(imp.skewY(angle)).get(), m_context.get());
return toJS(exec, JSSVGStaticPODTypeWrapper<TransformationMatrix>::create(imp.skewY(angle)).get(), m_context.get());
}
}
......
......@@ -44,13 +44,13 @@ public:
};
// This file contains JS wrapper objects for SVG datatypes, that are passed around by value
// in WebCore/svg (aka. 'POD types'). For instance SVGMatrix is mapped to AffineTransform, and
// in WebCore/svg (aka. 'POD types'). For instance SVGMatrix is mapped to TransformationMatrix, and
// passed around as const reference. SVG DOM demands these objects to be "live", changes to any
// of the writable attributes of SVGMatrix need to be reflected in the object which exposed the
// SVGMatrix object (ie. 'someElement.transform.matrix.a = 50.0', in that case 'SVGTransform').
// The SVGTransform class stores its "AffineTransform m_matrix" object on the stack. If it would
// The SVGTransform class stores its "TransformationMatrix m_matrix" object on the stack. If it would
// be stored as pointer we could just build an auto-generated JSSVG* wrapper object around it
// and all changes to that object would automatically affect the AffineTransform* object stored
// and all changes to that object would automatically affect the TransformationMatrix* object stored
// in the SVGTransform object. For the sake of efficiency and memory we don't pass around any
// primitive values as pointers, so a custom JS wrapper object is needed for all SVG types, that
// are internally represented by POD types (SVGRect <-> FloatRect, SVGPoint <-> FloatPoint, ...).
......
......@@ -299,7 +299,7 @@ namespace WebCore {
class NodeFilter;
#if ENABLE(SVG)
class AffineTransform;
class TransformationMatrix;
class FloatPoint;
class FloatRect;
#endif // ENABLE(SVG)
......
......@@ -1545,7 +1545,7 @@ my %nativeType = (
"EventTarget" => "EventTargetNode*",
"NodeFilter" => "RefPtr<NodeFilter>",
"SVGLength" => "SVGLength",
"SVGMatrix" => "AffineTransform",
"SVGMatrix" => "TransformationMatrix",
"SVGNumber" => "float",
"SVGPaintType" => "SVGPaint::SVGPaintType",
"SVGPoint" => "FloatPoint",
......
......@@ -647,7 +647,7 @@ sub AddIncludesForType
}
if ($type eq "SVGMatrix") {
$implIncludes{"AffineTransform.h"} = 1;
$implIncludes{"TransformationMatrix.h"} = 1;
$implIncludes{"DOM$type.h"} = 1;
$implIncludes{"SVGException.h"} = 1;
return;
......@@ -1444,8 +1444,8 @@ sub GenerateImplementation
}
# FIXME! We need [Custom] support for ObjC, to move these hacks into DOMSVGLength/MatrixCustom.mm
my $svgMatrixRotateFromVector = ($podType and $podType eq "AffineTransform" and $functionName eq "rotateFromVector");
my $svgMatrixInverse = ($podType and $podType eq "AffineTransform" and $functionName eq "inverse");
my $svgMatrixRotateFromVector = ($podType and $podType eq "TransformationMatrix" and $functionName eq "rotateFromVector");
my $svgMatrixInverse = ($podType and $podType eq "TransformationMatrix" and $functionName eq "inverse");
my $svgLengthConvertToSpecifiedUnits = ($podType and $podType eq "SVGLength" and $functionName eq "convertToSpecifiedUnits");
push(@parameterNames, "ec") if $raisesExceptions and !($svgMatrixRotateFromVector || $svgMatrixInverse);
......
......@@ -405,7 +405,7 @@ static PassRefPtr<CSSValue> computedTransform(RenderObject* renderer)
IntRect box = sizingBox(renderer);
AffineTransform transform;
TransformationMatrix transform;
renderer->style()->applyTransform(transform, box.size(), false);
RefPtr<WebKitCSSTransformValue> transformVal = WebKitCSSTransformValue::create(WebKitCSSTransformValue::MatrixTransformOperation);
......
......@@ -30,7 +30,7 @@
#include "config.h"
#include "CanvasRenderingContext2D.h"
#include "AffineTransform.h"
#include "TransformationMatrix.h"
#include "CSSParser.h"
#include "CachedImage.h"
#include "CanvasGradient.h"
......@@ -356,7 +356,7 @@ void CanvasRenderingContext2D::scale(float sx, float sy)
if (!state().m_invertibleCTM)
return;
AffineTransform newTransform = state().m_transform;
TransformationMatrix newTransform = state().m_transform;
newTransform.scale(sx, sy);
if (!newTransform.isInvertible()) {
state().m_invertibleCTM = false;
......@@ -365,7 +365,7 @@ void CanvasRenderingContext2D::scale(float sx, float sy)
state().m_transform = newTransform;
c->scale(FloatSize(sx, sy));
m_path.transform(AffineTransform().scale(1.0/sx, 1.0/sy));
m_path.transform(TransformationMatrix().scale(1.0/sx, 1.0/sy));
}
void CanvasRenderingContext2D::rotate(float angleInRadians)
......@@ -376,7 +376,7 @@ void CanvasRenderingContext2D::rotate(float angleInRadians)
if (!state().m_invertibleCTM)
return;
AffineTransform newTransform = state().m_transform;
TransformationMatrix newTransform = state().m_transform;
newTransform.rotate(angleInRadians / piDouble * 180.0);
if (!newTransform.isInvertible()) {
state().m_invertibleCTM = false;
......@@ -385,7 +385,7 @@ void CanvasRenderingContext2D::rotate(float angleInRadians)
state().m_transform = newTransform;
c->rotate(angleInRadians);
m_path.transform(AffineTransform().rotate(-angleInRadians / piDouble * 180.0));
m_path.transform(TransformationMatrix().rotate(-angleInRadians / piDouble * 180.0));
}
void CanvasRenderingContext2D::translate(float tx, float ty)
......@@ -396,7 +396,7 @@ void CanvasRenderingContext2D::translate(float tx, float ty)
if (!state().m_invertibleCTM)
return;
AffineTransform newTransform = state().m_transform;
TransformationMatrix newTransform = state().m_transform;
newTransform.translate(tx, ty);
if (!newTransform.isInvertible()) {
state().m_invertibleCTM = false;
......@@ -405,7 +405,7 @@ void CanvasRenderingContext2D::translate(float tx, float ty)
state().m_transform = newTransform;
c->translate(tx, ty);
m_path.transform(AffineTransform().translate(-tx, -ty));
m_path.transform(TransformationMatrix().translate(-tx, -ty));
}
void CanvasRenderingContext2D::transform(float m11, float m12, float m21, float m22, float dx, float dy)
......@@ -421,9 +421,9 @@ void CanvasRenderingContext2D::transform(float m11, float m12, float m21, float
!isfinite(m12) | !isfinite(m22) | !isfinite(dy))
return;
AffineTransform transform(m11, m12, m21, m22, dx, dy);
TransformationMatrix transform(m11, m12, m21, m22, dx, dy);
AffineTransform newTransform = state().m_transform;
TransformationMatrix newTransform = state().m_transform;
newTransform.multiply(transform);
if (!newTransform.isInvertible()) {
state().m_invertibleCTM = false;
......@@ -446,7 +446,7 @@ void CanvasRenderingContext2D::setTransform(float m11, float m12, float m21, flo
!isfinite(m12) | !isfinite(m22) | !isfinite(dy))
return;
AffineTransform ctm = state().m_transform;
TransformationMatrix ctm = state().m_transform;
if (!ctm.isInvertible())
return;
c->concatCTM(c->getCTM().inverse());
......@@ -696,7 +696,7 @@ bool CanvasRenderingContext2D::isPointInPath(const float x, const float y)
return false;
FloatPoint point(x, y);
AffineTransform ctm = state().m_transform;
TransformationMatrix ctm = state().m_transform;
FloatPoint transformedPoint = ctm.inverse().mapPoint(point);
return m_path.contains(transformedPoint);
}
......@@ -1144,7 +1144,7 @@ void CanvasRenderingContext2D::willDraw(const FloatRect& r, unsigned options)
FloatRect dirtyRect = r;
if (options & CanvasWillDrawApplyTransform) {
AffineTransform ctm = state().m_transform;
TransformationMatrix ctm = state().m_transform;
dirtyRect = ctm.mapRect(r);
}
......
......@@ -26,7 +26,7 @@
#ifndef CanvasRenderingContext2D_h
#define CanvasRenderingContext2D_h
#include "AffineTransform.h"
#include "TransformationMatrix.h"
#include "FloatSize.h"
#include "Font.h"
#include "GraphicsTypes.h"
......@@ -212,7 +212,7 @@ namespace WebCore {
String m_shadowColor;
float m_globalAlpha;
CompositeOperator m_globalComposite;
AffineTransform m_transform;
TransformationMatrix m_transform;
bool m_invertibleCTM;
// Text state.
......
......@@ -273,12 +273,12 @@ ImageBuffer* HTMLCanvasElement::buffer() const
return m_imageBuffer.get();
}
AffineTransform HTMLCanvasElement::baseTransform() const
TransformationMatrix HTMLCanvasElement::baseTransform() const
{
ASSERT(m_createdImageBuffer);
FloatSize unscaledSize(width(), height());
IntSize size = convertLogicalToDevice(unscaledSize);
AffineTransform transform;
TransformationMatrix transform;
if (size.width() && size.height())
transform.scale(size.width() / unscaledSize.width(), size.height() / unscaledSize.height());
transform.multiply(m_imageBuffer->baseTransform());
......
......@@ -27,7 +27,7 @@
#ifndef HTMLCanvasElement_h
#define HTMLCanvasElement_h
#include "AffineTransform.h"
#include "TransformationMatrix.h"
#include "FloatRect.h"
#include "HTMLElement.h"
#include "IntSize.h"
......@@ -106,7 +106,7 @@ public:
void setObserver(CanvasObserver* o) { m_observer = o; }
AffineTransform baseTransform() const;
TransformationMatrix baseTransform() const;
private:
void createImageBuffer() const;
void reset();
......
......@@ -130,8 +130,8 @@ static inline TransformOperations blendFunc(const AnimationBase* anim, const Tra
} else {
// Convert the TransformOperations into matrices
IntSize size = anim->renderer()->borderBox().size();
AffineTransform fromT;
AffineTransform toT;
TransformationMatrix fromT;
TransformationMatrix toT;
from.apply(size, fromT);
to.apply(size, toT);
......
......@@ -45,7 +45,7 @@ static void drawRectIntoContext(IntRect rect, FrameView* view, GraphicsContext*
rect.move(-offset.width(), -offset.height());
rect = view->convertToContainingWindow(rect);
gc->concatCTM(AffineTransform().translate(-rect.x(), -rect.y()));
gc->concatCTM(TransformationMatrix().translate(-rect.x(), -rect.y()));
view->paint(gc, rect);
}
......
......@@ -27,7 +27,7 @@
#include "runtime.h"
#include "FrameWin.h"
#include "AffineTransform.h"
#include "TransformationMatrix.h"
#include "FloatRect.h"
#include "Document.h"
#include "FramePrivate.h"
......
......@@ -155,7 +155,7 @@ protected:
#endif
virtual void draw(GraphicsContext*, const FloatRect& dstRect, const FloatRect& srcRect, CompositeOperator);
#if PLATFORM(QT) || PLATFORM(WX)
virtual void drawPattern(GraphicsContext*, const FloatRect& srcRect, const AffineTransform& patternTransform,
virtual void drawPattern(GraphicsContext*, const FloatRect& srcRect, const TransformationMatrix& patternTransform,
const FloatPoint& phase, CompositeOperator, const FloatRect& destRect);
#endif
size_t currentFrame() const { return m_currentFrame; }
......
......@@ -27,7 +27,7 @@
#include "config.h"
#include "FloatPoint.h"
#include "AffineTransform.h"
#include "TransformationMatrix.h"
#include "FloatConversion.h"
#include "IntPoint.h"
......@@ -37,7 +37,7 @@ FloatPoint::FloatPoint(const IntPoint& p) : m_x(p.x()), m_y(p.y())
{
}
FloatPoint FloatPoint::matrixTransform(const AffineTransform& transform) const
FloatPoint FloatPoint::matrixTransform(const TransformationMatrix& transform) const
{
double newX, newY;
transform.map(static_cast<double>(m_x), static_cast<double>(m_y), &newX, &newY);
......
......@@ -61,7 +61,7 @@ struct SkPoint;
namespace WebCore {
class AffineTransform;
class TransformationMatrix;
class IntPoint;
class FloatPoint {
......@@ -104,7 +104,7 @@ public:
FloatPoint(const SkPoint&);
#endif
FloatPoint matrixTransform(const AffineTransform&) const;
FloatPoint matrixTransform(const TransformationMatrix&) const;
private:
float m_x, m_y;
......
......@@ -47,7 +47,7 @@ void GeneratedImage::draw(GraphicsContext* context, const FloatRect& dstRect, co
context->restore();
}
void GeneratedImage::drawPattern(GraphicsContext* context, const FloatRect& srcRect, const AffineTransform& patternTransform,
void GeneratedImage::drawPattern(GraphicsContext* context, const FloatRect& srcRect, const TransformationMatrix& patternTransform,
const FloatPoint& phase, CompositeOperator compositeOp, const FloatRect& destRect)
{
// Create a BitmapImage and call drawPattern on it.
......