Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[GPU Process] Make FilterEffect appliers take FilterImages in their a…
…pply() methods

https://bugs.webkit.org/show_bug.cgi?id=233487

Reviewed by Cameron McCormack.

Eventually the FilterImage will be removed from FilterEffect. So this is
a step towards making the FilterEffect hold the effect data only. To do
his change, FilterImage needs to hold two new members: primitiveSubregion
and isAlphaImage.

FilterEffect::setIsAlphaImage() is not needed and isAlphaImage() will be
a virtual function but it will be renamed resultIsAlphaImage(). The result
of this function will be stored in the result FilterImage.

FEGaussianBlurSoftwareApplier::apply() is the only user of isAlphaImage.

* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/filters/FEBlend.cpp:
(WebCore::FEBlend::platformApplySoftware):
* platform/graphics/filters/FEColorMatrix.cpp:
(WebCore::FEColorMatrix::resultIsAlphaImage const):
(WebCore::FEColorMatrix::platformApplySoftware):
* platform/graphics/filters/FEColorMatrix.h:
* platform/graphics/filters/FEComponentTransfer.cpp:
(WebCore::FEComponentTransfer::platformApplySoftware):
* platform/graphics/filters/FEComposite.cpp:
(WebCore::FEComposite::platformApplySoftware):
* platform/graphics/filters/FEConvolveMatrix.cpp:
(WebCore::FEConvolveMatrix::platformApplySoftware):
* platform/graphics/filters/FEDisplacementMap.cpp:
(WebCore::FEDisplacementMap::platformApplySoftware):
* platform/graphics/filters/FEDropShadow.cpp:
(WebCore::FEDropShadow::platformApplySoftware):
* platform/graphics/filters/FEFlood.cpp:
(WebCore::FEFlood::platformApplySoftware):
* platform/graphics/filters/FEGaussianBlur.cpp:
(WebCore::FEGaussianBlur::resultIsAlphaImage const):
(WebCore::FEGaussianBlur::platformApplySoftware):
* platform/graphics/filters/FEGaussianBlur.h:
* platform/graphics/filters/FELighting.cpp:
(WebCore::FELighting::platformApplySoftware):
* platform/graphics/filters/FEMerge.cpp:
(WebCore::FEMerge::platformApplySoftware):
* platform/graphics/filters/FEMorphology.cpp:
(WebCore::FEMorphology::resultIsAlphaImage const):
(WebCore::FEMorphology::platformApplySoftware):
* platform/graphics/filters/FEMorphology.h:
* platform/graphics/filters/FEOffset.cpp:
(WebCore::FEOffset::resultIsAlphaImage const):
(WebCore::FEOffset::platformApplySoftware):
* platform/graphics/filters/FEOffset.h:
* platform/graphics/filters/FETile.cpp:
(WebCore::FETile::resultIsAlphaImage const):
(WebCore::FETile::platformApplySoftware):
* platform/graphics/filters/FETile.h:
* platform/graphics/filters/FETurbulence.cpp:
(WebCore::FETurbulence::platformApplySoftware):
* platform/graphics/filters/Filter.h:
(WebCore::Filter::maxEffectRect const):
* platform/graphics/filters/FilterEffect.cpp:
(WebCore::FilterEffect::apply):
(WebCore::FilterEffect::inputFilterImages const):
(WebCore::FilterEffect::externalRepresentation const):
(WebCore::FilterEffect::createResult): Deleted.
(WebCore::FilterEffect::imageBufferResult): Deleted.
(WebCore::FilterEffect::pixelBufferResult): Deleted.
(WebCore::FilterEffect::getPixelBufferResult): Deleted.
(WebCore::FilterEffect::copyPixelBufferResult const): Deleted.
* platform/graphics/filters/FilterEffect.h:
(WebCore::FilterEffect::filterImage const):
(WebCore::FilterEffect::resultIsAlphaImage const):
(WebCore::FilterEffect::isAlphaImage const): Deleted.
(WebCore::FilterEffect::setIsAlphaImage): Deleted.
(WebCore::FilterEffect::normalizedFloats): Deleted.
* platform/graphics/filters/FilterEffectApplier.h:
* platform/graphics/filters/FilterImage.cpp:
(WebCore::FilterImage::create):
(WebCore::FilterImage::FilterImage):
* platform/graphics/filters/FilterImage.h:
(WebCore::FilterImage::primitiveSubregion const):
(WebCore::FilterImage::isAlphaImage const):
* platform/graphics/filters/FilterImageVector.h: Copied from Source/WebCore/platform/graphics/filters/FilterEffectApplier.h.
* platform/graphics/filters/SourceAlpha.cpp:
(WebCore::SourceAlpha::platformApplySoftware):
* platform/graphics/filters/SourceGraphic.cpp:
(WebCore::SourceGraphic::platformApplySoftware):
* platform/graphics/filters/software/FEBlendSoftwareApplier.cpp:
(WebCore::FEBlendSoftwareApplier::apply):
* platform/graphics/filters/software/FEBlendSoftwareApplier.h:
* platform/graphics/filters/software/FEColorMatrixSoftwareApplier.cpp:
(WebCore::FEColorMatrixSoftwareApplier::apply):
* platform/graphics/filters/software/FEColorMatrixSoftwareApplier.h:
* platform/graphics/filters/software/FEComponentTransferSoftwareApplier.cpp:
(WebCore::FEComponentTransferSoftwareApplier::apply):
* platform/graphics/filters/software/FEComponentTransferSoftwareApplier.h:
* platform/graphics/filters/software/FECompositeSoftwareApplier.cpp:
(WebCore::FECompositeSoftwareApplier::applyArithmetic):
(WebCore::FECompositeSoftwareApplier::applyNonArithmetic):
(WebCore::FECompositeSoftwareApplier::apply):
* platform/graphics/filters/software/FECompositeSoftwareApplier.h:
* platform/graphics/filters/software/FEConvolveMatrixSoftwareApplier.cpp:
(WebCore::FEConvolveMatrixSoftwareApplier::apply):
* platform/graphics/filters/software/FEConvolveMatrixSoftwareApplier.h:
* platform/graphics/filters/software/FEDisplacementMapSoftwareApplier.cpp:
(WebCore::FEDisplacementMapSoftwareApplier::apply):
* platform/graphics/filters/software/FEDisplacementMapSoftwareApplier.h:
* platform/graphics/filters/software/FEDropShadowSoftwareApplier.cpp:
(WebCore::FEDropShadowSoftwareApplier::apply):
* platform/graphics/filters/software/FEDropShadowSoftwareApplier.h:
* platform/graphics/filters/software/FEFloodSoftwareApplier.cpp:
(WebCore::FEFloodSoftwareApplier::apply):
* platform/graphics/filters/software/FEFloodSoftwareApplier.h:
* platform/graphics/filters/software/FEGaussianBlurSoftwareApplier.cpp:
(WebCore::FEGaussianBlurSoftwareApplier::apply):
* platform/graphics/filters/software/FEGaussianBlurSoftwareApplier.h:
* platform/graphics/filters/software/FELightingSoftwareApplier.cpp:
(WebCore::FELightingSoftwareApplier::apply):
* platform/graphics/filters/software/FELightingSoftwareApplier.h:
* platform/graphics/filters/software/FEMergeSoftwareApplier.cpp:
(WebCore::FEMergeSoftwareApplier::apply):
* platform/graphics/filters/software/FEMergeSoftwareApplier.h:
* platform/graphics/filters/software/FEMorphologySoftwareApplier.cpp:
(WebCore::FEMorphologySoftwareApplier::apply):
* platform/graphics/filters/software/FEMorphologySoftwareApplier.h:
* platform/graphics/filters/software/FEOffsetSoftwareApplier.cpp:
(WebCore::FEOffsetSoftwareApplier::apply):
* platform/graphics/filters/software/FEOffsetSoftwareApplier.h:
* platform/graphics/filters/software/FETileSoftwareApplier.cpp:
(WebCore::FETileSoftwareApplier::apply):
* platform/graphics/filters/software/FETileSoftwareApplier.h:
* platform/graphics/filters/software/FETurbulenceSoftwareApplier.cpp:
(WebCore::FETurbulenceSoftwareApplier::apply):
* platform/graphics/filters/software/FETurbulenceSoftwareApplier.h:
* platform/graphics/filters/software/SourceAlphaSoftwareApplier.cpp:
(WebCore::SourceAlphaSoftwareApplier::apply):
* platform/graphics/filters/software/SourceAlphaSoftwareApplier.h:
* platform/graphics/filters/software/SourceGraphicSoftwareApplier.cpp:
(WebCore::SourceGraphicSoftwareApplier::apply):
* platform/graphics/filters/software/SourceGraphicSoftwareApplier.h:
* rendering/CSSFilter.cpp:
(WebCore::CSSFilter::output):
* rendering/svg/RenderSVGResourceFilter.cpp:
(WebCore::RenderSVGResourceFilter::postApplyResource):
* svg/graphics/filters/SVGFEImage.cpp:
(WebCore::FEImageSoftwareApplier::apply):
(WebCore::FEImage::platformApplySoftware):



