Bug 1052915 - Stop unnecessarily calling nsSVGUtils::AdjustMatrixForUnits() over and over in nsSVGClipPathFrame. r=longsonr

This commit is contained in:
Jonathan Watt 2014-08-13 13:34:52 +01:00
parent 7ad915612a
commit eb53e85094
2 changed files with 3 additions and 17 deletions

View File

@ -41,12 +41,7 @@ nsSVGClipPathFrame::ClipPaint(nsRenderingContext* aContext,
}
AutoClipPathReferencer clipRef(this);
mClipParent = aParent;
if (mClipParentMatrix) {
*mClipParentMatrix = aMatrix;
} else {
mClipParentMatrix = new gfxMatrix(aMatrix);
}
mMatrixForChildren = GetClipPathTransform(aParent) * aMatrix;
gfxContext *gfx = aContext->ThebesContext();
@ -325,15 +320,7 @@ nsSVGClipPathFrame::GetType() const
gfxMatrix
nsSVGClipPathFrame::GetCanvasTM(uint32_t aFor, nsIFrame* aTransformRoot)
{
SVGClipPathElement *content = static_cast<SVGClipPathElement*>(mContent);
gfxMatrix tm =
content->PrependLocalTransformsTo(mClipParentMatrix ?
*mClipParentMatrix : gfxMatrix());
return nsSVGUtils::AdjustMatrixForUnits(tm,
&content->mEnumAttributes[SVGClipPathElement::CLIPPATHUNITS],
mClipParent);
return mMatrixForChildren;
}
gfxMatrix

View File

@ -110,8 +110,7 @@ public:
MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER
};
nsIFrame *mClipParent;
nsAutoPtr<gfxMatrix> mClipParentMatrix;
gfxMatrix mMatrixForChildren;
// recursion prevention flag
bool mInUse;