Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge r182067 - FEMorphology::platformApplyGeneric() should bail out …
…if the radius is less than or equal to zero. https://bugs.webkit.org/show_bug.cgi?id=142885. Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2015-03-27 Reviewed by Dean Jackson. Source/WebCore: FEMorphology class implementation code clean up. Tests: svg/filters/feMorphology-radius-cases.svg * platform/graphics/filters/FEMorphology.cpp: (WebCore::shouldSupersedeExtremum): Reuse code instead of repeating it and use < and > instead of =< and >=. (WebCore::pixelArrayIndex): Returns the array index of a pixel in an image buffer, given: position(x, y), image width and the color channel. (WebCore::columnExtremum): Returns the extremum of a column of pixels. (WebCore::kernelExtremum): Returns the extremum of a filter kernel. (WebCore::FEMorphology::platformApplyGeneric): Apply some code clean-up. The kernel size should be equal to radius of the filter. The extra pixel was causing the resulted image to be asymmetric in some cases. (WebCore::FEMorphology::platformApplyDegenerate): (WebCore::FEMorphology::platformApplySoftware): After applying scaling, we still need to check the resulted radius is negative (overflow case) or less than one (zero radius case) and treat these cases differently. (WebCore::FEMorphology::morphologyOperator): Deleted. (WebCore::FEMorphology::radiusX): Deleted. (WebCore::FEMorphology::radiusY): Deleted. * platform/graphics/filters/FEMorphology.h: (WebCore::FEMorphology::morphologyOperator): (WebCore::FEMorphology::radiusX): (WebCore::FEMorphology::radiusY): Move a single line functions from the source file to the header file. LayoutTests: * svg/filters/feMorphology-radius-cases-expected.svg: Added. * svg/filters/feMorphology-radius-cases.svg: Added. Test different cases for radius of the feMorphology filter. There are three cases for the radius: 1. radius < 0: This is an error case, the source image should not be rendered. 2. radius = 0: This case is treated as if the filter never exists. 3. radius > 0: If the scaled radius is > 0, the filter is applied.
- Loading branch information
1 parent
5bb670a
commit 000c174
Showing
6 changed files
with
257 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
LayoutTests/svg/filters/feMorphology-radius-cases-expected.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.