[GPU Process] Make FilterEffects create FilterEffectAppliers which will be used by FilterEffect::apply()
https://bugs.webkit.org/show_bug.cgi?id=233516

Reviewed by Cameron McCormack.

This step is required to allow integrating CoreImage FilterEffect appliers
in FilterEffect::apply(). Currently applying CoreImage FilterEffect has
to go to a different code path in FilterEffectRendererCoreImage.

* platform/graphics/filters/FEBlend.cpp:
(WebCore::FEBlend::createApplier const):
(WebCore::FEBlend::platformApplySoftware): Deleted.
* platform/graphics/filters/FEBlend.h:
* platform/graphics/filters/FEColorMatrix.cpp:
(WebCore::FEColorMatrix::createApplier const):
(WebCore::FEColorMatrix::platformApplySoftware): Deleted.
* platform/graphics/filters/FEColorMatrix.h:
* platform/graphics/filters/FEComponentTransfer.cpp:
(WebCore::FEComponentTransfer::createApplier const):
(WebCore::FEComponentTransfer::platformApplySoftware): Deleted.
* platform/graphics/filters/FEComponentTransfer.h:
* platform/graphics/filters/FEComposite.cpp:
(WebCore::FEComposite::createApplier const):
(WebCore::FEComposite::platformApplySoftware): Deleted.
* platform/graphics/filters/FEComposite.h:
* platform/graphics/filters/FEConvolveMatrix.cpp:
(WebCore::FEConvolveMatrix::createApplier const):
(WebCore::FEConvolveMatrix::platformApplySoftware): Deleted.
* platform/graphics/filters/FEConvolveMatrix.h:
* platform/graphics/filters/FEDisplacementMap.cpp:
(WebCore::FEDisplacementMap::createApplier const):
(WebCore::FEDisplacementMap::platformApplySoftware): Deleted.
* platform/graphics/filters/FEDisplacementMap.h:
* platform/graphics/filters/FEDropShadow.cpp:
(WebCore::FEDropShadow::createApplier const):
(WebCore::FEDropShadow::platformApplySoftware): Deleted.
* platform/graphics/filters/FEDropShadow.h:
* platform/graphics/filters/FEFlood.cpp:
(WebCore::FEFlood::createApplier const):
(WebCore::FEFlood::platformApplySoftware): Deleted.
* platform/graphics/filters/FEFlood.h:
* platform/graphics/filters/FEGaussianBlur.cpp:
(WebCore::FEGaussianBlur::createApplier const):
(WebCore::FEGaussianBlur::platformApplySoftware): Deleted.
* platform/graphics/filters/FEGaussianBlur.h:
* platform/graphics/filters/FELighting.cpp:
(WebCore::FELighting::createApplier const):
(WebCore::FELighting::platformApplySoftware): Deleted.
* platform/graphics/filters/FELighting.h:
* platform/graphics/filters/FEMerge.cpp:
(WebCore::FEMerge::createApplier const):
(WebCore::FEMerge::platformApplySoftware): Deleted.
* platform/graphics/filters/FEMerge.h:
* platform/graphics/filters/FEMorphology.cpp:
(WebCore::FEMorphology::createApplier const):
(WebCore::FEMorphology::platformApplySoftware): Deleted.
* platform/graphics/filters/FEMorphology.h:
* platform/graphics/filters/FEOffset.cpp:
(WebCore::FEOffset::createApplier const):
(WebCore::FEOffset::platformApplySoftware): Deleted.
* platform/graphics/filters/FEOffset.h:
* platform/graphics/filters/FETile.cpp:
(WebCore::FETile::createApplier const):
(WebCore::FETile::platformApplySoftware): Deleted.
* platform/graphics/filters/FETile.h:
* platform/graphics/filters/FETurbulence.cpp:
(WebCore::FETurbulence::createApplier const):
(WebCore::FETurbulence::platformApplySoftware): Deleted.
* platform/graphics/filters/FETurbulence.h:
* platform/graphics/filters/FilterEffect.cpp:
(WebCore::FilterEffect::apply):
* platform/graphics/filters/FilterEffect.h:
* platform/graphics/filters/FilterEffectApplier.h:
(WebCore::FilterEffectApplier::create):
(WebCore::FilterEffectConcreteApplier::FilterEffectConcreteApplier):
* platform/graphics/filters/SourceAlpha.cpp:
(WebCore::SourceAlpha::createApplier const):
(WebCore::SourceAlpha::platformApplySoftware): Deleted.
* platform/graphics/filters/SourceAlpha.h:
* platform/graphics/filters/SourceGraphic.cpp:
(WebCore::SourceGraphic::createApplier const):
(WebCore::SourceGraphic::platformApplySoftware): Deleted.
* platform/graphics/filters/SourceGraphic.h:
* platform/graphics/filters/software/FEBlendSoftwareApplier.cpp:
(WebCore::FEBlendSoftwareApplier::apply const):
(WebCore::FEBlendSoftwareApplier::apply): Deleted.
* platform/graphics/filters/software/FEBlendSoftwareApplier.h:
* platform/graphics/filters/software/FEColorMatrixSoftwareApplier.cpp:
(WebCore::FEColorMatrixSoftwareApplier::FEColorMatrixSoftwareApplier):
(WebCore::FEColorMatrixSoftwareApplier::apply const):
(WebCore::FEColorMatrixSoftwareApplier::apply): Deleted.
* platform/graphics/filters/software/FEColorMatrixSoftwareApplier.h:
* platform/graphics/filters/software/FEComponentTransferSoftwareApplier.cpp:
(WebCore::FEComponentTransferSoftwareApplier::apply const):
(WebCore::FEComponentTransferSoftwareApplier::apply): Deleted.
* platform/graphics/filters/software/FEComponentTransferSoftwareApplier.h:
* platform/graphics/filters/software/FECompositeSoftwareApplier.cpp:
(WebCore::FECompositeSoftwareApplier::applyArithmetic const):
(WebCore::FECompositeSoftwareApplier::applyNonArithmetic const):
(WebCore::FECompositeSoftwareApplier::apply const):
(WebCore::FECompositeSoftwareApplier::applyArithmetic): Deleted.
(WebCore::FECompositeSoftwareApplier::applyNonArithmetic): Deleted.
(WebCore::FECompositeSoftwareApplier::apply): Deleted.
* platform/graphics/filters/software/FECompositeSoftwareApplier.h:
* platform/graphics/filters/software/FEConvolveMatrixSoftwareApplier.cpp:
(WebCore::FEConvolveMatrixSoftwareApplier::apply const):
(WebCore::FEConvolveMatrixSoftwareApplier::apply): Deleted.
* platform/graphics/filters/software/FEConvolveMatrixSoftwareApplier.h:
* platform/graphics/filters/software/FEDisplacementMapSoftwareApplier.cpp:
(WebCore::FEDisplacementMapSoftwareApplier::FEDisplacementMapSoftwareApplier):
(WebCore::FEDisplacementMapSoftwareApplier::apply const):
(WebCore::FEDisplacementMapSoftwareApplier::apply): Deleted.
* platform/graphics/filters/software/FEDisplacementMapSoftwareApplier.h:
* platform/graphics/filters/software/FEDropShadowSoftwareApplier.cpp:
(WebCore::FEDropShadowSoftwareApplier::apply const):
(WebCore::FEDropShadowSoftwareApplier::apply): Deleted.
* platform/graphics/filters/software/FEDropShadowSoftwareApplier.h:
* platform/graphics/filters/software/FEFloodSoftwareApplier.cpp:
(WebCore::FEFloodSoftwareApplier::apply const):
(WebCore::FEFloodSoftwareApplier::apply): Deleted.
* platform/graphics/filters/software/FEFloodSoftwareApplier.h:
* platform/graphics/filters/software/FEGaussianBlurSoftwareApplier.cpp:
(WebCore::FEGaussianBlurSoftwareApplier::apply const):
(WebCore::FEGaussianBlurSoftwareApplier::apply): Deleted.
* platform/graphics/filters/software/FEGaussianBlurSoftwareApplier.h:
* platform/graphics/filters/software/FELightingSoftwareApplier.cpp:
(WebCore::FELightingSoftwareApplier::apply const):
(WebCore::FELightingSoftwareApplier::apply): Deleted.
* platform/graphics/filters/software/FELightingSoftwareApplier.h:
* platform/graphics/filters/software/FEMergeSoftwareApplier.cpp:
(WebCore::FEMergeSoftwareApplier::apply const):
(WebCore::FEMergeSoftwareApplier::apply): Deleted.
* platform/graphics/filters/software/FEMergeSoftwareApplier.h:
* platform/graphics/filters/software/FEMorphologySoftwareApplier.cpp:
(WebCore::FEMorphologySoftwareApplier::apply const):
(WebCore::FEMorphologySoftwareApplier::apply): Deleted.
* platform/graphics/filters/software/FEMorphologySoftwareApplier.h:
* platform/graphics/filters/software/FEOffsetSoftwareApplier.cpp:
(WebCore::FEOffsetSoftwareApplier::apply const):
(WebCore::FEOffsetSoftwareApplier::apply): Deleted.
* platform/graphics/filters/software/FEOffsetSoftwareApplier.h:
* platform/graphics/filters/software/FETileSoftwareApplier.cpp:
(WebCore::FETileSoftwareApplier::apply const):
(WebCore::FETileSoftwareApplier::apply): Deleted.
* platform/graphics/filters/software/FETileSoftwareApplier.h:
* platform/graphics/filters/software/FETurbulenceSoftwareApplier.cpp:
(WebCore::FETurbulenceSoftwareApplier::apply const):
(WebCore::FETurbulenceSoftwareApplier::apply): Deleted.
* platform/graphics/filters/software/FETurbulenceSoftwareApplier.h:
* platform/graphics/filters/software/SourceAlphaSoftwareApplier.cpp:
(WebCore::SourceAlphaSoftwareApplier::apply const):
(WebCore::SourceAlphaSoftwareApplier::apply): Deleted.
* platform/graphics/filters/software/SourceAlphaSoftwareApplier.h:
* platform/graphics/filters/software/SourceGraphicSoftwareApplier.cpp:
(WebCore::SourceGraphicSoftwareApplier::apply const):
(WebCore::SourceGraphicSoftwareApplier::apply): Deleted.
* platform/graphics/filters/software/SourceGraphicSoftwareApplier.h:
* svg/graphics/filters/SVGFEImage.cpp:
(WebCore::FEImageSoftwareApplier::apply const):
(WebCore::FEImage::createApplier const):
(WebCore::FEImageSoftwareApplier::apply): Deleted.
(WebCore::FEImage::platformApplySoftware): Deleted.
* svg/graphics/filters/SVGFEImage.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@286186 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog
index 4c34a2c..180fd79 100644
--- a/Source/WebCore/ChangeLog
+++ b/Source/WebCore/ChangeLog
@@ -1,3 +1,169 @@
+2021-11-26  Said Abou-Hallawa  <said@apple.com>
+
+        [GPU Process] Make FilterEffects create FilterEffectAppliers which will be used by FilterEffect::apply()
+        https://bugs.webkit.org/show_bug.cgi?id=233516
+
+        Reviewed by Cameron McCormack.
+
+        This step is required to allow integrating CoreImage FilterEffect appliers
+        in FilterEffect::apply(). Currently applying CoreImage FilterEffect has
+        to go to a different code path in FilterEffectRendererCoreImage.
+
+        * platform/graphics/filters/FEBlend.cpp:
+        (WebCore::FEBlend::createApplier const):
+        (WebCore::FEBlend::platformApplySoftware): Deleted.
+        * platform/graphics/filters/FEBlend.h:
+        * platform/graphics/filters/FEColorMatrix.cpp:
+        (WebCore::FEColorMatrix::createApplier const):
+        (WebCore::FEColorMatrix::platformApplySoftware): Deleted.
+        * platform/graphics/filters/FEColorMatrix.h:
+        * platform/graphics/filters/FEComponentTransfer.cpp:
+        (WebCore::FEComponentTransfer::createApplier const):
+        (WebCore::FEComponentTransfer::platformApplySoftware): Deleted.
+        * platform/graphics/filters/FEComponentTransfer.h:
+        * platform/graphics/filters/FEComposite.cpp:
+        (WebCore::FEComposite::createApplier const):
+        (WebCore::FEComposite::platformApplySoftware): Deleted.
+        * platform/graphics/filters/FEComposite.h:
+        * platform/graphics/filters/FEConvolveMatrix.cpp:
+        (WebCore::FEConvolveMatrix::createApplier const):
+        (WebCore::FEConvolveMatrix::platformApplySoftware): Deleted.
+        * platform/graphics/filters/FEConvolveMatrix.h:
+        * platform/graphics/filters/FEDisplacementMap.cpp:
+        (WebCore::FEDisplacementMap::createApplier const):
+        (WebCore::FEDisplacementMap::platformApplySoftware): Deleted.
+        * platform/graphics/filters/FEDisplacementMap.h:
+        * platform/graphics/filters/FEDropShadow.cpp:
+        (WebCore::FEDropShadow::createApplier const):
+        (WebCore::FEDropShadow::platformApplySoftware): Deleted.
+        * platform/graphics/filters/FEDropShadow.h:
+        * platform/graphics/filters/FEFlood.cpp:
+        (WebCore::FEFlood::createApplier const):
+        (WebCore::FEFlood::platformApplySoftware): Deleted.
+        * platform/graphics/filters/FEFlood.h:
+        * platform/graphics/filters/FEGaussianBlur.cpp:
+        (WebCore::FEGaussianBlur::createApplier const):
+        (WebCore::FEGaussianBlur::platformApplySoftware): Deleted.
+        * platform/graphics/filters/FEGaussianBlur.h:
+        * platform/graphics/filters/FELighting.cpp:
+        (WebCore::FELighting::createApplier const):
+        (WebCore::FELighting::platformApplySoftware): Deleted.
+        * platform/graphics/filters/FELighting.h:
+        * platform/graphics/filters/FEMerge.cpp:
+        (WebCore::FEMerge::createApplier const):
+        (WebCore::FEMerge::platformApplySoftware): Deleted.
+        * platform/graphics/filters/FEMerge.h:
+        * platform/graphics/filters/FEMorphology.cpp:
+        (WebCore::FEMorphology::createApplier const):
+        (WebCore::FEMorphology::platformApplySoftware): Deleted.
+        * platform/graphics/filters/FEMorphology.h:
+        * platform/graphics/filters/FEOffset.cpp:
+        (WebCore::FEOffset::createApplier const):
+        (WebCore::FEOffset::platformApplySoftware): Deleted.
+        * platform/graphics/filters/FEOffset.h:
+        * platform/graphics/filters/FETile.cpp:
+        (WebCore::FETile::createApplier const):
+        (WebCore::FETile::platformApplySoftware): Deleted.
+        * platform/graphics/filters/FETile.h:
+        * platform/graphics/filters/FETurbulence.cpp:
+        (WebCore::FETurbulence::createApplier const):
+        (WebCore::FETurbulence::platformApplySoftware): Deleted.
+        * platform/graphics/filters/FETurbulence.h:
+        * platform/graphics/filters/FilterEffect.cpp:
+        (WebCore::FilterEffect::apply):
+        * platform/graphics/filters/FilterEffect.h:
+        * platform/graphics/filters/FilterEffectApplier.h:
+        (WebCore::FilterEffectApplier::create):
+        (WebCore::FilterEffectConcreteApplier::FilterEffectConcreteApplier):
+        * platform/graphics/filters/SourceAlpha.cpp:
+        (WebCore::SourceAlpha::createApplier const):
+        (WebCore::SourceAlpha::platformApplySoftware): Deleted.
+        * platform/graphics/filters/SourceAlpha.h:
+        * platform/graphics/filters/SourceGraphic.cpp:
+        (WebCore::SourceGraphic::createApplier const):
+        (WebCore::SourceGraphic::platformApplySoftware): Deleted.
+        * platform/graphics/filters/SourceGraphic.h:
+        * platform/graphics/filters/software/FEBlendSoftwareApplier.cpp:
+        (WebCore::FEBlendSoftwareApplier::apply const):
+        (WebCore::FEBlendSoftwareApplier::apply): Deleted.
+        * platform/graphics/filters/software/FEBlendSoftwareApplier.h:
+        * platform/graphics/filters/software/FEColorMatrixSoftwareApplier.cpp:
+        (WebCore::FEColorMatrixSoftwareApplier::FEColorMatrixSoftwareApplier):
+        (WebCore::FEColorMatrixSoftwareApplier::apply const):
+        (WebCore::FEColorMatrixSoftwareApplier::apply): Deleted.
+        * platform/graphics/filters/software/FEColorMatrixSoftwareApplier.h:
+        * platform/graphics/filters/software/FEComponentTransferSoftwareApplier.cpp:
+        (WebCore::FEComponentTransferSoftwareApplier::apply const):
+        (WebCore::FEComponentTransferSoftwareApplier::apply): Deleted.
+        * platform/graphics/filters/software/FEComponentTransferSoftwareApplier.h:
+        * platform/graphics/filters/software/FECompositeSoftwareApplier.cpp:
+        (WebCore::FECompositeSoftwareApplier::applyArithmetic const):
+        (WebCore::FECompositeSoftwareApplier::applyNonArithmetic const):
+        (WebCore::FECompositeSoftwareApplier::apply const):
+        (WebCore::FECompositeSoftwareApplier::applyArithmetic): Deleted.
+        (WebCore::FECompositeSoftwareApplier::applyNonArithmetic): Deleted.
+        (WebCore::FECompositeSoftwareApplier::apply): Deleted.
+        * platform/graphics/filters/software/FECompositeSoftwareApplier.h:
+        * platform/graphics/filters/software/FEConvolveMatrixSoftwareApplier.cpp:
+        (WebCore::FEConvolveMatrixSoftwareApplier::apply const):
+        (WebCore::FEConvolveMatrixSoftwareApplier::apply): Deleted.
+        * platform/graphics/filters/software/FEConvolveMatrixSoftwareApplier.h:
+        * platform/graphics/filters/software/FEDisplacementMapSoftwareApplier.cpp:
+        (WebCore::FEDisplacementMapSoftwareApplier::FEDisplacementMapSoftwareApplier):
+        (WebCore::FEDisplacementMapSoftwareApplier::apply const):
+        (WebCore::FEDisplacementMapSoftwareApplier::apply): Deleted.
+        * platform/graphics/filters/software/FEDisplacementMapSoftwareApplier.h:
+        * platform/graphics/filters/software/FEDropShadowSoftwareApplier.cpp:
+        (WebCore::FEDropShadowSoftwareApplier::apply const):
+        (WebCore::FEDropShadowSoftwareApplier::apply): Deleted.
+        * platform/graphics/filters/software/FEDropShadowSoftwareApplier.h:
+        * platform/graphics/filters/software/FEFloodSoftwareApplier.cpp:
+        (WebCore::FEFloodSoftwareApplier::apply const):
+        (WebCore::FEFloodSoftwareApplier::apply): Deleted.
+        * platform/graphics/filters/software/FEFloodSoftwareApplier.h:
+        * platform/graphics/filters/software/FEGaussianBlurSoftwareApplier.cpp:
+        (WebCore::FEGaussianBlurSoftwareApplier::apply const):
+        (WebCore::FEGaussianBlurSoftwareApplier::apply): Deleted.
+        * platform/graphics/filters/software/FEGaussianBlurSoftwareApplier.h:
+        * platform/graphics/filters/software/FELightingSoftwareApplier.cpp:
+        (WebCore::FELightingSoftwareApplier::apply const):
+        (WebCore::FELightingSoftwareApplier::apply): Deleted.
+        * platform/graphics/filters/software/FELightingSoftwareApplier.h:
+        * platform/graphics/filters/software/FEMergeSoftwareApplier.cpp:
+        (WebCore::FEMergeSoftwareApplier::apply const):
+        (WebCore::FEMergeSoftwareApplier::apply): Deleted.
+        * platform/graphics/filters/software/FEMergeSoftwareApplier.h:
+        * platform/graphics/filters/software/FEMorphologySoftwareApplier.cpp:
+        (WebCore::FEMorphologySoftwareApplier::apply const):
+        (WebCore::FEMorphologySoftwareApplier::apply): Deleted.
+        * platform/graphics/filters/software/FEMorphologySoftwareApplier.h:
+        * platform/graphics/filters/software/FEOffsetSoftwareApplier.cpp:
+        (WebCore::FEOffsetSoftwareApplier::apply const):
+        (WebCore::FEOffsetSoftwareApplier::apply): Deleted.
+        * platform/graphics/filters/software/FEOffsetSoftwareApplier.h:
+        * platform/graphics/filters/software/FETileSoftwareApplier.cpp:
+        (WebCore::FETileSoftwareApplier::apply const):
+        (WebCore::FETileSoftwareApplier::apply): Deleted.
+        * platform/graphics/filters/software/FETileSoftwareApplier.h:
+        * platform/graphics/filters/software/FETurbulenceSoftwareApplier.cpp:
+        (WebCore::FETurbulenceSoftwareApplier::apply const):
+        (WebCore::FETurbulenceSoftwareApplier::apply): Deleted.
+        * platform/graphics/filters/software/FETurbulenceSoftwareApplier.h:
+        * platform/graphics/filters/software/SourceAlphaSoftwareApplier.cpp:
+        (WebCore::SourceAlphaSoftwareApplier::apply const):
+        (WebCore::SourceAlphaSoftwareApplier::apply): Deleted.
+        * platform/graphics/filters/software/SourceAlphaSoftwareApplier.h:
+        * platform/graphics/filters/software/SourceGraphicSoftwareApplier.cpp:
+        (WebCore::SourceGraphicSoftwareApplier::apply const):
+        (WebCore::SourceGraphicSoftwareApplier::apply): Deleted.
+        * platform/graphics/filters/software/SourceGraphicSoftwareApplier.h:
+        * svg/graphics/filters/SVGFEImage.cpp:
+        (WebCore::FEImageSoftwareApplier::apply const):
+        (WebCore::FEImage::createApplier const):
+        (WebCore::FEImageSoftwareApplier::apply): Deleted.
+        (WebCore::FEImage::platformApplySoftware): Deleted.
+        * svg/graphics/filters/SVGFEImage.h:
+
 2021-11-26  Adrian Perez de Castro  <aperez@igalia.com>
 
         Unreviewed non-unified build fix.
