Bug 232469 - [GPU Process] [Filters 4/23] Make CSSFilter be a composite of FilterFunctions
Summary: [GPU Process] [Filters 4/23] Make CSSFilter be a composite of FilterFunctions
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Said Abou-Hallawa
URL:
Keywords: InRadar
Depends on:
Blocks: 231253
  Show dependency treegraph
 
Reported: 2021-10-28 22:35 PDT by Said Abou-Hallawa
Modified: 2022-05-08 20:12 PDT (History)
23 users (show)

See Also:


Attachments
Patch (151.60 KB, patch)
2021-10-28 22:55 PDT, Said Abou-Hallawa
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
Patch for review (56.67 KB, patch)
2021-10-28 22:59 PDT, Said Abou-Hallawa
simon.fraser: review+
Details | Formatted Diff | Diff
Patch (155.29 KB, patch)
2021-10-31 18:01 PDT, Said Abou-Hallawa
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
Patch (69.94 KB, patch)
2021-11-10 12:39 PST, Said Abou-Hallawa
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
Patch (66.43 KB, patch)
2021-11-10 14:38 PST, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff
Patch (66.49 KB, patch)
2021-11-10 19:58 PST, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Said Abou-Hallawa 2021-10-28 22:35:49 PDT
This will make CSSFilter have an item of SVGFilter in this list of FilterFunctions.
Comment 1 Said Abou-Hallawa 2021-10-28 22:55:27 PDT
Created attachment 442784 [details]
Patch
Comment 2 Said Abou-Hallawa 2021-10-28 22:59:10 PDT
Created attachment 442785 [details]
Patch for review
Comment 3 Simon Fraser (smfr) 2021-10-29 12:03:34 PDT
Comment on attachment 442785 [details]
Patch for review

View in context: https://bugs.webkit.org/attachment.cgi?id=442785&action=review

> Source/WebCore/ChangeLog:8
> +        In this patch, the CSS referenced filter is built as an SVGFilter and it

"reference filter"

> Source/WebCore/css/CSSFilterImageValue.cpp:120
> +    auto texture = ImageBuffer::create(size, renderingMode, 1, DestinationColorSpace::SRGB(), PixelFormat::BGRA8);

texture is a weird name for this.

> Source/WebCore/css/CSSFilterImageValue.cpp:130
> +    auto cssFilter = CSSFilter::create(m_filterOperations, renderingMode);
> +    
>      cssFilter->setSourceImageRect(imageRect);
>      if (!cssFilter->build(renderer, m_filterOperations, FilterConsumer::FilterFunction))

Why do we have to pass m_filterOperations both to the constructor, and to the build() function?

> Source/WebCore/rendering/CSSFilter.cpp:223
> +    auto builder = makeUnique<SVGFilterBuilder>();

Can SVGFilterBuilder just be on the stack?

> Source/WebCore/rendering/RenderLayerFilters.h:66
> +    GraphicsContext* beginFilterEffect(RenderElement&, const LayoutRect& filterBoxRect, const LayoutRect& dirtyRect, const LayoutRect& layerRepaintRect, GraphicsContext& destinationContext);

I tend to prefer GraphicsContext& destinationContext as the first argument.

> Source/WebCore/rendering/svg/SVGRenderTreeAsText.cpp:436
> +        auto builder = makeUnique<SVGFilterBuilder>();

Can this live on the stack?
Comment 4 Said Abou-Hallawa 2021-10-31 17:18:41 PDT
Some of the layout tests are failing because of the need to set the sourceImageRect before building the CSSFilter. The sourceImageRect has to include the Outsets of the FilterEffects. So currently to fix these tests we need to set the sourceImageRect twice and to build the CSSFilter twice. The plan to remove this dependency and be able to build the CSSFilter without having to set sourceImageRect and have the FilterEffects be able to calculate the outsets without knowing the sourceImageRect.

The reset of the failures are happing because of the color space which should be fixed once the calculation of the result color space out of the operating color space. So for now, I am going to skip these few tests and remove them by the end.
Comment 5 Said Abou-Hallawa 2021-10-31 18:01:03 PDT
Created attachment 442946 [details]
Patch
Comment 6 Radar WebKit Bug Importer 2021-11-04 22:36:17 PDT
<rdar://problem/85047148>
Comment 7 Said Abou-Hallawa 2021-11-10 12:39:25 PST
Created attachment 443851 [details]
Patch
Comment 8 Said Abou-Hallawa 2021-11-10 14:38:21 PST
Created attachment 443864 [details]
Patch
Comment 9 Said Abou-Hallawa 2021-11-10 19:58:07 PST
Created attachment 443899 [details]
Patch
Comment 10 EWS 2021-11-10 20:31:14 PST
Committed r285618 (244119@main): <https://commits.webkit.org/244119@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 443899 [details].