Canonical link: https://commits.webkit.org/244547@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@286164 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
shallawa committed Nov 25, 2021
1 parent b36733c commit 75a4a71
Show file tree
Hide file tree
Showing 68 changed files with 471 additions and 288 deletions.
149 changes: 149 additions & 0 deletions Source/WebCore/ChangeLog
@@ -1,3 +1,152 @@
2021-11-25 Said Abou-Hallawa <said@apple.com>

[GPU Process] Make FilterEffect appliers take FilterImages in their apply() methods
https://bugs.webkit.org/show_bug.cgi?id=233487

Reviewed by Cameron McCormack.

Eventually the FilterImage will be removed from FilterEffect. So this is
a step towards making the FilterEffect hold the effect data only. To do
his change, FilterImage needs to hold two new members: primitiveSubregion
and isAlphaImage.

FilterEffect::setIsAlphaImage() is not needed and isAlphaImage() will be
a virtual function but it will be renamed resultIsAlphaImage(). The result
of this function will be stored in the result FilterImage.

FEGaussianBlurSoftwareApplier::apply() is the only user of isAlphaImage.

* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/filters/FEBlend.cpp:
(WebCore::FEBlend::platformApplySoftware):
* platform/graphics/filters/FEColorMatrix.cpp:
(WebCore::FEColorMatrix::resultIsAlphaImage const):
(WebCore::FEColorMatrix::platformApplySoftware):
* platform/graphics/filters/FEColorMatrix.h:
* platform/graphics/filters/FEComponentTransfer.cpp:
(WebCore::FEComponentTransfer::platformApplySoftware):
* platform/graphics/filters/FEComposite.cpp:
(WebCore::FEComposite::platformApplySoftware):
* platform/graphics/filters/FEConvolveMatrix.cpp:
(WebCore::FEConvolveMatrix::platformApplySoftware):
* platform/graphics/filters/FEDisplacementMap.cpp:
(WebCore::FEDisplacementMap::platformApplySoftware):
* platform/graphics/filters/FEDropShadow.cpp:
(WebCore::FEDropShadow::platformApplySoftware):
* platform/graphics/filters/FEFlood.cpp:
(WebCore::FEFlood::platformApplySoftware):
* platform/graphics/filters/FEGaussianBlur.cpp:
(WebCore::FEGaussianBlur::resultIsAlphaImage const):
(WebCore::FEGaussianBlur::platformApplySoftware):
* platform/graphics/filters/FEGaussianBlur.h:
* platform/graphics/filters/FELighting.cpp:
(WebCore::FELighting::platformApplySoftware):
* platform/graphics/filters/FEMerge.cpp:
(WebCore::FEMerge::platformApplySoftware):
* platform/graphics/filters/FEMorphology.cpp:
(WebCore::FEMorphology::resultIsAlphaImage const):
(WebCore::FEMorphology::platformApplySoftware):
* platform/graphics/filters/FEMorphology.h:
* platform/graphics/filters/FEOffset.cpp:
(WebCore::FEOffset::resultIsAlphaImage const):
(WebCore::FEOffset::platformApplySoftware):
* platform/graphics/filters/FEOffset.h:
* platform/graphics/filters/FETile.cpp:
(WebCore::FETile::resultIsAlphaImage const):
(WebCore::FETile::platformApplySoftware):
* platform/graphics/filters/FETile.h:
* platform/graphics/filters/FETurbulence.cpp:
(WebCore::FETurbulence::platformApplySoftware):
* platform/graphics/filters/Filter.h:
(WebCore::Filter::maxEffectRect const):
* platform/graphics/filters/FilterEffect.cpp:
(WebCore::FilterEffect::apply):
(WebCore::FilterEffect::inputFilterImages const):
(WebCore::FilterEffect::externalRepresentation const):
(WebCore::FilterEffect::createResult): Deleted.
(WebCore::FilterEffect::imageBufferResult): Deleted.
(WebCore::FilterEffect::pixelBufferResult): Deleted.
(WebCore::FilterEffect::getPixelBufferResult): Deleted.
(WebCore::FilterEffect::copyPixelBufferResult const): Deleted.
* platform/graphics/filters/FilterEffect.h:
(WebCore::FilterEffect::filterImage const):
(WebCore::FilterEffect::resultIsAlphaImage const):
(WebCore::FilterEffect::isAlphaImage const): Deleted.
(WebCore::FilterEffect::setIsAlphaImage): Deleted.
(WebCore::FilterEffect::normalizedFloats): Deleted.
* platform/graphics/filters/FilterEffectApplier.h:
* platform/graphics/filters/FilterImage.cpp:
(WebCore::FilterImage::create):
(WebCore::FilterImage::FilterImage):
* platform/graphics/filters/FilterImage.h:
(WebCore::FilterImage::primitiveSubregion const):
(WebCore::FilterImage::isAlphaImage const):
* platform/graphics/filters/FilterImageVector.h: Copied from Source/WebCore/platform/graphics/filters/FilterEffectApplier.h.
* platform/graphics/filters/SourceAlpha.cpp:
(WebCore::SourceAlpha::platformApplySoftware):
* platform/graphics/filters/SourceGraphic.cpp:
(WebCore::SourceGraphic::platformApplySoftware):
* platform/graphics/filters/software/FEBlendSoftwareApplier.cpp:
(WebCore::FEBlendSoftwareApplier::apply):
* platform/graphics/filters/software/FEBlendSoftwareApplier.h:
* platform/graphics/filters/software/FEColorMatrixSoftwareApplier.cpp:
(WebCore::FEColorMatrixSoftwareApplier::apply):
* platform/graphics/filters/software/FEColorMatrixSoftwareApplier.h:
* platform/graphics/filters/software/FEComponentTransferSoftwareApplier.cpp:
(WebCore::FEComponentTransferSoftwareApplier::apply):
* platform/graphics/filters/software/FEComponentTransferSoftwareApplier.h:
* platform/graphics/filters/software/FECompositeSoftwareApplier.cpp:
(WebCore::FECompositeSoftwareApplier::applyArithmetic):
(WebCore::FECompositeSoftwareApplier::applyNonArithmetic):
(WebCore::FECompositeSoftwareApplier::apply):
* platform/graphics/filters/software/FECompositeSoftwareApplier.h:
* platform/graphics/filters/software/FEConvolveMatrixSoftwareApplier.cpp:
(WebCore::FEConvolveMatrixSoftwareApplier::apply):
* platform/graphics/filters/software/FEConvolveMatrixSoftwareApplier.h:
* platform/graphics/filters/software/FEDisplacementMapSoftwareApplier.cpp:
(WebCore::FEDisplacementMapSoftwareApplier::apply):
* platform/graphics/filters/software/FEDisplacementMapSoftwareApplier.h:
* platform/graphics/filters/software/FEDropShadowSoftwareApplier.cpp:
(WebCore::FEDropShadowSoftwareApplier::apply):
* platform/graphics/filters/software/FEDropShadowSoftwareApplier.h:
* platform/graphics/filters/software/FEFloodSoftwareApplier.cpp:
(WebCore::FEFloodSoftwareApplier::apply):
* platform/graphics/filters/software/FEFloodSoftwareApplier.h:
* platform/graphics/filters/software/FEGaussianBlurSoftwareApplier.cpp:
(WebCore::FEGaussianBlurSoftwareApplier::apply):
* platform/graphics/filters/software/FEGaussianBlurSoftwareApplier.h:
* platform/graphics/filters/software/FELightingSoftwareApplier.cpp:
(WebCore::FELightingSoftwareApplier::apply):
* platform/graphics/filters/software/FELightingSoftwareApplier.h:
* platform/graphics/filters/software/FEMergeSoftwareApplier.cpp:
(WebCore::FEMergeSoftwareApplier::apply):
* platform/graphics/filters/software/FEMergeSoftwareApplier.h:
* platform/graphics/filters/software/FEMorphologySoftwareApplier.cpp:
(WebCore::FEMorphologySoftwareApplier::apply):
* platform/graphics/filters/software/FEMorphologySoftwareApplier.h:
* platform/graphics/filters/software/FEOffsetSoftwareApplier.cpp:
(WebCore::FEOffsetSoftwareApplier::apply):
* platform/graphics/filters/software/FEOffsetSoftwareApplier.h:
* platform/graphics/filters/software/FETileSoftwareApplier.cpp:
(WebCore::FETileSoftwareApplier::apply):
* platform/graphics/filters/software/FETileSoftwareApplier.h:
* platform/graphics/filters/software/FETurbulenceSoftwareApplier.cpp:
(WebCore::FETurbulenceSoftwareApplier::apply):
* platform/graphics/filters/software/FETurbulenceSoftwareApplier.h:
* platform/graphics/filters/software/SourceAlphaSoftwareApplier.cpp:
(WebCore::SourceAlphaSoftwareApplier::apply):
* platform/graphics/filters/software/SourceAlphaSoftwareApplier.h:
* platform/graphics/filters/software/SourceGraphicSoftwareApplier.cpp:
(WebCore::SourceGraphicSoftwareApplier::apply):
* platform/graphics/filters/software/SourceGraphicSoftwareApplier.h:
* rendering/CSSFilter.cpp:
(WebCore::CSSFilter::output):
* rendering/svg/RenderSVGResourceFilter.cpp:
(WebCore::RenderSVGResourceFilter::postApplyResource):
* svg/graphics/filters/SVGFEImage.cpp:
(WebCore::FEImageSoftwareApplier::apply):
(WebCore::FEImage::platformApplySoftware):