diff --git a/Source/WebCore/platform/graphics/filters/FEBlend.cpp b/Source/WebCore/platform/graphics/filters/FEBlend.cpp
index 35cd655..9417217 100644
--- a/Source/WebCore/platform/graphics/filters/FEBlend.cpp
+++ b/Source/WebCore/platform/graphics/filters/FEBlend.cpp
@@ -51,9 +51,9 @@
     return true;
 }
 
-bool FEBlend::platformApplySoftware(const Filter& filter)
+std::unique_ptr<FilterEffectApplier> FEBlend::createApplier(const Filter&) const
 {
-    return FEBlendSoftwareApplier(*this).apply(filter, inputFilterImages(), *filterImage());
+    return FilterEffectApplier::create<FEBlendSoftwareApplier>(*this);
 }
 
 TextStream& FEBlend::externalRepresentation(TextStream& ts, RepresentationType representation) const
diff --git a/Source/WebCore/platform/graphics/filters/FEBlend.h b/Source/WebCore/platform/graphics/filters/FEBlend.h
index 47cf85e..889c6f7 100644
--- a/Source/WebCore/platform/graphics/filters/FEBlend.h
+++ b/Source/WebCore/platform/graphics/filters/FEBlend.h
@@ -38,7 +38,7 @@
 private:
     FEBlend(BlendMode);
 
