Skip to content

Conversation

shallawa
Copy link
Contributor

@shallawa shallawa commented Nov 21, 2022

d4236a4

[Filters] FilterEffect::calculatePrimitiveSubregion() and calculateImageRect() should take a span of the input image rects
https://bugs.webkit.org/show_bug.cgi?id=248181
rdar://102586592

Reviewed by Cameron McCormack.

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.

* Source/WebCore/platform/graphics/filters/FEComposite.cpp:
(WebCore::FEComposite::calculateImageRect const):
* Source/WebCore/platform/graphics/filters/FEComposite.h:
* Source/WebCore/platform/graphics/filters/FEConvolveMatrix.cpp:
(WebCore::FEConvolveMatrix::calculateImageRect const):
* Source/WebCore/platform/graphics/filters/FEConvolveMatrix.h:
* Source/WebCore/platform/graphics/filters/FEDisplacementMap.cpp:
(WebCore::FEDisplacementMap::calculateImageRect const):
* Source/WebCore/platform/graphics/filters/FEDisplacementMap.h:
* Source/WebCore/platform/graphics/filters/FEDropShadow.cpp:
(WebCore::FEDropShadow::calculateImageRect const):
* Source/WebCore/platform/graphics/filters/FEDropShadow.h:
* Source/WebCore/platform/graphics/filters/FEFlood.cpp:
(WebCore::FEFlood::calculateImageRect const):
* Source/WebCore/platform/graphics/filters/FEFlood.h:
* Source/WebCore/platform/graphics/filters/FEGaussianBlur.cpp:
(WebCore::FEGaussianBlur::calculateImageRect const):
* Source/WebCore/platform/graphics/filters/FEGaussianBlur.h:
* Source/WebCore/platform/graphics/filters/FEImage.cpp:
(WebCore::FEImage::calculateImageRect const):
* Source/WebCore/platform/graphics/filters/FEImage.h:
* Source/WebCore/platform/graphics/filters/FELighting.cpp:
(WebCore::FELighting::calculateImageRect const):
* Source/WebCore/platform/graphics/filters/FELighting.h:
* Source/WebCore/platform/graphics/filters/FEMorphology.cpp:
(WebCore::FEMorphology::calculateImageRect const):
* Source/WebCore/platform/graphics/filters/FEMorphology.h:
* Source/WebCore/platform/graphics/filters/FEOffset.cpp:
(WebCore::FEOffset::calculateImageRect const):
* Source/WebCore/platform/graphics/filters/FEOffset.h:
* Source/WebCore/platform/graphics/filters/FETile.cpp:
(WebCore::FETile::calculateImageRect const):
* Source/WebCore/platform/graphics/filters/FETile.h:
* Source/WebCore/platform/graphics/filters/FETurbulence.cpp:
(WebCore::FETurbulence::calculateImageRect const):
* Source/WebCore/platform/graphics/filters/FETurbulence.h:
* Source/WebCore/platform/graphics/filters/FilterEffect.cpp:
(WebCore::inputPrimitiveSubregions):
(WebCore::FilterEffect::calculatePrimitiveSubregion const):
(WebCore::inputImageRects):
(WebCore::FilterEffect::calculateImageRect const):
(WebCore::FilterEffect::apply):
* Source/WebCore/platform/graphics/filters/FilterEffect.h:

Canonical link: https://commits.webkit.org/256983@main

e5d5317

Misc iOS, tvOS & watchOS macOS Linux Windows
✅ 🧪 style ✅ 🛠 ios ✅ 🛠 mac ✅ 🛠 wpe ✅ 🛠 🧪 win
✅ 🧪 bindings ✅ 🛠 ios-sim ✅ 🛠 mac-debug ✅ 🛠 gtk ✅ 🛠 wincairo
✅ 🧪 webkitperl 🧪 ios-wk2 ✅ 🛠 mac-AS-debug ✅ 🧪 gtk-wk2
🧪 api-ios 🧪 api-mac ✅ 🧪 api-gtk
✅ 🛠 tv 🧪 mac-wk1
✅ 🛠 tv-sim 🧪 mac-wk2
❌ 🛠 🧪 merge ✅ 🛠 watch 🧪 mac-AS-debug-wk2
✅ 🛠 watch-sim ✅ 🧪 mac-wk2-stress

@shallawa shallawa self-assigned this Nov 21, 2022
@shallawa shallawa added the Layout and Rendering For bugs with layout and rendering of Web pages. label Nov 21, 2022
@shallawa shallawa force-pushed the eng/Filters-FilterEffectcalculatePrimitiveSubregion-and-calculateImageRect-should-take-a-vector-of-the-input-rects branch from 1ae380a to c30e2a1 Compare November 23, 2022 20:46
@shallawa shallawa changed the title [Filters] FilterEffect::calculatePrimitiveSubregion() and calculateImageRect() should take a vector of the input rects [Filters] FilterEffect::calculatePrimitiveSubregion() and calculateImageRect() should take a span of the input image rects Nov 23, 2022
Comment on lines 55 to 61
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could write this as:

    return inputs.map([] (auto& input) { return input->primitiveSubregion(); });

