Skip to content
Permalink
Browse files
[GPU Process] Introduce FilterFunction and make it the base class of …
…Filter and FilterEffect

https://bugs.webkit.org/show_bug.cgi?id=232413
rdar://84966765

Reviewed by Myles C. Maxfield.

This allows CSSFilter to hold a list of FilterFunctions. The Filter in
this case will act like a composite pattern of FilterEffects.

This patch also
1. Removes the virtual function filterName() from all the FilterEffect
   classes. It replaces it with a static function in FilterFunction.
2. Removes the virtual function filterEffectType() and the function
   FilterEffect::filterEffectClassType() since they can both be replaced
   by FilterFunction::filterType().
3. Adds trait macros for all FilterEffects and the SVGFilters class.

* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/coreimage/FilterEffectRendererCoreImage.mm:
(WebCore::FilterEffectRendererCoreImage::supportsCoreImageRendering):
(WebCore::FilterEffectRendererCoreImage::connectCIFilters):
* platform/graphics/filters/FEBlend.cpp:
(WebCore::FEBlend::FEBlend):
* platform/graphics/filters/FEBlend.h:
(): Deleted.
* platform/graphics/filters/FEColorMatrix.cpp:
(WebCore::FEColorMatrix::FEColorMatrix):
* platform/graphics/filters/FEColorMatrix.h:
(isType): Deleted.
* platform/graphics/filters/FEComponentTransfer.cpp:
(WebCore::FEComponentTransfer::FEComponentTransfer):
* platform/graphics/filters/FEComponentTransfer.h:
(isType): Deleted.
* platform/graphics/filters/FEComposite.cpp:
(WebCore::FEComposite::FEComposite):
* platform/graphics/filters/FEComposite.h:
* platform/graphics/filters/FEConvolveMatrix.cpp:
(WebCore::FEConvolveMatrix::FEConvolveMatrix):
* platform/graphics/filters/FEConvolveMatrix.h:
* platform/graphics/filters/FEDiffuseLighting.cpp:
(WebCore::FEDiffuseLighting::FEDiffuseLighting):
* platform/graphics/filters/FEDiffuseLighting.h:
* platform/graphics/filters/FEDisplacementMap.cpp:
(WebCore::FEDisplacementMap::FEDisplacementMap):
* platform/graphics/filters/FEDisplacementMap.h:
* platform/graphics/filters/FEDropShadow.cpp:
(WebCore::FEDropShadow::FEDropShadow):
* platform/graphics/filters/FEDropShadow.h:
(): Deleted.
* platform/graphics/filters/FEFlood.cpp:
(WebCore::FEFlood::FEFlood):
* platform/graphics/filters/FEFlood.h:
* platform/graphics/filters/FEGaussianBlur.cpp:
(WebCore::FEGaussianBlur::FEGaussianBlur):
* platform/graphics/filters/FEGaussianBlur.h:
(): Deleted.
* platform/graphics/filters/FELighting.h:
* platform/graphics/filters/FEMerge.cpp:
(WebCore::FEMerge::FEMerge):
* platform/graphics/filters/FEMerge.h:
(): Deleted.
* platform/graphics/filters/FEMorphology.cpp:
(WebCore::FEMorphology::FEMorphology):
* platform/graphics/filters/FEMorphology.h:
* platform/graphics/filters/FEOffset.cpp:
(WebCore::FEOffset::FEOffset):
* platform/graphics/filters/FEOffset.h:
(): Deleted.
* platform/graphics/filters/FESpecularLighting.cpp:
(WebCore::FESpecularLighting::FESpecularLighting):
* platform/graphics/filters/FESpecularLighting.h:
* platform/graphics/filters/FETile.cpp:
(WebCore::FETile::FETile):
(WebCore::FETile::platformApplySoftware):
* platform/graphics/filters/FETile.h:
* platform/graphics/filters/FETurbulence.cpp:
(WebCore::FETurbulence::FETurbulence):
* platform/graphics/filters/FETurbulence.h:
* platform/graphics/filters/Filter.h:
(WebCore::Filter::Filter):
* platform/graphics/filters/FilterEffect.cpp:
(WebCore::FilterEffect::FilterEffect):
(WebCore::FilterEffect::determineFilterPrimitiveSubregion):
(WebCore::FilterEffect::createImageBufferResult):
(WebCore::FilterEffect::createUnmultipliedImageResult):
(WebCore::FilterEffect::createPremultipliedImageResult):
* platform/graphics/filters/FilterEffect.h:
(isType):
(WebCore::FilterEffect::filterEffectType const): Deleted.
(WebCore::FilterEffect::filterEffectClassType const): Deleted.
* platform/graphics/filters/FilterFunction.cpp: Added.
(WebCore::FilterFunction::FilterFunction):
(WebCore::FilterFunction::filterName):
* platform/graphics/filters/FilterFunction.h: Added.
(WebCore::FilterFunction::filterType const):
(WebCore::FilterFunction::isCSSFilter const):
(WebCore::FilterFunction::isSVGFilter const):
(WebCore::FilterFunction::isFilter const):
(WebCore::FilterFunction::isFilterEffect const):
(WebCore::FilterFunction::sourceAlphaName):
(WebCore::FilterFunction::sourceGraphicName):
(WebCore::FilterFunction::filterName const):
* platform/graphics/filters/SourceAlpha.cpp:
(WebCore::SourceAlpha::SourceAlpha):
(WebCore::SourceAlpha::effectName): Deleted.
* platform/graphics/filters/SourceAlpha.h:
(WebCore::SourceAlpha::effectName):
(): Deleted.
* platform/graphics/filters/SourceGraphic.cpp:
(WebCore::SourceGraphic::effectName): Deleted.
* platform/graphics/filters/SourceGraphic.h:
(WebCore::SourceGraphic::effectName):
(WebCore::SourceGraphic::SourceGraphic):
(): Deleted.
(isType): Deleted.
* platform/mediastream/mac/RealtimeIncomingAudioSourceCocoa.cpp:
* rendering/CSSFilter.cpp:
(WebCore::CSSFilter::CSSFilter):
* svg/graphics/filters/SVGFEImage.cpp:
(WebCore::FEImage::FEImage):
* svg/graphics/filters/SVGFEImage.h:
* svg/graphics/filters/SVGFilter.cpp:
(WebCore::SVGFilter::SVGFilter):
* svg/graphics/filters/SVGFilter.h:
(isType):
* svg/graphics/filters/SVGFilterBuilder.cpp:



Canonical link: https://commits.webkit.org/244057@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@285543 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
shallawa committed Nov 10, 2021
1 parent 1f64c4c commit c1f4497e65c40fe91244224af0eae7862806a779
Showing 53 changed files with 420 additions and 223 deletions.
@@ -1,3 +1,133 @@
2021-11-09 Said Abou-Hallawa <said@apple.com>

[GPU Process] Introduce FilterFunction and make it the base class of Filter and FilterEffect
https://bugs.webkit.org/show_bug.cgi?id=232413
rdar://84966765

Reviewed by Myles C. Maxfield.

This allows CSSFilter to hold a list of FilterFunctions. The Filter in
this case will act like a composite pattern of FilterEffects.

This patch also
1. Removes the virtual function filterName() from all the FilterEffect
classes. It replaces it with a static function in FilterFunction.
2. Removes the virtual function filterEffectType() and the function
FilterEffect::filterEffectClassType() since they can both be replaced
by FilterFunction::filterType().
3. Adds trait macros for all FilterEffects and the SVGFilters class.

* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/coreimage/FilterEffectRendererCoreImage.mm:
(WebCore::FilterEffectRendererCoreImage::supportsCoreImageRendering):
(WebCore::FilterEffectRendererCoreImage::connectCIFilters):
* platform/graphics/filters/FEBlend.cpp:
(WebCore::FEBlend::FEBlend):
* platform/graphics/filters/FEBlend.h:
(): Deleted.
* platform/graphics/filters/FEColorMatrix.cpp:
(WebCore::FEColorMatrix::FEColorMatrix):
* platform/graphics/filters/FEColorMatrix.h:
(isType): Deleted.
* platform/graphics/filters/FEComponentTransfer.cpp:
(WebCore::FEComponentTransfer::FEComponentTransfer):
* platform/graphics/filters/FEComponentTransfer.h:
(isType): Deleted.
* platform/graphics/filters/FEComposite.cpp:
(WebCore::FEComposite::FEComposite):
* platform/graphics/filters/FEComposite.h:
* platform/graphics/filters/FEConvolveMatrix.cpp:
(WebCore::FEConvolveMatrix::FEConvolveMatrix):
* platform/graphics/filters/FEConvolveMatrix.h:
* platform/graphics/filters/FEDiffuseLighting.cpp:
(WebCore::FEDiffuseLighting::FEDiffuseLighting):
* platform/graphics/filters/FEDiffuseLighting.h:
* platform/graphics/filters/FEDisplacementMap.cpp:
(WebCore::FEDisplacementMap::FEDisplacementMap):
* platform/graphics/filters/FEDisplacementMap.h:
* platform/graphics/filters/FEDropShadow.cpp:
(WebCore::FEDropShadow::FEDropShadow):
* platform/graphics/filters/FEDropShadow.h:
(): Deleted.
* platform/graphics/filters/FEFlood.cpp:
(WebCore::FEFlood::FEFlood):
* platform/graphics/filters/FEFlood.h:
* platform/graphics/filters/FEGaussianBlur.cpp:
(WebCore::FEGaussianBlur::FEGaussianBlur):
* platform/graphics/filters/FEGaussianBlur.h:
(): Deleted.
* platform/graphics/filters/FELighting.h:
* platform/graphics/filters/FEMerge.cpp:
(WebCore::FEMerge::FEMerge):
* platform/graphics/filters/FEMerge.h:
(): Deleted.
* platform/graphics/filters/FEMorphology.cpp:
(WebCore::FEMorphology::FEMorphology):
* platform/graphics/filters/FEMorphology.h:
* platform/graphics/filters/FEOffset.cpp:
(WebCore::FEOffset::FEOffset):
* platform/graphics/filters/FEOffset.h:
(): Deleted.
* platform/graphics/filters/FESpecularLighting.cpp:
(WebCore::FESpecularLighting::FESpecularLighting):
* platform/graphics/filters/FESpecularLighting.h:
* platform/graphics/filters/FETile.cpp:
(WebCore::FETile::FETile):
(WebCore::FETile::platformApplySoftware):
* platform/graphics/filters/FETile.h:
* platform/graphics/filters/FETurbulence.cpp:
(WebCore::FETurbulence::FETurbulence):
* platform/graphics/filters/FETurbulence.h:
* platform/graphics/filters/Filter.h:
(WebCore::Filter::Filter):
* platform/graphics/filters/FilterEffect.cpp:
(WebCore::FilterEffect::FilterEffect):
(WebCore::FilterEffect::determineFilterPrimitiveSubregion):
(WebCore::FilterEffect::createImageBufferResult):
(WebCore::FilterEffect::createUnmultipliedImageResult):
(WebCore::FilterEffect::createPremultipliedImageResult):
* platform/graphics/filters/FilterEffect.h:
(isType):
(WebCore::FilterEffect::filterEffectType const): Deleted.
(WebCore::FilterEffect::filterEffectClassType const): Deleted.
* platform/graphics/filters/FilterFunction.cpp: Added.
(WebCore::FilterFunction::FilterFunction):
(WebCore::FilterFunction::filterName):
* platform/graphics/filters/FilterFunction.h: Added.
(WebCore::FilterFunction::filterType const):
(WebCore::FilterFunction::isCSSFilter const):
(WebCore::FilterFunction::isSVGFilter const):
(WebCore::FilterFunction::isFilter const):
(WebCore::FilterFunction::isFilterEffect const):
(WebCore::FilterFunction::sourceAlphaName):
(WebCore::FilterFunction::sourceGraphicName):
(WebCore::FilterFunction::filterName const):
* platform/graphics/filters/SourceAlpha.cpp:
(WebCore::SourceAlpha::SourceAlpha):
(WebCore::SourceAlpha::effectName): Deleted.
* platform/graphics/filters/SourceAlpha.h:
(WebCore::SourceAlpha::effectName):
(): Deleted.
* platform/graphics/filters/SourceGraphic.cpp:
(WebCore::SourceGraphic::effectName): Deleted.
* platform/graphics/filters/SourceGraphic.h:
(WebCore::SourceGraphic::effectName):
(WebCore::SourceGraphic::SourceGraphic):
(): Deleted.
(isType): Deleted.
* platform/mediastream/mac/RealtimeIncomingAudioSourceCocoa.cpp:
* rendering/CSSFilter.cpp:
(WebCore::CSSFilter::CSSFilter):
* svg/graphics/filters/SVGFEImage.cpp:
(WebCore::FEImage::FEImage):
* svg/graphics/filters/SVGFEImage.h:
* svg/graphics/filters/SVGFilter.cpp:
(WebCore::SVGFilter::SVGFilter):
* svg/graphics/filters/SVGFilter.h:
(isType):
* svg/graphics/filters/SVGFilterBuilder.cpp:

2021-11-09 Commit Queue <commit-queue@webkit.org>

Unreviewed, reverting r285246.
@@ -2091,6 +2091,7 @@ platform/graphics/filters/FETile.cpp
platform/graphics/filters/FETurbulence.cpp
platform/graphics/filters/FilterEffect.cpp
platform/graphics/filters/FilterEffectRenderer.cpp
platform/graphics/filters/FilterFunction.cpp
platform/graphics/filters/FilterOperation.cpp
platform/graphics/filters/FilterOperations.cpp
platform/graphics/filters/PointLightSource.cpp
@@ -10848,6 +10848,8 @@
724EE54E1DC7F25B00A91FFB /* ActivityState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ActivityState.h; sourceTree = "<group>"; };
724EE54F1DC7F25B00A91FFB /* ActivityStateChangeObserver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ActivityStateChangeObserver.h; sourceTree = "<group>"; };
7252396B254CADC200F5FB15 /* NativeImage.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = NativeImage.cpp; sourceTree = "<group>"; };
7262D756272A174100C56A09 /* FilterFunction.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FilterFunction.h; sourceTree = "<group>"; };
7262D757272A174100C56A09 /* FilterFunction.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = FilterFunction.cpp; sourceTree = "<group>"; };
7266F0132241BCE200833975 /* SVGPropertyAnimatorFactory.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SVGPropertyAnimatorFactory.h; sourceTree = "<group>"; };
7266F0142241BFB200833975 /* SVGPrimitivePropertyAnimatorImpl.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SVGPrimitivePropertyAnimatorImpl.h; sourceTree = "<group>"; };
7266F0152241C09800833975 /* SVGPrimitivePropertyAnimator.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SVGPrimitivePropertyAnimator.h; sourceTree = "<group>"; };
@@ -18907,11 +18909,11 @@
1A569CC40D7E2B60007C3983 /* bridge */ = {
isa = PBXGroup;
children = (
1A569CE20D7E2B82007C3983 /* objc */,
599E758F11055A1F00D904FA /* Bridge.h */,
1A71D5790F33819000F9CE4E /* IdentifierRep.cpp */,
1A71D57A0F33819000F9CE4E /* IdentifierRep.h */,
59B5977111086556007159E8 /* jsc */,
1A569CE20D7E2B82007C3983 /* objc */,
1A569CEF0D7E2B82007C3983 /* runtime_array.cpp */,
1A569CF00D7E2B82007C3983 /* runtime_array.h */,
1A569CF10D7E2B82007C3983 /* runtime_method.cpp */,
@@ -25869,6 +25871,8 @@
08C925180FCC7C4A00480DEC /* FilterEffect.h */,
2C85653824C10B0B00A37673 /* FilterEffectRenderer.cpp */,
2C85653324C0F73C00A37673 /* FilterEffectRenderer.h */,
7262D757272A174100C56A09 /* FilterFunction.cpp */,
7262D756272A174100C56A09 /* FilterFunction.h */,
49ECEB631499790D00CDD3A4 /* FilterOperation.cpp */,
49ECEB641499790D00CDD3A4 /* FilterOperation.h */,
49ECEB651499790D00CDD3A4 /* FilterOperations.cpp */,
@@ -72,11 +72,11 @@ static bool isNullOrLinearComponentTransferFunction(const FEComponentTransfer& e
bool FilterEffectRendererCoreImage::supportsCoreImageRendering(FilterEffect& effect)
{
// FIXME: change return value to true once they are implemented
switch (effect.filterEffectClassType()) {
switch (effect.filterType()) {
case FilterEffect::Type::SourceGraphic:
return true;

case FilterEffect::Type::ColorMatrix: {
case FilterEffect::Type::FEColorMatrix: {
switch (downcast<FEColorMatrix>(effect).type()) {
case FECOLORMATRIX_TYPE_UNKNOWN:
case FECOLORMATRIX_TYPE_LUMINANCETOALPHA:
@@ -88,26 +88,10 @@ static bool isNullOrLinearComponentTransferFunction(const FEComponentTransfer& e
}
}

case FilterEffect::Type::ComponentTransfer:
case FilterEffect::Type::FEComponentTransfer:
return isNullOrLinearComponentTransferFunction(downcast<FEComponentTransfer>(effect));

case FilterEffect::Type::Blend:
case FilterEffect::Type::Composite:
case FilterEffect::Type::ConvolveMatrix:
case FilterEffect::Type::DiffuseLighting:
case FilterEffect::Type::DisplacementMap:
case FilterEffect::Type::DropShadow:
case FilterEffect::Type::Flood:
case FilterEffect::Type::GaussianBlur:
case FilterEffect::Type::Image:
case FilterEffect::Type::Lighting:
case FilterEffect::Type::Merge:
case FilterEffect::Type::Morphology:
case FilterEffect::Type::Offset:
case FilterEffect::Type::SpecularLighting:
case FilterEffect::Type::Tile:
case FilterEffect::Type::Turbulence:
case FilterEffect::Type::SourceAlpha:
default:
return false;
}
return false;
@@ -137,32 +121,14 @@ static bool isNullOrLinearComponentTransferFunction(const FEComponentTransfer& e
if (effect.absolutePaintRect().isEmpty() || ImageBuffer::sizeNeedsClamping(effect.absolutePaintRect().size()))
return nullptr;

switch (effect.filterEffectClassType()) {
switch (effect.filterType()) {
case FilterEffect::Type::SourceGraphic:
return imageForSourceGraphic(downcast<SourceGraphic>(effect));
case FilterEffect::Type::ColorMatrix:
case FilterEffect::Type::FEColorMatrix:
return imageForFEColorMatrix(downcast<FEColorMatrix>(effect), inputImages);
case FilterEffect::Type::ComponentTransfer:
case FilterEffect::Type::FEComponentTransfer:
return imageForFEComponentTransfer(downcast<FEComponentTransfer>(effect), inputImages);

// FIXME: Implement those filters using CIFilter so that the function returns a valid CIImage
case FilterEffect::Type::Blend:
case FilterEffect::Type::Composite:
case FilterEffect::Type::ConvolveMatrix:
case FilterEffect::Type::DiffuseLighting:
case FilterEffect::Type::DisplacementMap:
case FilterEffect::Type::DropShadow:
case FilterEffect::Type::Flood:
case FilterEffect::Type::GaussianBlur:
case FilterEffect::Type::Image:
case FilterEffect::Type::Lighting:
case FilterEffect::Type::Merge:
case FilterEffect::Type::Morphology:
case FilterEffect::Type::Offset:
case FilterEffect::Type::SpecularLighting:
case FilterEffect::Type::Tile:
case FilterEffect::Type::Turbulence:
case FilterEffect::Type::SourceAlpha:
default:
return nullptr;
}
@@ -35,7 +35,7 @@
namespace WebCore {

FEBlend::FEBlend(Filter& filter, BlendMode mode)
: FilterEffect(filter, Type::Blend)
: FilterEffect(filter, FilterEffect::Type::FEBlend)
, m_mode(mode)
{
}
@@ -36,8 +36,6 @@ class FEBlend : public FilterEffect {
bool setBlendMode(BlendMode);

private:
const char* filterName() const final { return "FEBlend"; }

void platformApplySoftware() override;
void platformApplyGeneric(unsigned char* srcPixelArrayA, unsigned char* srcPixelArrayB, unsigned char* dstPixelArray,
unsigned colorArrayLength);
@@ -53,3 +51,4 @@ class FEBlend : public FilterEffect {

} // namespace WebCore

SPECIALIZE_TYPE_TRAITS_FILTER_EFFECT(FEBlend)
@@ -36,7 +36,7 @@
namespace WebCore {

FEColorMatrix::FEColorMatrix(Filter& filter, ColorMatrixType type, Vector<float>&& values)
: FilterEffect(filter, Type::ColorMatrix)
: FilterEffect(filter, FilterEffect::Type::FEColorMatrix)
, m_type(type)
, m_values(WTFMove(values))
{
@@ -52,8 +52,6 @@ class FEColorMatrix : public FilterEffect {
private:
FEColorMatrix(Filter&, ColorMatrixType, Vector<float>&&);

const char* filterName() const final { return "FEColorMatrix"; }

void platformApplySoftware() override;

WTF::TextStream& externalRepresentation(WTF::TextStream&, RepresentationType) const override;
@@ -93,7 +91,4 @@ inline void FEColorMatrix::calculateHueRotateComponents(float* components, float

} // namespace WebCore

SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::FEColorMatrix)
static bool isType(const WebCore::FilterEffect& effect) { return effect.filterEffectClassType() == WebCore::FilterEffect::Type::ColorMatrix; }
SPECIALIZE_TYPE_TRAITS_END()

SPECIALIZE_TYPE_TRAITS_FILTER_EFFECT(FEColorMatrix)
@@ -33,9 +33,8 @@

namespace WebCore {

FEComponentTransfer::FEComponentTransfer(Filter& filter, const ComponentTransferFunction& redFunction,
const ComponentTransferFunction& greenFunction, const ComponentTransferFunction& blueFunction, const ComponentTransferFunction& alphaFunction)
: FilterEffect(filter, Type::ComponentTransfer)
FEComponentTransfer::FEComponentTransfer(Filter& filter, const ComponentTransferFunction& redFunction, const ComponentTransferFunction& greenFunction, const ComponentTransferFunction& blueFunction, const ComponentTransferFunction& alphaFunction)
: FilterEffect(filter, FilterEffect::Type::FEComponentTransfer)
, m_redFunction(redFunction)
, m_greenFunction(greenFunction)
, m_blueFunction(blueFunction)
@@ -65,8 +65,6 @@ class FEComponentTransfer : public FilterEffect {
FEComponentTransfer(Filter&, const ComponentTransferFunction& redFunc, const ComponentTransferFunction& greenFunc,
const ComponentTransferFunction& blueFunc, const ComponentTransferFunction& alphaFunc);

const char* filterName() const final { return "FEComponentTransfer"; }

using LookupTable = std::array<uint8_t, 256>;

static void computeIdentityTable(LookupTable&, const ComponentTransferFunction&);
@@ -89,6 +87,4 @@ class FEComponentTransfer : public FilterEffect {

} // namespace WebCore

SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::FEComponentTransfer)
static bool isType(const WebCore::FilterEffect& effect) { return effect.filterEffectClassType() == WebCore::FilterEffect::Type::ComponentTransfer; }
SPECIALIZE_TYPE_TRAITS_END()
SPECIALIZE_TYPE_TRAITS_FILTER_EFFECT(FEComponentTransfer)
@@ -33,7 +33,7 @@
namespace WebCore {

FEComposite::FEComposite(Filter& filter, const CompositeOperationType& type, float k1, float k2, float k3, float k4)
: FilterEffect(filter, Type::Composite)
: FilterEffect(filter, FilterEffect::Type::FEComposite)
, m_type(type)
, m_k1(k1)
, m_k2(k2)
@@ -64,8 +64,6 @@ class FEComposite : public FilterEffect {
private:
FEComposite(Filter&, const CompositeOperationType&, float, float, float, float);

const char* filterName() const final { return "FEComposite"; }

void correctFilterResultIfNeeded() override;
void determineAbsolutePaintRect() override;

@@ -90,3 +88,4 @@ class FEComposite : public FilterEffect {

} // namespace WebCore

SPECIALIZE_TYPE_TRAITS_FILTER_EFFECT(FEComposite)
@@ -32,10 +32,8 @@

namespace WebCore {

FEConvolveMatrix::FEConvolveMatrix(Filter& filter, const IntSize& kernelSize,
float divisor, float bias, const IntPoint& targetOffset, EdgeModeType edgeMode,
const FloatPoint& kernelUnitLength, bool preserveAlpha, const Vector<float>& kernelMatrix)
: FilterEffect(filter, Type::ConvolveMatrix)
FEConvolveMatrix::FEConvolveMatrix(Filter& filter, const IntSize& kernelSize, float divisor, float bias, const IntPoint& targetOffset, EdgeModeType edgeMode, const FloatPoint& kernelUnitLength, bool preserveAlpha, const Vector<float>& kernelMatrix)
: FilterEffect(filter, FilterEffect::Type::FEConvolveMatrix)
, m_kernelSize(kernelSize)
, m_divisor(divisor)
, m_bias(bias)
@@ -80,8 +80,6 @@ class FEConvolveMatrix : public FilterEffect {
FEConvolveMatrix(Filter&, const IntSize&, float, float,
const IntPoint&, EdgeModeType, const FloatPoint&, bool, const Vector<float>&);

const char* filterName() const final { return "FEConvolveMatrix"; }

void determineAbsolutePaintRect() override { setAbsolutePaintRect(enclosingIntRect(maxEffectRect())); }

void platformApplySoftware() override;
@@ -115,3 +113,4 @@ class FEConvolveMatrix : public FilterEffect {

} // namespace WebCore

SPECIALIZE_TYPE_TRAITS_FILTER_EFFECT(FEConvolveMatrix)
@@ -28,7 +28,7 @@
namespace WebCore {

FEDiffuseLighting::FEDiffuseLighting(Filter& filter, const Color& lightingColor, float surfaceScale, float diffuseConstant, float kernelUnitLengthX, float kernelUnitLengthY, Ref<LightSource>&& lightSource)
: FELighting(filter, DiffuseLighting, lightingColor, surfaceScale, diffuseConstant, 0, 0, kernelUnitLengthX, kernelUnitLengthY, WTFMove(lightSource), Type::DiffuseLighting)
: FELighting(filter, DiffuseLighting, lightingColor, surfaceScale, diffuseConstant, 0, 0, kernelUnitLengthX, kernelUnitLengthY, WTFMove(lightSource), FilterEffect::Type::FEDiffuseLighting)
{
}

@@ -37,8 +37,6 @@ Ref<FEDiffuseLighting> FEDiffuseLighting::create(Filter& filter, const Color& li
return adoptRef(*new FEDiffuseLighting(filter, lightingColor, surfaceScale, diffuseConstant, kernelUnitLengthX, kernelUnitLengthY, WTFMove(lightSource)));
}

FEDiffuseLighting::~FEDiffuseLighting() = default;

bool FEDiffuseLighting::setDiffuseConstant(float diffuseConstant)
{
if (m_diffuseConstant == diffuseConstant)

0 comments on commit c1f4497

Please sign in to comment.