-
Notifications
You must be signed in to change notification settings - Fork 1.8k
[CI Filters] Implement FEGaussianBlur in Core Image, and fix some geometry issues #56009
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
EWS run on previous version of this PR (hash e41a15c) Details
|
e41a15c to
be5879e
Compare
|
EWS run on previous version of this PR (hash be5879e) Details |
| // FIXME: Support edge modes. | ||
| auto absoluteStdDeviation = filter.scaledByFilterScale(FloatSize(m_effect->stdDeviationX(), m_effect->stdDeviationY())); | ||
|
|
||
| auto ciFilter = [CIFilter filterWithName:@"CIGaussianBlurXY"]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should you use RetainPtr here since filterWithName says:
Creates a CIFilter object for a specific kind of filter.
so presumably an auto-released object is returned?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be a RetainPtr
Safer C++ Build #72966 (e41a15c)❌ Found 1 failing file with 1 issue. Please address these issues before landing. See WebKit Guidelines for Safer C++ Programming. |
Safer C++ Build #72968 (be5879e)❌ Found 1 failing file with 1 issue. Please address these issues before landing. See WebKit Guidelines for Safer C++ Programming. |
be5879e to
726fb60
Compare
|
EWS run on previous version of this PR (hash 726fb60) Details
|
726fb60 to
653d01d
Compare
|
EWS run on current version of this PR (hash 653d01d) Details |
…metry issues https://bugs.webkit.org/show_bug.cgi?id=304854 rdar://167443665 Reviewed by Mike Wyrzykowski. Add FEGaussianBlurCoreImageApplier, which uses a `CIGaussianBlurXY` filter so we can control X and Y radii independently. Testing this revealed an issue where the geometry was wrong for SVG reference filters used in CSS. When a CSS filter chain contains both CSS and SVG filters, the entire chain is rendered using Core Image if possible. This means that every primitive needs to use the same reference geometry, since Core Image works in flipped coordinates, so the rect relative to which flipping happens needs to be consistent. To fix this, introduce the concept of an "enclosing filter region", which is the union of the filterRegions of all the filters in the chain. This is computed by `CSSFilterRenderer` just before applying. Each primitive can then use `filter.flippedRectRelativeToAbsoluteEnclosingFilterRegion(result.absoluteImageRect())` to compute the correct extent rect. Add `BEGIN_BLOCK_OBJC_EXCEPTIONS`/`END_BLOCK_OBJC_EXCEPTIONS` around all the CI code. * Source/WebCore/SourcesCocoa.txt: * Source/WebCore/WebCore.xcodeproj/project.pbxproj: * Source/WebCore/platform/graphics/coreimage/FEBlendCoreImageApplier.mm: (WebCore::FEBlendCoreImageApplier::apply const): * Source/WebCore/platform/graphics/coreimage/FEColorMatrixCoreImageApplier.mm: (WebCore::FEColorMatrixCoreImageApplier::apply const): * Source/WebCore/platform/graphics/coreimage/FEComponentTransferCoreImageApplier.mm: * Source/WebCore/platform/graphics/coreimage/FECompositeCoreImageApplier.mm: (WebCore::FECompositeCoreImageApplier::apply const): * Source/WebCore/platform/graphics/coreimage/FEFloodCoreImageApplier.mm: (WebCore::FEFloodCoreImageApplier::apply const): * Source/WebCore/platform/graphics/coreimage/FEGaussianBlurCoreImageApplier.h: * Source/WebCore/platform/graphics/coreimage/FEGaussianBlurCoreImageApplier.mm: (WebCore::FEGaussianBlurCoreImageApplier::FEGaussianBlurCoreImageApplier): (WebCore::FEGaussianBlurCoreImageApplier::supportsCoreImageRendering): (WebCore::FEGaussianBlurCoreImageApplier::apply const): * Source/WebCore/platform/graphics/coreimage/FEMorphologyCoreImageApplier.mm: (WebCore::FEMorphologyCoreImageApplier::apply const): * Source/WebCore/platform/graphics/coreimage/FilterImageCoreImage.mm: (WebCore::FilterImage::filterResultImageBuffer): * Source/WebCore/platform/graphics/coreimage/SourceAlphaCoreImageApplier.mm: (WebCore::SourceAlphaCoreImageApplier::apply const): * Source/WebCore/platform/graphics/coreimage/SourceGraphicCoreImageApplier.mm: (WebCore::SourceGraphicCoreImageApplier::apply const): * Source/WebCore/platform/graphics/filters/FEGaussianBlur.cpp: (WebCore::FEGaussianBlur::supportedFilterRenderingModes const): (WebCore::FEGaussianBlur::createAcceleratedApplier const): * Source/WebCore/platform/graphics/filters/Filter.cpp: (WebCore::Filter::Filter): (WebCore::Filter::absoluteEnclosingFilterRegion const): (WebCore::Filter::flippedRectRelativeToAbsoluteEnclosingFilterRegion const): (WebCore::Filter::filterResultBuffer const): * Source/WebCore/platform/graphics/filters/Filter.h: (WebCore::Filter::enclosingFilterRegion const): (WebCore::Filter::setEnclosingFilterRegion): * Source/WebCore/platform/network/mac/WebCoreURLResponse.mm: Unified sources fix. * Source/WebCore/rendering/CSSFilterRenderer.cpp: (WebCore::CSSFilterRenderer::computeEnclosingFilterRegion): * Source/WebCore/rendering/CSSFilterRenderer.h: Canonical link: https://commits.webkit.org/305054@main
653d01d to
bb11508
Compare
|
Committed 305054@main (bb11508): https://commits.webkit.org/305054@main Reviewed commits have been landed. Closing PR #56009 and removing active labels. |
bb11508
653d01d
🧪 win-tests