Bug 786216 - Fix evenodd fill-rule. r=jwatt

This commit is contained in:
Robert Longson 2012-08-28 15:47:01 +01:00
parent 5f0b06009c
commit f974ac08a0
3 changed files with 18 additions and 0 deletions

View File

@ -309,6 +309,7 @@ random-if(/^Windows\x20NT\x205\.1/.test(http.oscpu)) == tspan-rotate-06.svg tspa
== viewBox-valid-01.svg pass.svg
== viewBox-valid-02.xhtml pass.svg
== viewport-percent-graphic-user-01.svg pass.svg
== winding-01.svg pass.svg
== svg-effects-area-unzoomed.xhtml svg-effects-area-unzoomed-ref.xhtml
== svg-effects-area-zoomed-in.xhtml svg-effects-area-zoomed-in-ref.xhtml

View File

@ -0,0 +1,11 @@
<svg xmlns="http://www.w3.org/2000/svg" version="1.1">
<title>Testcase for path with evenodd winding</title>
<!-- From https://bugzilla.mozilla.org/show_bug.cgi?id=786216 -->
<rect width="100%" height="100%" fill="lime"/>
<path fill-rule="evenodd" fill="red" d="M100,100 l 50,0 0,50 -50,0 0,-50 50,0 0,50 -50,0 0,-50z"/>
</svg>

After

Width:  |  Height:  |  Size: 343 B

View File

@ -1894,6 +1894,12 @@ nsSVGUtils::SetupCairoFillPaint(nsIFrame *aFrame, gfxContext* aContext)
const nsStyleSVG* style = aFrame->GetStyleSVG();
if (style->mFill.mType == eStyleSVGPaintType_None)
return false;
if (style->mFillRule == NS_STYLE_FILL_RULE_EVENODD)
aContext->SetFillRule(gfxContext::FILL_RULE_EVEN_ODD);
else
aContext->SetFillRule(gfxContext::FILL_RULE_WINDING);
float opacity = MaybeOptimizeOpacity(aFrame, style->mFillOpacity);
nsSVGPaintServerFrame *ps =
nsSVGEffects::GetPaintServer(aFrame, &style->mFill, nsSVGEffects::FillProperty());