haikuwebkit/LayoutTests/svg/filters/big-width-filter.svg

16 lines
338 B
XML
Raw Permalink Normal View History

Filters should test for area instead of single dimension https://bugs.webkit.org/show_bug.cgi?id=123716 Reviewed by Dirk Schulze. A filtered SVG element with a sigle dimension bigger than 5000 (counting the margin/border) will fail to render. So an element with 4000x4000 will render fine, while another with 5000x10 won't. This patch instead tests against the total element area, which fixes such cases. Source/WebCore: It also fixes some layer violations where FilterEffectRenderer and RenderSVGResourceFilter were directly accessing the maximum filter size in FilterEffect. Since before a somewhat bigger filter would be aborted, it required to change the maximum kernel size for blur filter (some filters are slower to run than others for bigger SVGs). Tests: svg/filters/big-height-filter-expected.svg svg/filters/big-height-filter.svg svg/filters/big-width-filter-expected.svg svg/filters/big-width-filter.svg * platform/graphics/filters/FEGaussianBlur.cpp: * platform/graphics/filters/FilterEffect.cpp: (WebCore::FilterEffect::maxFilterArea): New function, returns the maximum allowed element area (currently is 4096 x 4096). (WebCore::FilterEffect::isFilterSizeValid): Now it tests for element area instead of a single dimension. This code is reused by FilterEffectRenderer. * platform/graphics/filters/FilterEffect.h: * rendering/FilterEffectRenderer.cpp: (WebCore::FilterEffectRenderer::updateBackingStoreRect): Uses the new function in FilterEffect to test for valid sizes. (WebCore::FilterEffectRendererHelper::beginFilterEffect): Same case. * rendering/svg/RenderSVGResourceFilter.cpp: (WebCore::RenderSVGResourceFilter::fitsInMaximumImageSize): Test for maximum area and properly changes the scale of transformed element to fit. LayoutTests: The current patch fixes the rendering issue and at same time, fixes some layer violations where FilterEffectRenderer and RenderSVGResourceFilter were directly accessing the kMax value in FilterEffect. Since before a somewhat bigger filter would be aborted, it required to change the maximum kernel size for blur filter (some filters are slower to run than others for bigger SVGs). * svg/filters/big-height-filter-expected.svg: Added. * svg/filters/big-height-filter.svg: Added. * svg/filters/big-width-filter-expected.svg: Added. * svg/filters/big-width-filter.svg: Added. Canonical link: https://commits.webkit.org/147570@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@164886 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-02-28 22:54:47 +00:00
<svg xmlns="http://www.w3.org/2000/svg" style="width: 100px; height: 100px;">
<defs>
<filter id="simpler">
<feFlood flood-color="green"/>
</filter>
</defs>
<rect style="fill: red" width="4167" height="100">
</rect>
<rect style="fill: #000099; filter:url(#simpler);" width="4167" height="100">
</rect>
</svg>