diff --git a/content/svg/content/src/DOMSVGPoint.cpp b/content/svg/content/src/DOMSVGPoint.cpp index c4236959e6d..a75c7108bf3 100644 --- a/content/svg/content/src/DOMSVGPoint.cpp +++ b/content/svg/content/src/DOMSVGPoint.cpp @@ -6,6 +6,7 @@ #include "DOMSVGPoint.h" #include "DOMSVGPointList.h" #include "SVGPoint.h" +#include "gfx2DGlue.h" #include "nsSVGElement.h" #include "nsError.h" #include "mozilla/dom/SVGMatrix.h" @@ -13,6 +14,7 @@ // See the architecture comment in DOMSVGPointList.h. using namespace mozilla; +using namespace mozilla::gfx; namespace mozilla { @@ -112,7 +114,7 @@ DOMSVGPoint::MatrixTransform(dom::SVGMatrix& matrix) float x = HasOwner() ? InternalItem().mX : mPt.mX; float y = HasOwner() ? InternalItem().mY : mPt.mY; - gfxPoint pt = matrix.GetMatrix().Transform(gfxPoint(x, y)); + Point pt = ToMatrix(matrix.GetMatrix()) * Point(x, y); nsCOMPtr newPoint = new DOMSVGPoint(pt); return newPoint.forget(); } diff --git a/content/svg/content/src/DOMSVGPoint.h b/content/svg/content/src/DOMSVGPoint.h index ad5f277eeb1..7b40e112f8b 100644 --- a/content/svg/content/src/DOMSVGPoint.h +++ b/content/svg/content/src/DOMSVGPoint.h @@ -7,7 +7,6 @@ #define MOZILLA_DOMSVGPOINT_H__ #include "DOMSVGPointList.h" -#include "gfxPoint.h" #include "mozilla/gfx/2D.h" #include "nsAutoPtr.h" #include "nsDebug.h" @@ -87,15 +86,6 @@ public: "DOMSVGPoint coords are not finite"); } - explicit DOMSVGPoint(const gfxPoint &aPt) - : nsISVGPoint() - { - mPt.mX = float(aPt.x); - mPt.mY = float(aPt.y); - NS_ASSERTION(NS_finite(mPt.mX) && NS_finite(mPt.mX), - "DOMSVGPoint coords are not finite"); - } - // WebIDL virtual float X(); diff --git a/layout/svg/SVGTextFrame.cpp b/layout/svg/SVGTextFrame.cpp index c120f66e63e..06c76093c0c 100644 --- a/layout/svg/SVGTextFrame.cpp +++ b/layout/svg/SVGTextFrame.cpp @@ -4152,7 +4152,8 @@ SVGTextFrame::GetStartPositionOfChar(nsIContent* aContent, // We need to return the start position of the whole glyph. uint32_t startIndex = it.GlyphStartTextElementCharIndex(); - NS_ADDREF(*aResult = new DOMSVGPoint(mPositions[startIndex].mPosition)); + NS_ADDREF(*aResult = + new DOMSVGPoint(ToPoint(mPositions[startIndex].mPosition))); return NS_OK; } @@ -4184,10 +4185,10 @@ SVGTextFrame::GetEndPositionOfChar(nsIContent* aContent, // The end position is the start position plus the advance in the direction // of the glyph's rotation. - gfxMatrix m; - m.Translate(mPositions[startIndex].mPosition); - m.Rotate(mPositions[startIndex].mAngle); - gfxPoint p = m.Transform(gfxPoint(advance / mFontSizeScaleFactor, 0)); + Matrix m = + Matrix::Rotation(mPositions[startIndex].mAngle) * + Matrix::Translation(ToPoint(mPositions[startIndex].mPosition)); + Point p = m * Point(advance / mFontSizeScaleFactor, 0); NS_ADDREF(*aResult = new DOMSVGPoint(p)); return NS_OK;