# HG changeset patch # Parent 5ceac2f64b5ce0bdaeee86c41e3f77164ddde5f1 # User Daniel Holbert Bug 604723: Multiply onto (instead of replacing) our gfxContext matrix when painting SVG images. r?jwatt a=blocking diff --git a/layout/reftests/svg/image/image-svg-inline-01.html b/layout/reftests/svg/image/image-svg-inline-01.html new file mode 100644 --- /dev/null +++ b/layout/reftests/svg/image/image-svg-inline-01.html @@ -0,0 +1,16 @@ + + + + +
+ + + + +
+ + diff --git a/layout/reftests/svg/image/reftest.list b/layout/reftests/svg/image/reftest.list --- a/layout/reftests/svg/image/reftest.list +++ b/layout/reftests/svg/image/reftest.list @@ -1,20 +1,21 @@ # Tests of the SVG element -== image-fill-01.svg ../pass.svg -== image-opacity-01.svg image-opacity-01-ref.svg -== image-opacity-02.svg image-opacity-02-ref.svg -== image-rotate-01.svg image-rotate-01-ref.svg -== image-rotate-02a.svg image-rotate-02-ref.svg -== image-rotate-02b.svg image-rotate-02-ref.svg -== image-scaling-01.svg ../pass.svg -== image-scaling-02.svg ../pass.svg -== image-translate-01.svg image-translate-01-ref.svg -== image-x-01.svg image-x-01-ref.svg -== image-xy-01.svg image-xy-01-ref.svg -== image-y-01.svg image-y-01-ref.svg +== image-fill-01.svg ../pass.svg +== image-opacity-01.svg image-opacity-01-ref.svg +== image-opacity-02.svg image-opacity-02-ref.svg +== image-rotate-01.svg image-rotate-01-ref.svg +== image-rotate-02a.svg image-rotate-02-ref.svg +== image-rotate-02b.svg image-rotate-02-ref.svg +== image-scaling-01.svg ../pass.svg +== image-scaling-02.svg ../pass.svg +== image-svg-inline-01.html ../pass.svg +== image-translate-01.svg image-translate-01-ref.svg +== image-x-01.svg image-x-01-ref.svg +== image-xy-01.svg image-xy-01-ref.svg +== image-y-01.svg image-y-01-ref.svg # Tests for with preserveAspectRatio # NOTE: The reference cases in the following tests trigger 20 assertions each # (1 per element), due to bug 563481. asserts(20) == image-preserveAspectRatio-01.svg image-preserveAspectRatio-01-ref.svg asserts(20) == image-preserveAspectRatio-02.svg image-preserveAspectRatio-02-ref.svg diff --git a/layout/svg/base/src/nsSVGImageFrame.cpp b/layout/svg/base/src/nsSVGImageFrame.cpp --- a/layout/svg/base/src/nsSVGImageFrame.cpp +++ b/layout/svg/base/src/nsSVGImageFrame.cpp @@ -253,17 +253,17 @@ nsSVGImageFrame::PaintSVG(nsSVGRenderSta gfxRect clipRect = nsSVGUtils::GetClipRectForFrame(this, x, y, width, height); nsSVGUtils::SetClipRect(ctx, GetCanvasTM(), clipRect); } // NOTE: To ensure that |width| and |height| don't accidentally // scale the user-unit size in SVG images, we apply those attributes // via |destRect|, not via our gfxContext's transform. - ctx->SetMatrix(GetImageTransform()); + ctx->Multiply(GetImageTransform()); // fill-opacity doesn't affect , so if we're allowed to // optimize group opacity, the opacity used for compositing the // image into the current canvas is just the group opacity. float opacity = 1.0f; if (nsSVGUtils::CanOptimizeOpacity(this)) { opacity = GetStyleDisplay()->mOpacity; }