Bug 233893 - [GPU Process] [Filters] Make FilterEffect::externalRepresentation() and its overridable functions work iteratively
Summary: [GPU Process] [Filters] Make FilterEffect::externalRepresentation() and its ...
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-12-06 12:47 PST by Said Abou-Hallawa
Modified: 2021-12-06 23:20 PST (History)
18 users (show)

See Also:


Attachments
Patch (89.09 KB, patch)
2021-12-06 12:52 PST, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff
Patch (64.77 KB, patch)
2021-12-06 19:10 PST, Said Abou-Hallawa
heycam: review+
Details | Formatted Diff | Diff
Patch (62.34 KB, patch)
2021-12-06 22:17 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-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>