Bug 233893

Summary: [GPU Process] [Filters] Make FilterEffect::externalRepresentation() and its overridable functions work iteratively
Product: WebKit Reporter: Said Abou-Hallawa <sabouhallawa>
Component: Layout and RenderingAssignee: Said Abou-Hallawa <sabouhallawa>
Status: RESOLVED FIXED    
Severity: Normal CC: annulen, bfulgham, changseok, dino, esprehn+autocc, ews-watchlist, fmalita, glenn, gyuyoung.kim, heycam, kondapallykalyan, pdr, ryuan.choi, schenney, sergio, simon.fraser, webkit-bug-importer, zalan
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 231253    
Attachments:
Description Flags
Patch
none
Patch
heycam: review+
Patch none

Description Said Abou-Hallawa 2021-12-06 12:47:01 PST
This is a step towards removing the inputEffect() from FilterEffect.
Comment 1 Said Abou-Hallawa 2021-12-06 12:52:25 PST
Created attachment 446070 [details]
Patch
Comment 2 Said Abou-Hallawa 2021-12-06 19:10:22 PST
Created attachment 446109 [details]
Patch
Comment 3 Cameron McCormack (:heycam) 2021-12-06 19:54:05 PST
Comment on attachment 446109 [details]
Patch

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

> Source/WebCore/platform/graphics/filters/FEBlend.cpp:63
> +    {

No need for the block (and in all other externalRepresentation functions that don't use an IndentScope).

> Source/WebCore/rendering/CSSFilter.cpp:419
> +        TextStream::IndentScope indentScope(ts, level++);

Is there a need to indent? I don't think it provides any information.

> Source/WebCore/svg/graphics/filters/SVGFilter.cpp:140
> +    auto end = m_expression.rend();
> +
> +    for (auto it = m_expression.rbegin(); it != end; ++it) {

Probably more idiomatic to write this as:

for (auto it = m_expression.rbegin(), end = m_expression.rend(); it != end; ++it)

> Source/WebCore/svg/graphics/filters/SVGFilter.cpp:147
> +        TextStream::IndentScope indentScope(ts, term.level);

Similarly, is it useful to represent the depth in the filter DAG as the indent level? What makes me doubt this is that it doesn't fully encode the dependencies between the nodes in the filter graph, e.g. if two filter effects depend on the one other filter effect.

> Source/WebCore/svg/graphics/filters/SVGFilterBuilder.cpp:220
> +    expression.append({ *effect, effectGeometry(*effect), level });

I don't think we should bother computing and storing the level. Unless it's needed for something other than externalRepresentation.
Comment 4 Said Abou-Hallawa 2021-12-06 22:17:19 PST
Created attachment 446123 [details]
Patch
Comment 5 Said Abou-Hallawa 2021-12-06 22:24:07 PST
Comment on attachment 446109 [details]
Patch

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

>> Source/WebCore/platform/graphics/filters/FEBlend.cpp:63
>> +    {
> 
> No need for the block (and in all other externalRepresentation functions that don't use an IndentScope).

The block was removed.

>> Source/WebCore/rendering/CSSFilter.cpp:419
>> +        TextStream::IndentScope indentScope(ts, level++);
> 
> Is there a need to indent? I don't think it provides any information.

Removing the indentation will require rebase-line for many layout tests. We can remove the indentation in a future patch.

>> Source/WebCore/svg/graphics/filters/SVGFilter.cpp:140
>> +    for (auto it = m_expression.rbegin(); it != end; ++it) {
> 
> Probably more idiomatic to write this as:
> 
> for (auto it = m_expression.rbegin(), end = m_expression.rend(); it != end; ++it)

Fixed.
Comment 6 EWS 2021-12-06 23:19:18 PST
Committed r286589 (?): <https://commits.webkit.org/r286589>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 446123 [details].
Comment 7 Radar WebKit Bug Importer 2021-12-06 23:20:22 PST
<rdar://problem/86141818>