if you think it's clearer. (I'm always on the fence, given C++'s verbose lambda syntax.)

Comment on lines 93 to 99
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And similarly here.

@shallawa shallawa force-pushed the eng/Filters-FilterEffectcalculatePrimitiveSubregion-and-calculateImageRect-should-take-a-vector-of-the-input-rects branch from c30e2a1 to e5d5317 Compare November 24, 2022 01:56
@shallawa shallawa added the merge-queue Applied to send a pull request to merge-queue label Nov 24, 2022
@webkit-commit-queue webkit-commit-queue force-pushed the eng/Filters-FilterEffectcalculatePrimitiveSubregion-and-calculateImageRect-should-take-a-vector-of-the-input-rects branch from e5d5317 to b362815 Compare November 24, 2022 04:29
…ageRect() should take a span of the input image rects

https://bugs.webkit.org/show_bug.cgi?id=248181
rdar://102586592

Reviewed by Cameron McCormack.

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.

* Source/WebCore/platform/graphics/filters/FEComposite.cpp:
(WebCore::FEComposite::calculateImageRect const):
* Source/WebCore/platform/graphics/filters/FEComposite.h:
* Source/WebCore/platform/graphics/filters/FEConvolveMatrix.cpp:
(WebCore::FEConvolveMatrix::calculateImageRect const):
* Source/WebCore/platform/graphics/filters/FEConvolveMatrix.h:
* Source/WebCore/platform/graphics/filters/FEDisplacementMap.cpp:
(WebCore::FEDisplacementMap::calculateImageRect const):
* Source/WebCore/platform/graphics/filters/FEDisplacementMap.h:
* Source/WebCore/platform/graphics/filters/FEDropShadow.cpp:
(WebCore::FEDropShadow::calculateImageRect const):
* Source/WebCore/platform/graphics/filters/FEDropShadow.h:
* Source/WebCore/platform/graphics/filters/FEFlood.cpp:
(WebCore::FEFlood::calculateImageRect const):
* Source/WebCore/platform/graphics/filters/FEFlood.h:
* Source/WebCore/platform/graphics/filters/FEGaussianBlur.cpp:
(WebCore::FEGaussianBlur::calculateImageRect const):
* Source/WebCore/platform/graphics/filters/FEGaussianBlur.h:
* Source/WebCore/platform/graphics/filters/FEImage.cpp:
(WebCore::FEImage::calculateImageRect const):
* Source/WebCore/platform/graphics/filters/FEImage.h:
* Source/WebCore/platform/graphics/filters/FELighting.cpp:
(WebCore::FELighting::calculateImageRect const):
* Source/WebCore/platform/graphics/filters/FELighting.h:
* Source/WebCore/platform/graphics/filters/FEMorphology.cpp:
(WebCore::FEMorphology::calculateImageRect const):
* Source/WebCore/platform/graphics/filters/FEMorphology.h:
* Source/WebCore/platform/graphics/filters/FEOffset.cpp:
(WebCore::FEOffset::calculateImageRect const):
* Source/WebCore/platform/graphics/filters/FEOffset.h:
* Source/WebCore/platform/graphics/filters/FETile.cpp:
(WebCore::FETile::calculateImageRect const):
* Source/WebCore/platform/graphics/filters/FETile.h:
* Source/WebCore/platform/graphics/filters/FETurbulence.cpp:
(WebCore::FETurbulence::calculateImageRect const):
* Source/WebCore/platform/graphics/filters/FETurbulence.h:
* Source/WebCore/platform/graphics/filters/FilterEffect.cpp:
(WebCore::inputPrimitiveSubregions):
(WebCore::FilterEffect::calculatePrimitiveSubregion const):
(WebCore::inputImageRects):
(WebCore::FilterEffect::calculateImageRect const):
(WebCore::FilterEffect::apply):
* Source/WebCore/platform/graphics/filters/FilterEffect.h:

Canonical link: https://commits.webkit.org/256983@main
@webkit-commit-queue webkit-commit-queue force-pushed the eng/Filters-FilterEffectcalculatePrimitiveSubregion-and-calculateImageRect-should-take-a-vector-of-the-input-rects branch from b362815 to d4236a4 Compare November 24, 2022 04:31
@webkit-commit-queue
Copy link
Collaborator

Committed 256983@main (d4236a4): https://commits.webkit.org/256983@main

Reviewed commits have been landed. Closing PR #6706 and removing active labels.

@webkit-commit-queue webkit-commit-queue merged commit d4236a4 into WebKit:main Nov 24, 2022
@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Nov 24, 2022
@shallawa shallawa deleted the eng/Filters-FilterEffectcalculatePrimitiveSubregion-and-calculateImageRect-should-take-a-vector-of-the-input-rects branch May 9, 2023 20:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Layout and Rendering For bugs with layout and rendering of Web pages.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants