Bug 725918 patch 2: Fixed wrong assertion in nsSVGGlyphFrame. r=longsonr

This commit is contained in:
Edwin Flores 2012-02-17 16:33:23 -08:00
parent e1c317e025
commit da32cba556
6 changed files with 36 additions and 7 deletions

View File

@ -242,6 +242,7 @@ fails-if(Android) random-if(gtk2Widget) != text-language-01.xhtml text-language-
== text-layout-03.svg text-layout-03-ref.svg
== text-layout-04.svg text-layout-04-ref.svg
== text-layout-05.svg text-layout-05-ref.svg
== text-layout-06.svg text-layout-06-ref.svg
== text-scale-01.svg text-scale-01-ref.svg
== text-stroke-scaling-01.svg text-stroke-scaling-01-ref.svg
== stroke-dasharray-and-pathLength-01.svg pass.svg

View File

@ -0,0 +1,10 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<svg xmlns="http://www.w3.org/2000/svg">
<title>Reference to check fill and stroke handling</title>
<text x="50" y="80" font-size="80" fill="blue" stroke="none">A B</text>
<text x="50" y="80" font-size="80" fill="none" stroke="yellow" stroke-width="2">A B</text>
</svg>

After

Width:  |  Height:  |  Size: 395 B

View File

@ -0,0 +1,9 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<svg xmlns="http://www.w3.org/2000/svg">
<title>Testcase to check fill and stroke handling</title>
<text x="50" y="80" font-size="80" fill="blue" stroke="yellow" stroke-width="2">A B</text>
</svg>

After

Width:  |  Height:  |  Size: 320 B

View File

@ -900,21 +900,25 @@ nsSVGGlyphFrame::SetupCairoState(gfxContext *aContext, nsRefPtr<gfxPattern> *aSt
nsSVGPaintServerFrame *ps = GetPaintServer(&style->mStroke,
nsSVGEffects::StrokeProperty());
nsRefPtr<gfxPattern> strokePattern;
if (ps) {
// Gradient or Pattern: can get pattern directly from frame
*aStrokePattern = ps->GetPaintServerPattern(this, opacity);
strokePattern = ps->GetPaintServerPattern(this, opacity);
}
NS_ASSERTION(*aStrokePattern, "No pattern returned from paint server");
} else {
if (!strokePattern) {
nscolor color;
nsSVGUtils::GetFallbackOrPaintColor(aContext, GetStyleContext(),
&nsStyleSVG::mStroke, &opacity,
&color);
*aStrokePattern = new gfxPattern(gfxRGBA(NS_GET_R(color) / 255.0,
NS_GET_G(color) / 255.0,
NS_GET_B(color) / 255.0,
NS_GET_A(color) / 255.0 * opacity));
strokePattern = new gfxPattern(gfxRGBA(NS_GET_R(color) / 255.0,
NS_GET_G(color) / 255.0,
NS_GET_B(color) / 255.0,
NS_GET_A(color) / 255.0 * opacity));
}
strokePattern.swap(*aStrokePattern);
}
if (SetupCairoFill(aContext)) {

View File

@ -0,0 +1,4 @@
<svg xmlns="http://www.w3.org/2000/svg">
<text stroke="url(#p)">t</text>
<pattern id="p"/>
</svg>

After

Width:  |  Height:  |  Size: 102 B

View File

@ -123,3 +123,4 @@ load 709920-1.svg
load 709920-2.svg
load 713413-1.svg
load 722003-1.svg
load 725918-1.svg