-    bool platformApplySoftware(const Filter&) override;
+    std::unique_ptr<FilterEffectApplier> createApplier(const Filter&) const override;
 
     void platformApplyNEON(unsigned char* srcPixelArrayA, unsigned char* srcPixelArrayB, unsigned char* dstPixelArray,
                            unsigned colorArrayLength);
diff --git a/Source/WebCore/platform/graphics/filters/FEColorMatrix.cpp b/Source/WebCore/platform/graphics/filters/FEColorMatrix.cpp
index 5aa882a..630599f 100644
--- a/Source/WebCore/platform/graphics/filters/FEColorMatrix.cpp
+++ b/Source/WebCore/platform/graphics/filters/FEColorMatrix.cpp
@@ -25,6 +25,7 @@
 #include "FEColorMatrix.h"
 
 #include "FEColorMatrixSoftwareApplier.h"
+#include "Filter.h"
 #include <wtf/text/TextStream.h>
 
 namespace WebCore {
@@ -98,9 +99,14 @@
     return m_type == FECOLORMATRIX_TYPE_LUMINANCETOALPHA;
 }
 
-bool FEColorMatrix::platformApplySoftware(const Filter& filter)
+std::unique_ptr<FilterEffectApplier> FEColorMatrix::createApplier(const Filter& filter) const
 {
-    return FEColorMatrixSoftwareApplier(*this).apply(filter, inputFilterImages(), *filterImage());
+#if USE(CORE_IMAGE)
+    // FIXME: return FEColorMatrixCoreImageApplier.
+    if (filter.renderingMode() == RenderingMode::Accelerated)
+        return nullptr;
+#endif
+    return FilterEffectApplier::create<FEColorMatrixSoftwareApplier>(*this);
 }
 
 static TextStream& operator<<(TextStream& ts, const ColorMatrixType& type)
diff --git a/Source/WebCore/platform/graphics/filters/FEColorMatrix.h b/Source/WebCore/platform/graphics/filters/FEColorMatrix.h
index e1ac688..04f57f1 100644
--- a/Source/WebCore/platform/graphics/filters/FEColorMatrix.h
+++ b/Source/WebCore/platform/graphics/filters/FEColorMatrix.h
@@ -54,7 +54,7 @@
 
     bool resultIsAlphaImage() const override;
 
-    bool platformApplySoftware(const Filter&) override;
+    std::unique_ptr<FilterEffectApplier> createApplier(const Filter&) const override;
 
     WTF::TextStream& externalRepresentation(WTF::TextStream&, RepresentationType) const override;
 
diff --git a/Source/WebCore/platform/graphics/filters/FEComponentTransfer.cpp b/Source/WebCore/platform/graphics/filters/FEComponentTransfer.cpp
index bb5428a..eafa6b3 100644
--- a/Source/WebCore/platform/graphics/filters/FEComponentTransfer.cpp
+++ b/Source/WebCore/platform/graphics/filters/FEComponentTransfer.cpp
@@ -26,6 +26,7 @@
 #include "FEComponentTransfer.h"
 
 #include "FEComponentTransferSoftwareApplier.h"
+#include "Filter.h"
 #include <wtf/text/TextStream.h>
 
 namespace WebCore {
@@ -44,9 +45,14 @@
 {
 }
 
-bool FEComponentTransfer::platformApplySoftware(const Filter& filter)
+std::unique_ptr<FilterEffectApplier> FEComponentTransfer::createApplier(const Filter& filter) const
 {
-    return FEComponentTransferSoftwareApplier(*this).apply(filter, inputFilterImages(), *filterImage());
+#if USE(CORE_IMAGE)
+    // FIXME: return FEComponentTransferCoreImageApplier.
+    if (filter.renderingMode() == RenderingMode::Accelerated)
+        return nullptr;
+#endif
+    return FilterEffectApplier::create<FEComponentTransferSoftwareApplier>(*this);
 }
 
 static TextStream& operator<<(TextStream& ts, ComponentTransferType type)
diff --git a/Source/WebCore/platform/graphics/filters/FEComponentTransfer.h b/Source/WebCore/platform/graphics/filters/FEComponentTransfer.h
index c7d3493..59c97b6 100644
--- a/Source/WebCore/platform/graphics/filters/FEComponentTransfer.h
+++ b/Source/WebCore/platform/graphics/filters/FEComponentTransfer.h
@@ -62,7 +62,7 @@
 private:
     FEComponentTransfer(const ComponentTransferFunction& redFunc, const ComponentTransferFunction& greenFunc, const ComponentTransferFunction& blueFunc, const ComponentTransferFunction& alphaFunc);
 
-    bool platformApplySoftware(const Filter&) override;
+    std::unique_ptr<FilterEffectApplier> createApplier(const Filter&) const override;
 
     WTF::TextStream& externalRepresentation(WTF::TextStream&, RepresentationType) const override;
 
diff --git a/Source/WebCore/platform/graphics/filters/FEComposite.cpp b/Source/WebCore/platform/graphics/filters/FEComposite.cpp
index 5a48ea4..0e773c0 100644
--- a/Source/WebCore/platform/graphics/filters/FEComposite.cpp
+++ b/Source/WebCore/platform/graphics/filters/FEComposite.cpp
@@ -107,9 +107,9 @@
     }
 }
 
-bool FEComposite::platformApplySoftware(const Filter& filter)
+std::unique_ptr<FilterEffectApplier> FEComposite::createApplier(const Filter&) const
 {
-    return FECompositeSoftwareApplier(*this).apply(filter, inputFilterImages(), *filterImage());
+    return FilterEffectApplier::create<FECompositeSoftwareApplier>(*this);
 }
 
 static TextStream& operator<<(TextStream& ts, const CompositeOperationType& type)
diff --git a/Source/WebCore/platform/graphics/filters/FEComposite.h b/Source/WebCore/platform/graphics/filters/FEComposite.h
index f5e4974..b0e826f 100644
--- a/Source/WebCore/platform/graphics/filters/FEComposite.h
+++ b/Source/WebCore/platform/graphics/filters/FEComposite.h
@@ -64,7 +64,7 @@
 
     bool mayProduceInvalidPremultipliedPixels() const override { return m_type == FECOMPOSITE_OPERATOR_ARITHMETIC; }
 
-    bool platformApplySoftware(const Filter&) override;
+    std::unique_ptr<FilterEffectApplier> createApplier(const Filter&) const override;
 
     WTF::TextStream& externalRepresentation(WTF::TextStream&, RepresentationType) const override;
 
diff --git a/Source/WebCore/platform/graphics/filters/FEConvolveMatrix.cpp b/Source/WebCore/platform/graphics/filters/FEConvolveMatrix.cpp
index ddbd95e..f2659d3 100644
--- a/Source/WebCore/platform/graphics/filters/FEConvolveMatrix.cpp
+++ b/Source/WebCore/platform/graphics/filters/FEConvolveMatrix.cpp
@@ -113,9 +113,9 @@
     return true;
 }
 
-bool FEConvolveMatrix::platformApplySoftware(const Filter& filter)
+std::unique_ptr<FilterEffectApplier> FEConvolveMatrix::createApplier(const Filter&) const
 {
-    return FEConvolveMatrixSoftwareApplier(*this).apply(filter, inputFilterImages(), *filterImage());
+    return FilterEffectApplier::create<FEConvolveMatrixSoftwareApplier>(*this);
 }
 
 static TextStream& operator<<(TextStream& ts, const EdgeModeType& type)
diff --git a/Source/WebCore/platform/graphics/filters/FEConvolveMatrix.h b/Source/WebCore/platform/graphics/filters/FEConvolveMatrix.h
index 02d7c2b..ebb006d 100644
--- a/Source/WebCore/platform/graphics/filters/FEConvolveMatrix.h
+++ b/Source/WebCore/platform/graphics/filters/FEConvolveMatrix.h
@@ -69,7 +69,7 @@
 
     void determineAbsolutePaintRect(const Filter&) override { setAbsolutePaintRect(enclosingIntRect(maxEffectRect())); }
 
-    bool platformApplySoftware(const Filter&) override;
+    std::unique_ptr<FilterEffectApplier> createApplier(const Filter&) const override;
 
     WTF::TextStream& externalRepresentation(WTF::TextStream&, RepresentationType) const override;
 
diff --git a/Source/WebCore/platform/graphics/filters/FEDisplacementMap.cpp b/Source/WebCore/platform/graphics/filters/FEDisplacementMap.cpp
index 5adefd7..78997a0 100644
--- a/Source/WebCore/platform/graphics/filters/FEDisplacementMap.cpp
+++ b/Source/WebCore/platform/graphics/filters/FEDisplacementMap.cpp
@@ -83,9 +83,9 @@
         in->transformResultColorSpace(operatingColorSpace());
 }
 
-bool FEDisplacementMap::platformApplySoftware(const Filter& filter)
+std::unique_ptr<FilterEffectApplier> FEDisplacementMap::createApplier(const Filter&) const
 {
-    return FEDisplacementMapSoftwareApplier(*this).apply(filter, inputFilterImages(), *filterImage());
+    return FilterEffectApplier::create<FEDisplacementMapSoftwareApplier>(*this);
 }
 
 static TextStream& operator<<(TextStream& ts, const ChannelSelectorType& type)
diff --git a/Source/WebCore/platform/graphics/filters/FEDisplacementMap.h b/Source/WebCore/platform/graphics/filters/FEDisplacementMap.h
index 9654627..cec6b32 100644
--- a/Source/WebCore/platform/graphics/filters/FEDisplacementMap.h
+++ b/Source/WebCore/platform/graphics/filters/FEDisplacementMap.h
@@ -51,13 +51,13 @@
 private:
     FEDisplacementMap(ChannelSelectorType xChannelSelector, ChannelSelectorType yChannelSelector, float);
 
-    bool platformApplySoftware(const Filter&) override;
-
     const DestinationColorSpace& resultColorSpace() const override;
     void transformResultColorSpace(FilterEffect*, const int) override;
 
     void determineAbsolutePaintRect(const Filter&) override { setAbsolutePaintRect(enclosingIntRect(maxEffectRect())); }
 
+    std::unique_ptr<FilterEffectApplier> createApplier(const Filter&) const override;
+
     WTF::TextStream& externalRepresentation(WTF::TextStream&, RepresentationType) const override;
 
     ChannelSelectorType m_xChannelSelector;
diff --git a/Source/WebCore/platform/graphics/filters/FEDropShadow.cpp b/Source/WebCore/platform/graphics/filters/FEDropShadow.cpp
index f5f5c60..18d8c32 100644
--- a/Source/WebCore/platform/graphics/filters/FEDropShadow.cpp
+++ b/Source/WebCore/platform/graphics/filters/FEDropShadow.cpp
@@ -66,11 +66,6 @@
     setAbsolutePaintRect(enclosingIntRect(absolutePaintRect));
 }
 
-bool FEDropShadow::platformApplySoftware(const Filter& filter)
-{
-    return FEDropShadowSoftwareApplier(*this).apply(filter, inputFilterImages(), *filterImage());
-}
-    
 IntOutsets FEDropShadow::outsets() const
 {
     IntSize outsetSize = FEGaussianBlur::calculateOutsetSize({ m_stdX, m_stdY });
@@ -82,6 +77,11 @@
     };
 }
 
