RESOLVED FIXED 232705
[GPU Process] [Filters 17/23] Make FilterEffect calculate the primitive subregion only when needed
https://bugs.webkit.org/show_bug.cgi?id=232705
Summary [GPU Process] [Filters 17/23] Make FilterEffect calculate the primitive subre...
Said Abou-Hallawa
Reported 2021-11-04 02:40:13 PDT
FilterEffect should be able to calculate and hold only two rectangles: 1) primitiveSubRegion which is defined here https://www.w3.org/TR/filter-effects-1/#FilterPrimitiveSubRegion 2) imageRect which is the rectangle of the result FilterImage. And to simplify the calculation we can keep these two rectangles as FloatRects and they will be in filter coordinates. But 1) Only when drawing to a FilterImage, we should convert from filter coordinates to absolute coordinates. 2) And when getting pixels from or putting pixels in a FilterImage, we will convert the FloatRect to a IntRect. And since the plan is to remove the result FilterImage from the FilterEffect, we are going to keep these rectangles in FilterImage. The conversion from filter coordinates to absolute coordinates will happen through the Filter class.
Attachments
Patch (393.13 KB, patch)
2021-11-04 03:04 PDT, Said Abou-Hallawa
no flags
Patch (394.50 KB, patch)
2021-11-07 02:16 PST, Said Abou-Hallawa
ews-feeder: commit-queue-
Patch (395.09 KB, patch)
2021-11-07 02:20 PST, Said Abou-Hallawa
no flags
Patch (395.15 KB, patch)
2021-11-07 02:58 PST, Said Abou-Hallawa
no flags
Patch (395.42 KB, patch)
2021-11-07 11:58 PST, Said Abou-Hallawa
ews-feeder: commit-queue-
Patch (395.21 KB, patch)
2021-11-07 12:17 PST, Said Abou-Hallawa
no flags
Patch for review (203.45 KB, patch)
2021-11-08 20:37 PST, Said Abou-Hallawa
no flags
Patch (29.42 KB, patch)
2021-12-04 01:49 PST, Said Abou-Hallawa
no flags
Patch (31.55 KB, patch)
2021-12-06 11:02 PST, Said Abou-Hallawa
no flags
Patch (31.57 KB, patch)
2021-12-06 11:03 PST, Said Abou-Hallawa
no flags
Patch (32.08 KB, patch)
2021-12-06 13:19 PST, Said Abou-Hallawa
no flags
Said Abou-Hallawa
Comment 1 2021-11-04 03:04:15 PDT
Said Abou-Hallawa
Comment 2 2021-11-07 02:16:19 PST
Said Abou-Hallawa
Comment 3 2021-11-07 02:20:46 PST
Said Abou-Hallawa
Comment 4 2021-11-07 02:58:14 PST
Said Abou-Hallawa
Comment 5 2021-11-07 11:58:14 PST
Said Abou-Hallawa
Comment 6 2021-11-07 12:17:53 PST
Said Abou-Hallawa
Comment 7 2021-11-08 20:37:34 PST
Created attachment 443652 [details] Patch for review
Radar WebKit Bug Importer
Comment 8 2021-11-11 01:41:20 PST
Said Abou-Hallawa
Comment 9 2021-12-04 01:49:41 PST
Said Abou-Hallawa
Comment 10 2021-12-06 11:02:09 PST
Said Abou-Hallawa
Comment 11 2021-12-06 11:03:36 PST
Said Abou-Hallawa
Comment 12 2021-12-06 13:19:35 PST
Cameron McCormack (:heycam)
Comment 13 2021-12-06 15:35:26 PST
Comment on attachment 446074 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=446074&action=review > Source/WebCore/platform/graphics/filters/FilterEffect.cpp:52 > + for (auto& input : inputs) > + primitiveSubregion.unite(input->primitiveSubregion()); I guess we're guaranteed that input's primitive subregion has already been calculated at this point, because of the ordering of the filter effects in the overall expression?
Said Abou-Hallawa
Comment 14 2021-12-06 15:50:45 PST
Comment on attachment 446074 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=446074&action=review >> Source/WebCore/platform/graphics/filters/FilterEffect.cpp:52 >> + primitiveSubregion.unite(input->primitiveSubregion()); > > I guess we're guaranteed that input's primitive subregion has already been calculated at this point, because of the ordering of the filter effects in the overall expression? Yes this correct. In SVGFilter we apply the effects from the SVGFilterExpression which is the post-fix notation of the filter. For CSSFilter we apply the effects from left to right since every effect is the input to the next effect.
EWS
Comment 15 2021-12-06 16:37:04 PST
Committed r286578 (?): <https://commits.webkit.org/r286578> All reviewed patches have been landed. Closing bug and clearing flags on attachment 446074 [details].
Note You need to log in before you can comment on or make changes to this bug.