From 59503b53229d03d63b525ffbdbf81548fddf6ebd Mon Sep 17 00:00:00 2001 From: Robert Longson Date: Fri, 24 Dec 2010 09:30:01 +0000 Subject: [PATCH] Bug 621210 - Clear cached ctm when painting mask children; r=jwatt; a=roc --- .../svg/objectBoundingBox-and-mask-02.svg | 17 +++++++++++++++++ layout/reftests/svg/reftest.list | 1 + layout/svg/base/src/nsSVGMaskFrame.cpp | 6 ++++++ 3 files changed, 24 insertions(+) create mode 100644 layout/reftests/svg/objectBoundingBox-and-mask-02.svg diff --git a/layout/reftests/svg/objectBoundingBox-and-mask-02.svg b/layout/reftests/svg/objectBoundingBox-and-mask-02.svg new file mode 100644 index 000000000000..0184b288eb59 --- /dev/null +++ b/layout/reftests/svg/objectBoundingBox-and-mask-02.svg @@ -0,0 +1,17 @@ + + + + + Testcase for re-using an objectBoundingBox mask with a <g> child + + + + + + + + + diff --git a/layout/reftests/svg/reftest.list b/layout/reftests/svg/reftest.list index b2570ebbc465..a87e9b9df7a4 100644 --- a/layout/reftests/svg/reftest.list +++ b/layout/reftests/svg/reftest.list @@ -135,6 +135,7 @@ fails == inline-in-xul-basic-01.xul pass.svg # Bug 588684 random-if(gtk2Widget) == objectBoundingBox-and-fePointLight-01.svg objectBoundingBox-and-fePointLight-01-ref.svg == objectBoundingBox-and-mask.svg pass.svg +== objectBoundingBox-and-mask-02.svg pass.svg == objectBoundingBox-and-pattern-01a.svg objectBoundingBox-and-pattern-01-ref.svg == objectBoundingBox-and-pattern-01b.svg objectBoundingBox-and-pattern-01-ref.svg == objectBoundingBox-and-pattern-01c.svg objectBoundingBox-and-pattern-01-ref.svg diff --git a/layout/svg/base/src/nsSVGMaskFrame.cpp b/layout/svg/base/src/nsSVGMaskFrame.cpp index 1babe8c7b5f4..688875448fea 100644 --- a/layout/svg/base/src/nsSVGMaskFrame.cpp +++ b/layout/svg/base/src/nsSVGMaskFrame.cpp @@ -121,6 +121,12 @@ nsSVGMaskFrame::ComputeMaskAlpha(nsSVGRenderState *aContext, for (nsIFrame* kid = mFrames.FirstChild(); kid; kid = kid->GetNextSibling()) { + // The CTM of each frame referencing us can be different + nsISVGChildFrame* SVGFrame = do_QueryFrame(kid); + if (SVGFrame) { + SVGFrame->NotifySVGChanged(nsISVGChildFrame::SUPPRESS_INVALIDATION | + nsISVGChildFrame::TRANSFORM_CHANGED); + } nsSVGUtils::PaintFrameWithEffects(&tmpState, nsnull, kid); }