+std::unique_ptr<FilterEffectApplier> FEDropShadow::createApplier(const Filter&) const
+{
+    return FilterEffectApplier::create<FEDropShadowSoftwareApplier>(*this);
+}
+    
 TextStream& FEDropShadow::externalRepresentation(TextStream& ts, RepresentationType representation) const
 {
     ts << indent <<"[feDropShadow";
diff --git a/Source/WebCore/platform/graphics/filters/FEDropShadow.h b/Source/WebCore/platform/graphics/filters/FEDropShadow.h
index 869d703..71f30bb 100644
--- a/Source/WebCore/platform/graphics/filters/FEDropShadow.h
+++ b/Source/WebCore/platform/graphics/filters/FEDropShadow.h
@@ -54,7 +54,7 @@
 
     IntOutsets outsets() const override;
 
-    bool platformApplySoftware(const Filter&) override;
+    std::unique_ptr<FilterEffectApplier> createApplier(const Filter&) const override;
 
     WTF::TextStream& externalRepresentation(WTF::TextStream&, RepresentationType) const override;
 
diff --git a/Source/WebCore/platform/graphics/filters/FEFlood.cpp b/Source/WebCore/platform/graphics/filters/FEFlood.cpp
index a4814ee..d4ed2d5 100644
--- a/Source/WebCore/platform/graphics/filters/FEFlood.cpp
+++ b/Source/WebCore/platform/graphics/filters/FEFlood.cpp
@@ -58,9 +58,9 @@
     return true;
 }
 
-bool FEFlood::platformApplySoftware(const Filter& filter)
+std::unique_ptr<FilterEffectApplier> FEFlood::createApplier(const Filter&) const
 {
-    return FEFloodSoftwareApplier(*this).apply(filter, { }, *filterImage());
+    return FilterEffectApplier::create<FEFloodSoftwareApplier>(*this);
 }
 
 TextStream& FEFlood::externalRepresentation(TextStream& ts, RepresentationType representation) const
diff --git a/Source/WebCore/platform/graphics/filters/FEFlood.h b/Source/WebCore/platform/graphics/filters/FEFlood.h
index b97b43e..d5f44ea 100644
--- a/Source/WebCore/platform/graphics/filters/FEFlood.h
+++ b/Source/WebCore/platform/graphics/filters/FEFlood.h
@@ -48,7 +48,7 @@
 
     void determineAbsolutePaintRect(const Filter&) override { setAbsolutePaintRect(enclosingIntRect(maxEffectRect())); }
 
-    bool platformApplySoftware(const Filter&) override;
+    std::unique_ptr<FilterEffectApplier> createApplier(const Filter&) const override;
 
     WTF::TextStream& externalRepresentation(WTF::TextStream&, RepresentationType) const override;
 
diff --git a/Source/WebCore/platform/graphics/filters/FEGaussianBlur.cpp b/Source/WebCore/platform/graphics/filters/FEGaussianBlur.cpp
index ea9d333..6ce6ff7 100644
--- a/Source/WebCore/platform/graphics/filters/FEGaussianBlur.cpp
+++ b/Source/WebCore/platform/graphics/filters/FEGaussianBlur.cpp
@@ -136,9 +136,9 @@
     return inputEffect(0)->resultIsAlphaImage();
 }
 
-bool FEGaussianBlur::platformApplySoftware(const Filter& filter)
+std::unique_ptr<FilterEffectApplier> FEGaussianBlur::createApplier(const Filter&) const
 {
-    return FEGaussianBlurSoftwareApplier(*this).apply(filter, inputFilterImages(), *filterImage());
+    return FilterEffectApplier::create<FEGaussianBlurSoftwareApplier>(*this);
 }
 
 TextStream& FEGaussianBlur::externalRepresentation(TextStream& ts, RepresentationType representation) const
diff --git a/Source/WebCore/platform/graphics/filters/FEGaussianBlur.h b/Source/WebCore/platform/graphics/filters/FEGaussianBlur.h
index 4d4e020..229f4f3 100644
--- a/Source/WebCore/platform/graphics/filters/FEGaussianBlur.h
+++ b/Source/WebCore/platform/graphics/filters/FEGaussianBlur.h
@@ -53,7 +53,7 @@
 
     bool resultIsAlphaImage() const override;
 
-    bool platformApplySoftware(const Filter&) override;
+    std::unique_ptr<FilterEffectApplier> createApplier(const Filter&) const override;
 
     WTF::TextStream& externalRepresentation(WTF::TextStream&, RepresentationType) const override;
 
diff --git a/Source/WebCore/platform/graphics/filters/FELighting.cpp b/Source/WebCore/platform/graphics/filters/FELighting.cpp
index 309df9e..6b066b3 100644
--- a/Source/WebCore/platform/graphics/filters/FELighting.cpp
+++ b/Source/WebCore/platform/graphics/filters/FELighting.cpp
@@ -81,9 +81,9 @@
     return true;
 }
 
-bool FELighting::platformApplySoftware(const Filter& filter)
+std::unique_ptr<FilterEffectApplier> FELighting::createApplier(const Filter&) const
 {
-    return FELightingSoftwareApplier(*this).apply(filter, inputFilterImages(), *filterImage());
+    return FilterEffectApplier::create<FELightingSoftwareApplier>(*this);
 }
 
 } // namespace WebCore
diff --git a/Source/WebCore/platform/graphics/filters/FELighting.h b/Source/WebCore/platform/graphics/filters/FELighting.h
index 31189a4..9d7d6ae 100644
--- a/Source/WebCore/platform/graphics/filters/FELighting.h
+++ b/Source/WebCore/platform/graphics/filters/FELighting.h
@@ -60,7 +60,7 @@
 
     void determineAbsolutePaintRect(const Filter&) override { setAbsolutePaintRect(enclosingIntRect(maxEffectRect())); }
 
-    bool platformApplySoftware(const Filter&) override;
+    std::unique_ptr<FilterEffectApplier> createApplier(const Filter&) const override;
 
 #if CPU(ARM_NEON) && CPU(ARM_TRADITIONAL) && COMPILER(GCC_COMPATIBLE)
     static int getPowerCoefficients(float exponent);
diff --git a/Source/WebCore/platform/graphics/filters/FEMerge.cpp b/Source/WebCore/platform/graphics/filters/FEMerge.cpp
index 0c4220f..863b799 100644
--- a/Source/WebCore/platform/graphics/filters/FEMerge.cpp
+++ b/Source/WebCore/platform/graphics/filters/FEMerge.cpp
@@ -38,9 +38,9 @@
 {
 }
 
-bool FEMerge::platformApplySoftware(const Filter& filter)
+std::unique_ptr<FilterEffectApplier> FEMerge::createApplier(const Filter&) const
 {
-    return FEMergeSoftwareApplier(*this).apply(filter, inputFilterImages(), *filterImage());
+    return FilterEffectApplier::create<FEMergeSoftwareApplier>(*this);
 }
 
 TextStream& FEMerge::externalRepresentation(TextStream& ts, RepresentationType representation) const
diff --git a/Source/WebCore/platform/graphics/filters/FEMerge.h b/Source/WebCore/platform/graphics/filters/FEMerge.h
index 846b15c..64ed4a7 100644
--- a/Source/WebCore/platform/graphics/filters/FEMerge.h
+++ b/Source/WebCore/platform/graphics/filters/FEMerge.h
@@ -33,7 +33,7 @@
 private:
     FEMerge();
 
-    bool platformApplySoftware(const Filter&) override;
+    std::unique_ptr<FilterEffectApplier> createApplier(const Filter&) const override;
 
     WTF::TextStream& externalRepresentation(WTF::TextStream&, RepresentationType) const override;
 };
diff --git a/Source/WebCore/platform/graphics/filters/FEMorphology.cpp b/Source/WebCore/platform/graphics/filters/FEMorphology.cpp
index b946e20..f1f4ddd 100644
--- a/Source/WebCore/platform/graphics/filters/FEMorphology.cpp
+++ b/Source/WebCore/platform/graphics/filters/FEMorphology.cpp
@@ -84,9 +84,9 @@
     return inputEffect(0)->resultIsAlphaImage();
 }
 
-bool FEMorphology::platformApplySoftware(const Filter& filter)
+std::unique_ptr<FilterEffectApplier> FEMorphology::createApplier(const Filter&) const
 {
-    return FEMorphologySoftwareApplier(*this).apply(filter, inputFilterImages(), *filterImage());
+    return FilterEffectApplier::create<FEMorphologySoftwareApplier>(*this);
 }
 
 static TextStream& operator<<(TextStream& ts, const MorphologyOperatorType& type)
diff --git a/Source/WebCore/platform/graphics/filters/FEMorphology.h b/Source/WebCore/platform/graphics/filters/FEMorphology.h
index dbcdab6..e548480 100644
--- a/Source/WebCore/platform/graphics/filters/FEMorphology.h
+++ b/Source/WebCore/platform/graphics/filters/FEMorphology.h
@@ -52,7 +52,7 @@
 
     bool resultIsAlphaImage() const override;
 
-    bool platformApplySoftware(const Filter&) override;
+    std::unique_ptr<FilterEffectApplier> createApplier(const Filter&) const override;
 
     WTF::TextStream& externalRepresentation(WTF::TextStream&, RepresentationType) const override;
 
diff --git a/Source/WebCore/platform/graphics/filters/FEOffset.cpp b/Source/WebCore/platform/graphics/filters/FEOffset.cpp
index 13a0c6f..04490b3 100644
--- a/Source/WebCore/platform/graphics/filters/FEOffset.cpp
+++ b/Source/WebCore/platform/graphics/filters/FEOffset.cpp
@@ -69,9 +69,9 @@
     return inputEffect(0)->resultIsAlphaImage();
 }
 
-bool FEOffset::platformApplySoftware(const Filter& filter)
+std::unique_ptr<FilterEffectApplier> FEOffset::createApplier(const Filter&) const
 {
-    return FEOffsetSoftwareApplier(*this).apply(filter, inputFilterImages(), *filterImage());
+    return FilterEffectApplier::create<FEOffsetSoftwareApplier>(*this);
 }
 
 TextStream& FEOffset::externalRepresentation(TextStream& ts, RepresentationType representation) const
diff --git a/Source/WebCore/platform/graphics/filters/FEOffset.h b/Source/WebCore/platform/graphics/filters/FEOffset.h
index ed73f27..3c2daaf3 100644
--- a/Source/WebCore/platform/graphics/filters/FEOffset.h
+++ b/Source/WebCore/platform/graphics/filters/FEOffset.h
@@ -43,7 +43,7 @@
 
     bool resultIsAlphaImage() const override;
 
-    bool platformApplySoftware(const Filter&) override;
+    std::unique_ptr<FilterEffectApplier> createApplier(const Filter&) const override;
 
     WTF::TextStream& externalRepresentation(WTF::TextStream&, RepresentationType) const override;
 
diff --git a/Source/WebCore/platform/graphics/filters/FETile.cpp b/Source/WebCore/platform/graphics/filters/FETile.cpp
index 5a0bce7..2ad97b3 100644
--- a/Source/WebCore/platform/graphics/filters/FETile.cpp
+++ b/Source/WebCore/platform/graphics/filters/FETile.cpp
@@ -42,9 +42,9 @@
     return inputEffect(0)->resultIsAlphaImage();
 }
 
-bool FETile::platformApplySoftware(const Filter& filter)
+std::unique_ptr<FilterEffectApplier> FETile::createApplier(const Filter&) const
 {
-    return FETileSoftwareApplier(*this).apply(filter, inputFilterImages(), *filterImage());
+    return FilterEffectApplier::create<FETileSoftwareApplier>(*this);
 }
 
 TextStream& FETile::externalRepresentation(TextStream& ts, RepresentationType representation) const
diff --git a/Source/WebCore/platform/graphics/filters/FETile.h b/Source/WebCore/platform/graphics/filters/FETile.h
index 806aba3..2ee3731 100644
--- a/Source/WebCore/platform/graphics/filters/FETile.h
+++ b/Source/WebCore/platform/graphics/filters/FETile.h
@@ -37,7 +37,7 @@
 
     bool resultIsAlphaImage() const override;
 
-    bool platformApplySoftware(const Filter&) override;
+    std::unique_ptr<FilterEffectApplier> createApplier(const Filter&) const override;
 
     WTF::TextStream& externalRepresentation(WTF::TextStream&, RepresentationType) const override;
 };
