From e357f0c9be7bf9d9de08cacc1785e998072487f8 Mon Sep 17 00:00:00 2001 From: David Zbarsky Date: Mon, 30 Dec 2013 01:50:17 -0500 Subject: [PATCH] Bug 952977: Switch GetViewBoxTransform to gfx::Matrix r=nical --- content/svg/content/src/SVGContentUtils.cpp | 10 +++++----- content/svg/content/src/SVGContentUtils.h | 8 ++++++-- content/svg/content/src/SVGFEImageElement.cpp | 4 ++-- content/svg/content/src/SVGMarkerElement.cpp | 14 +++++++------- content/svg/content/src/SVGMarkerElement.h | 11 +++++------ content/svg/content/src/SVGSVGElement.cpp | 16 +++++++++------- content/svg/content/src/SVGSVGElement.h | 2 +- layout/svg/nsISVGChildFrame.h | 2 +- layout/svg/nsSVGContainerFrame.h | 8 ++++---- layout/svg/nsSVGForeignObjectFrame.cpp | 4 ++-- layout/svg/nsSVGForeignObjectFrame.h | 4 ++-- layout/svg/nsSVGImageFrame.cpp | 4 ++-- layout/svg/nsSVGInnerSVGFrame.cpp | 2 +- layout/svg/nsSVGInnerSVGFrame.h | 2 +- layout/svg/nsSVGMarkerFrame.cpp | 8 ++++---- layout/svg/nsSVGMarkerFrame.h | 2 +- layout/svg/nsSVGOuterSVGFrame.h | 8 ++++---- layout/svg/nsSVGPathGeometryFrame.h | 6 +++--- layout/svg/nsSVGPatternFrame.cpp | 4 ++-- layout/svg/nsSVGPatternFrame.h | 2 -- 20 files changed, 62 insertions(+), 59 deletions(-) diff --git a/content/svg/content/src/SVGContentUtils.cpp b/content/svg/content/src/SVGContentUtils.cpp index 18f89fd2e52b..4a29ec50e41d 100644 --- a/content/svg/content/src/SVGContentUtils.cpp +++ b/content/svg/content/src/SVGContentUtils.cpp @@ -272,7 +272,7 @@ SVGContentUtils::AngleBisect(float a1, float a2) return r; } -gfxMatrix +gfx::Matrix SVGContentUtils::GetViewBoxTransform(float aViewportWidth, float aViewportHeight, float aViewboxX, float aViewboxY, float aViewboxWidth, float aViewboxHeight, @@ -284,7 +284,7 @@ SVGContentUtils::GetViewBoxTransform(float aViewportWidth, float aViewportHeight aPreserveAspectRatio.GetAnimValue()); } -gfxMatrix +gfx::Matrix SVGContentUtils::GetViewBoxTransform(float aViewportWidth, float aViewportHeight, float aViewboxX, float aViewboxY, float aViewboxWidth, float aViewboxHeight, @@ -361,11 +361,11 @@ SVGContentUtils::GetViewBoxTransform(float aViewportWidth, float aViewportHeight } else NS_NOTREACHED("Unknown value for meetOrSlice"); } - + if (aViewboxX) e += -a * aViewboxX; if (aViewboxY) f += -d * aViewboxY; - - return gfxMatrix(a, 0.0f, 0.0f, d, e, f); + + return gfx::Matrix(a, 0.0f, 0.0f, d, e, f); } static bool diff --git a/content/svg/content/src/SVGContentUtils.h b/content/svg/content/src/SVGContentUtils.h index 8a6b75bddf3f..7f1a9608eba1 100644 --- a/content/svg/content/src/SVGContentUtils.h +++ b/content/svg/content/src/SVGContentUtils.h @@ -28,6 +28,10 @@ namespace dom { class Element; class SVGSVGElement; } // namespace dom + +namespace gfx { +class Matrix; +} // namespace gfx } // namespace mozilla inline bool @@ -123,13 +127,13 @@ public: /* Generate a viewbox to viewport tranformation matrix */ - static gfxMatrix + static mozilla::gfx::Matrix GetViewBoxTransform(float aViewportWidth, float aViewportHeight, float aViewboxX, float aViewboxY, float aViewboxWidth, float aViewboxHeight, const SVGAnimatedPreserveAspectRatio &aPreserveAspectRatio); - static gfxMatrix + static mozilla::gfx::Matrix GetViewBoxTransform(float aViewportWidth, float aViewportHeight, float aViewboxX, float aViewboxY, float aViewboxWidth, float aViewboxHeight, diff --git a/content/svg/content/src/SVGFEImageElement.cpp b/content/svg/content/src/SVGFEImageElement.cpp index c91795c30447..9eb3ed53af45 100644 --- a/content/svg/content/src/SVGFEImageElement.cpp +++ b/content/svg/content/src/SVGFEImageElement.cpp @@ -229,12 +229,12 @@ SVGFEImageElement::GetPrimitiveDescription(nsSVGFilterInstance* aInstance, imageContainer->GetWidth(&nativeSize.width); imageContainer->GetHeight(&nativeSize.height); - gfxMatrix viewBoxTM = + Matrix viewBoxTM = SVGContentUtils::GetViewBoxTransform(aFilterSubregion.width, aFilterSubregion.height, 0, 0, nativeSize.width, nativeSize.height, mPreserveAspectRatio); Matrix xyTM = Matrix().Translate(aFilterSubregion.x, aFilterSubregion.y); - Matrix TM = ToMatrix(viewBoxTM) * xyTM; + Matrix TM = viewBoxTM * xyTM; Filter filter = ToFilter(nsLayoutUtils::GetGraphicsFilterForFrame(frame)); diff --git a/content/svg/content/src/SVGMarkerElement.cpp b/content/svg/content/src/SVGMarkerElement.cpp index 9b613a825c81..d4131cc9e749 100644 --- a/content/svg/content/src/SVGMarkerElement.cpp +++ b/content/svg/content/src/SVGMarkerElement.cpp @@ -13,7 +13,7 @@ #include "mozilla/dom/SVGMarkerElement.h" #include "mozilla/dom/SVGMarkerElementBinding.h" #include "mozilla/Preferences.h" -#include "gfxMatrix.h" +#include "mozilla/gfx/Matrix.h" #include "SVGContentUtils.h" NS_IMPL_NS_NEW_NAMESPACED_SVG_ELEMENT(Marker) @@ -334,7 +334,7 @@ SVGMarkerElement::GetViewBoxRect() mLengthAttributes[MARKERHEIGHT].GetAnimValue(mCoordCtx)); } -gfxMatrix +gfx::Matrix SVGMarkerElement::GetViewBoxTransform() { if (!mViewBoxToViewportTransform) { @@ -342,13 +342,13 @@ SVGMarkerElement::GetViewBoxTransform() mLengthAttributes[MARKERWIDTH].GetAnimValue(mCoordCtx); float viewportHeight = mLengthAttributes[MARKERHEIGHT].GetAnimValue(mCoordCtx); - + nsSVGViewBoxRect viewbox = GetViewBoxRect(); NS_ABORT_IF_FALSE(viewbox.width > 0.0f && viewbox.height > 0.0f, "Rendering should be disabled"); - gfxMatrix viewBoxTM = + gfx::Matrix viewBoxTM = SVGContentUtils::GetViewBoxTransform(viewportWidth, viewportHeight, viewbox.x, viewbox.y, viewbox.width, viewbox.height, @@ -357,11 +357,11 @@ SVGMarkerElement::GetViewBoxTransform() float refX = mLengthAttributes[REFX].GetAnimValue(mCoordCtx); float refY = mLengthAttributes[REFY].GetAnimValue(mCoordCtx); - gfxPoint ref = viewBoxTM.Transform(gfxPoint(refX, refY)); + gfx::Point ref = viewBoxTM * gfx::Point(refX, refY); - gfxMatrix TM = viewBoxTM * gfxMatrix().Translate(gfxPoint(-ref.x, -ref.y)); + gfx::Matrix TM = viewBoxTM * gfx::Matrix().Translate(-ref.x, -ref.y); - mViewBoxToViewportTransform = new gfxMatrix(TM); + mViewBoxToViewportTransform = new gfx::Matrix(TM); } return *mViewBoxToViewportTransform; diff --git a/content/svg/content/src/SVGMarkerElement.h b/content/svg/content/src/SVGMarkerElement.h index e57454fa5640..be6fe27cd529 100644 --- a/content/svg/content/src/SVGMarkerElement.h +++ b/content/svg/content/src/SVGMarkerElement.h @@ -6,7 +6,6 @@ #ifndef mozilla_dom_SVGMarkerElement_h #define mozilla_dom_SVGMarkerElement_h -#include "gfxMatrix.h" #include "nsSVGAngle.h" #include "nsSVGEnum.h" #include "nsSVGLength2.h" @@ -121,11 +120,11 @@ public: virtual bool HasValidDimensions() const MOZ_OVERRIDE; // public helpers - mozilla::gfx::Matrix GetMarkerTransform(float aStrokeWidth, - float aX, float aY, float aAutoAngle, - bool aIsStart); + gfx::Matrix GetMarkerTransform(float aStrokeWidth, + float aX, float aY, float aAutoAngle, + bool aIsStart); nsSVGViewBoxRect GetViewBoxRect(); - gfxMatrix GetViewBoxTransform(); + gfx::Matrix GetViewBoxTransform(); virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const MOZ_OVERRIDE; @@ -181,7 +180,7 @@ protected: nsSVGOrientType mOrientType; SVGSVGElement *mCoordCtx; - nsAutoPtr mViewBoxToViewportTransform; + nsAutoPtr mViewBoxToViewportTransform; }; } // namespace dom diff --git a/content/svg/content/src/SVGSVGElement.cpp b/content/svg/content/src/SVGSVGElement.cpp index aa2e00c1be86..875805ffb6c8 100644 --- a/content/svg/content/src/SVGSVGElement.cpp +++ b/content/svg/content/src/SVGSVGElement.cpp @@ -42,6 +42,8 @@ NS_IMPL_NS_NEW_NAMESPACED_SVG_ELEMENT_CHECK_PARSER(SVG) +using namespace mozilla::gfx; + namespace mozilla { namespace dom { @@ -639,7 +641,7 @@ ComputeSynthesizedViewBoxDimension(const nsSVGLength2& aLength, //---------------------------------------------------------------------- // public helpers: -gfxMatrix +gfx::Matrix SVGSVGElement::GetViewBoxTransform() const { float viewportWidth, viewportHeight; @@ -653,14 +655,14 @@ SVGSVGElement::GetViewBoxTransform() const } if (viewportWidth <= 0.0f || viewportHeight <= 0.0f) { - return gfxMatrix(0.0, 0.0, 0.0, 0.0, 0.0, 0.0); // singular + return gfx::Matrix(0.0, 0.0, 0.0, 0.0, 0.0, 0.0); // singular } nsSVGViewBoxRect viewBox = GetViewBoxWithSynthesis(viewportWidth, viewportHeight); if (viewBox.width <= 0.0f || viewBox.height <= 0.0f) { - return gfxMatrix(0.0, 0.0, 0.0, 0.0, 0.0, 0.0); // singular + return gfx::Matrix(0.0, 0.0, 0.0, 0.0, 0.0, 0.0); // singular } return SVGContentUtils::GetViewBoxTransform(viewportWidth, viewportHeight, @@ -965,21 +967,21 @@ SVGSVGElement::PrependLocalTransformsTo(const gfxMatrix &aMatrix, const_cast(this)->GetAnimatedLengthValues(&x, &y, nullptr); if (aWhich == eAllTransforms) { // the common case - return GetViewBoxTransform() * gfxMatrix().Translate(gfxPoint(x, y)) * fromUserSpace; + return ThebesMatrix(GetViewBoxTransform()) * gfxMatrix().Translate(gfxPoint(x, y)) * fromUserSpace; } NS_ABORT_IF_FALSE(aWhich == eChildToUserSpace, "Unknown TransformTypes"); - return GetViewBoxTransform() * gfxMatrix().Translate(gfxPoint(x, y)); + return ThebesMatrix(GetViewBoxTransform()) * gfxMatrix().Translate(gfxPoint(x, y)); } if (IsRoot()) { gfxMatrix zoomPanTM; zoomPanTM.Translate(gfxPoint(mCurrentTranslate.GetX(), mCurrentTranslate.GetY())); zoomPanTM.Scale(mCurrentScale, mCurrentScale); - return GetViewBoxTransform() * zoomPanTM * fromUserSpace; + return ThebesMatrix(GetViewBoxTransform()) * zoomPanTM * fromUserSpace; } // outer-, but inline in some other content: - return GetViewBoxTransform() * fromUserSpace; + return ThebesMatrix(GetViewBoxTransform()) * fromUserSpace; } /* virtual */ bool diff --git a/content/svg/content/src/SVGSVGElement.h b/content/svg/content/src/SVGSVGElement.h index 6e02d22971e8..0704f6ae6d46 100644 --- a/content/svg/content/src/SVGSVGElement.h +++ b/content/svg/content/src/SVGSVGElement.h @@ -168,7 +168,7 @@ public: return HasViewBoxRect() || ShouldSynthesizeViewBox(); } - gfxMatrix GetViewBoxTransform() const; + gfx::Matrix GetViewBoxTransform() const; bool HasChildrenOnlyTransform() const { return mHasChildrenOnlyTransform; diff --git a/layout/svg/nsISVGChildFrame.h b/layout/svg/nsISVGChildFrame.h index d7d4f1c22147..bb7b512d0752 100644 --- a/layout/svg/nsISVGChildFrame.h +++ b/layout/svg/nsISVGChildFrame.h @@ -133,7 +133,7 @@ public: * @param aFlags Flags indicating whether, stroke, for example, should be * included in the bbox calculation. */ - virtual SVGBBox GetBBoxContribution(const mozilla::gfx::Matrix &aToBBoxUserspace, + virtual SVGBBox GetBBoxContribution(const Matrix &aToBBoxUserspace, uint32_t aFlags) = 0; // Are we a container frame? diff --git a/layout/svg/nsSVGContainerFrame.h b/layout/svg/nsSVGContainerFrame.h index 4d46222ae91e..61b52fc1820c 100644 --- a/layout/svg/nsSVGContainerFrame.h +++ b/layout/svg/nsSVGContainerFrame.h @@ -68,7 +68,7 @@ public: * due to a root- having its currentScale/currentTransform properties * set. If aTransform is non-null, then it will be set to the transform. */ - virtual bool HasChildrenOnlyTransform(mozilla::gfx::Matrix *aTransform) const { + virtual bool HasChildrenOnlyTransform(Matrix *aTransform) const { return false; } @@ -141,8 +141,8 @@ public: const nsRect& aDirtyRect, const nsDisplayListSet& aLists) MOZ_OVERRIDE; - virtual bool IsSVGTransformed(mozilla::gfx::Matrix *aOwnTransform = nullptr, - mozilla::gfx::Matrix *aFromParentTransform = nullptr) const MOZ_OVERRIDE; + virtual bool IsSVGTransformed(Matrix *aOwnTransform = nullptr, + Matrix *aFromParentTransform = nullptr) const MOZ_OVERRIDE; // nsISVGChildFrame interface: NS_IMETHOD PaintSVG(nsRenderingContext* aContext, @@ -152,7 +152,7 @@ public: NS_IMETHOD_(nsRect) GetCoveredRegion() MOZ_OVERRIDE; virtual void ReflowSVG() MOZ_OVERRIDE; virtual void NotifySVGChanged(uint32_t aFlags) MOZ_OVERRIDE; - virtual SVGBBox GetBBoxContribution(const mozilla::gfx::Matrix &aToBBoxUserspace, + virtual SVGBBox GetBBoxContribution(const Matrix &aToBBoxUserspace, uint32_t aFlags) MOZ_OVERRIDE; NS_IMETHOD_(bool) IsDisplayContainer() MOZ_OVERRIDE { return true; } }; diff --git a/layout/svg/nsSVGForeignObjectFrame.cpp b/layout/svg/nsSVGForeignObjectFrame.cpp index 68db0f62224b..236b770205f2 100644 --- a/layout/svg/nsSVGForeignObjectFrame.cpp +++ b/layout/svg/nsSVGForeignObjectFrame.cpp @@ -165,8 +165,8 @@ nsSVGForeignObjectFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder, } bool -nsSVGForeignObjectFrame::IsSVGTransformed(mozilla::gfx::Matrix *aOwnTransform, - mozilla::gfx::Matrix *aFromParentTransform) const +nsSVGForeignObjectFrame::IsSVGTransformed(Matrix *aOwnTransform, + Matrix *aFromParentTransform) const { bool foundTransform = false; diff --git a/layout/svg/nsSVGForeignObjectFrame.h b/layout/svg/nsSVGForeignObjectFrame.h index 41cc226b2a70..95ec3b8d3f44 100644 --- a/layout/svg/nsSVGForeignObjectFrame.h +++ b/layout/svg/nsSVGForeignObjectFrame.h @@ -65,8 +65,8 @@ public: ~(nsIFrame::eSVG | nsIFrame::eSVGForeignObject)); } - virtual bool IsSVGTransformed(mozilla::gfx::Matrix *aOwnTransform, - mozilla::gfx::Matrix *aFromParentTransform) const MOZ_OVERRIDE; + virtual bool IsSVGTransformed(Matrix *aOwnTransform, + Matrix *aFromParentTransform) const MOZ_OVERRIDE; #ifdef DEBUG NS_IMETHOD GetFrameName(nsAString& aResult) const MOZ_OVERRIDE diff --git a/layout/svg/nsSVGImageFrame.cpp b/layout/svg/nsSVGImageFrame.cpp index 496ef68edd16..709c498f5ee9 100644 --- a/layout/svg/nsSVGImageFrame.cpp +++ b/layout/svg/nsSVGImageFrame.cpp @@ -233,12 +233,12 @@ nsSVGImageFrame::GetRasterImageTransform(int32_t aNativeWidth, SVGImageElement *element = static_cast(mContent); element->GetAnimatedLengthValues(&x, &y, &width, &height, nullptr); - gfxMatrix viewBoxTM = + Matrix viewBoxTM = SVGContentUtils::GetViewBoxTransform(width, height, 0, 0, aNativeWidth, aNativeHeight, element->mPreserveAspectRatio); - return viewBoxTM * + return ThebesMatrix(viewBoxTM) * gfxMatrix().Translate(gfxPoint(x, y)) * GetCanvasTM(aFor, aTransformRoot); } diff --git a/layout/svg/nsSVGInnerSVGFrame.cpp b/layout/svg/nsSVGInnerSVGFrame.cpp index c06161c61b3e..9d3fa1673a5d 100644 --- a/layout/svg/nsSVGInnerSVGFrame.cpp +++ b/layout/svg/nsSVGInnerSVGFrame.cpp @@ -300,7 +300,7 @@ nsSVGInnerSVGFrame::HasChildrenOnlyTransform(gfx::Matrix *aTransform) const if (content->HasViewBoxOrSyntheticViewBox()) { // XXX Maybe return false if the transform is the identity transform? if (aTransform) { - *aTransform = gfx::ToMatrix(content->GetViewBoxTransform()); + *aTransform = content->GetViewBoxTransform(); } return true; } diff --git a/layout/svg/nsSVGInnerSVGFrame.h b/layout/svg/nsSVGInnerSVGFrame.h index 10d8059596d7..239752693917 100644 --- a/layout/svg/nsSVGInnerSVGFrame.h +++ b/layout/svg/nsSVGInnerSVGFrame.h @@ -65,7 +65,7 @@ public: virtual gfxMatrix GetCanvasTM(uint32_t aFor, nsIFrame* aTransformRoot = nullptr) MOZ_OVERRIDE; - virtual bool HasChildrenOnlyTransform(mozilla::gfx::Matrix *aTransform) const MOZ_OVERRIDE; + virtual bool HasChildrenOnlyTransform(Matrix *aTransform) const MOZ_OVERRIDE; // nsISVGSVGFrame interface: virtual void NotifyViewportOrTransformChanged(uint32_t aFlags) MOZ_OVERRIDE; diff --git a/layout/svg/nsSVGMarkerFrame.cpp b/layout/svg/nsSVGMarkerFrame.cpp index f6a36c10aeab..0d948e4b0c66 100644 --- a/layout/svg/nsSVGMarkerFrame.cpp +++ b/layout/svg/nsSVGMarkerFrame.cpp @@ -88,9 +88,9 @@ nsSVGMarkerFrame::GetCanvasTM(uint32_t aFor, nsIFrame* aTransformRoot) Matrix markerTM = content->GetMarkerTransform(mStrokeWidth, mX, mY, mAutoAngle, mIsStart); - gfxMatrix viewBoxTM = content->GetViewBoxTransform(); + Matrix viewBoxTM = content->GetViewBoxTransform(); - return viewBoxTM * ThebesMatrix(markerTM) * markedTM; + return ThebesMatrix(viewBoxTM * markerTM) * markedTM; } static nsIFrame* @@ -186,9 +186,9 @@ nsSVGMarkerFrame::GetMarkBBoxContribution(const Matrix &aToBBoxUserspace, Matrix markerTM = content->GetMarkerTransform(mStrokeWidth, mX, mY, mAutoAngle, mIsStart); - gfxMatrix viewBoxTM = content->GetViewBoxTransform(); + Matrix viewBoxTM = content->GetViewBoxTransform(); - Matrix tm = ToMatrix(viewBoxTM) * markerTM * aToBBoxUserspace; + Matrix tm = viewBoxTM * markerTM * aToBBoxUserspace; nsISVGChildFrame* child = do_QueryFrame(GetAnonymousChildFrame(this)); // When we're being called to obtain the invalidation area, we need to diff --git a/layout/svg/nsSVGMarkerFrame.h b/layout/svg/nsSVGMarkerFrame.h index 2b8220bf0a01..948302fda7f6 100644 --- a/layout/svg/nsSVGMarkerFrame.h +++ b/layout/svg/nsSVGMarkerFrame.h @@ -94,7 +94,7 @@ public: nsSVGMark *aMark, float aStrokeWidth); - SVGBBox GetMarkBBoxContribution(const mozilla::gfx::Matrix &aToBBoxUserspace, + SVGBBox GetMarkBBoxContribution(const Matrix &aToBBoxUserspace, uint32_t aFlags, nsSVGPathGeometryFrame *aMarkedFrame, const nsSVGMark *aMark, diff --git a/layout/svg/nsSVGOuterSVGFrame.h b/layout/svg/nsSVGOuterSVGFrame.h index ade439e78326..2db28c2f3d22 100644 --- a/layout/svg/nsSVGOuterSVGFrame.h +++ b/layout/svg/nsSVGOuterSVGFrame.h @@ -97,8 +97,8 @@ public: return GetFirstPrincipalChild()->GetContentInsertionFrame(); } - virtual bool IsSVGTransformed(mozilla::gfx::Matrix *aOwnTransform, - mozilla::gfx::Matrix *aFromParentTransform) const MOZ_OVERRIDE { + virtual bool IsSVGTransformed(Matrix *aOwnTransform, + Matrix *aFromParentTransform) const MOZ_OVERRIDE { // Our anonymous wrapper performs the transforms. We simply // return whether we are transformed here but don't apply the transforms // themselves. @@ -132,7 +132,7 @@ public: void RegisterForeignObject(nsSVGForeignObjectFrame* aFrame); void UnregisterForeignObject(nsSVGForeignObjectFrame* aFrame); - virtual bool HasChildrenOnlyTransform(mozilla::gfx::Matrix *aTransform) const MOZ_OVERRIDE { + virtual bool HasChildrenOnlyTransform(Matrix *aTransform) const MOZ_OVERRIDE { // Our anonymous wrapper child must claim our children-only transforms as // its own so that our real children (the frames it wraps) are transformed // by them, and we must pretend we don't have any children-only transforms @@ -270,7 +270,7 @@ public: return static_cast(mParent)->GetCanvasTM(aFor, aTransformRoot); } - virtual bool HasChildrenOnlyTransform(mozilla::gfx::Matrix *aTransform) const MOZ_OVERRIDE; + virtual bool HasChildrenOnlyTransform(Matrix *aTransform) const MOZ_OVERRIDE; }; #endif diff --git a/layout/svg/nsSVGPathGeometryFrame.h b/layout/svg/nsSVGPathGeometryFrame.h index 13299628adc3..76e1465085fe 100644 --- a/layout/svg/nsSVGPathGeometryFrame.h +++ b/layout/svg/nsSVGPathGeometryFrame.h @@ -66,8 +66,8 @@ public: */ virtual nsIAtom* GetType() const MOZ_OVERRIDE; - virtual bool IsSVGTransformed(mozilla::gfx::Matrix *aOwnTransforms = nullptr, - mozilla::gfx::Matrix *aFromParentTransforms = nullptr) const MOZ_OVERRIDE; + virtual bool IsSVGTransformed(Matrix *aOwnTransforms = nullptr, + Matrix *aFromParentTransforms = nullptr) const MOZ_OVERRIDE; #ifdef DEBUG NS_IMETHOD GetFrameName(nsAString& aResult) const MOZ_OVERRIDE @@ -93,7 +93,7 @@ protected: NS_IMETHOD_(nsRect) GetCoveredRegion() MOZ_OVERRIDE; virtual void ReflowSVG() MOZ_OVERRIDE; virtual void NotifySVGChanged(uint32_t aFlags) MOZ_OVERRIDE; - virtual SVGBBox GetBBoxContribution(const mozilla::gfx::Matrix &aToBBoxUserspace, + virtual SVGBBox GetBBoxContribution(const Matrix &aToBBoxUserspace, uint32_t aFlags) MOZ_OVERRIDE; NS_IMETHOD_(bool) IsDisplayContainer() MOZ_OVERRIDE { return false; } diff --git a/layout/svg/nsSVGPatternFrame.cpp b/layout/svg/nsSVGPatternFrame.cpp index 64b70eb64d6e..2f29492dafcb 100644 --- a/layout/svg/nsSVGPatternFrame.cpp +++ b/layout/svg/nsSVGPatternFrame.cpp @@ -679,13 +679,13 @@ nsSVGPatternFrame::ConstructCTM(const nsSVGViewBox& aViewBox, return gfxMatrix(0.0, 0.0, 0.0, 0.0, 0.0, 0.0); // singular } - gfxMatrix tm = SVGContentUtils::GetViewBoxTransform( + Matrix tm = SVGContentUtils::GetViewBoxTransform( viewportWidth, viewportHeight, viewBoxRect.x, viewBoxRect.y, viewBoxRect.width, viewBoxRect.height, GetPreserveAspectRatio()); - return tm * tCTM; + return ThebesMatrix(tm) * tCTM; } //---------------------------------------------------------------------- diff --git a/layout/svg/nsSVGPatternFrame.h b/layout/svg/nsSVGPatternFrame.h index 3b39e11801bd..b5af9e781a76 100644 --- a/layout/svg/nsSVGPatternFrame.h +++ b/layout/svg/nsSVGPatternFrame.h @@ -31,8 +31,6 @@ typedef nsSVGPaintServerFrame nsSVGPatternFrameBase; */ class nsSVGPatternFrame : public nsSVGPatternFrameBase { - typedef mozilla::gfx::Matrix Matrix; - public: NS_DECL_FRAMEARENA_HELPERS