Bug 1127507 - Get transforms on the children of SVG <mask> working. r=dholbert

This commit is contained in:
Jonathan Watt 2015-01-29 23:58:42 +00:00
parent e60ef82770
commit 9aa1f1fb38
4 changed files with 21 additions and 1 deletions

View File

@ -0,0 +1,8 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<svg xmlns="http://www.w3.org/2000/svg">
<rect x="50" y="75" width="100" height="50" fill="blue"/>
</svg>

After

Width:  |  Height:  |  Size: 227 B

View File

@ -0,0 +1,11 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<svg xmlns="http://www.w3.org/2000/svg">
<mask id="mask" maskUnits="objectBoundingBox" maskContentUnits="objectBoundingBox">
<rect x="0.25" y="0" width="0.5" height="1" fill="white" transform="rotate(90,0.5,0.5)"/>
</mask>
<rect x="50" y="50" width="100" height="100" fill="blue" mask="url(#mask)"/>
</svg>

After

Width:  |  Height:  |  Size: 436 B

View File

@ -209,6 +209,7 @@ pref(svg.marker-improvements.enabled,true) == marker-orientation-02.svg marker-o
== mask-containing-masked-content-01.svg pass.svg
== mask-transformed-01.svg mask-transformed-01-ref.svg
== mask-transformed-02.svg pass.svg
== mask-transformed-child-01.svg mask-transformed-child-01-ref.svg
pref(layout.css.masking.enabled,true) fuzzy-if(d2d,1,6400) == mask-type-01.svg mask-type-01-ref.svg
pref(layout.css.masking.enabled,true) fuzzy-if(d2d,1,6400) == mask-type-02.svg mask-type-01-ref.svg
pref(layout.css.masking.enabled,true) fuzzy-if(d2d,1,6400) == mask-type-03.svg mask-type-01-ref.svg

View File

@ -277,7 +277,7 @@ nsSVGMaskFrame::GetMaskForMaskedFrame(gfxContext* aContext,
m = static_cast<nsSVGElement*>(kid->GetContent())->
PrependLocalTransformsTo(m);
}
nsSVGUtils::PaintFrameWithEffects(kid, *tmpCtx, mMatrixForChildren);
nsSVGUtils::PaintFrameWithEffects(kid, *tmpCtx, m);
}
RefPtr<SourceSurface> maskSnapshot = maskDT->Snapshot();