haikuwebkit/LayoutTests/svg/custom/convolution-crash.svg

6 lines
315 B
XML
Raw Permalink Normal View History

2010-07-15 Alex Nicolaou <anicolao@chromium.org> Reviewed by Eric Seidel. Convolution computation causes bad alpha channel values https://bugs.webkit.org/show_bug.cgi?id=42273 Fixed by clamping colour channel values to the alpha value so that r <= a, g <= a, and b <= a after the convolution is applied. See the bug for why I believe the SVG specification needs to be updated. Test must be drawn to crash. 100x100 green rectangle is used to indicate pass to minimize the chance of regression. * platform/mac/svg/custom/convolution-crash-expected.checksum: Added. * platform/mac/svg/custom/convolution-crash-expected.txt: Added. * svg/custom/convolution-crash.svg: Added. 2010-07-15 Alex Nicolaou <anicolao@chromium.org> Reviewed by Eric Seidel. Convolution computation causes bad alpha channel values https://bugs.webkit.org/show_bug.cgi?id=42273 Fixed by clamping colour channel values to the alpha value so that r <= a, g <= a, and b <= a after the convolution is applied. See the bug for why I believe the SVG specification needs to be updated. Test must be drawn to crash. 100x100 green rectangle is used to indicate pass to minimize the chance of regression. Test: svg/custom/convolution-crash.svg * platform/graphics/skia/SkiaUtils.cpp: (WebCore::SkPMColorToColor): * svg/graphics/filters/SVGFEConvolveMatrix.cpp: (WebCore::clampRGBAValue): (WebCore::setDestinationPixels): (WebCore::FEConvolveMatrix::fastSetInteriorPixels): (WebCore::FEConvolveMatrix::fastSetOuterPixels): Canonical link: https://commits.webkit.org/54328@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@63485 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2010-07-15 23:14:04 +00:00
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<defs> <filter id="foo"> <feConvolveMatrix kernelMatrix="0 0 0 0 1 0 0 0 -1"/> </filter> </defs>
<image width="2" height="3" xlink:href="bar" filter="url(#foo)" />
<rect x="10" y="10" width="100" height="100" fill="green"/>
</svg>