Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
[GPU Process] Remove the dependency from FilterEffect to its inputs
https://bugs.webkit.org/show_bug.cgi?id=232841 rdar://85425930 Reviewed by Darin Adler. This is the last clean-up in the FilterEffect code. It will make the FilterEffect objects in the GPUProcess resemble exactly their counterpart ones in the WebProcess from now on. For CSSFilter, we do not need to set the input effects because every FilterFunction is the input of its successor. Passing the previous result FilterImage to the apply() method of the current FilterFunction is enough to get the filter applied correctly. For SVGFilter, we need the filter effect inputs only when building the SVGFilterExpression. So we can build a HashMap in SVGFilterBuilder which maps a FilterEffect to its input FilterEffectVector. To make the change clearer, the SVGFExxxElement classes will implement two methods: 1. filterEffectInputsNames() which returns the names of the input FilterEffects. 2. filterEffect() which returns the FilterEffect representing this element. SVGFilterBuilder::buildFilterEffects() converts the names to FilterEffects. No need to initialize the SourceGraphic of the referenced SVGFilter with the FilterEffect of its previous FilterFunction. The referenced SVGFilter will create its own native SourceGraphic. This SourceGraphic will copy the input FilterImage to the result FilterImage. * platform/graphics/filters/FilterEffect.cpp: (WebCore::FilterEffect::inputEffect const): Deleted. * platform/graphics/filters/FilterEffect.h: (WebCore::FilterEffect::inputEffects): Deleted. * platform/graphics/filters/SourceAlpha.cpp: (WebCore::SourceAlpha::create): (WebCore::SourceAlpha::SourceAlpha): * platform/graphics/filters/SourceAlpha.h: * rendering/CSSFilter.cpp: (WebCore::createSVGFilter): (WebCore::CSSFilter::buildFilterFunctions): * rendering/svg/RenderSVGResourceFilter.cpp: (WebCore::RenderSVGResourceFilter::applyResource): * rendering/svg/SVGRenderTreeAsText.cpp: (WebCore::writeSVGResourceContainer): * svg/SVGFEBlendElement.cpp: (WebCore::SVGFEBlendElement::filterEffect const): (WebCore::SVGFEBlendElement::build const): Deleted. * svg/SVGFEBlendElement.h: * svg/SVGFEColorMatrixElement.cpp: (WebCore::SVGFEColorMatrixElement::filterEffect const): (WebCore::SVGFEColorMatrixElement::build const): Deleted. * svg/SVGFEColorMatrixElement.h: * svg/SVGFEComponentTransferElement.cpp: (WebCore::SVGFEComponentTransferElement::filterEffect const): (WebCore::SVGFEComponentTransferElement::build const): Deleted. * svg/SVGFEComponentTransferElement.h: * svg/SVGFECompositeElement.cpp: (WebCore::SVGFECompositeElement::filterEffect const): (WebCore::SVGFECompositeElement::build const): Deleted. * svg/SVGFECompositeElement.h: * svg/SVGFEConvolveMatrixElement.cpp: (WebCore::SVGFEConvolveMatrixElement::filterEffect const): (WebCore::SVGFEConvolveMatrixElement::build const): Deleted. * svg/SVGFEConvolveMatrixElement.h: * svg/SVGFEDiffuseLightingElement.cpp: (WebCore::SVGFEDiffuseLightingElement::filterEffect const): (WebCore::SVGFEDiffuseLightingElement::build const): Deleted. * svg/SVGFEDiffuseLightingElement.h: * svg/SVGFEDisplacementMapElement.cpp: (WebCore::SVGFEDisplacementMapElement::filterEffect const): (WebCore::SVGFEDisplacementMapElement::build const): Deleted. * svg/SVGFEDisplacementMapElement.h: * svg/SVGFEDistantLightElement.cpp: (WebCore::SVGFEDistantLightElement::lightSource const): * svg/SVGFEDistantLightElement.h: * svg/SVGFEDropShadowElement.cpp: (WebCore::SVGFEDropShadowElement::filterEffect const): (WebCore::SVGFEDropShadowElement::build const): Deleted. * svg/SVGFEDropShadowElement.h: * svg/SVGFEFloodElement.cpp: (WebCore::SVGFEFloodElement::filterEffect const): (WebCore::SVGFEFloodElement::build const): Deleted. * svg/SVGFEFloodElement.h: * svg/SVGFEGaussianBlurElement.cpp: (WebCore::SVGFEGaussianBlurElement::filterEffect const): (WebCore::SVGFEGaussianBlurElement::build const): Deleted. * svg/SVGFEGaussianBlurElement.h: * svg/SVGFEImageElement.cpp: (WebCore::SVGFEImageElement::filterEffect const): (WebCore::SVGFEImageElement::build const): Deleted. * svg/SVGFEImageElement.h: * svg/SVGFELightElement.h: * svg/SVGFEMergeElement.cpp: (WebCore::SVGFEMergeElement::filterEffectInputsNames const): (WebCore::SVGFEMergeElement::filterEffect const): (WebCore::SVGFEMergeElement::build const): Deleted. * svg/SVGFEMergeElement.h: * svg/SVGFEMorphologyElement.cpp: (WebCore::SVGFEMorphologyElement::filterEffect const): (WebCore::SVGFEMorphologyElement::build const): Deleted. * svg/SVGFEMorphologyElement.h: * svg/SVGFEOffsetElement.cpp: (WebCore::SVGFEOffsetElement::filterEffect const): (WebCore::SVGFEOffsetElement::build const): Deleted. * svg/SVGFEOffsetElement.h: * svg/SVGFEPointLightElement.cpp: (WebCore::SVGFEPointLightElement::lightSource const): * svg/SVGFEPointLightElement.h: * svg/SVGFESpecularLightingElement.cpp: (WebCore::SVGFESpecularLightingElement::filterEffect const): (WebCore::SVGFESpecularLightingElement::build const): Deleted. * svg/SVGFESpecularLightingElement.h: * svg/SVGFESpotLightElement.cpp: (WebCore::SVGFESpotLightElement::lightSource const): * svg/SVGFESpotLightElement.h: * svg/SVGFETileElement.cpp: (WebCore::SVGFETileElement::filterEffect const): (WebCore::SVGFETileElement::build const): Deleted. * svg/SVGFETileElement.h: * svg/SVGFETurbulenceElement.cpp: (WebCore::SVGFETurbulenceElement::filterEffect const): (WebCore::SVGFETurbulenceElement::build const): Deleted. * svg/SVGFETurbulenceElement.h: * svg/SVGFilterPrimitiveStandardAttributes.h: (WebCore::SVGFilterPrimitiveStandardAttributes::filterEffectInputsNames const): * svg/graphics/filters/SVGFilter.cpp: (WebCore::SVGFilter::create): * svg/graphics/filters/SVGFilter.h: * svg/graphics/filters/SVGFilterBuilder.cpp: (WebCore::SVGFilterBuilder::setupBuiltinEffects): (WebCore::SVGFilterBuilder::buildFilterEffects): (WebCore::SVGFilterBuilder::sourceGraphic const): (WebCore::SVGFilterBuilder::sourceAlpha const): (WebCore::SVGFilterBuilder::addNamedEffect): (WebCore::SVGFilterBuilder::namedEffect const): (WebCore::SVGFilterBuilder::namedEffects const): (WebCore::SVGFilterBuilder::setEffectInputs): (WebCore::SVGFilterBuilder::buildEffectExpression const): (WebCore::SVGFilterBuilder::add): Deleted. (WebCore::SVGFilterBuilder::getEffectById const): Deleted. * svg/graphics/filters/SVGFilterBuilder.h: Canonical link: https://commits.webkit.org/245930@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@287892 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Showing
with
377 additions
and 340 deletions.
- +143 −0 Source/WebCore/ChangeLog
- +0 −6 Source/WebCore/platform/graphics/filters/FilterEffect.cpp
- +4 −12 Source/WebCore/platform/graphics/filters/FilterEffect.h
- +5 −17 Source/WebCore/platform/graphics/filters/SourceAlpha.cpp
- +2 −4 Source/WebCore/platform/graphics/filters/SourceAlpha.h
- +6 −12 Source/WebCore/rendering/CSSFilter.cpp
- +1 −1 Source/WebCore/rendering/svg/RenderSVGResourceFilter.cpp
- +1 −1 Source/WebCore/rendering/svg/SVGRenderTreeAsText.cpp
- +4 −14 Source/WebCore/svg/SVGFEBlendElement.cpp
- +3 −2 Source/WebCore/svg/SVGFEBlendElement.h
- +5 −13 Source/WebCore/svg/SVGFEColorMatrixElement.cpp
- +3 −2 Source/WebCore/svg/SVGFEColorMatrixElement.h
- +5 −13 Source/WebCore/svg/SVGFEComponentTransferElement.cpp
- +3 −2 Source/WebCore/svg/SVGFEComponentTransferElement.h
- +5 −14 Source/WebCore/svg/SVGFECompositeElement.cpp
- +3 −2 Source/WebCore/svg/SVGFECompositeElement.h
- +8 −15 Source/WebCore/svg/SVGFEConvolveMatrixElement.cpp
- +3 −2 Source/WebCore/svg/SVGFEConvolveMatrixElement.h
- +4 −13 Source/WebCore/svg/SVGFEDiffuseLightingElement.cpp
- +3 −2 Source/WebCore/svg/SVGFEDiffuseLightingElement.h
- +5 −14 Source/WebCore/svg/SVGFEDisplacementMapElement.cpp
- +3 −2 Source/WebCore/svg/SVGFEDisplacementMapElement.h
- +1 −1 Source/WebCore/svg/SVGFEDistantLightElement.cpp
- +1 −1 Source/WebCore/svg/SVGFEDistantLightElement.h
- +4 −11 Source/WebCore/svg/SVGFEDropShadowElement.cpp
- +3 −2 Source/WebCore/svg/SVGFEDropShadowElement.h
- +4 −3 Source/WebCore/svg/SVGFEFloodElement.cpp
- +2 −1 Source/WebCore/svg/SVGFEFloodElement.h
- +5 −12 Source/WebCore/svg/SVGFEGaussianBlurElement.cpp
- +3 −2 Source/WebCore/svg/SVGFEGaussianBlurElement.h
- +3 −3 Source/WebCore/svg/SVGFEImageElement.cpp
- +2 −2 Source/WebCore/svg/SVGFEImageElement.h
- +1 −1 Source/WebCore/svg/SVGFELightElement.h
- +11 −20 Source/WebCore/svg/SVGFEMergeElement.cpp
- +3 −1 Source/WebCore/svg/SVGFEMergeElement.h
- +5 −14 Source/WebCore/svg/SVGFEMorphologyElement.cpp
- +3 −2 Source/WebCore/svg/SVGFEMorphologyElement.h
- +4 −12 Source/WebCore/svg/SVGFEOffsetElement.cpp
- +3 −2 Source/WebCore/svg/SVGFEOffsetElement.h
- +1 −1 Source/WebCore/svg/SVGFEPointLightElement.cpp
- +1 −1 Source/WebCore/svg/SVGFEPointLightElement.h
- +7 −14 Source/WebCore/svg/SVGFESpecularLightingElement.cpp
- +3 −2 Source/WebCore/svg/SVGFESpecularLightingElement.h
- +1 −3 Source/WebCore/svg/SVGFESpotLightElement.cpp
- +1 −1 Source/WebCore/svg/SVGFESpotLightElement.h
- +4 −13 Source/WebCore/svg/SVGFETileElement.cpp
- +3 −2 Source/WebCore/svg/SVGFETileElement.h
- +4 −3 Source/WebCore/svg/SVGFETurbulenceElement.cpp
- +2 −2 Source/WebCore/svg/SVGFETurbulenceElement.h
- +6 −5 Source/WebCore/svg/SVGFilterPrimitiveStandardAttributes.h
- +2 −16 Source/WebCore/svg/graphics/filters/SVGFilter.cpp
- +1 −3 Source/WebCore/svg/graphics/filters/SVGFilter.h
- +52 −15 Source/WebCore/svg/graphics/filters/SVGFilterBuilder.cpp
- +12 −6 Source/WebCore/svg/graphics/filters/SVGFilterBuilder.h
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
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.