2021-11-25 Carlos Garcia Campos <cgarcia@igalia.com>

Unreviewed. Fix GTK distcheck build
Expand Down
2 changes: 2 additions & 0 deletions Source/WebCore/WebCore.xcodeproj/project.pbxproj
Expand Up @@ -10931,6 +10931,7 @@
72A13AD7274DE57800E2A88E /* SourceGraphicSoftwareApplier.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SourceGraphicSoftwareApplier.h; sourceTree = "<group>"; };
72B4EF74274E233300293C2F /* FEBlendSoftwareApplier.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FEBlendSoftwareApplier.h; sourceTree = "<group>"; };
72B4EF75274E233400293C2F /* FEBlendSoftwareApplier.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = FEBlendSoftwareApplier.cpp; sourceTree = "<group>"; };
72B4EF7C274EE37F00293C2F /* FilterImageVector.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FilterImageVector.h; sourceTree = "<group>"; };
72BAC3A423E17327008D741C /* ImageBufferBackend.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ImageBufferBackend.cpp; sourceTree = "<group>"; };
72BAC3A523E17328008D741C /* ImageBufferBackend.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ImageBufferBackend.h; sourceTree = "<group>"; };
72BAC3A623E17328008D741C /* PlatformImageBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformImageBuffer.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -26027,6 +26028,7 @@
7262D756272A174100C56A09 /* FilterFunction.h */,
72435EF5273D07670005E7EE /* FilterImage.cpp */,
72435EF4273D07670005E7EE /* FilterImage.h */,
72B4EF7C274EE37F00293C2F /* FilterImageVector.h */,
49ECEB631499790D00CDD3A4 /* FilterOperation.cpp */,
49ECEB641499790D00CDD3A4 /* FilterOperation.h */,
49ECEB651499790D00CDD3A4 /* FilterOperations.cpp */,
Expand Down
2 changes: 1 addition & 1 deletion Source/WebCore/platform/graphics/filters/FEBlend.cpp
Expand Up @@ -53,7 +53,7 @@ bool FEBlend::setBlendMode(BlendMode mode)

