RESOLVED FIXED 248181
[Filters] FilterEffect::calculatePrimitiveSubregion() and calculateImageRect() should take a span of the input image rects
https://bugs.webkit.org/show_bug.cgi?id=248181
Summary [Filters] FilterEffect::calculatePrimitiveSubregion() and calculateImageRect(...
Said Abou-Hallawa
Reported 2022-11-21 10:40:47 PST
Instead of passing a FilterImageVector to these functions we should pass a Vector<FloatRect> since they care about the FilterImage::imageRect() only. This work is towards supporting CoreGraphics filters since no FilterImage will be used while applying the FilterEffects.
Attachments
Patch (28.45 KB, patch)
2022-11-21 11:29 PST, Said Abou-Hallawa
darin: review+
ews-feeder: commit-queue-
Radar WebKit Bug Importer
Comment 1 2022-11-21 11:20:52 PST
Said Abou-Hallawa
Comment 2 2022-11-21 11:27:34 PST
Said Abou-Hallawa
Comment 3 2022-11-21 11:29:14 PST
Darin Adler
Comment 4 2022-11-21 15:42:38 PST
Comment on attachment 463641 [details] Patch Functions like these should take Span<const X> rather than const Vector<X>& for greater flexibility if possible
Said Abou-Hallawa
Comment 5 2022-11-23 12:46:40 PST
EWS
Comment 6 2022-11-23 20:31:50 PST
Committed 256983@main (d4236a4ea1de): <https://commits.webkit.org/256983@main> Reviewed commits have been landed. Closing PR #6706 and removing active labels.
Darin Adler
Comment 7 2022-11-29 07:32:00 PST
Comment on attachment 463641 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=463641&action=review > COMMIT_MESSAGE:8 > +Instead of passing a FilterImageVector to these functions we should pass a > +Vector<FloatRect> since they care about the FilterImage::imageRect() only. I suggest we pass Span<const FloatRect> instead. Still would have a Vector<FloatRect> locally at the call site. Just a good habit to pass Span any time so we don’t have to construct a vector. Lets us use FixedVector or an array or even a single element. > Source/WebCore/platform/graphics/filters/FilterEffect.cpp:61 > + Vector<FloatRect> inputPrimitiveSubregions; > + inputPrimitiveSubregions.reserveInitialCapacity(inputs.size()); > + > + for (auto& input : inputs) > + inputPrimitiveSubregions.uncheckedAppend(input->primitiveSubregion()); > + > + return inputPrimitiveSubregions; This should use map. > Source/WebCore/platform/graphics/filters/FilterEffect.cpp:99 > - FloatRect imageRect; > + Vector<FloatRect> inputImageRects; > + inputImageRects.reserveInitialCapacity(inputs.size()); > + > for (auto& input : inputs) > - imageRect.unite(input->imageRect()); > + inputImageRects.uncheckedAppend(input->imageRect()); > + > + return inputImageRects; This should use map.
Darin Adler
Comment 8 2022-11-29 07:32:29 PST
Oh, looks like this already landed a while ago. Well consider my comments ideas of how to refine.
Said Abou-Hallawa
Comment 9 2022-11-30 10:44:58 PST
Comment on attachment 463641 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=463641&action=review >> Source/WebCore/platform/graphics/filters/FilterEffect.cpp:61 >> + return inputPrimitiveSubregions; > > This should use map. This is already done in 256983@main. >> Source/WebCore/platform/graphics/filters/FilterEffect.cpp:99 >> + return inputImageRects; > > This should use map. This is already done in 256983@main.
Note You need to log in before you can comment on or make changes to this bug.