diff --git a/Source/WebCore/platform/graphics/filters/FETurbulence.cpp b/Source/WebCore/platform/graphics/filters/FETurbulence.cpp
index e4186a4..ac6a449 100644
--- a/Source/WebCore/platform/graphics/filters/FETurbulence.cpp
+++ b/Source/WebCore/platform/graphics/filters/FETurbulence.cpp
@@ -95,9 +95,9 @@
     return true;
 }
 
-bool FETurbulence::platformApplySoftware(const Filter& filter)
+std::unique_ptr<FilterEffectApplier> FETurbulence::createApplier(const Filter&) const
 {
-    return FETurbulenceSoftwareApplier(*this).apply(filter, { }, *filterImage());
+    return FilterEffectApplier::create<FETurbulenceSoftwareApplier>(*this);
 }
 
 static TextStream& operator<<(TextStream& ts, TurbulenceType type)
diff --git a/Source/WebCore/platform/graphics/filters/FETurbulence.h b/Source/WebCore/platform/graphics/filters/FETurbulence.h
index 973eb1d..5ffadde 100644
--- a/Source/WebCore/platform/graphics/filters/FETurbulence.h
+++ b/Source/WebCore/platform/graphics/filters/FETurbulence.h
@@ -62,7 +62,7 @@
 
     void determineAbsolutePaintRect(const Filter&) override { setAbsolutePaintRect(enclosingIntRect(maxEffectRect())); }
 
-    bool platformApplySoftware(const Filter&) override;
+    std::unique_ptr<FilterEffectApplier> createApplier(const Filter&) const override;
 
     WTF::TextStream& externalRepresentation(WTF::TextStream&, RepresentationType) const override;
 
diff --git a/Source/WebCore/platform/graphics/filters/FilterEffect.cpp b/Source/WebCore/platform/graphics/filters/FilterEffect.cpp
index 7acb883..08d8d36 100644
--- a/Source/WebCore/platform/graphics/filters/FilterEffect.cpp
+++ b/Source/WebCore/platform/graphics/filters/FilterEffect.cpp
@@ -26,10 +26,10 @@
 
 #include "Color.h"
 #include "Filter.h"
+#include "FilterEffectApplier.h"
 #include "GeometryUtilities.h"
 #include "ImageBuffer.h"
 #include "Logging.h"
-#include "PixelBuffer.h"
 #include <wtf/text/TextStream.h>
 
 namespace WebCore {
@@ -144,8 +144,11 @@
     if (!m_filterImage)
         return false;
 
-    // Add platform specific apply functions here and return earlier.
-    return platformApplySoftware(filter);
+    auto applier = createApplier(filter);
+    if (!applier)
+        return false;
+
+    return applier->apply(filter, inputFilterImages(), *m_filterImage);
 }
 
 void FilterEffect::clearResult()
diff --git a/Source/WebCore/platform/graphics/filters/FilterEffect.h b/Source/WebCore/platform/graphics/filters/FilterEffect.h
index 875d8fe..e2bd1e8 100644
--- a/Source/WebCore/platform/graphics/filters/FilterEffect.h
+++ b/Source/WebCore/platform/graphics/filters/FilterEffect.h
@@ -37,6 +37,7 @@
 namespace WebCore {
 
 class Filter;
+class FilterEffectApplier;
 class ImageBuffer;
 
 class FilterEffect : public FilterFunction {
@@ -116,12 +117,12 @@
     using FilterFunction::FilterFunction;
 
     virtual bool mayProduceInvalidPremultipliedPixels() const { return false; }
+    
+    virtual std::unique_ptr<FilterEffectApplier> createApplier(const Filter&) const = 0;
 
     void clipAbsolutePaintRect();
 
 private:
-    virtual bool platformApplySoftware(const Filter&) = 0;
-
     FilterEffectVector m_inputEffects;
 
     RefPtr<FilterImage> m_filterImage;
diff --git a/Source/WebCore/platform/graphics/filters/FilterEffectApplier.h b/Source/WebCore/platform/graphics/filters/FilterEffectApplier.h
index fe324f7..c921b2c 100644
--- a/Source/WebCore/platform/graphics/filters/FilterEffectApplier.h
+++ b/Source/WebCore/platform/graphics/filters/FilterEffectApplier.h
@@ -33,22 +33,28 @@
 
 class FilterEffectApplier {
 public:
+    template<typename FilterEffectApplierType, typename FilterEffectType>
+    static std::unique_ptr<FilterEffectApplierType> create(const FilterEffectType& effect)
+    {
+        return makeUnique<FilterEffectApplierType>(effect);
+    }
+    
     FilterEffectApplier() = default;
     virtual ~FilterEffectApplier() = default;
     
-    virtual bool apply(const Filter&, const FilterImageVector& inputs, FilterImage& result) = 0;
+    virtual bool apply(const Filter&, const FilterImageVector& inputs, FilterImage& result) const = 0;
 };
 
 template<typename FilterEffectType>
 class FilterEffectConcreteApplier : public FilterEffectApplier {
 public:
-    FilterEffectConcreteApplier(FilterEffectType& effect)
+    FilterEffectConcreteApplier(const FilterEffectType& effect)
         : m_effect(effect)
     {
     }
     
 protected:
-    FilterEffectType& m_effect;
+    const FilterEffectType& m_effect;
 };
 
 } // namespace WebCore
diff --git a/Source/WebCore/platform/graphics/filters/SourceAlpha.cpp b/Source/WebCore/platform/graphics/filters/SourceAlpha.cpp
index bc5a255..84f67cf 100644
--- a/Source/WebCore/platform/graphics/filters/SourceAlpha.cpp
+++ b/Source/WebCore/platform/graphics/filters/SourceAlpha.cpp
@@ -45,9 +45,9 @@
     setAbsolutePaintRect(inputEffect(0)->absolutePaintRect());
 }
 
-bool SourceAlpha::platformApplySoftware(const Filter& filter)
+std::unique_ptr<FilterEffectApplier> SourceAlpha::createApplier(const Filter&) const
 {
-    return SourceAlphaSoftwareApplier(*this).apply(filter, inputFilterImages(), *filterImage());
+    return FilterEffectApplier::create<SourceAlphaSoftwareApplier>(*this);
 }
 
 TextStream& SourceAlpha::externalRepresentation(TextStream& ts, RepresentationType) const
diff --git a/Source/WebCore/platform/graphics/filters/SourceAlpha.h b/Source/WebCore/platform/graphics/filters/SourceAlpha.h
index ecfbf12..93a2439 100644
--- a/Source/WebCore/platform/graphics/filters/SourceAlpha.h
+++ b/Source/WebCore/platform/graphics/filters/SourceAlpha.h
@@ -35,7 +35,7 @@
 
     void determineAbsolutePaintRect(const Filter&) override;
 
-    bool platformApplySoftware(const Filter&) override;
+    std::unique_ptr<FilterEffectApplier> createApplier(const Filter&) const override;
 
     WTF::TextStream& externalRepresentation(WTF::TextStream&, RepresentationType) const override;
 };
diff --git a/Source/WebCore/platform/graphics/filters/SourceGraphic.cpp b/Source/WebCore/platform/graphics/filters/SourceGraphic.cpp
index 106f544..f7b16e6 100644
--- a/Source/WebCore/platform/graphics/filters/SourceGraphic.cpp
+++ b/Source/WebCore/platform/graphics/filters/SourceGraphic.cpp
@@ -43,9 +43,14 @@
     setAbsolutePaintRect(enclosingIntRect(paintRect));
 }
 
-bool SourceGraphic::platformApplySoftware(const Filter& filter)
+std::unique_ptr<FilterEffectApplier> SourceGraphic::createApplier(const Filter& filter) const
 {
-    return SourceGraphicSoftwareApplier(*this).apply(filter, { }, *filterImage());
+#if USE(CORE_IMAGE)
+    // FIXME: return SourceGraphicCoreImageApplier.
+    if (filter.renderingMode() == RenderingMode::Accelerated)
+        return nullptr;
+#endif
+    return FilterEffectApplier::create<SourceGraphicSoftwareApplier>(*this);
 }
 
 TextStream& SourceGraphic::externalRepresentation(TextStream& ts, RepresentationType) const
diff --git a/Source/WebCore/platform/graphics/filters/SourceGraphic.h b/Source/WebCore/platform/graphics/filters/SourceGraphic.h
index 50f47a1..e42be6c 100644
--- a/Source/WebCore/platform/graphics/filters/SourceGraphic.h
+++ b/Source/WebCore/platform/graphics/filters/SourceGraphic.h
@@ -36,7 +36,7 @@
 
     void determineAbsolutePaintRect(const Filter&) override;
 
-    bool platformApplySoftware(const Filter&) override;
+    std::unique_ptr<FilterEffectApplier> createApplier(const Filter&) const override;
 
     WTF::TextStream& externalRepresentation(WTF::TextStream&, RepresentationType) const override;
 };
