diff --git a/layout/svg/nsFilterInstance.cpp b/layout/svg/nsFilterInstance.cpp index 790dac913039..b8759a37fe64 100644 --- a/layout/svg/nsFilterInstance.cpp +++ b/layout/svg/nsFilterInstance.cpp @@ -503,14 +503,8 @@ nsFilterInstance::Render(DrawTarget* aDrawTarget) } AutoRestoreTransform autoRestoreTransform(aDrawTarget); - gfxMatrix filterSpaceToUserSpace = mPaintTransform; - DebugOnly invertible = filterSpaceToUserSpace.Invert(); - MOZ_ASSERT(invertible); - filterSpaceToUserSpace *= nsSVGUtils::GetCSSPxToDevPxMatrix(mTargetFrame); - Matrix newTM = - ToMatrix(filterSpaceToUserSpace).PreTranslate(filterRect.x, filterRect.y) * - aDrawTarget->GetTransform(); + aDrawTarget->GetTransform().PreTranslate(filterRect.x, filterRect.y); aDrawTarget->SetTransform(newTM); ComputeNeededBoxes(); diff --git a/layout/svg/nsSVGIntegrationUtils.cpp b/layout/svg/nsSVGIntegrationUtils.cpp index ec129add23b3..d80ed8e2328e 100644 --- a/layout/svg/nsSVGIntegrationUtils.cpp +++ b/layout/svg/nsSVGIntegrationUtils.cpp @@ -1093,6 +1093,11 @@ nsSVGIntegrationUtils::PaintFilter(const PaintFramesParams& aParams) gfxMatrix scaleMatrix(scaleFactors.width, 0.0f, 0.0f, scaleFactors.height, 0.0f, 0.0f); + gfxMatrix reverseScaleMatrix = scaleMatrix; + DebugOnly invertible = reverseScaleMatrix.Invert(); + MOZ_ASSERT(invertible); + context.SetMatrix(reverseScaleMatrix * context.CurrentMatrix()); + gfxMatrix tm = scaleMatrix * nsSVGUtils::GetCSSPxToDevPxMatrix(frame); DrawResult result = diff --git a/layout/svg/nsSVGUtils.cpp b/layout/svg/nsSVGUtils.cpp index 88c783e400f8..baeb64abaf83 100644 --- a/layout/svg/nsSVGUtils.cpp +++ b/layout/svg/nsSVGUtils.cpp @@ -883,12 +883,6 @@ nsSVGUtils::PaintFrameWithEffects(nsIFrame *aFrame, dirtyRegion = &tmpDirtyRegion; } - gfxContextMatrixAutoSaveRestore saver(target); - gfxMatrix devPxToCssPxTM = nsSVGUtils::GetCSSPxToDevPxMatrix(aFrame); - DebugOnly invertible = devPxToCssPxTM.Invert(); - MOZ_ASSERT(invertible); - target->SetMatrix(aTransform * devPxToCssPxTM); - SVGPaintCallback paintCallback(aFlags); result = nsFilterInstance::PaintFilteredFrame(aFrame, target->GetDrawTarget(),