bool FEBlend::platformApplySoftware(const Filter& filter)
{
return FEBlendSoftwareApplier(*this).apply(filter, inputEffects());
return FEBlendSoftwareApplier(*this).apply(filter, inputFilterImages(), *filterImage());
}

TextStream& FEBlend::externalRepresentation(TextStream& ts, RepresentationType representation) const
Expand Down
7 changes: 6 additions & 1 deletion Source/WebCore/platform/graphics/filters/FEColorMatrix.cpp
Expand Up @@ -93,9 +93,14 @@ Vector<float> FEColorMatrix::normalizedFloats(const Vector<float>& values)
return normalizedValues;
}

bool FEColorMatrix::resultIsAlphaImage() const
{
return m_type == FECOLORMATRIX_TYPE_LUMINANCETOALPHA;
}

bool FEColorMatrix::platformApplySoftware(const Filter& filter)
{
return FEColorMatrixSoftwareApplier(*this).apply(filter, inputEffects());
return FEColorMatrixSoftwareApplier(*this).apply(filter, inputFilterImages(), *filterImage());
}

static TextStream& operator<<(TextStream& ts, const ColorMatrixType& type)
Expand Down
2 changes: 2 additions & 0 deletions Source/WebCore/platform/graphics/filters/FEColorMatrix.h
Expand Up @@ -52,6 +52,8 @@ class FEColorMatrix : public FilterEffect {
private:
FEColorMatrix(ColorMatrixType, Vector<float>&&);

bool resultIsAlphaImage() const override;

bool platformApplySoftware(const Filter&) override;

WTF::TextStream& externalRepresentation(WTF::TextStream&, RepresentationType) const override;
Expand Down
Expand Up @@ -46,7 +46,7 @@ FEComponentTransfer::FEComponentTransfer(const ComponentTransferFunction& redFun

bool FEComponentTransfer::platformApplySoftware(const Filter& filter)
{
return FEComponentTransferSoftwareApplier(*this).apply(filter, inputEffects());
return FEComponentTransferSoftwareApplier(*this).apply(filter, inputFilterImages(), *filterImage());
}

static TextStream& operator<<(TextStream& ts, ComponentTransferType type)
Expand Down
2 changes: 1 addition & 1 deletion Source/WebCore/platform/graphics/filters/FEComposite.cpp
Expand Up @@ -109,7 +109,7 @@ void FEComposite::determineAbsolutePaintRect(const Filter& filter)

bool FEComposite::platformApplySoftware(const Filter& filter)
{
return FECompositeSoftwareApplier(*this).apply(filter, inputEffects());
return FECompositeSoftwareApplier(*this).apply(filter, inputFilterImages(), *filterImage());
}

static TextStream& operator<<(TextStream& ts, const CompositeOperationType& type)
Expand Down
Expand Up @@ -115,7 +115,7 @@ bool FEConvolveMatrix::setPreserveAlpha(bool preserveAlpha)

bool FEConvolveMatrix::platformApplySoftware(const Filter& filter)
{
return FEConvolveMatrixSoftwareApplier(*this).apply(filter, inputEffects());
return FEConvolveMatrixSoftwareApplier(*this).apply(filter, inputFilterImages(), *filterImage());
}

static TextStream& operator<<(TextStream& ts, const EdgeModeType& type)
Expand Down
Expand Up @@ -85,7 +85,7 @@ void FEDisplacementMap::transformResultColorSpace(FilterEffect* in, const int in

bool FEDisplacementMap::platformApplySoftware(const Filter& filter)
{
return FEDisplacementMapSoftwareApplier(*this).apply(filter, inputEffects());
return FEDisplacementMapSoftwareApplier(*this).apply(filter, inputFilterImages(), *filterImage());
}

static TextStream& operator<<(TextStream& ts, const ChannelSelectorType& type)
Expand Down
2 changes: 1 addition & 1 deletion Source/WebCore/platform/graphics/filters/FEDropShadow.cpp
Expand Up @@ -68,7 +68,7 @@ void FEDropShadow::determineAbsolutePaintRect(const Filter& filter)

bool FEDropShadow::platformApplySoftware(const Filter& filter)
{
return FEDropShadowSoftwareApplier(*this).apply(filter, inputEffects());
return FEDropShadowSoftwareApplier(*this).apply(filter, inputFilterImages(), *filterImage());
}

IntOutsets FEDropShadow::outsets() const
Expand Down
2 changes: 1 addition & 1 deletion Source/WebCore/platform/graphics/filters/FEFlood.cpp
Expand Up @@ -60,7 +60,7 @@ bool FEFlood::setFloodOpacity(float floodOpacity)

bool FEFlood::platformApplySoftware(const Filter& filter)
{
return FEFloodSoftwareApplier(*this).apply(filter, inputEffects());
return FEFloodSoftwareApplier(*this).apply(filter, { }, *filterImage());
}

TextStream& FEFlood::externalRepresentation(TextStream& ts, RepresentationType representation) const
Expand Down
15 changes: 10 additions & 5 deletions Source/WebCore/platform/graphics/filters/FEGaussianBlur.cpp
Expand Up @@ -125,17 +125,22 @@ void FEGaussianBlur::determineAbsolutePaintRect(const Filter& filter)
setAbsolutePaintRect(enclosingIntRect(absolutePaintRect));
}

bool FEGaussianBlur::platformApplySoftware(const Filter& filter)
{
return FEGaussianBlurSoftwareApplier(*this).apply(filter, inputEffects());
}

IntOutsets FEGaussianBlur::outsets() const
{
IntSize outsetSize = calculateOutsetSize({ m_stdX, m_stdY });
return { outsetSize.height(), outsetSize.width(), outsetSize.height(), outsetSize.width() };
}

bool FEGaussianBlur::resultIsAlphaImage() const
{
return inputEffect(0)->resultIsAlphaImage();
}

bool FEGaussianBlur::platformApplySoftware(const Filter& filter)
{
return FEGaussianBlurSoftwareApplier(*this).apply(filter, inputFilterImages(), *filterImage());
}

TextStream& FEGaussianBlur::externalRepresentation(TextStream& ts, RepresentationType representation) const
{
ts << indent << "[feGaussianBlur";
Expand Down
2 changes: 2 additions & 0 deletions Source/WebCore/platform/graphics/filters/FEGaussianBlur.h
Expand Up @@ -51,6 +51,8 @@ class FEGaussianBlur : public FilterEffect {

IntOutsets outsets() const override;

bool resultIsAlphaImage() const override;

bool platformApplySoftware(const Filter&) override;

WTF::TextStream& externalRepresentation(WTF::TextStream&, RepresentationType) const override;
Expand Down
2 changes: 1 addition & 1 deletion Source/WebCore/platform/graphics/filters/FELighting.cpp
Expand Up @@ -83,7 +83,7 @@ bool FELighting::setKernelUnitLengthY(float kernelUnitLengthY)

bool FELighting::platformApplySoftware(const Filter& filter)
{
return FELightingSoftwareApplier(*this).apply(filter, inputEffects());
return FELightingSoftwareApplier(*this).apply(filter, inputFilterImages(), *filterImage());
}

} // namespace WebCore
2 changes: 1 addition & 1 deletion Source/WebCore/platform/graphics/filters/FEMerge.cpp
Expand Up @@ -40,7 +40,7 @@ FEMerge::FEMerge()

bool FEMerge::platformApplySoftware(const Filter& filter)
{
return FEMergeSoftwareApplier(*this).apply(filter, inputEffects());
return FEMergeSoftwareApplier(*this).apply(filter, inputFilterImages(), *filterImage());
}

TextStream& FEMerge::externalRepresentation(TextStream& ts, RepresentationType representation) const
Expand Down
7 changes: 6 additions & 1 deletion Source/WebCore/platform/graphics/filters/FEMorphology.cpp
Expand Up @@ -79,9 +79,14 @@ void FEMorphology::determineAbsolutePaintRect(const Filter& filter)
setAbsolutePaintRect(enclosingIntRect(paintRect));
}

bool FEMorphology::resultIsAlphaImage() const
{
return inputEffect(0)->resultIsAlphaImage();
}

bool FEMorphology::platformApplySoftware(const Filter& filter)
{
return FEMorphologySoftwareApplier(*this).apply(filter, inputEffects());
return FEMorphologySoftwareApplier(*this).apply(filter, inputFilterImages(), *filterImage());
}

static TextStream& operator<<(TextStream& ts, const MorphologyOperatorType& type)
Expand Down
2 changes: 2 additions & 0 deletions Source/WebCore/platform/graphics/filters/FEMorphology.h
Expand Up @@ -50,6 +50,8 @@ class FEMorphology : public FilterEffect {

void determineAbsolutePaintRect(const Filter&) override;

bool resultIsAlphaImage() const override;

bool platformApplySoftware(const Filter&) override;

WTF::TextStream& externalRepresentation(WTF::TextStream&, RepresentationType) const override;
Expand Down
7 changes: 6 additions & 1 deletion Source/WebCore/platform/graphics/filters/FEOffset.cpp
Expand Up @@ -64,9 +64,14 @@ void FEOffset::determineAbsolutePaintRect(const Filter& filter)
setAbsolutePaintRect(enclosingIntRect(paintRect));
}

bool FEOffset::resultIsAlphaImage() const
{
return inputEffect(0)->resultIsAlphaImage();
}

bool FEOffset::platformApplySoftware(const Filter& filter)
{
return FEOffsetSoftwareApplier(*this).apply(filter, inputEffects());
return FEOffsetSoftwareApplier(*this).apply(filter, inputFilterImages(), *filterImage());
}

TextStream& FEOffset::externalRepresentation(TextStream& ts, RepresentationType representation) const
Expand Down
2 changes: 2 additions & 0 deletions Source/WebCore/platform/graphics/filters/FEOffset.h
Expand Up @@ -41,6 +41,8 @@ class FEOffset : public FilterEffect {

void determineAbsolutePaintRect(const Filter&) override;

bool resultIsAlphaImage() const override;

bool platformApplySoftware(const Filter&) override;

WTF::TextStream& externalRepresentation(WTF::TextStream&, RepresentationType) const override;
Expand Down
8 changes: 6 additions & 2 deletions Source/WebCore/platform/graphics/filters/FETile.cpp
Expand Up @@ -23,7 +23,6 @@
#include "FETile.h"

#include "FETileSoftwareApplier.h"
#include "GraphicsContext.h"
#include <wtf/text/TextStream.h>

namespace WebCore {
Expand All @@ -38,9 +37,14 @@ FETile::FETile()
{
}

bool FETile::resultIsAlphaImage() const
{
return inputEffect(0)->resultIsAlphaImage();
}

bool FETile::platformApplySoftware(const Filter& filter)
{
return FETileSoftwareApplier(*this).apply(filter, inputEffects());
return FETileSoftwareApplier(*this).apply(filter, inputFilterImages(), *filterImage());
}

TextStream& FETile::externalRepresentation(TextStream& ts, RepresentationType representation) const
Expand Down
2 changes: 2 additions & 0 deletions Source/WebCore/platform/graphics/filters/FETile.h
Expand Up @@ -35,6 +35,8 @@ class FETile : public FilterEffect {

void determineAbsolutePaintRect(const Filter&) override { setAbsolutePaintRect(enclosingIntRect(maxEffectRect())); }

bool resultIsAlphaImage() const override;

bool platformApplySoftware(const Filter&) override;

WTF::TextStream& externalRepresentation(WTF::TextStream&, RepresentationType) const override;
Expand Down

0 comments on commit 75a4a71

Please sign in to comment.