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
[GPU Process] Make SVGFilter and CSSFilter work in the same coordinat…
…es system https://bugs.webkit.org/show_bug.cgi?id=232457 rdar://85035379 Reviewed by Simon Fraser. Source/WebCore: Currently SVGFilter sets the following members of Filter 1. AffineTransform m_absoluteTransform: this is the scaling part from the transformation from the target element to the outermost coordinate system 2. FloatSize m_filterResolution: this is the clamping scale if the size of the result ImageBuffers exceeds MaxClampedArea And the CSSFilter sets the following member of Filter: 1. float m_filterScale: this is the document().deviceScaleFactor() The discrepancy happens also when creating the result ImageBuffers. For SVGFilter, we create them with scaleFactor = 1. This means the logicalSize of the ImageBuffer is equal to its backendSize. But for CSSFilter we create them with scaleFactor = m_filterScale. This means the logicalSize != backendSize in this case. We need to unify the coordinates system for both filters. We need also to replace the three members by a single FloatSize called "m_filterScale". * css/CSSFilterImageValue.cpp: (WebCore::CSSFilterImageValue::image): * platform/graphics/coreimage/FilterEffectRendererCoreImage.mm: (WebCore::FilterEffectRendererCoreImage::renderToImageBuffer): (WebCore::FilterEffectRendererCoreImage::destRect const): * platform/graphics/filters/FEConvolveMatrix.cpp: (WebCore::FEConvolveMatrix::platformApplySoftware): * platform/graphics/filters/FEDisplacementMap.cpp: (WebCore::FEDisplacementMap::platformApplySoftware): * platform/graphics/filters/FEDropShadow.cpp: (WebCore::FEDropShadow::determineAbsolutePaintRect): (WebCore::FEDropShadow::platformApplySoftware): * platform/graphics/filters/FEGaussianBlur.cpp: (WebCore::FEGaussianBlur::calculateKernelSize): (WebCore::FEGaussianBlur::platformApplySoftware): * platform/graphics/filters/FEMorphology.cpp: (WebCore::FEMorphology::determineAbsolutePaintRect): (WebCore::FEMorphology::platformApplySoftware): * platform/graphics/filters/FEOffset.cpp: (WebCore::FEOffset::determineAbsolutePaintRect): (WebCore::FEOffset::platformApplySoftware): * platform/graphics/filters/FETile.cpp: (WebCore::FETile::platformApplySoftware): * platform/graphics/filters/FETurbulence.cpp: (WebCore::FETurbulence::fillRegion const): (WebCore::FETurbulence::platformApplySoftware): * platform/graphics/filters/Filter.h: (WebCore::Filter::filterScale const): (WebCore::Filter::setFilterScale): (WebCore::Filter::sourceImageRect const): (WebCore::Filter::setSourceImageRect): (WebCore::Filter::filterRegion const): (WebCore::Filter::setFilterRegion): (WebCore::Filter::scaledByFilterScale const): (WebCore::Filter::sourceImage): (WebCore::Filter::setSourceImage): (WebCore::Filter::Filter): (WebCore::Filter::filterResolution const): Deleted. (WebCore::Filter::setFilterResolution): Deleted. (WebCore::Filter::absoluteTransform const): Deleted. (WebCore::Filter::isSVGFilter const): Deleted. (WebCore::Filter::isCSSFilter const): Deleted. (WebCore::Filter::scaledByFilterResolution const): Deleted. * platform/graphics/filters/FilterEffect.cpp: (WebCore::FilterEffect::determineFilterPrimitiveSubregion): (WebCore::FilterEffect::apply): (WebCore::FilterEffect::imageBufferResult): (WebCore::FilterEffect::unmultipliedResult): (WebCore::FilterEffect::premultipliedResult): (WebCore::FilterEffect::copyImageBytes const): (WebCore::FilterEffect::convertPixelBufferToColorSpace): (WebCore::FilterEffect::convertImageBufferToColorSpace): (WebCore::FilterEffect::copyUnmultipliedResult): (WebCore::FilterEffect::copyPremultipliedResult): (WebCore::FilterEffect::createImageBufferResult): (WebCore::FilterEffect::createUnmultipliedImageResult): (WebCore::FilterEffect::createPremultipliedImageResult): * platform/graphics/filters/SourceGraphic.cpp: (WebCore::SourceGraphic::determineAbsolutePaintRect): * rendering/CSSFilter.cpp: (WebCore::CSSFilter::create): (WebCore::CSSFilter::CSSFilter): (WebCore::CSSFilter::buildReferenceFilter): (WebCore::CSSFilter::build): (WebCore::CSSFilter::allocateBackingStoreIfNeeded): (WebCore::CSSFilter::determineFilterPrimitiveSubregion): (WebCore::CSSFilter::clearIntermediateResults): (WebCore::CSSFilter::setSourceImageRect): (WebCore::CSSFilter::outputRect const): * rendering/CSSFilter.h: * rendering/RenderLayerFilters.cpp: (WebCore::RenderLayerFilters::buildFilter): * rendering/svg/RenderSVGResourceFilter.cpp: (WebCore::RenderSVGResourceFilter::applyResource): (WebCore::RenderSVGResourceFilter::postApplyResource): * rendering/svg/RenderSVGResourceFilter.h: * rendering/svg/SVGRenderTreeAsText.cpp: (WebCore::writeSVGResourceContainer): * svg/graphics/filters/SVGFEImage.cpp: (WebCore::FEImage::determineAbsolutePaintRect): (WebCore::FEImage::platformApplySoftware): * svg/graphics/filters/SVGFilter.cpp: (WebCore::SVGFilter::SVGFilter): (WebCore::SVGFilter::scaledByFilterScale const): (WebCore::SVGFilter::create): (WebCore::SVGFilter::scaledByFilterResolution const): Deleted. * svg/graphics/filters/SVGFilter.h: LayoutTests: * TestExpectations: Skip the hidpi reference filter tests till we connect the FilterEffects to the correct parent Filter. * platform/ios/TestExpectations: * platform/mac/TestExpectations: Remove unnecessary un-skipping for conic-gradients tests since they were not skipped globally. Canonical link: https://commits.webkit.org/244103@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@285597 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Showing
27 changed files
with
279 additions
and
194 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
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
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.