Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
[Filters] LightSource should keep its points in <length-percentage> u…
…nits https://bugs.webkit.org/show_bug.cgi?id=241535 <rdar://problem/94973414> Reviewed by Cameron McCormack. PointLightSource and SpotLightSource are created with points in user space coordinates. See SVGFEPointLightElement::lightSource() and SVGFESpotLightElement::lightSource(). But this requires knowing the filter targetBoundingBox and the primitiveUnits at the LightSource creation time. When dynamically updating these points through SVGFEDiffuseLightingElement:: setFilterEffectAttribute() or SVGFESpecularLightingElement::setFilterEffectAttribute() the SVGFilter is not available and these points are stored as <length-percentage> coordinates. This means if the primitiveUnits is SVG_UNIT_TYPE_OBJECTBOUNDINGBOX, fractions of the targetBoundingBox will be treated as lengths in user space. The fix is to store the LightSources points in <length-percentage> units and to resolve them to user space coordinates in initPaintingData(). * LayoutTests/svg/filters/feDiffuseLighting-feSpotLight-dynamic-update-expected.svg: Added. * LayoutTests/svg/filters/feDiffuseLighting-feSpotLight-dynamic-update.svg: Added. * LayoutTests/svg/filters/feSpecularLighting-fePointLight-dynamic-update-expected.svg: Added. * LayoutTests/svg/filters/feSpecularLighting-fePointLight-dynamic-update.svg: Added. * Source/WebCore/platform/graphics/filters/Filter.h: (WebCore::Filter::resolvedPoint3D const): * Source/WebCore/platform/graphics/filters/PointLightSource.cpp: (WebCore::PointLightSource::PointLightSource): (WebCore::PointLightSource::initPaintingData const): (WebCore::PointLightSource::setX): (WebCore::PointLightSource::setY): (WebCore::PointLightSource::setZ): * Source/WebCore/platform/graphics/filters/PointLightSource.h: (WebCore::PointLightSource::position const): (WebCore::PointLightSource::encode const): * Source/WebCore/platform/graphics/filters/SpotLightSource.cpp: (WebCore::SpotLightSource::SpotLightSource): (WebCore::SpotLightSource::initPaintingData const): (WebCore::SpotLightSource::setX): (WebCore::SpotLightSource::setY): (WebCore::SpotLightSource::setZ): (WebCore::SpotLightSource::setPointsAtX): (WebCore::SpotLightSource::setPointsAtY): (WebCore::SpotLightSource::setPointsAtZ): * Source/WebCore/platform/graphics/filters/SpotLightSource.h: (WebCore::SpotLightSource::position const): (WebCore::SpotLightSource::direction const): (WebCore::SpotLightSource::encode const): * Source/WebCore/svg/SVGFEBlendElement.cpp: (WebCore::SVGFEBlendElement::filterEffect const): * Source/WebCore/svg/SVGFEBlendElement.h: * Source/WebCore/svg/SVGFEColorMatrixElement.cpp: (WebCore::SVGFEColorMatrixElement::filterEffect const): * Source/WebCore/svg/SVGFEColorMatrixElement.h: * Source/WebCore/svg/SVGFEComponentTransferElement.cpp: (WebCore::SVGFEComponentTransferElement::filterEffect const): * Source/WebCore/svg/SVGFEComponentTransferElement.h: * Source/WebCore/svg/SVGFECompositeElement.cpp: (WebCore::SVGFECompositeElement::filterEffect const): * Source/WebCore/svg/SVGFECompositeElement.h: * Source/WebCore/svg/SVGFEConvolveMatrixElement.cpp: (WebCore::SVGFEConvolveMatrixElement::filterEffect const): * Source/WebCore/svg/SVGFEConvolveMatrixElement.h: * Source/WebCore/svg/SVGFEDiffuseLightingElement.cpp: (WebCore::SVGFEDiffuseLightingElement::filterEffect const): * Source/WebCore/svg/SVGFEDiffuseLightingElement.h: * Source/WebCore/svg/SVGFEDisplacementMapElement.cpp: (WebCore::SVGFEDisplacementMapElement::filterEffect const): * Source/WebCore/svg/SVGFEDisplacementMapElement.h: * Source/WebCore/svg/SVGFEDistantLightElement.cpp: (WebCore::SVGFEDistantLightElement::lightSource const): * Source/WebCore/svg/SVGFEDistantLightElement.h: * Source/WebCore/svg/SVGFEDropShadowElement.cpp: (WebCore::SVGFEDropShadowElement::filterEffect const): * Source/WebCore/svg/SVGFEDropShadowElement.h: * Source/WebCore/svg/SVGFEFloodElement.cpp: (WebCore::SVGFEFloodElement::filterEffect const): * Source/WebCore/svg/SVGFEFloodElement.h: * Source/WebCore/svg/SVGFEGaussianBlurElement.cpp: (WebCore::SVGFEGaussianBlurElement::filterEffect const): * Source/WebCore/svg/SVGFEGaussianBlurElement.h: * Source/WebCore/svg/SVGFEImageElement.cpp: (WebCore::SVGFEImageElement::filterEffect const): * Source/WebCore/svg/SVGFEImageElement.h: * Source/WebCore/svg/SVGFELightElement.h: * Source/WebCore/svg/SVGFEMergeElement.cpp: (WebCore::SVGFEMergeElement::filterEffect const): * Source/WebCore/svg/SVGFEMergeElement.h: * Source/WebCore/svg/SVGFEMorphologyElement.cpp: (WebCore::SVGFEMorphologyElement::filterEffect const): * Source/WebCore/svg/SVGFEMorphologyElement.h: * Source/WebCore/svg/SVGFEOffsetElement.cpp: (WebCore::SVGFEOffsetElement::filterEffect const): * Source/WebCore/svg/SVGFEOffsetElement.h: * Source/WebCore/svg/SVGFEPointLightElement.cpp: (WebCore::SVGFEPointLightElement::lightSource const): * Source/WebCore/svg/SVGFEPointLightElement.h: * Source/WebCore/svg/SVGFESpecularLightingElement.cpp: (WebCore::SVGFESpecularLightingElement::filterEffect const): * Source/WebCore/svg/SVGFESpecularLightingElement.h: * Source/WebCore/svg/SVGFESpotLightElement.cpp: (WebCore::SVGFESpotLightElement::lightSource const): * Source/WebCore/svg/SVGFESpotLightElement.h: * Source/WebCore/svg/SVGFETileElement.cpp: (WebCore::SVGFETileElement::filterEffect const): * Source/WebCore/svg/SVGFETileElement.h: * Source/WebCore/svg/SVGFETurbulenceElement.cpp: (WebCore::SVGFETurbulenceElement::filterEffect const): * Source/WebCore/svg/SVGFETurbulenceElement.h: * Source/WebCore/svg/SVGFilterPrimitiveStandardAttributes.h: * Source/WebCore/svg/graphics/filters/SVGFilter.cpp: (WebCore::SVGFilter::resolvedPoint3D const): * Source/WebCore/svg/graphics/filters/SVGFilter.h: * Source/WebCore/svg/graphics/filters/SVGFilterBuilder.cpp: (WebCore::SVGFilterBuilder::buildFilterExpression): Canonical link: https://commits.webkit.org/251486@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@295481 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Showing
54 changed files
with
210 additions
and
139 deletions.
There are no files selected for viewing
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.
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
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
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
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
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.