Bug 691646 - Pattern tile pixelated on patternTransform. r=dholbert

This commit is contained in:
Robert Longson 2011-10-04 16:22:46 +01:00
parent c632b70b2b
commit 80407654c9
4 changed files with 31 additions and 2 deletions

View File

@ -0,0 +1,13 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<svg xmlns="http://www.w3.org/2000/svg">
<defs>
<pattern id="pattern" width="200" height="200" patternUnits="userSpaceOnUse">
<circle cx="100" cy="100" r="100" fill="lime" />
</pattern>
</defs>
<rect width="200" height="200" fill="url(#pattern)" />
<circle cx="100" cy="100" r="100" fill="none" stroke="lime" stroke-width="2" shape-rendering="crispEdges" />
</svg>

After

Width:  |  Height:  |  Size: 505 B

View File

@ -0,0 +1,13 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<svg xmlns="http://www.w3.org/2000/svg">
<defs>
<pattern id="pattern" width="5" height="5" patternUnits="userSpaceOnUse" patternTransform="scale(-40)">
<circle cx="2.5" cy="2.5" r="2.5" fill="lime" />
</pattern>
</defs>
<rect width="200" height="200" fill="url(#pattern)" />
<circle cx="100" cy="100" r="100" fill="none" stroke="lime" stroke-width="2" shape-rendering="crispEdges" />
</svg>

After

Width:  |  Height:  |  Size: 531 B

View File

@ -176,6 +176,7 @@ fails-if(Android&&layersOpenGL) == path-04.svg pass.svg
== pattern-live-01a.svg pattern-live-01-ref.svg
== pattern-live-01b.svg pattern-live-01-ref.svg
== pattern-live-01c.svg pattern-live-01-ref.svg
== pattern-scale-01.svg pattern-scale-01-ref.svg
== pattern-transform-presence-01.svg pattern-transform-presence-01-ref.svg
== polygon-marker-01.svg pass.svg
== polygon-points-negative-01.svg pass.svg

View File

@ -261,8 +261,10 @@ nsSVGPatternFrame::PaintPattern(gfxASurface** surface,
bool resultOverflows;
gfxIntSize surfaceSize =
nsSVGUtils::ConvertToSurfaceSize(gfxSize(patternWidth, patternHeight),
&resultOverflows);
nsSVGUtils::ConvertToSurfaceSize(
gfxSize(patternWidth * fabs(patternMatrix->xx),
patternHeight * fabs(patternMatrix->yy)),
&resultOverflows);
// 0 disables rendering, < 0 is an error
if (surfaceSize.width <= 0 || surfaceSize.height <= 0)