diff --git a/Source/WebCore/platform/graphics/filters/software/FEBlendSoftwareApplier.cpp b/Source/WebCore/platform/graphics/filters/software/FEBlendSoftwareApplier.cpp
index d3cb55c..53d5afc 100644
--- a/Source/WebCore/platform/graphics/filters/software/FEBlendSoftwareApplier.cpp
+++ b/Source/WebCore/platform/graphics/filters/software/FEBlendSoftwareApplier.cpp
@@ -34,7 +34,7 @@
 namespace WebCore {
 
 #if !HAVE(ARM_NEON_INTRINSICS)
-bool FEBlendSoftwareApplier::apply(const Filter&, const FilterImageVector& inputs, FilterImage& result)
+bool FEBlendSoftwareApplier::apply(const Filter&, const FilterImageVector& inputs, FilterImage& result) const
 {
     auto& input = inputs[0].get();
     auto& input2 = inputs[1].get();
diff --git a/Source/WebCore/platform/graphics/filters/software/FEBlendSoftwareApplier.h b/Source/WebCore/platform/graphics/filters/software/FEBlendSoftwareApplier.h
index 1502852..f440d81 100644
--- a/Source/WebCore/platform/graphics/filters/software/FEBlendSoftwareApplier.h
+++ b/Source/WebCore/platform/graphics/filters/software/FEBlendSoftwareApplier.h
@@ -30,12 +30,13 @@
 class FEBlend;
 
 class FEBlendSoftwareApplier : public FilterEffectConcreteApplier<FEBlend> {
+    WTF_MAKE_FAST_ALLOCATED;
     using Base = FilterEffectConcreteApplier<FEBlend>;
 
 public:
     using Base::Base;
 
-    bool apply(const Filter&, const FilterImageVector& inputs, FilterImage& result) override;
+    bool apply(const Filter&, const FilterImageVector& inputs, FilterImage& result) const override;
 };
 
 } // namespace WebCore
diff --git a/Source/WebCore/platform/graphics/filters/software/FEColorMatrixSoftwareApplier.cpp b/Source/WebCore/platform/graphics/filters/software/FEColorMatrixSoftwareApplier.cpp
index 4f0e3fb..3163a56 100644
--- a/Source/WebCore/platform/graphics/filters/software/FEColorMatrixSoftwareApplier.cpp
+++ b/Source/WebCore/platform/graphics/filters/software/FEColorMatrixSoftwareApplier.cpp
@@ -36,7 +36,7 @@
 
 namespace WebCore {
 
-FEColorMatrixSoftwareApplier::FEColorMatrixSoftwareApplier(FEColorMatrix& effect)
+FEColorMatrixSoftwareApplier::FEColorMatrixSoftwareApplier(const FEColorMatrix& effect)
     : Base(effect)
 {
     if (m_effect.type() == FECOLORMATRIX_TYPE_SATURATE)
@@ -259,7 +259,7 @@
     applyPlatformUnaccelerated(pixelBuffer);
 }
 
-bool FEColorMatrixSoftwareApplier::apply(const Filter&, const FilterImageVector& inputs, FilterImage& result)
+bool FEColorMatrixSoftwareApplier::apply(const Filter&, const FilterImageVector& inputs, FilterImage& result) const
 {
     auto& input = inputs[0].get();
 
diff --git a/Source/WebCore/platform/graphics/filters/software/FEColorMatrixSoftwareApplier.h b/Source/WebCore/platform/graphics/filters/software/FEColorMatrixSoftwareApplier.h
index 0bc48be..d32135c 100644
--- a/Source/WebCore/platform/graphics/filters/software/FEColorMatrixSoftwareApplier.h
+++ b/Source/WebCore/platform/graphics/filters/software/FEColorMatrixSoftwareApplier.h
@@ -30,12 +30,13 @@
 class PixelBuffer;
 
 class FEColorMatrixSoftwareApplier : public FilterEffectConcreteApplier<FEColorMatrix> {
+    WTF_MAKE_FAST_ALLOCATED;
     using Base = FilterEffectConcreteApplier<FEColorMatrix>;
 
 public:
-    FEColorMatrixSoftwareApplier(FEColorMatrix&);
+    FEColorMatrixSoftwareApplier(const FEColorMatrix&);
 
-    bool apply(const Filter&, const FilterImageVector& inputs, FilterImage& result) override;
+    bool apply(const Filter&, const FilterImageVector& inputs, FilterImage& result) const override;
 
 private:
     inline void matrix(float& red, float& green, float& blue, float& alpha) const;
diff --git a/Source/WebCore/platform/graphics/filters/software/FEComponentTransferSoftwareApplier.cpp b/Source/WebCore/platform/graphics/filters/software/FEComponentTransferSoftwareApplier.cpp
index 1b25f78..4f4b320 100644
--- a/Source/WebCore/platform/graphics/filters/software/FEComponentTransferSoftwareApplier.cpp
+++ b/Source/WebCore/platform/graphics/filters/software/FEComponentTransferSoftwareApplier.cpp
@@ -131,7 +131,7 @@
     }
 }
 
-bool FEComponentTransferSoftwareApplier::apply(const Filter&, const FilterImageVector& inputs, FilterImage& result)
+bool FEComponentTransferSoftwareApplier::apply(const Filter&, const FilterImageVector& inputs, FilterImage& result) const
 {
     auto& input = inputs[0].get();
     
diff --git a/Source/WebCore/platform/graphics/filters/software/FEComponentTransferSoftwareApplier.h b/Source/WebCore/platform/graphics/filters/software/FEComponentTransferSoftwareApplier.h
index 9fa007c..70a084b 100644
--- a/Source/WebCore/platform/graphics/filters/software/FEComponentTransferSoftwareApplier.h
+++ b/Source/WebCore/platform/graphics/filters/software/FEComponentTransferSoftwareApplier.h
@@ -31,12 +31,13 @@
 struct ComponentTransferFunction;
 
 class FEComponentTransferSoftwareApplier : public FilterEffectConcreteApplier<FEComponentTransfer> {
+    WTF_MAKE_FAST_ALLOCATED;
     using Base = FilterEffectConcreteApplier<FEComponentTransfer>;
 
 public:
     using Base::Base;
 
-    bool apply(const Filter&, const FilterImageVector& inputs, FilterImage& result) override;
+    bool apply(const Filter&, const FilterImageVector& inputs, FilterImage& result) const override;
 
 private:
     using LookupTable = std::array<uint8_t, 256>;
diff --git a/Source/WebCore/platform/graphics/filters/software/FECompositeSoftwareApplier.cpp b/Source/WebCore/platform/graphics/filters/software/FECompositeSoftwareApplier.cpp
index 150a28a..292cef7 100644
--- a/Source/WebCore/platform/graphics/filters/software/FECompositeSoftwareApplier.cpp
+++ b/Source/WebCore/platform/graphics/filters/software/FECompositeSoftwareApplier.cpp
@@ -126,7 +126,7 @@
 }
 #endif
 
-bool FECompositeSoftwareApplier::applyArithmetic(FilterImage& input, FilterImage& input2, FilterImage& result)
+bool FECompositeSoftwareApplier::applyArithmetic(FilterImage& input, FilterImage& input2, FilterImage& result) const
 {
     auto destinationPixelBuffer = result.pixelBuffer(AlphaPremultiplication::Premultiplied);
     if (!destinationPixelBuffer)
@@ -149,7 +149,7 @@
     return true;
 }
 
-bool FECompositeSoftwareApplier::applyNonArithmetic(FilterImage& input, FilterImage& input2, FilterImage& result)
+bool FECompositeSoftwareApplier::applyNonArithmetic(FilterImage& input, FilterImage& input2, FilterImage& result) const
 {
     auto resultImage = result.imageBuffer();
     if (!resultImage)
@@ -216,7 +216,7 @@
     return true;
 }
 
-bool FECompositeSoftwareApplier::apply(const Filter&, const FilterImageVector& inputs, FilterImage& result)
+bool FECompositeSoftwareApplier::apply(const Filter&, const FilterImageVector& inputs, FilterImage& result) const
 {
     auto& input = inputs[0].get();
     auto& input2 = inputs[1].get();
diff --git a/Source/WebCore/platform/graphics/filters/software/FECompositeSoftwareApplier.h b/Source/WebCore/platform/graphics/filters/software/FECompositeSoftwareApplier.h
index 86ae02f..d6e617a 100644
--- a/Source/WebCore/platform/graphics/filters/software/FECompositeSoftwareApplier.h
+++ b/Source/WebCore/platform/graphics/filters/software/FECompositeSoftwareApplier.h
@@ -29,12 +29,13 @@
 class FEComposite;
 
 class FECompositeSoftwareApplier : public FilterEffectConcreteApplier<FEComposite> {
+    WTF_MAKE_FAST_ALLOCATED;
     using Base = FilterEffectConcreteApplier<FEComposite>;
 
 public:
     using Base::Base;
 
-    bool apply(const Filter&, const FilterImageVector& inputs, FilterImage& result) override;
+    bool apply(const Filter&, const FilterImageVector& inputs, FilterImage& result) const override;
 
 private:
     static uint8_t clampByte(int);
@@ -47,8 +48,8 @@
 
     static inline void applyPlatformArithmetic(unsigned char* source, unsigned char* destination, int pixelArrayLength, float k1, float k2, float k3, float k4);
 
-    bool applyArithmetic(FilterImage& input, FilterImage& input2, FilterImage& result);
-    bool applyNonArithmetic(FilterImage& input, FilterImage& input2, FilterImage& result);
+    bool applyArithmetic(FilterImage& input, FilterImage& input2, FilterImage& result) const;
+    bool applyNonArithmetic(FilterImage& input, FilterImage& input2, FilterImage& result) const;
 };
 
 } // namespace WebCore
diff --git a/Source/WebCore/platform/graphics/filters/software/FEConvolveMatrixSoftwareApplier.cpp b/Source/WebCore/platform/graphics/filters/software/FEConvolveMatrixSoftwareApplier.cpp
index 6e5b1c0..e614120 100644
--- a/Source/WebCore/platform/graphics/filters/software/FEConvolveMatrixSoftwareApplier.cpp
+++ b/Source/WebCore/platform/graphics/filters/software/FEConvolveMatrixSoftwareApplier.cpp
@@ -286,7 +286,7 @@
         setOuterPixels(paintingData, clipRight, paintingData.targetOffset.y(), paintingData.width, clipBottom);
 }
 
-bool FEConvolveMatrixSoftwareApplier::apply(const Filter&, const FilterImageVector& inputs, FilterImage& result)
+bool FEConvolveMatrixSoftwareApplier::apply(const Filter&, const FilterImageVector& inputs, FilterImage& result) const
 {
     auto& input = inputs[0].get();
 
diff --git a/Source/WebCore/platform/graphics/filters/software/FEConvolveMatrixSoftwareApplier.h b/Source/WebCore/platform/graphics/filters/software/FEConvolveMatrixSoftwareApplier.h
index d5d1f0c..e077df2 100644
--- a/Source/WebCore/platform/graphics/filters/software/FEConvolveMatrixSoftwareApplier.h
+++ b/Source/WebCore/platform/graphics/filters/software/FEConvolveMatrixSoftwareApplier.h
@@ -35,12 +35,13 @@
 enum class EdgeModeType;
 
 class FEConvolveMatrixSoftwareApplier : public FilterEffectConcreteApplier<FEConvolveMatrix> {
+    WTF_MAKE_FAST_ALLOCATED;
     using Base = FilterEffectConcreteApplier<FEConvolveMatrix>;
 
 public:
     using Base::Base;
 
-    bool apply(const Filter&, const FilterImageVector& inputs, FilterImage& result) override;
+    bool apply(const Filter&, const FilterImageVector& inputs, FilterImage& result) const override;
 
 private:
     struct PaintingData {
diff --git a/Source/WebCore/platform/graphics/filters/software/FEDisplacementMapSoftwareApplier.cpp b/Source/WebCore/platform/graphics/filters/software/FEDisplacementMapSoftwareApplier.cpp
index 4ecd049..ae026e3 100644
--- a/Source/WebCore/platform/graphics/filters/software/FEDisplacementMapSoftwareApplier.cpp
+++ b/Source/WebCore/platform/graphics/filters/software/FEDisplacementMapSoftwareApplier.cpp
@@ -32,7 +32,7 @@
 
 namespace WebCore {
 
-FEDisplacementMapSoftwareApplier::FEDisplacementMapSoftwareApplier(FEDisplacementMap& effect)
+FEDisplacementMapSoftwareApplier::FEDisplacementMapSoftwareApplier(const FEDisplacementMap& effect)
     : Base(effect)
 {
     ASSERT(m_effect.xChannelSelector() != CHANNEL_UNKNOWN);
@@ -49,7 +49,7 @@
     return m_effect.yChannelSelector() - 1;
 }
 
-bool FEDisplacementMapSoftwareApplier::apply(const Filter& filter, const FilterImageVector& inputs, FilterImage& result)
+bool FEDisplacementMapSoftwareApplier::apply(const Filter& filter, const FilterImageVector& inputs, FilterImage& result) const
 {
     auto& input = inputs[0].get();
     auto& input2 = inputs[1].get();
diff --git a/Source/WebCore/platform/graphics/filters/software/FEDisplacementMapSoftwareApplier.h b/Source/WebCore/platform/graphics/filters/software/FEDisplacementMapSoftwareApplier.h
index b857cf8..7782a36 100644
--- a/Source/WebCore/platform/graphics/filters/software/FEDisplacementMapSoftwareApplier.h
+++ b/Source/WebCore/platform/graphics/filters/software/FEDisplacementMapSoftwareApplier.h
@@ -29,12 +29,13 @@
 class FEDisplacementMap;
 
 class FEDisplacementMapSoftwareApplier : public FilterEffectConcreteApplier<FEDisplacementMap> {
+    WTF_MAKE_FAST_ALLOCATED;
     using Base = FilterEffectConcreteApplier<FEDisplacementMap>;
 
 public:
-    FEDisplacementMapSoftwareApplier(FEDisplacementMap&);
+    FEDisplacementMapSoftwareApplier(const FEDisplacementMap&);
 
-    bool apply(const Filter&, const FilterImageVector& inputs, FilterImage& result) override;
+    bool apply(const Filter&, const FilterImageVector& inputs, FilterImage& result) const override;
 
 private:
     static inline unsigned byteOffsetOfPixel(unsigned x, unsigned y, unsigned rowBytes)
diff --git a/Source/WebCore/platform/graphics/filters/software/FEDropShadowSoftwareApplier.cpp b/Source/WebCore/platform/graphics/filters/software/FEDropShadowSoftwareApplier.cpp
index 79a3e77..411eb48 100644
--- a/Source/WebCore/platform/graphics/filters/software/FEDropShadowSoftwareApplier.cpp
+++ b/Source/WebCore/platform/graphics/filters/software/FEDropShadowSoftwareApplier.cpp
@@ -30,7 +30,7 @@
 
 namespace WebCore {
 
-bool FEDropShadowSoftwareApplier::apply(const Filter& filter, const FilterImageVector& inputs, FilterImage& result)
+bool FEDropShadowSoftwareApplier::apply(const Filter& filter, const FilterImageVector& inputs, FilterImage& result) const
 {
     auto& input = inputs[0].get();
 
diff --git a/Source/WebCore/platform/graphics/filters/software/FEDropShadowSoftwareApplier.h b/Source/WebCore/platform/graphics/filters/software/FEDropShadowSoftwareApplier.h
index b4a893b..165e3ae 100644
--- a/Source/WebCore/platform/graphics/filters/software/FEDropShadowSoftwareApplier.h
+++ b/Source/WebCore/platform/graphics/filters/software/FEDropShadowSoftwareApplier.h
@@ -27,12 +27,13 @@
 class FEDropShadow;
 
 class FEDropShadowSoftwareApplier : public FilterEffectConcreteApplier<FEDropShadow> {
+    WTF_MAKE_FAST_ALLOCATED;
     using Base = FilterEffectConcreteApplier<FEDropShadow>;
 
 public:
     using Base::Base;
 
-    bool apply(const Filter&, const FilterImageVector& inputs, FilterImage& result) override;
+    bool apply(const Filter&, const FilterImageVector& inputs, FilterImage& result) const override;
 };
 
 } // namespace WebCore
diff --git a/Source/WebCore/platform/graphics/filters/software/FEFloodSoftwareApplier.cpp b/Source/WebCore/platform/graphics/filters/software/FEFloodSoftwareApplier.cpp
index 31da8b4..26b2486 100644
--- a/Source/WebCore/platform/graphics/filters/software/FEFloodSoftwareApplier.cpp
+++ b/Source/WebCore/platform/graphics/filters/software/FEFloodSoftwareApplier.cpp
@@ -30,7 +30,7 @@
 
 namespace WebCore {
 
-bool FEFloodSoftwareApplier::apply(const Filter&, const FilterImageVector&, FilterImage& result)
+bool FEFloodSoftwareApplier::apply(const Filter&, const FilterImageVector&, FilterImage& result) const
 {
     auto resultImage = result.imageBuffer();
     if (!resultImage)
diff --git a/Source/WebCore/platform/graphics/filters/software/FEFloodSoftwareApplier.h b/Source/WebCore/platform/graphics/filters/software/FEFloodSoftwareApplier.h
index 2cca05d..2a89d7e 100644
--- a/Source/WebCore/platform/graphics/filters/software/FEFloodSoftwareApplier.h
+++ b/Source/WebCore/platform/graphics/filters/software/FEFloodSoftwareApplier.h
@@ -29,12 +29,13 @@
 class FEFlood;
 
 class FEFloodSoftwareApplier : public FilterEffectConcreteApplier<FEFlood> {
+    WTF_MAKE_FAST_ALLOCATED;
     using Base = FilterEffectConcreteApplier<FEFlood>;
 
 public:
     using Base::Base;
 
-    bool apply(const Filter&, const FilterImageVector& inputs, FilterImage& result) override;
+    bool apply(const Filter&, const FilterImageVector& inputs, FilterImage& result) const override;
 };
 
 } // namespace WebCore
diff --git a/Source/WebCore/platform/graphics/filters/software/FEGaussianBlurSoftwareApplier.cpp b/Source/WebCore/platform/graphics/filters/software/FEGaussianBlurSoftwareApplier.cpp
index db196bb..f375484 100644
--- a/Source/WebCore/platform/graphics/filters/software/FEGaussianBlurSoftwareApplier.cpp
+++ b/Source/WebCore/platform/graphics/filters/software/FEGaussianBlurSoftwareApplier.cpp
@@ -425,7 +425,7 @@
     boxBlurGeneric(ioBuffer, tmpPixelArray, kernelSizeX, kernelSizeY, paintSize, isAlphaImage, edgeMode);
 }
 
-bool FEGaussianBlurSoftwareApplier::apply(const Filter& filter, const FilterImageVector& inputs, FilterImage& result)
+bool FEGaussianBlurSoftwareApplier::apply(const Filter& filter, const FilterImageVector& inputs, FilterImage& result) const
 {
     auto& input = inputs[0].get();
 
diff --git a/Source/WebCore/platform/graphics/filters/software/FEGaussianBlurSoftwareApplier.h b/Source/WebCore/platform/graphics/filters/software/FEGaussianBlurSoftwareApplier.h
index 199b8cb..12180ad 100644
--- a/Source/WebCore/platform/graphics/filters/software/FEGaussianBlurSoftwareApplier.h
+++ b/Source/WebCore/platform/graphics/filters/software/FEGaussianBlurSoftwareApplier.h
@@ -32,12 +32,13 @@
 enum class EdgeModeType;
 
 class FEGaussianBlurSoftwareApplier : public FilterEffectConcreteApplier<FEGaussianBlur> {
+    WTF_MAKE_FAST_ALLOCATED;
     using Base = FilterEffectConcreteApplier<FEGaussianBlur>;
 
 public:
     using Base::Base;
 
-    bool apply(const Filter&, const FilterImageVector& inputs, FilterImage& result) override;
+    bool apply(const Filter&, const FilterImageVector& inputs, FilterImage& result) const override;
 
 private:
     struct ApplyParameters {
diff --git a/Source/WebCore/platform/graphics/filters/software/FELightingSoftwareApplier.cpp b/Source/WebCore/platform/graphics/filters/software/FELightingSoftwareApplier.cpp
index 880a212..ce0acb8 100644
--- a/Source/WebCore/platform/graphics/filters/software/FELightingSoftwareApplier.cpp
+++ b/Source/WebCore/platform/graphics/filters/software/FELightingSoftwareApplier.cpp
@@ -391,7 +391,7 @@
     }
 }
 
-bool FELightingSoftwareApplier::apply(const Filter&, const FilterImageVector& inputs, FilterImage& result)
+bool FELightingSoftwareApplier::apply(const Filter&, const FilterImageVector& inputs, FilterImage& result) const
 {
     auto& input = inputs[0].get();
 
@@ -418,7 +418,6 @@
 
     LightingData data;
     data.effect = &m_effect;
-    data.filterType = m_effect.filterType();
     data.lightingColor = m_effect.lightingColor();
     data.surfaceScale = m_effect.surfaceScale() / 255.0f;
     data.diffuseConstant = m_effect.diffuseConstant();
diff --git a/Source/WebCore/platform/graphics/filters/software/FELightingSoftwareApplier.h b/Source/WebCore/platform/graphics/filters/software/FELightingSoftwareApplier.h
index 63aa0b0..0b48a93 100644
--- a/Source/WebCore/platform/graphics/filters/software/FELightingSoftwareApplier.h
+++ b/Source/WebCore/platform/graphics/filters/software/FELightingSoftwareApplier.h
@@ -38,12 +38,13 @@
 class FELighting;
 
 class FELightingSoftwareApplier : public FilterEffectConcreteApplier<FELighting> {
+    WTF_MAKE_FAST_ALLOCATED;
     using Base = FilterEffectConcreteApplier<FELighting>;
 
 public:
     using Base::Base;
 
-    bool apply(const Filter&, const FilterImageVector& inputs, FilterImage& result) override;
+    bool apply(const Filter&, const FilterImageVector& inputs, FilterImage& result) const override;
 
 private:
     static constexpr int cPixelSize = 4;
@@ -92,8 +93,7 @@
 
     struct LightingData {
         // This structure contains only read-only (SMP safe) data
-        FELighting* effect;
-        FilterEffect::Type filterType;
+        const FELighting* effect;
         Color lightingColor;
         float surfaceScale;
         float diffuseConstant;
diff --git a/Source/WebCore/platform/graphics/filters/software/FEMergeSoftwareApplier.cpp b/Source/WebCore/platform/graphics/filters/software/FEMergeSoftwareApplier.cpp
index 23b1fbd..87671b8 100644
--- a/Source/WebCore/platform/graphics/filters/software/FEMergeSoftwareApplier.cpp
+++ b/Source/WebCore/platform/graphics/filters/software/FEMergeSoftwareApplier.cpp
@@ -29,7 +29,7 @@
 
 namespace WebCore {
 
-bool FEMergeSoftwareApplier::apply(const Filter&, const FilterImageVector& inputs, FilterImage& result)
+bool FEMergeSoftwareApplier::apply(const Filter&, const FilterImageVector& inputs, FilterImage& result) const
 {
     ASSERT(inputs.size() == m_effect.numberOfEffectInputs());
 
diff --git a/Source/WebCore/platform/graphics/filters/software/FEMergeSoftwareApplier.h b/Source/WebCore/platform/graphics/filters/software/FEMergeSoftwareApplier.h
index 1b30aba..59d6af9 100644
--- a/Source/WebCore/platform/graphics/filters/software/FEMergeSoftwareApplier.h
+++ b/Source/WebCore/platform/graphics/filters/software/FEMergeSoftwareApplier.h
@@ -29,12 +29,13 @@
 class FEMerge;
 
 class FEMergeSoftwareApplier : public FilterEffectConcreteApplier<FEMerge> {
+    WTF_MAKE_FAST_ALLOCATED;
     using Base = FilterEffectConcreteApplier<FEMerge>;
 
 public:
     using Base::Base;
 
-    bool apply(const Filter&, const FilterImageVector& inputs, FilterImage& result) override;
+    bool apply(const Filter&, const FilterImageVector& inputs, FilterImage& result) const override;
 };
 
 } // namespace WebCore
diff --git a/Source/WebCore/platform/graphics/filters/software/FEMorphologySoftwareApplier.cpp b/Source/WebCore/platform/graphics/filters/software/FEMorphologySoftwareApplier.cpp
index b405411..0911cc0 100644
--- a/Source/WebCore/platform/graphics/filters/software/FEMorphologySoftwareApplier.cpp
+++ b/Source/WebCore/platform/graphics/filters/software/FEMorphologySoftwareApplier.cpp
@@ -141,7 +141,7 @@
     applyPlatformGeneric(paintingData, 0, paintingData.height);
 }
 
-bool FEMorphologySoftwareApplier::apply(const Filter& filter, const FilterImageVector& inputs, FilterImage& result)
+bool FEMorphologySoftwareApplier::apply(const Filter& filter, const FilterImageVector& inputs, FilterImage& result) const
 {
     auto& input = inputs[0].get();
 
diff --git a/Source/WebCore/platform/graphics/filters/software/FEMorphologySoftwareApplier.h b/Source/WebCore/platform/graphics/filters/software/FEMorphologySoftwareApplier.h
index f13bbb1..79f9820 100644
--- a/Source/WebCore/platform/graphics/filters/software/FEMorphologySoftwareApplier.h
+++ b/Source/WebCore/platform/graphics/filters/software/FEMorphologySoftwareApplier.h
@@ -33,12 +33,13 @@
 enum class MorphologyOperatorType;
 
 class FEMorphologySoftwareApplier : public FilterEffectConcreteApplier<FEMorphology> {
+    WTF_MAKE_FAST_ALLOCATED;
     using Base = FilterEffectConcreteApplier<FEMorphology>;
 
 public:
     using Base::Base;
 
-    bool apply(const Filter&, const FilterImageVector& inputs, FilterImage& result) override;
+    bool apply(const Filter&, const FilterImageVector& inputs, FilterImage& result) const override;
 
 private:
     using ColumnExtrema = Vector<ColorComponents<uint8_t, 4>, 16>;
diff --git a/Source/WebCore/platform/graphics/filters/software/FEOffsetSoftwareApplier.cpp b/Source/WebCore/platform/graphics/filters/software/FEOffsetSoftwareApplier.cpp
index 01e8f4e..cf2dced 100644
--- a/Source/WebCore/platform/graphics/filters/software/FEOffsetSoftwareApplier.cpp
+++ b/Source/WebCore/platform/graphics/filters/software/FEOffsetSoftwareApplier.cpp
@@ -32,7 +32,7 @@
 
 namespace WebCore {
 
-bool FEOffsetSoftwareApplier::apply(const Filter& filter, const FilterImageVector& inputs, FilterImage& result)
+bool FEOffsetSoftwareApplier::apply(const Filter& filter, const FilterImageVector& inputs, FilterImage& result) const
 {
     auto& input = inputs[0].get();
 
diff --git a/Source/WebCore/platform/graphics/filters/software/FEOffsetSoftwareApplier.h b/Source/WebCore/platform/graphics/filters/software/FEOffsetSoftwareApplier.h
index c345b72..65aeec9 100644
--- a/Source/WebCore/platform/graphics/filters/software/FEOffsetSoftwareApplier.h
+++ b/Source/WebCore/platform/graphics/filters/software/FEOffsetSoftwareApplier.h
@@ -29,12 +29,13 @@
 class FEOffset;
 
 class FEOffsetSoftwareApplier : public FilterEffectConcreteApplier<FEOffset> {
+    WTF_MAKE_FAST_ALLOCATED;
     using Base = FilterEffectConcreteApplier<FEOffset>;
 
 public:
     using Base::Base;
 
-    bool apply(const Filter&, const FilterImageVector& inputs, FilterImage& result) override;
+    bool apply(const Filter&, const FilterImageVector& inputs, FilterImage& result) const override;
 };
 
 } // namespace WebCore
diff --git a/Source/WebCore/platform/graphics/filters/software/FETileSoftwareApplier.cpp b/Source/WebCore/platform/graphics/filters/software/FETileSoftwareApplier.cpp
index 5182df5..8fa7a39 100644
--- a/Source/WebCore/platform/graphics/filters/software/FETileSoftwareApplier.cpp
+++ b/Source/WebCore/platform/graphics/filters/software/FETileSoftwareApplier.cpp
@@ -30,7 +30,7 @@
 
 namespace WebCore {
 
-bool FETileSoftwareApplier::apply(const Filter& filter, const FilterImageVector& inputs, FilterImage& result)
+bool FETileSoftwareApplier::apply(const Filter& filter, const FilterImageVector& inputs, FilterImage& result) const
 {
     auto& input = inputs[0].get();
 
diff --git a/Source/WebCore/platform/graphics/filters/software/FETileSoftwareApplier.h b/Source/WebCore/platform/graphics/filters/software/FETileSoftwareApplier.h
index 4a5cc21..675a29f 100644
--- a/Source/WebCore/platform/graphics/filters/software/FETileSoftwareApplier.h
+++ b/Source/WebCore/platform/graphics/filters/software/FETileSoftwareApplier.h
@@ -29,12 +29,13 @@
 class FETile;
 
 class FETileSoftwareApplier : public FilterEffectConcreteApplier<FETile> {
+    WTF_MAKE_FAST_ALLOCATED;
     using Base = FilterEffectConcreteApplier<FETile>;
 
 public:
     using Base::Base;
 
-    bool apply(const Filter&, const FilterImageVector& inputs, FilterImage& result) override;
+    bool apply(const Filter&, const FilterImageVector& inputs, FilterImage& result) const override;
 };
 
 } // namespace WebCore
diff --git a/Source/WebCore/platform/graphics/filters/software/FETurbulenceSoftwareApplier.cpp b/Source/WebCore/platform/graphics/filters/software/FETurbulenceSoftwareApplier.cpp
index e27bd3d..6d65064 100644
--- a/Source/WebCore/platform/graphics/filters/software/FETurbulenceSoftwareApplier.cpp
+++ b/Source/WebCore/platform/graphics/filters/software/FETurbulenceSoftwareApplier.cpp
@@ -339,7 +339,7 @@
     applyPlatformGeneric(filterRegion, filterScale, pixelArray, paintingData, stitchData, 0, height);
 }
 
-bool FETurbulenceSoftwareApplier::apply(const Filter& filter, const FilterImageVector&, FilterImage& result)
+bool FETurbulenceSoftwareApplier::apply(const Filter& filter, const FilterImageVector&, FilterImage& result) const
 {
     auto destinationPixelBuffer = result.pixelBuffer(AlphaPremultiplication::Unpremultiplied);
     if (!destinationPixelBuffer)
diff --git a/Source/WebCore/platform/graphics/filters/software/FETurbulenceSoftwareApplier.h b/Source/WebCore/platform/graphics/filters/software/FETurbulenceSoftwareApplier.h
index a52e7c5..23cbcc92 100644
--- a/Source/WebCore/platform/graphics/filters/software/FETurbulenceSoftwareApplier.h
+++ b/Source/WebCore/platform/graphics/filters/software/FETurbulenceSoftwareApplier.h
@@ -36,12 +36,13 @@
 enum class TurbulenceType;
 
 class FETurbulenceSoftwareApplier : public FilterEffectConcreteApplier<FETurbulence> {
+    WTF_MAKE_FAST_ALLOCATED;
     using Base = FilterEffectConcreteApplier<FETurbulence>;
 
 public:
     using Base::Base;
 
-    bool apply(const Filter&, const FilterImageVector& inputs, FilterImage& result) override;
+    bool apply(const Filter&, const FilterImageVector& inputs, FilterImage& result) const override;
 
 private:
     // Produces results in the range [1, 2**31 - 2]. Algorithm is:
diff --git a/Source/WebCore/platform/graphics/filters/software/SourceAlphaSoftwareApplier.cpp b/Source/WebCore/platform/graphics/filters/software/SourceAlphaSoftwareApplier.cpp
index 5025195..5e392e4 100644
--- a/Source/WebCore/platform/graphics/filters/software/SourceAlphaSoftwareApplier.cpp
+++ b/Source/WebCore/platform/graphics/filters/software/SourceAlphaSoftwareApplier.cpp
@@ -27,7 +27,7 @@
 
 namespace WebCore {
 
-bool SourceAlphaSoftwareApplier::apply(const Filter&, const FilterImageVector& inputs, FilterImage& result)
+bool SourceAlphaSoftwareApplier::apply(const Filter&, const FilterImageVector& inputs, FilterImage& result) const
 {
     auto& input = inputs[0].get();
 
diff --git a/Source/WebCore/platform/graphics/filters/software/SourceAlphaSoftwareApplier.h b/Source/WebCore/platform/graphics/filters/software/SourceAlphaSoftwareApplier.h
index 748ff7e..464e78f 100644
--- a/Source/WebCore/platform/graphics/filters/software/SourceAlphaSoftwareApplier.h
+++ b/Source/WebCore/platform/graphics/filters/software/SourceAlphaSoftwareApplier.h
@@ -27,12 +27,13 @@
 class SourceAlpha;
 
 class SourceAlphaSoftwareApplier : public FilterEffectConcreteApplier<SourceAlpha> {
+    WTF_MAKE_FAST_ALLOCATED;
     using Base = FilterEffectConcreteApplier<SourceAlpha>;
 
 public:
     using Base::Base;
 
-    bool apply(const Filter&, const FilterImageVector& inputs, FilterImage& result) override;
+    bool apply(const Filter&, const FilterImageVector& inputs, FilterImage& result) const override;
 };
 
 } // namespace WebCore
diff --git a/Source/WebCore/platform/graphics/filters/software/SourceGraphicSoftwareApplier.cpp b/Source/WebCore/platform/graphics/filters/software/SourceGraphicSoftwareApplier.cpp
index 7b5d804..63ad8bc 100644
--- a/Source/WebCore/platform/graphics/filters/software/SourceGraphicSoftwareApplier.cpp
+++ b/Source/WebCore/platform/graphics/filters/software/SourceGraphicSoftwareApplier.cpp
@@ -27,7 +27,7 @@
 
 namespace WebCore {
 
-bool SourceGraphicSoftwareApplier::apply(const Filter& filter, const FilterImageVector&, FilterImage& result)
+bool SourceGraphicSoftwareApplier::apply(const Filter& filter, const FilterImageVector&, FilterImage& result) const
 {
     auto resultImage = result.imageBuffer();
     auto sourceImage = filter.sourceImage();
diff --git a/Source/WebCore/platform/graphics/filters/software/SourceGraphicSoftwareApplier.h b/Source/WebCore/platform/graphics/filters/software/SourceGraphicSoftwareApplier.h
index 07169cc..b706fcc 100644
--- a/Source/WebCore/platform/graphics/filters/software/SourceGraphicSoftwareApplier.h
+++ b/Source/WebCore/platform/graphics/filters/software/SourceGraphicSoftwareApplier.h
@@ -28,12 +28,13 @@
 class SourceGraphic;
 
 class SourceGraphicSoftwareApplier : public FilterEffectConcreteApplier<SourceGraphic> {
+    WTF_MAKE_FAST_ALLOCATED;
     using Base = FilterEffectConcreteApplier<SourceGraphic>;
 
 public:
     using Base::Base;
 
-    bool apply(const Filter&, const FilterImageVector& inputs, FilterImage& result) override;
+    bool apply(const Filter&, const FilterImageVector& inputs, FilterImage& result) const override;
 };
 
 } // namespace WebCore
diff --git a/Source/WebCore/svg/graphics/filters/SVGFEImage.cpp b/Source/WebCore/svg/graphics/filters/SVGFEImage.cpp
index eaad382..8a49cf9 100644
--- a/Source/WebCore/svg/graphics/filters/SVGFEImage.cpp
+++ b/Source/WebCore/svg/graphics/filters/SVGFEImage.cpp
@@ -77,15 +77,16 @@
 
 // FIXME: Move the class FEImageSoftwareApplier to separate source and header files.
 class FEImageSoftwareApplier : public FilterEffectConcreteApplier<FEImage> {
+    WTF_MAKE_FAST_ALLOCATED;
     using Base = FilterEffectConcreteApplier<FEImage>;
 
 public:
     using Base::Base;
 
-    bool apply(const Filter&, const FilterImageVector& inputs, FilterImage& result) override;
+    bool apply(const Filter&, const FilterImageVector& inputs, FilterImage& result) const override;
 };
 
-bool FEImageSoftwareApplier::apply(const Filter& filter, const FilterImageVector&, FilterImage& result)
+bool FEImageSoftwareApplier::apply(const Filter& filter, const FilterImageVector&, FilterImage& result) const
 {
     auto resultImage = result.imageBuffer();
     if (!resultImage)
@@ -115,9 +116,9 @@
     return true;
 }
 
-bool FEImage::platformApplySoftware(const Filter& filter)
+std::unique_ptr<FilterEffectApplier> FEImage::createApplier(const Filter&) const
 {
-    return FEImageSoftwareApplier(*this).apply(filter, { }, *filterImage());
+    return FilterEffectApplier::create<FEImageSoftwareApplier>(*this);
 }
 
 TextStream& FEImage::externalRepresentation(TextStream& ts, RepresentationType representation) const
diff --git a/Source/WebCore/svg/graphics/filters/SVGFEImage.h b/Source/WebCore/svg/graphics/filters/SVGFEImage.h
index 37557a9..6c9ae79 100644
--- a/Source/WebCore/svg/graphics/filters/SVGFEImage.h
+++ b/Source/WebCore/svg/graphics/filters/SVGFEImage.h
@@ -38,7 +38,7 @@
     static Ref<FEImage> create(Ref<Image>&&, const SVGPreserveAspectRatioValue&);
     static Ref<FEImage> create(SourceImage&&, const FloatRect& sourceImageRect, const SVGPreserveAspectRatioValue&);
 
-    SourceImage& sourceImage() { return m_sourceImage; }
+    const SourceImage& sourceImage() const { return m_sourceImage; }
     void setImageSource(SourceImage&& sourceImage) { m_sourceImage = WTFMove(sourceImage); }
 
     FloatRect sourceImageRect() const { return m_sourceImageRect; }
@@ -52,7 +52,7 @@
 
     void determineAbsolutePaintRect(const Filter&) final;
 
-    bool platformApplySoftware(const Filter&) final;
+    std::unique_ptr<FilterEffectApplier> createApplier(const Filter&) const final;
 
     WTF::TextStream& externalRepresentation(WTF::TextStream&, RepresentationType) const final;