mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-02 01:48:05 +00:00
Bug 1325865 - Part 1. Remove double transform. r=longsonr+218550
For an SVG container element(such as g/svg etc) used in mask, we apply transform of it twice: 1. The first time is in nsSVGMaskFrame::GetMaskForMaskedFrame. We apply transform by eAllTransforms(= eUserSpaceToParent + eChildToUserSpace) 2. The second time is in nsSVGDisplayContainerFrame::PaintSVG. We apply transform by eChildToUserSpace So, totally we apply 1 * eUserSpaceToParent + 2 * eChildToUserSpace. This patch is trying to remove this one extra eChildToUserSpace. MozReview-Commit-ID: 2pQCsrCIPNA --HG-- extra : rebase_source : 27fe1648eb80d9c4d5111bbaec7ec38d80a0a8ac
This commit is contained in:
parent
32f337db55
commit
d476a5e983
@ -284,9 +284,16 @@ SVGGeometryFrame::PaintSVG(gfxContext& aContext,
|
||||
if (!StyleVisibility()->IsVisible())
|
||||
return DrawResult::SUCCESS;
|
||||
|
||||
gfxMatrix childToUserSpace = aTransform;
|
||||
if (GetContent()->IsSVGElement()) {
|
||||
childToUserSpace = static_cast<const nsSVGElement*>(GetContent())->
|
||||
PrependLocalTransformsTo(childToUserSpace,
|
||||
eChildToUserSpace);
|
||||
}
|
||||
|
||||
// Matrix to the geometry's user space:
|
||||
gfxMatrix newMatrix =
|
||||
aContext.CurrentMatrix().PreMultiply(aTransform).NudgeToIntegers();
|
||||
aContext.CurrentMatrix().PreMultiply(childToUserSpace).NudgeToIntegers();
|
||||
if (newMatrix.IsSingular()) {
|
||||
return DrawResult::BAD_ARGS;
|
||||
}
|
||||
|
@ -262,7 +262,7 @@ nsSVGMaskFrame::GetMaskForMaskedFrame(MaskParams& aParams)
|
||||
gfxMatrix m = mMatrixForChildren;
|
||||
if (kid->GetContent()->IsSVGElement()) {
|
||||
m = static_cast<nsSVGElement*>(kid->GetContent())->
|
||||
PrependLocalTransformsTo(m);
|
||||
PrependLocalTransformsTo(m, eUserSpaceToParent);
|
||||
}
|
||||
result = nsSVGUtils::PaintFrameWithEffects(kid, *tmpCtx, m);
|
||||
if (result != DrawResult::SUCCESS) {
|
||||
|
Loading…
Reference in New Issue
Block a user