+2006-08-22 Rob Buis <buis@kde.org>
+
+ Reviewed by Eric.
+
+ http://bugzilla.opendarwin.org/show_bug.cgi?id=10491
+ KCanvasMatrix removal
+
+ Remove KCanvasMatrix from project, using AffineTransform instead.
+
+ * WebCore.xcodeproj/project.pbxproj:
+ * kcanvas/KCanvasMatrix.cpp: Removed.
+ * kcanvas/KCanvasMatrix.h: Removed.
+ * kcanvas/KCanvasResources.cpp:
+ (WebCore::KCanvasMarker::draw):
+ * kcanvas/KCanvasResources.h:
+ * kcanvas/RenderForeignObject.cpp:
+ * kcanvas/RenderPath.h:
+ * kcanvas/RenderSVGContainer.cpp:
+ (WebCore::RenderSVGContainer::viewportTransform):
+ (WebCore::RenderSVGContainer::getAspectRatio):
+ * kcanvas/RenderSVGContainer.h:
+ * kcanvas/RenderSVGText.cpp:
+ * kcanvas/device/KRenderingDevice.h:
+ * kcanvas/device/KRenderingPaintServerGradient.cpp:
+ (WebCore::KRenderingPaintServerGradient::gradientTransform):
+ (WebCore::KRenderingPaintServerGradient::setGradientTransform):
+ (WebCore::KRenderingPaintServerGradient::externalRepresentation):
+ * kcanvas/device/KRenderingPaintServerGradient.h:
+ * kcanvas/device/KRenderingPaintServerPattern.cpp:
+ (WebCore::KRenderingPaintServerPattern::patternTransform):
+ (WebCore::KRenderingPaintServerPattern::setPatternTransform):
+ (WebCore::KRenderingPaintServerPattern::externalRepresentation):
+ * kcanvas/device/KRenderingPaintServerPattern.h:
+ * kcanvas/device/quartz/KCanvasFilterQuartz.mm:
+ * kcanvas/device/quartz/KCanvasItemQuartz.mm:
+ * kcanvas/device/quartz/KRenderingDeviceQuartz.h:
+ * kcanvas/device/quartz/KRenderingDeviceQuartz.mm:
+ (WebCore::KRenderingDeviceContextQuartz::concatCTM):
+ (WebCore::KRenderingDeviceContextQuartz::ctm):
+ * kcanvas/device/quartz/KRenderingPaintServerGradientQuartz.mm:
+ (WebCore::KRenderingPaintServerGradientQuartz::renderPath):
+ * kcanvas/device/quartz/KRenderingPaintServerQuartz.mm:
+ (WebCore::KRenderingPaintServerPatternQuartz::setup):
+ * kcanvas/device/quartz/QuartzSupport.mm:
+ * ksvg2/misc/KCanvasRenderingStyle.h:
+ * ksvg2/svg/SVGAnimateTransformElement.cpp:
+ * ksvg2/svg/SVGAnimateTransformElement.h:
+ * ksvg2/svg/SVGLinearGradientElement.cpp:
+ (SVGLinearGradientElement::buildGradient):
+ * ksvg2/svg/SVGPatternElement.cpp:
+ (WebCore::SVGPatternElement::fillAttributesFromReferencePattern):
+ (WebCore::SVGPatternElement::drawPatternContentIntoTile):
+ (WebCore::SVGPatternElement::notifyAttributeChange):
+ * ksvg2/svg/SVGPatternElement.h:
+ * ksvg2/svg/SVGRadialGradientElement.cpp:
+ (WebCore::SVGRadialGradientElement::buildGradient):
+
2006-08-22 Rob Buis <buis@kde.org>
Reviewed by Eric.
A88AD3C00952486E001DD196 /* KCanvasImage.h in Headers */ = {isa = PBXBuildFile; fileRef = A8C0FB81089701F800BA5114 /* KCanvasImage.h */; };
A88AD3C10952486E001DD196 /* RenderPath.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8C0FB82089701F800BA5114 /* RenderPath.cpp */; };
A88AD3C20952486E001DD196 /* RenderPath.h in Headers */ = {isa = PBXBuildFile; fileRef = A8C0FB83089701F800BA5114 /* RenderPath.h */; };
- A88AD3C30952486E001DD196 /* KCanvasMatrix.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8C0FB84089701F800BA5114 /* KCanvasMatrix.cpp */; };
- A88AD3C40952486E001DD196 /* KCanvasMatrix.h in Headers */ = {isa = PBXBuildFile; fileRef = A8C0FB85089701F800BA5114 /* KCanvasMatrix.h */; };
A88AD3C50952486E001DD196 /* KCanvasPath.h in Headers */ = {isa = PBXBuildFile; fileRef = A8C0FB86089701F800BA5114 /* KCanvasPath.h */; };
A88AD3C60952486E001DD196 /* KCanvasPath.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4758C44308C5F217009BAF05 /* KCanvasPath.cpp */; };
A88AD3C70952486E001DD196 /* KCanvasResourceListener.h in Headers */ = {isa = PBXBuildFile; fileRef = A8C0FB89089701F800BA5114 /* KCanvasResourceListener.h */; };
A8C0FB81089701F800BA5114 /* KCanvasImage.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = KCanvasImage.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
A8C0FB82089701F800BA5114 /* RenderPath.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderPath.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
A8C0FB83089701F800BA5114 /* RenderPath.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = RenderPath.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
- A8C0FB84089701F800BA5114 /* KCanvasMatrix.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = KCanvasMatrix.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
- A8C0FB85089701F800BA5114 /* KCanvasMatrix.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = KCanvasMatrix.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
A8C0FB86089701F800BA5114 /* KCanvasPath.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = KCanvasPath.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
A8C0FB89089701F800BA5114 /* KCanvasResourceListener.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = KCanvasResourceListener.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
A8C0FB8A089701F800BA5114 /* KCanvasResources.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = KCanvasResources.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
A8C0FB7E089701F800BA5114 /* KCanvasFilters.cpp */,
A8C0FB7F089701F800BA5114 /* KCanvasFilters.h */,
A8C0FB81089701F800BA5114 /* KCanvasImage.h */,
- A8C0FB84089701F800BA5114 /* KCanvasMatrix.cpp */,
- A8C0FB85089701F800BA5114 /* KCanvasMatrix.h */,
4758C44308C5F217009BAF05 /* KCanvasPath.cpp */,
A8C0FB86089701F800BA5114 /* KCanvasPath.h */,
A8C0FB89089701F800BA5114 /* KCanvasResourceListener.h */,
A88AD3BE0952486E001DD196 /* KCanvasFilters.h in Headers */,
A88AD3C00952486E001DD196 /* KCanvasImage.h in Headers */,
A88AD3C20952486E001DD196 /* RenderPath.h in Headers */,
- A88AD3C40952486E001DD196 /* KCanvasMatrix.h in Headers */,
A88AD3C50952486E001DD196 /* KCanvasPath.h in Headers */,
A88AD3C70952486E001DD196 /* KCanvasResourceListener.h in Headers */,
A88AD3C90952486E001DD196 /* KCanvasResources.h in Headers */,
A88AD3BB0952486E001DD196 /* KCanvasCreator.cpp in Sources */,
A88AD3BD0952486E001DD196 /* KCanvasFilters.cpp in Sources */,
A88AD3C10952486E001DD196 /* RenderPath.cpp in Sources */,
- A88AD3C30952486E001DD196 /* KCanvasMatrix.cpp in Sources */,
A88AD3C60952486E001DD196 /* KCanvasPath.cpp in Sources */,
A88AD3C80952486E001DD196 /* KCanvasResources.cpp in Sources */,
A88AD3CC0952486E001DD196 /* KCanvasTreeDebug.cpp in Sources */,
+++ /dev/null
-/*
- Copyright (C) 2004, 2005 Nikolas Zimmermann <wildfox@kde.org>
- 2004, 2005 Rob Buis <buis@kde.org>
-
- This file is part of the KDE project
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public License
- aint with this library; see the file COPYING.LIB. If not, write to
- the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA.
-*/
-
-#include "config.h"
-#ifdef SVG_SUPPORT
-#include "KCanvasMatrix.h"
-
-#include "KCanvasPath.h"
-#include "AffineTransform.h"
-#include <math.h>
-
-namespace WebCore {
-
-static const double deg2rad = 0.017453292519943295769; // pi/180
-
-// KCanvasMatrix
-KCanvasMatrix::KCanvasMatrix()
-{
- m_mode = OPS_PREMUL;
-}
-
-KCanvasMatrix::KCanvasMatrix(const AffineTransform &matrix)
-{
- m_mode = OPS_PREMUL;
- (*this) = matrix;
-}
-
-KCanvasMatrix::KCanvasMatrix(const KCanvasMatrix &matrix)
-{
- m_mode = OPS_PREMUL;
- (*this) = matrix;
-}
-
-KCanvasMatrix::KCanvasMatrix(double a, double b, double c, double d, double e, double f)
-{
- m_mode = OPS_PREMUL;
- m_matrix.setMatrix(a, b, c, d, e, f);
-}
-
-KCanvasMatrix::~KCanvasMatrix()
-{
-}
-
-KCanvasMatrix &KCanvasMatrix::operator=(const AffineTransform &other)
-{
- m_matrix = other;
- return *this;
-}
-
-KCanvasMatrix &KCanvasMatrix::operator=(const KCanvasMatrix &other)
-{
- m_matrix = other.m_matrix;
- return *this;
-}
-
-bool KCanvasMatrix::operator==(const AffineTransform &other) const
-{
- return (m_matrix == other);
-}
-
-bool KCanvasMatrix::operator!=(const AffineTransform &other) const
-{
- return !operator==(other);
-}
-
-bool KCanvasMatrix::operator==(const KCanvasMatrix &other) const
-{
- return (m_matrix == other.m_matrix);
-}
-
-bool KCanvasMatrix::operator!=(const KCanvasMatrix &other) const
-{
- return !operator==(other);
-}
-
-void KCanvasMatrix::setOperationMode(KCMatrixOperationMode mode)
-{
- m_mode = mode;
-}
-
-void KCanvasMatrix::setA(double a)
-{
- m_matrix.setMatrix(a, m_matrix.m12(), m_matrix.m21(), m_matrix.m22(), m_matrix.dx(), m_matrix.dy());
-}
-
-double KCanvasMatrix::a() const
-{
- return m_matrix.m11();
-}
-
-void KCanvasMatrix::setB(double b)
-{
- m_matrix.setMatrix(m_matrix.m11(), b, m_matrix.m21(), m_matrix.m22(), m_matrix.dx(), m_matrix.dy());
-}
-
-double KCanvasMatrix::b() const
-{
- return m_matrix.m12();
-}
-
-void KCanvasMatrix::setC(double c)
-{
- m_matrix.setMatrix(m_matrix.m11(), m_matrix.m12(), c, m_matrix.m22(), m_matrix.dx(), m_matrix.dy());
-}
-
-double KCanvasMatrix::c() const
-{
- return m_matrix.m21();
-}
-
-void KCanvasMatrix::setD(double d)
-{
- m_matrix.setMatrix(m_matrix.m11(), m_matrix.m12(), m_matrix.m21(), d, m_matrix.dx(), m_matrix.dy());
-}
-
-double KCanvasMatrix::d() const
-{
- return m_matrix.m22();
-}
-
-void KCanvasMatrix::setE(double e)
-{
- m_matrix.setMatrix(m_matrix.m11(), m_matrix.m12(), m_matrix.m21(), m_matrix.m22(), e, m_matrix.dy());
-}
-
-double KCanvasMatrix::e() const
-{
- return m_matrix.dx();
-}
-
-void KCanvasMatrix::setF(double f)
-{
- m_matrix.setMatrix(m_matrix.m11(), m_matrix.m12(), m_matrix.m21(), m_matrix.m22(), m_matrix.dx(), f);
-}
-
-double KCanvasMatrix::f() const
-{
- return m_matrix.dy();
-}
-
-KCanvasMatrix &KCanvasMatrix::translate(double x, double y)
-{
- if(m_mode == OPS_PREMUL)
- m_matrix.translate(x, y);
- else
- {
- AffineTransform temp;
- temp.translate(x, y);
- m_matrix *= temp;
- }
-
- return *this;
-}
-
-KCanvasMatrix &KCanvasMatrix::multiply(const KCanvasMatrix &other)
-{
- AffineTransform temp(other.a(), other.b(), other.c(), other.d(), other.e(), other.f());
-
- if(m_mode == OPS_PREMUL)
- {
- temp *= m_matrix;
- m_matrix = temp;
- }
- else
- m_matrix *= temp;
-
- return *this;
-}
-
-KCanvasMatrix &KCanvasMatrix::scale(double scaleFactorX, double scaleFactorY)
-{
- if(m_mode == OPS_PREMUL)
- m_matrix.scale(scaleFactorX, scaleFactorY);
- else
- {
- AffineTransform temp;
- temp.scale(scaleFactorX, scaleFactorY);
- m_matrix *= temp;
- }
-
- return *this;
-}
-
-KCanvasMatrix &KCanvasMatrix::rotate(double angle)
-{
- if(m_mode == OPS_PREMUL)
- m_matrix.rotate(angle);
- else
- {
- AffineTransform temp;
- temp.rotate(angle);
- m_matrix *= temp;
- }
-
- return *this;
-}
-
-KCanvasMatrix &KCanvasMatrix::rotateFromVector(double x, double y)
-{
- if(m_mode == OPS_PREMUL)
- m_matrix.rotate(atan2(y, x) / deg2rad);
- else
- {
- AffineTransform temp;
- temp.rotate(atan2(y, x) / deg2rad);
- m_matrix *= temp;
- }
-
- return *this;
-}
-
-KCanvasMatrix &KCanvasMatrix::flipX()
-{
- return scale(-1.0f, 1.0f);
-}
-
-KCanvasMatrix &KCanvasMatrix::flipY()
-{
- return scale(1.0f, -1.0f);
-}
-
-KCanvasMatrix &KCanvasMatrix::skewX(double angle)
-{
- if(m_mode == OPS_PREMUL)
- m_matrix.shear(tan(angle * deg2rad), 0.0f);
- else
- {
- AffineTransform temp;
- temp.shear(tan(angle * deg2rad), 0.0f);
- m_matrix *= temp;
- }
-
- return *this;
-}
-
-KCanvasMatrix &KCanvasMatrix::skewY(double angle)
-{
- if(m_mode == OPS_PREMUL)
- m_matrix.shear(0.0f, tan(angle * deg2rad));
- else
- {
- AffineTransform temp;
- temp.shear(0.0f, tan(angle * deg2rad));
- m_matrix *= temp;
- }
-
- return *this;
-}
-
-void KCanvasMatrix::reset()
-{
- m_matrix.reset();
-}
-
-void KCanvasMatrix::removeScale(double *xScale, double *yScale)
-{
- double sx = sqrt(a() * a() + b() *b());
- double sy = sqrt(c() * c() + d() *d());
-
- // Remove the scaling from the matrix.
- setA(a() / sx); setB(b() / sx);
- setC(c() / sy); setD(d() / sy);
-
- *xScale = sx; *yScale = sy;
-}
-
-AffineTransform KCanvasMatrix::matrix() const
-{
- return m_matrix;
-}
-
-}
-
-// vim:ts=4:noet
-#endif // SVG_SUPPORT
-
+++ /dev/null
-/*
- Copyright (C) 2004, 2005 Nikolas Zimmermann <wildfox@kde.org>
- 2004, 2005 Rob Buis <buis@kde.org>
-
- This file is part of the KDE project
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public License
- aint with this library; see the file COPYING.LIB. If not, write to
- the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA.
-*/
-
-#ifndef KCanvasMatrix_H
-#define KCanvasMatrix_H
-#ifdef SVG_SUPPORT
-
-#include "AffineTransform.h"
-
-namespace WebCore {
-
-enum KCMatrixOperationMode {
- OPS_PREMUL = 1, // Default mode (svg compatible)
- OPS_POSTMUL = 2
-};
-
-class KCanvasPath;
-class KCanvasMatrix
-{
-public:
- KCanvasMatrix();
- KCanvasMatrix(const AffineTransform &matrix);
- KCanvasMatrix(const KCanvasMatrix &matrix);
- KCanvasMatrix(double a, double b, double c, double d, double e, double f);
- ~KCanvasMatrix();
-
- // Operators
- KCanvasMatrix &operator=(const AffineTransform &other);
- KCanvasMatrix &operator=(const KCanvasMatrix &other);
-
- bool operator==(const AffineTransform &other) const;
- bool operator!=(const AffineTransform &other) const;
-
- bool operator==(const KCanvasMatrix &other) const;
- bool operator!=(const KCanvasMatrix &other) const;
-
- void setOperationMode(KCMatrixOperationMode mode);
-
- double a() const;
- void setA(double a);
-
- double b() const;
- void setB(double b);
-
- double c() const;
- void setC(double c);
-
- double d() const;
- void setD(double d);
-
- double e() const;
- void setE(double e);
-
- double f() const;
- void setF(double f);
-
- // OPS_PREMUL : Pre-multiplied operations (needed for svg-like matrix operations)
- // OPS_POSTMUL: Post-multiplied operations
- KCanvasMatrix &translate(double x, double y);
- KCanvasMatrix &multiply(const KCanvasMatrix &other);
- KCanvasMatrix &scale(double scaleFactorX, double scaleFactorY);
-
- KCanvasMatrix &rotate(double angle);
- KCanvasMatrix &rotateFromVector(double x, double y);
-
- KCanvasMatrix &flipX();
- KCanvasMatrix &flipY();
-
- KCanvasMatrix &skewX(double angle);
- KCanvasMatrix &skewY(double angle);
-
- void reset();
-
- // Determine the scaling component of the matrix and factor it out.
- // After this operation, the matrix has x and y scale of one ('1').
- void removeScale(double *xScale, double *yScale);
-
- AffineTransform matrix() const;
-
-private:
- AffineTransform m_matrix;
- KCMatrixOperationMode m_mode;
-};
-
-}
-
-#endif // SVG_SUPPORT
-#endif
-
-// vim:ts=4:noet
#include "IntRect.h"
#include "RenderSVGContainer.h"
#include "KCanvasImage.h"
-#include "KCanvasMatrix.h"
#include "KCanvasTreeDebug.h"
#include "KRenderingDevice.h"
#include "RenderPath.h"
{
if(m_marker)
{
- KCanvasMatrix translation;
+ AffineTransform translation;
translation.translate(x, y);
- KCanvasMatrix rotation;
- rotation.setOperationMode(OPS_POSTMUL);
- rotation.translate(-m_refX, -m_refY);
- rotation.scale(m_scaleX, m_scaleY);
- rotation.rotate(m_angle > -1 ? m_angle : angle);
-
+ AffineTransform rotation;
// stroke width
if(m_useStrokeWidth)
rotation.scale(strokeWidth, strokeWidth);
+ rotation.rotate(m_angle > -1 ? m_angle : angle);
+ rotation.scale(m_scaleX, m_scaleY);
+ rotation.translate(-m_refX, -m_refY);
// FIXME: PaintInfo should be passed into this method instead.
// FIXME: bounding box fractions lost
RenderObject::PaintInfo info(context, enclosingIntRect(rect), PaintPhaseForeground, 0, 0, 0);
- m_marker->setLocalTransform(rotation.multiply(translation).matrix());
+ rotation = rotation * translation;
+ m_marker->setLocalTransform(rotation);
static_cast<RenderSVGContainer *>(m_marker)->setDrawsContents(true);
m_marker->paint(info, 0, 0);
static_cast<RenderSVGContainer *>(m_marker)->setDrawsContents(false);
RS_MASKER = 4
} KCResourceType;
-class KCanvasMatrix;
class KRenderingPaintServer;
class KCanvasResource
#include "RenderForeignObject.h"
#include "GraphicsContext.h"
-#include "KCanvasMatrix.h"
#include "KRenderingDevice.h"
#include "SVGAnimatedLength.h"
#include "SVGForeignObjectElement.h"
class KCanvasPath;
class RenderSVGContainer;
-class KCanvasMatrix;
class RenderPath : public RenderObject
{
FloatRect viewportRect = viewport();
if (!parent()->isKCanvasContainer())
viewportRect = FloatRect(viewport().x(), viewport().y(), width(), height());
- return getAspectRatio(viewBox(), viewportRect).matrix();
+ return getAspectRatio(viewBox(), viewportRect);
}
return AffineTransform();
}
return d->slice;
}
-KCanvasMatrix RenderSVGContainer::getAspectRatio(const FloatRect& logical, const FloatRect& physical) const
+AffineTransform RenderSVGContainer::getAspectRatio(const FloatRect& logical, const FloatRect& physical) const
{
- KCanvasMatrix temp;
+ AffineTransform temp;
float logicX = logical.x();
float logicY = logical.y();
bool slice() const;
private:
- KCanvasMatrix getAspectRatio(const FloatRect& logical, const FloatRect& physical) const;
+ AffineTransform getAspectRatio(const FloatRect& logical, const FloatRect& physical) const;
AffineTransform viewportTransform() const;
class Private;
#include "RenderSVGText.h"
#include "GraphicsContext.h"
-#include "KCanvasMatrix.h"
#include "KCanvasRenderingStyle.h"
#include "KRenderingDevice.h"
#include "SVGAnimatedLengthList.h"
namespace WebCore {
// aka where to draw
-class KCanvasMatrix;
class KRenderingDeviceContext
{
public:
KRenderingDeviceContext() { }
virtual ~KRenderingDeviceContext() { }
- virtual KCanvasMatrix concatCTM(const KCanvasMatrix &worldMatrix) = 0;
- virtual KCanvasMatrix ctm() const = 0;
+ virtual AffineTransform concatCTM(const AffineTransform&) = 0;
+ virtual AffineTransform ctm() const = 0;
virtual void clearPath() = 0;
virtual void addPath(const KCanvasPath*) = 0;
#include "IntPoint.h"
#include "KRenderingPaintServerGradient.h"
-#include "KCanvasMatrix.h"
+#include "AffineTransform.h"
#include "TextStream.h"
#include "KCanvasTreeDebug.h"
Vector<KCGradientStop> stops;
KCGradientSpreadMethod spreadMethod;
bool boundingBoxMode;
- KCanvasMatrix gradientTransform;
+ AffineTransform gradientTransform;
KCanvasResourceListener *listener;
};
d->boundingBoxMode = mode;
}
-KCanvasMatrix KRenderingPaintServerGradient::gradientTransform() const
+AffineTransform KRenderingPaintServerGradient::gradientTransform() const
{
return d->gradientTransform;
}
-void KRenderingPaintServerGradient::setGradientTransform(const KCanvasMatrix &mat)
+void KRenderingPaintServerGradient::setGradientTransform(const AffineTransform& mat)
{
d->gradientTransform = mat;
}
ts << "[method=" << spreadMethod() << "]";
if (!boundingBoxMode())
ts << " [bounding box mode=" << boundingBoxMode() << "]";
- if (!gradientTransform().matrix().isIdentity())
- ts << " [transform=" << gradientTransform().matrix() << "]";
+ if (!gradientTransform().isIdentity())
+ ts << " [transform=" << gradientTransform() << "]";
return ts;
}
TextStream& operator<<(TextStream&, KCGradientSpreadMethod);
-class KCanvasMatrix;
class KRenderingPaintServerGradient : public KRenderingPaintServer
{
public:
bool boundingBoxMode() const;
void setBoundingBoxMode(bool mode = true);
- KCanvasMatrix gradientTransform() const;
- void setGradientTransform(const KCanvasMatrix &mat);
+ AffineTransform gradientTransform() const;
+ void setGradientTransform(const AffineTransform&);
KCanvasResourceListener *listener() const;
void setListener(KCanvasResourceListener *listener);
#include "config.h"
#ifdef SVG_SUPPORT
-#include "KCanvasMatrix.h"
#include "KCanvasImage.h"
#include "KRenderingPaintServerPattern.h"
+#include "AffineTransform.h"
#include "TextStream.h"
#include "KCanvasTreeDebug.h"
~Private() { delete tile; }
KCanvasImage *tile;
- KCanvasMatrix patternTransform;
+ AffineTransform patternTransform;
FloatRect bbox;
bool useBoundingBoxMode;
KCanvasResourceListener *listener;
d->tile = tile;
}
-KCanvasMatrix KRenderingPaintServerPattern::patternTransform() const
+AffineTransform KRenderingPaintServerPattern::patternTransform() const
{
return d->patternTransform;
}
-void KRenderingPaintServerPattern::setPatternTransform(const KCanvasMatrix &mat)
+void KRenderingPaintServerPattern::setPatternTransform(const AffineTransform& mat)
{
d->patternTransform = mat;
}
<< " [bbox=" << bbox() << "]";
if (!boundingBoxMode())
ts << " [bounding box mode=" << boundingBoxMode() << "]";
- if (!patternTransform().matrix().isIdentity())
- ts << " [pattern transform=" << patternTransform().matrix() << "]";
+ if (!patternTransform().isIdentity())
+ ts << " [pattern transform=" << patternTransform() << "]";
return ts;
}
KCanvasImage *tile() const;
void setTile(KCanvasImage *tile);
- KCanvasMatrix patternTransform() const;
- void setPatternTransform(const KCanvasMatrix &mat);
+ AffineTransform patternTransform() const;
+ void setPatternTransform(const AffineTransform&);
KCanvasResourceListener *listener() const;
void setListener(KCanvasResourceListener *listener);
/*
* Copyright (C) 2005, 2006 Apple Computer, Inc. All rights reserved.
* Copyright (C) 2006 Dave MacLachlan (dmaclach@mac.com)
+ * 2006 Rob Buis <buis@kde.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
#ifdef SVG_SUPPORT
#import "KCanvasFilterQuartz.h"
+#import "AffineTransform.h"
#import "BlockExceptions.h"
#import "CachedImage.h"
#import "FoundationExtras.h"
/*
* Copyright (C) 2005 Apple Computer, Inc. All rights reserved.
* (C) 2006 Alexander Kellett <lypanov@kde.org>
+ * 2006 Rob Buis <buis@kde.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
#import "KCanvasRenderingStyle.h"
#import "KRenderingFillPainter.h"
#import "KRenderingStrokePainter.h"
-#import "KCanvasMatrix.h"
#import "KCanvasPathQuartz.h"
#import "KRenderingDeviceQuartz.h"
/*
* Copyright (C) 2005 Apple Computer, Inc. All rights reserved.
+ * 2006 Rob Buis <buis@kde.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
KRenderingDeviceContextQuartz(CGContextRef context);
virtual ~KRenderingDeviceContextQuartz();
- virtual KCanvasMatrix concatCTM(const KCanvasMatrix &worldMatrix);
- virtual KCanvasMatrix ctm() const;
+ virtual AffineTransform concatCTM(const AffineTransform&);
+ virtual AffineTransform ctm() const;
virtual void clearPath();
virtual void addPath(const KCanvasPath*);
/*
* Copyright (C) 2005 Apple Computer, Inc. All rights reserved.
+ * 2006 Rob Buis <buis@kde.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
#import "KCanvasFilterQuartz.h"
#import "KCanvasItemQuartz.h"
#import "KCanvasMaskerQuartz.h"
-#import "KCanvasMatrix.h"
#import "KCanvasPathQuartz.h"
#import "KCanvasResourcesQuartz.h"
#import "KRenderingFillPainter.h"
HardRelease(m_nsGraphicsContext);
}
-KCanvasMatrix KRenderingDeviceContextQuartz::concatCTM(const KCanvasMatrix &worldMatrix)
+AffineTransform KRenderingDeviceContextQuartz::concatCTM(const AffineTransform& worldMatrix)
{
- KCanvasMatrix ret = ctm();
- CGAffineTransform wMatrix = CGAffineTransformMake(worldMatrix.a(), worldMatrix.b(), worldMatrix.c(),
- worldMatrix.d(), worldMatrix.e(), worldMatrix.f());
+ AffineTransform ret = ctm();
+ CGAffineTransform wMatrix = worldMatrix;
CGContextConcatCTM(m_cgContext, wMatrix);
return ret;
}
-KCanvasMatrix KRenderingDeviceContextQuartz::ctm() const
+AffineTransform KRenderingDeviceContextQuartz::ctm() const
{
- CGAffineTransform contextCTM = CGContextGetCTM(m_cgContext);
- return KCanvasMatrix(contextCTM.a, contextCTM.b, contextCTM.c, contextCTM.d, contextCTM.tx, contextCTM.ty);
+ return CGContextGetCTM(m_cgContext);
}
void KRenderingDeviceContextQuartz::clearPath()
/*
* Copyright (C) 2005 Apple Computer, Inc. All rights reserved.
* 2006 Alexander Kellett <lypanov@kde.org>
+ * 2006 Rob Buis <buis@kde.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
#import "KRenderingPaintServer.h"
#import "KRenderingFillPainter.h"
#import "KRenderingStrokePainter.h"
-#import "KCanvasMatrix.h"
#import "KRenderingDeviceQuartz.h"
#import "KCanvasResourcesQuartz.h"
}
// apply the gradient's own transform
- CGAffineTransform gradientTransform = CGAffineTransform(server->gradientTransform().matrix());
+ CGAffineTransform gradientTransform = server->gradientTransform();
CGContextConcatCTM(context, gradientTransform);
}
/*
* Copyright (C) 2005, 2006 Apple Computer, Inc. All rights reserved.
* 2006 Alexander Kellett <lypanov@kde.org>
+ * 2006 Rob Buis <buis@kde.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
#import "KRenderingPaintServer.h"
#import "KRenderingFillPainter.h"
#import "KRenderingStrokePainter.h"
-#import "KCanvasMatrix.h"
#import "KRenderingDevice.h"
#import "Logging.h"
// Patterns don't seem to resepect the CTM unless we make them...
CGAffineTransform ctm = CGContextGetCTM(context);
- CGAffineTransform transform = CGAffineTransform(patternTransform().matrix());
+ CGAffineTransform transform = patternTransform();
transform = CGAffineTransformConcat(transform, ctm);
CGSize phase = CGSizeMake(bbox().x(), bbox().y());
/*
* Copyright (C) 2005 Apple Computer, Inc. All rights reserved.
+ * 2006 Rob Buis <buis@kde.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
#import "QuartzSupport.h"
#import "GraphicsContext.h"
-#import "KCanvasMatrix.h"
#import "KCanvasResourcesQuartz.h"
#import "KRenderingFillPainter.h"
#import "KRenderingStrokePainter.h"
#ifdef SVG_SUPPORT
#include "DeprecatedValueList.h"
-#include <kcanvas/KCanvasMatrix.h>
namespace WebCore {
#include "Attr.h"
#include <kcanvas/RenderPath.h>
-#include <kcanvas/KCanvasMatrix.h>
#include "SVGAngle.h"
#include "SVGMatrix.h"
#include "ksvg.h"
#include "SVGAnimationElement.h"
-#include <kcanvas/KCanvasMatrix.h>
namespace WebCore {
#include "SVGLinearGradientElement.h"
#include "SVGAnimatedTransformList.h"
-#include <kcanvas/KCanvasMatrix.h>
#include <kcanvas/KCanvasResources.h>
#include <kcanvas/device/KRenderingDevice.h>
#include <kcanvas/device/KRenderingPaintServerGradient.h>
float _x2 = x2()->baseVal()->value(), _y2 = y2()->baseVal()->value();
KRenderingPaintServerLinearGradient *grad = static_cast<KRenderingPaintServerLinearGradient *>(_grad);
- KCanvasMatrix mat;
+ AffineTransform mat;
if(gradientTransform()->baseVal()->numberOfItems() > 0)
- mat = KCanvasMatrix(gradientTransform()->baseVal()->consolidate()->matrix()->matrix());
+ mat = gradientTransform()->baseVal()->consolidate()->matrix()->matrix();
DeprecatedString ref = String(href()->baseVal()).deprecatedString();
KRenderingPaintServer *pserver = getPaintServerById(document(), ref.mid(1));
#include "RenderSVGContainer.h"
#include "KCanvasCreator.h"
#include "KCanvasImage.h"
-#include "KCanvasMatrix.h"
#include "KCanvasRenderingStyle.h"
#include "KRenderingDevice.h"
#include "KRenderingPaintServerPattern.h"
notifyAttributeChange();
}
-void SVGPatternElement::fillAttributesFromReferencePattern(const SVGPatternElement* target, KCanvasMatrix& patternTransformMatrix) const
+void SVGPatternElement::fillAttributesFromReferencePattern(const SVGPatternElement* target, AffineTransform& patternTransformMatrix) const
{
DeprecatedString ref = String(href()->baseVal()).deprecatedString();
KRenderingPaintServer *refServer = getPaintServerById(document(), ref.mid(1));
patternTransformMatrix = refPattern->patternTransform();
}
-void SVGPatternElement::drawPatternContentIntoTile(const SVGPatternElement* target, const IntSize& newSize, KCanvasMatrix patternTransformMatrix) const
+void SVGPatternElement::drawPatternContentIntoTile(const SVGPatternElement* target, const IntSize& newSize, AffineTransform patternTransformMatrix) const
{
KRenderingDevice* device = renderingDevice();
unsigned short savedPatternUnits = patternUnits()->baseVal();
unsigned short savedPatternContentUnits = patternContentUnits()->baseVal();
- KCanvasMatrix patternTransformMatrix;
+ AffineTransform patternTransformMatrix;
if (patternTransform()->baseVal()->numberOfItems() > 0)
- patternTransformMatrix = KCanvasMatrix(patternTransform()->baseVal()->consolidate()->matrix()->matrix());
+ patternTransformMatrix = patternTransform()->baseVal()->consolidate()->matrix()->matrix();
fillAttributesFromReferencePattern(target, patternTransformMatrix);
private:
// notifyAttributeChange helpers:
- void fillAttributesFromReferencePattern(const SVGPatternElement *target, KCanvasMatrix &patternTransformMatrix) const;
- void drawPatternContentIntoTile(const SVGPatternElement *target, const IntSize &newSize, KCanvasMatrix patternTransformMatrix) const;
+ void fillAttributesFromReferencePattern(const SVGPatternElement *target, AffineTransform& patternTransformMatrix) const;
+ void drawPatternContentIntoTile(const SVGPatternElement *target, const IntSize &newSize, AffineTransform patternTransformMatrix) const;
void notifyClientsToRepaint() const;
};
#include "SVGRadialGradientElement.h"
#include "SVGAnimatedTransformList.h"
-#include <kcanvas/KCanvasMatrix.h>
#include <kcanvas/device/KRenderingDevice.h>
#include <kcanvas/device/KRenderingPaintServerGradient.h>
float _fy = fySet ? fy()->baseVal()->value() : _cy;
KRenderingPaintServerRadialGradient *grad = static_cast<KRenderingPaintServerRadialGradient *>(_grad);
- KCanvasMatrix mat;
+ AffineTransform mat;
if(gradientTransform()->baseVal()->numberOfItems() > 0)
- mat = KCanvasMatrix(gradientTransform()->baseVal()->consolidate()->matrix()->matrix());
+ mat = gradientTransform()->baseVal()->consolidate()->matrix()->matrix();
DeprecatedString ref = String(href()->baseVal()).deprecatedString();
KRenderingPaintServer *pserver = getPaintServerById(document(), ref.mid(1));