2008-07-09 Alex Mathews <possessedpenguinbob@gmail.com>
authoroliver@apple.com <oliver@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 10 Jul 2008 07:12:23 +0000 (07:12 +0000)
committeroliver@apple.com <oliver@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 10 Jul 2008 07:12:23 +0000 (07:12 +0000)
        Reviewed by Oliver Hunt.

        bug 19835: WebKit needs cross-platform filter system
        <https://bugs.webkit.org/show_bug.cgi?id=19835>

        More class refactoring in preparation for cross-platform filter
        implementation.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@35094 268f45cc-cd09-0410-ab3c-d52691b4dbfc

69 files changed:
WebCore/ChangeLog
WebCore/WebCore.xcodeproj/project.pbxproj
WebCore/rendering/SVGRenderTreeAsText.h
WebCore/svg/FilterEffect.cpp
WebCore/svg/FilterEffect.h
WebCore/svg/SVGFEBlendElement.cpp
WebCore/svg/SVGFEBlendElement.h
WebCore/svg/SVGFEColorMatrixElement.cpp
WebCore/svg/SVGFEColorMatrixElement.h
WebCore/svg/SVGFEComponentTransferElement.cpp
WebCore/svg/SVGFEComponentTransferElement.h
WebCore/svg/SVGFECompositeElement.cpp
WebCore/svg/SVGFECompositeElement.h
WebCore/svg/SVGFEDiffuseLightingElement.cpp
WebCore/svg/SVGFEDiffuseLightingElement.h
WebCore/svg/SVGFEDisplacementMapElement.cpp
WebCore/svg/SVGFEDisplacementMapElement.h
WebCore/svg/SVGFEFloodElement.cpp
WebCore/svg/SVGFEFloodElement.h
WebCore/svg/SVGFEGaussianBlurElement.cpp
WebCore/svg/SVGFEGaussianBlurElement.h
WebCore/svg/SVGFEImageElement.cpp
WebCore/svg/SVGFEImageElement.h
WebCore/svg/SVGFEMergeElement.cpp
WebCore/svg/SVGFEMergeElement.h
WebCore/svg/SVGFEOffsetElement.cpp
WebCore/svg/SVGFEOffsetElement.h
WebCore/svg/SVGFESpecularLightingElement.cpp
WebCore/svg/SVGFESpecularLightingElement.h
WebCore/svg/SVGFETileElement.cpp
WebCore/svg/SVGFETileElement.h
WebCore/svg/SVGFETurbulenceElement.cpp
WebCore/svg/SVGFETurbulenceElement.h
WebCore/svg/SVGFilterPrimitiveStandardAttributes.h
WebCore/svg/graphics/filters/SVGFEConvolveMatrix.cpp
WebCore/svg/graphics/filters/SVGFEConvolveMatrix.h
WebCore/svg/graphics/filters/SVGFEDiffuseLighting.cpp
WebCore/svg/graphics/filters/SVGFEDiffuseLighting.h
WebCore/svg/graphics/filters/SVGFEDisplacementMap.cpp
WebCore/svg/graphics/filters/SVGFEDisplacementMap.h
WebCore/svg/graphics/filters/SVGFEFlood.cpp
WebCore/svg/graphics/filters/SVGFEFlood.h
WebCore/svg/graphics/filters/SVGFEGaussianBlur.cpp
WebCore/svg/graphics/filters/SVGFEGaussianBlur.h
WebCore/svg/graphics/filters/SVGFEImage.cpp
WebCore/svg/graphics/filters/SVGFEImage.h
WebCore/svg/graphics/filters/SVGFEMerge.cpp
WebCore/svg/graphics/filters/SVGFEMerge.h
WebCore/svg/graphics/filters/SVGFEMorphology.cpp
WebCore/svg/graphics/filters/SVGFEMorphology.h
WebCore/svg/graphics/filters/SVGFEOffset.cpp
WebCore/svg/graphics/filters/SVGFEOffset.h
WebCore/svg/graphics/filters/SVGFESpecularLighting.cpp
WebCore/svg/graphics/filters/SVGFESpecularLighting.h
WebCore/svg/graphics/filters/SVGFETile.cpp
WebCore/svg/graphics/filters/SVGFETile.h
WebCore/svg/graphics/filters/SVGFETurbulence.cpp
WebCore/svg/graphics/filters/SVGFETurbulence.h
WebCore/svg/graphics/filters/cg/SVGFEDiffuseLightingCg.mm [deleted file]
WebCore/svg/graphics/filters/cg/SVGFEDisplacementMapCg.mm [deleted file]
WebCore/svg/graphics/filters/cg/SVGFEFloodCg.mm [deleted file]
WebCore/svg/graphics/filters/cg/SVGFEGaussianBlurCg.mm [deleted file]
WebCore/svg/graphics/filters/cg/SVGFEHelpersCg.h
WebCore/svg/graphics/filters/cg/SVGFEHelpersCg.mm
WebCore/svg/graphics/filters/cg/SVGFEImageCg.mm [deleted file]
WebCore/svg/graphics/filters/cg/SVGFEMergeCg.mm [deleted file]
WebCore/svg/graphics/filters/cg/SVGFEOffsetCg.mm [deleted file]
WebCore/svg/graphics/filters/cg/SVGFESpecularLightingCg.mm [deleted file]
WebCore/svg/graphics/filters/cg/SVGFETileCg.mm [deleted file]

index cf54ccc..eefd8ea 100644 (file)
@@ -1,3 +1,269 @@
+2008-07-09  Alex Mathews  <possessedpenguinbob@gmail.com>
+
+        Reviewed by Oliver Hunt.
+
+        bug 19835: WebKit needs cross-platform filter system
+        <https://bugs.webkit.org/show_bug.cgi?id=19835>
+
+        More class refactoring in preparation for cross-platform filter 
+        implementation.
+
+        * WebCore.xcodeproj/project.pbxproj:
+        * rendering/SVGRenderTreeAsText.h:
+        (WebCore::operator<<):
+        * svg/FilterEffect.cpp:
+        (WebCore::FilterEffect::externalRepresentation):
+        * svg/FilterEffect.h:
+        * svg/SVGFEBlendElement.cpp:
+        (WebCore::SVGFEBlendElement::build):
+        * svg/SVGFEBlendElement.h:
+        * svg/SVGFEColorMatrixElement.cpp:
+        (WebCore::SVGFEColorMatrixElement::build):
+        * svg/SVGFEColorMatrixElement.h:
+        * svg/SVGFEComponentTransferElement.cpp:
+        (WebCore::SVGFEComponentTransferElement::build):
+        * svg/SVGFEComponentTransferElement.h:
+        * svg/SVGFECompositeElement.cpp:
+        (WebCore::SVGFECompositeElement::build):
+        * svg/SVGFECompositeElement.h:
+        * svg/SVGFEDiffuseLightingElement.cpp:
+        (WebCore::SVGFEDiffuseLightingElement::filterEffect):
+        (WebCore::SVGFEDiffuseLightingElement::build):
+        (WebCore::SVGFEDiffuseLightingElement::findLights):
+        * svg/SVGFEDiffuseLightingElement.h:
+        * svg/SVGFEDisplacementMapElement.cpp:
+        (WebCore::SVGFEDisplacementMapElement::SVGFEDisplacementMapElement):
+        (WebCore::SVGFEDisplacementMapElement::stringToChannel):
+        (WebCore::SVGFEDisplacementMapElement::filterEffect):
+        (WebCore::SVGFEDisplacementMapElement::build):
+        * svg/SVGFEDisplacementMapElement.h:
+        * svg/SVGFEFloodElement.cpp:
+        (WebCore::SVGFEFloodElement::filterEffect):
+        (WebCore::SVGFEFloodElement::build):
+        * svg/SVGFEFloodElement.h:
+        (WebCore::SVGFEFloodElement::contextElement):
+        * svg/SVGFEGaussianBlurElement.cpp:
+        (WebCore::SVGFEGaussianBlurElement::filterEffect):
+        (WebCore::SVGFEGaussianBlurElement::build):
+        * svg/SVGFEGaussianBlurElement.h:
+        * svg/SVGFEImageElement.cpp:
+        (WebCore::SVGFEImageElement::filterEffect):
+        (WebCore::SVGFEImageElement::build):
+        * svg/SVGFEImageElement.h:
+        * svg/SVGFEMergeElement.cpp:
+        (WebCore::SVGFEMergeElement::filterEffect):
+        (WebCore::SVGFEMergeElement::build):
+        * svg/SVGFEMergeElement.h:
+        (WebCore::SVGFEMergeElement::contextElement):
+        * svg/SVGFEOffsetElement.cpp:
+        (WebCore::SVGFEOffsetElement::filterEffect):
+        (WebCore::SVGFEOffsetElement::build):
+        * svg/SVGFEOffsetElement.h:
+        * svg/SVGFESpecularLightingElement.cpp:
+        (WebCore::SVGFESpecularLightingElement::filterEffect):
+        (WebCore::SVGFESpecularLightingElement::findLights):
+        (WebCore::SVGFESpecularLightingElement::build):
+        * svg/SVGFESpecularLightingElement.h:
+        * svg/SVGFETileElement.cpp:
+        (WebCore::SVGFETileElement::filterEffect):
+        (WebCore::SVGFETileElement::build):
+        * svg/SVGFETileElement.h:
+        * svg/SVGFETurbulenceElement.cpp:
+        (WebCore::SVGFETurbulenceElement::SVGFETurbulenceElement):
+        (WebCore::SVGFETurbulenceElement::parseMappedAttribute):
+        (WebCore::SVGFETurbulenceElement::filterEffect):
+        (WebCore::SVGFETurbulenceElement::build):
+        * svg/SVGFETurbulenceElement.h:
+        * svg/SVGFilterPrimitiveStandardAttributes.h:
+        * svg/graphics/filters/SVGFEConvolveMatrix.cpp:
+        (WebCore::FEConvolveMatrix::FEConvolveMatrix):
+        (WebCore::FEConvolveMatrix::create):
+        (WebCore::FEConvolveMatrix::kernelSize):
+        (WebCore::FEConvolveMatrix::setKernelSize):
+        (WebCore::FEConvolveMatrix::kernel):
+        (WebCore::FEConvolveMatrix::setKernel):
+        (WebCore::FEConvolveMatrix::divisor):
+        (WebCore::FEConvolveMatrix::setDivisor):
+        (WebCore::FEConvolveMatrix::bias):
+        (WebCore::FEConvolveMatrix::setBias):
+        (WebCore::FEConvolveMatrix::targetOffset):
+        (WebCore::FEConvolveMatrix::setTargetOffset):
+        (WebCore::FEConvolveMatrix::edgeMode):
+        (WebCore::FEConvolveMatrix::setEdgeMode):
+        (WebCore::FEConvolveMatrix::kernelUnitLength):
+        (WebCore::FEConvolveMatrix::setKernelUnitLength):
+        (WebCore::FEConvolveMatrix::preserveAlpha):
+        (WebCore::FEConvolveMatrix::setPreserveAlpha):
+        (WebCore::FEConvolveMatrix::apply):
+        (WebCore::FEConvolveMatrix::dump):
+        (WebCore::operator<<):
+        (WebCore::FEConvolveMatrix::externalRepresentation):
+        * svg/graphics/filters/SVGFEConvolveMatrix.h:
+        (WebCore::):
+        * svg/graphics/filters/SVGFEDiffuseLighting.cpp:
+        (WebCore::FEDiffuseLighting::FEDiffuseLighting):
+        (WebCore::FEDiffuseLighting::create):
+        (WebCore::FEDiffuseLighting::~FEDiffuseLighting):
+        (WebCore::FEDiffuseLighting::lightingColor):
+        (WebCore::FEDiffuseLighting::setLightingColor):
+        (WebCore::FEDiffuseLighting::surfaceScale):
+        (WebCore::FEDiffuseLighting::setSurfaceScale):
+        (WebCore::FEDiffuseLighting::diffuseConstant):
+        (WebCore::FEDiffuseLighting::setDiffuseConstant):
+        (WebCore::FEDiffuseLighting::kernelUnitLengthX):
+        (WebCore::FEDiffuseLighting::setKernelUnitLengthX):
+        (WebCore::FEDiffuseLighting::kernelUnitLengthY):
+        (WebCore::FEDiffuseLighting::setKernelUnitLengthY):
+        (WebCore::FEDiffuseLighting::lightSource):
+        (WebCore::FEDiffuseLighting::setLightSource):
+        (WebCore::FEDiffuseLighting::apply):
+        (WebCore::FEDiffuseLighting::dump):
+        (WebCore::FEDiffuseLighting::externalRepresentation):
+        * svg/graphics/filters/SVGFEDiffuseLighting.h:
+        * svg/graphics/filters/SVGFEDisplacementMap.cpp:
+        (WebCore::FEDisplacementMap::FEDisplacementMap):
+        (WebCore::FEDisplacementMap::create):
+        (WebCore::FEDisplacementMap::xChannelSelector):
+        (WebCore::FEDisplacementMap::setXChannelSelector):
+        (WebCore::FEDisplacementMap::yChannelSelector):
+        (WebCore::FEDisplacementMap::setYChannelSelector):
+        (WebCore::FEDisplacementMap::scale):
+        (WebCore::FEDisplacementMap::setScale):
+        (WebCore::FEDisplacementMap::apply):
+        (WebCore::FEDisplacementMap::dump):
+        (WebCore::operator<<):
+        (WebCore::FEDisplacementMap::externalRepresentation):
+        * svg/graphics/filters/SVGFEDisplacementMap.h:
+        (WebCore::):
+        * svg/graphics/filters/SVGFEFlood.cpp:
+        (WebCore::FEFlood::FEFlood):
+        (WebCore::FEFlood::create):
+        (WebCore::FEFlood::floodColor):
+        (WebCore::FEFlood::setFloodColor):
+        (WebCore::FEFlood::floodOpacity):
+        (WebCore::FEFlood::setFloodOpacity):
+        (WebCore::FEFlood::apply):
+        (WebCore::FEFlood::dump):
+        (WebCore::FEFlood::externalRepresentation):
+        * svg/graphics/filters/SVGFEFlood.h:
+        * svg/graphics/filters/SVGFEGaussianBlur.cpp:
+        (WebCore::FEGaussianBlur::FEGaussianBlur):
+        (WebCore::FEGaussianBlur::create):
+        (WebCore::FEGaussianBlur::stdDeviationX):
+        (WebCore::FEGaussianBlur::setStdDeviationX):
+        (WebCore::FEGaussianBlur::stdDeviationY):
+        (WebCore::FEGaussianBlur::setStdDeviationY):
+        (WebCore::FEGaussianBlur::apply):
+        (WebCore::FEGaussianBlur::dump):
+        (WebCore::FEGaussianBlur::externalRepresentation):
+        * svg/graphics/filters/SVGFEGaussianBlur.h:
+        * svg/graphics/filters/SVGFEImage.cpp:
+        (WebCore::FEImage::FEImage):
+        (WebCore::FEImage::create):
+        (WebCore::FEImage::~FEImage):
+        (WebCore::FEImage::cachedImage):
+        (WebCore::FEImage::apply):
+        (WebCore::FEImage::dump):
+        (WebCore::FEImage::externalRepresentation):
+        * svg/graphics/filters/SVGFEImage.h:
+        * svg/graphics/filters/SVGFEMerge.cpp:
+        (WebCore::FEMerge::FEMerge):
+        (WebCore::FEMerge::create):
+        (WebCore::FEMerge::mergeInputs):
+        (WebCore::FEMerge::setMergeInputs):
+        (WebCore::FEMerge::apply):
+        (WebCore::FEMerge::dump):
+        (WebCore::FEMerge::externalRepresentation):
+        * svg/graphics/filters/SVGFEMerge.h:
+        * svg/graphics/filters/SVGFEMorphology.cpp:
+        (WebCore::FEMorphology::FEMorphology):
+        (WebCore::FEMorphology::create):
+        (WebCore::FEMorphology::morphologyOperator):
+        (WebCore::FEMorphology::setMorphologyOperator):
+        (WebCore::FEMorphology::radiusX):
+        (WebCore::FEMorphology::setRadiusX):
+        (WebCore::FEMorphology::radiusY):
+        (WebCore::FEMorphology::setRadiusY):
+        (WebCore::FEMorphology::apply):
+        (WebCore::FEMorphology::dump):
+        (WebCore::operator<<):
+        (WebCore::FEMorphology::externalRepresentation):
+        * svg/graphics/filters/SVGFEMorphology.h:
+        (WebCore::):
+        * svg/graphics/filters/SVGFEOffset.cpp:
+        (WebCore::FEOffset::FEOffset):
+        (WebCore::FEOffset::create):
+        (WebCore::FEOffset::dx):
+        (WebCore::FEOffset::setDx):
+        (WebCore::FEOffset::dy):
+        (WebCore::FEOffset::setDy):
+        (WebCore::FEOffset::apply):
+        (WebCore::FEOffset::dump):
+        (WebCore::FEOffset::externalRepresentation):
+        * svg/graphics/filters/SVGFEOffset.h:
+        * svg/graphics/filters/SVGFESpecularLighting.cpp:
+        (WebCore::FESpecularLighting::FESpecularLighting):
+        (WebCore::FESpecularLighting::create):
+        (WebCore::FESpecularLighting::~FESpecularLighting):
+        (WebCore::FESpecularLighting::lightingColor):
+        (WebCore::FESpecularLighting::setLightingColor):
+        (WebCore::FESpecularLighting::surfaceScale):
+        (WebCore::FESpecularLighting::setSurfaceScale):
+        (WebCore::FESpecularLighting::specularConstant):
+        (WebCore::FESpecularLighting::setSpecularConstant):
+        (WebCore::FESpecularLighting::specularExponent):
+        (WebCore::FESpecularLighting::setSpecularExponent):
+        (WebCore::FESpecularLighting::kernelUnitLengthX):
+        (WebCore::FESpecularLighting::setKernelUnitLengthX):
+        (WebCore::FESpecularLighting::kernelUnitLengthY):
+        (WebCore::FESpecularLighting::setKernelUnitLengthY):
+        (WebCore::FESpecularLighting::lightSource):
+        (WebCore::FESpecularLighting::setLightSource):
+        (WebCore::FESpecularLighting::apply):
+        (WebCore::FESpecularLighting::dump):
+        (WebCore::FESpecularLighting::externalRepresentation):
+        * svg/graphics/filters/SVGFESpecularLighting.h:
+        * svg/graphics/filters/SVGFETile.cpp:
+        (WebCore::FETile::FETile):
+        (WebCore::FETile::create):
+        (WebCore::FETile::apply):
+        (WebCore::FETile::dump):
+        (WebCore::FETile::externalRepresentation):
+        * svg/graphics/filters/SVGFETile.h:
+        * svg/graphics/filters/SVGFETurbulence.cpp:
+        (WebCore::FETurbulence::FETurbulence):
+        (WebCore::FETurbulence::create):
+        (WebCore::FETurbulence::type):
+        (WebCore::FETurbulence::setType):
+        (WebCore::FETurbulence::baseFrequencyY):
+        (WebCore::FETurbulence::setBaseFrequencyY):
+        (WebCore::FETurbulence::baseFrequencyX):
+        (WebCore::FETurbulence::setBaseFrequencyX):
+        (WebCore::FETurbulence::seed):
+        (WebCore::FETurbulence::setSeed):
+        (WebCore::FETurbulence::numOctaves):
+        (WebCore::FETurbulence::setNumOctaves):
+        (WebCore::FETurbulence::stitchTiles):
+        (WebCore::FETurbulence::setStitchTiles):
+        (WebCore::FETurbulence::apply):
+        (WebCore::FETurbulence::dump):
+        (WebCore::operator<<):
+        (WebCore::FETurbulence::externalRepresentation):
+        * svg/graphics/filters/SVGFETurbulence.h:
+        (WebCore::):
+        * svg/graphics/filters/cg/SVGFEDiffuseLightingCg.mm:
+        * svg/graphics/filters/cg/SVGFEDisplacementMapCg.mm:
+        * svg/graphics/filters/cg/SVGFEFloodCg.mm:
+        * svg/graphics/filters/cg/SVGFEGaussianBlurCg.mm:
+        * svg/graphics/filters/cg/SVGFEHelpersCg.h:
+        * svg/graphics/filters/cg/SVGFEHelpersCg.mm:
+        (WebCore::getVectorForChannel):
+        * svg/graphics/filters/cg/SVGFEImageCg.mm:
+        * svg/graphics/filters/cg/SVGFEMergeCg.mm:
+        * svg/graphics/filters/cg/SVGFEOffsetCg.mm:
+        * svg/graphics/filters/cg/SVGFESpecularLightingCg.mm:
+        * svg/graphics/filters/cg/SVGFETileCg.mm:
+
 2008-07-09  Mark Rowe  <mrowe@apple.com>
 
         Reviewed by Geoff Garen.
index 889904d..0be495c 100644 (file)
                B25599330D00D8BA00BB825C /* SVGResourceClipperCg.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B25598970D00D8B800BB825C /* SVGResourceClipperCg.cpp */; };
                B25599350D00D8BA00BB825C /* SVGResourceFilterCg.mm in Sources */ = {isa = PBXBuildFile; fileRef = B25598990D00D8B800BB825C /* SVGResourceFilterCg.mm */; };
                B25599370D00D8BA00BB825C /* SVGResourceMaskerCg.mm in Sources */ = {isa = PBXBuildFile; fileRef = B255989B0D00D8B800BB825C /* SVGResourceMaskerCg.mm */; };
-               B255993C0D00D8BA00BB825C /* SVGFEDiffuseLightingCg.mm in Sources */ = {isa = PBXBuildFile; fileRef = B25598A20D00D8B800BB825C /* SVGFEDiffuseLightingCg.mm */; };
-               B255993D0D00D8BA00BB825C /* SVGFEDisplacementMapCg.mm in Sources */ = {isa = PBXBuildFile; fileRef = B25598A30D00D8B800BB825C /* SVGFEDisplacementMapCg.mm */; };
-               B255993E0D00D8BA00BB825C /* SVGFEFloodCg.mm in Sources */ = {isa = PBXBuildFile; fileRef = B25598A40D00D8B800BB825C /* SVGFEFloodCg.mm */; };
-               B255993F0D00D8BA00BB825C /* SVGFEGaussianBlurCg.mm in Sources */ = {isa = PBXBuildFile; fileRef = B25598A50D00D8B800BB825C /* SVGFEGaussianBlurCg.mm */; };
                B25599400D00D8BA00BB825C /* SVGFEHelpersCg.h in Headers */ = {isa = PBXBuildFile; fileRef = B25598A60D00D8B800BB825C /* SVGFEHelpersCg.h */; };
                B25599410D00D8BA00BB825C /* SVGFEHelpersCg.mm in Sources */ = {isa = PBXBuildFile; fileRef = B25598A70D00D8B800BB825C /* SVGFEHelpersCg.mm */; };
-               B25599420D00D8BA00BB825C /* SVGFEImageCg.mm in Sources */ = {isa = PBXBuildFile; fileRef = B25598A80D00D8B800BB825C /* SVGFEImageCg.mm */; };
-               B25599430D00D8BA00BB825C /* SVGFEMergeCg.mm in Sources */ = {isa = PBXBuildFile; fileRef = B25598A90D00D8B800BB825C /* SVGFEMergeCg.mm */; };
-               B25599440D00D8BA00BB825C /* SVGFEOffsetCg.mm in Sources */ = {isa = PBXBuildFile; fileRef = B25598AA0D00D8B800BB825C /* SVGFEOffsetCg.mm */; };
-               B25599450D00D8BA00BB825C /* SVGFESpecularLightingCg.mm in Sources */ = {isa = PBXBuildFile; fileRef = B25598AB0D00D8B800BB825C /* SVGFESpecularLightingCg.mm */; };
-               B25599460D00D8BA00BB825C /* SVGFETileCg.mm in Sources */ = {isa = PBXBuildFile; fileRef = B25598AC0D00D8B800BB825C /* SVGFETileCg.mm */; };
                B25599470D00D8BA00BB825C /* SVGFilterEffectCg.mm in Sources */ = {isa = PBXBuildFile; fileRef = B25598AD0D00D8B800BB825C /* SVGFilterEffectCg.mm */; };
                B25599480D00D8BA00BB825C /* WKArithmeticFilter.cikernel in Resources */ = {isa = PBXBuildFile; fileRef = B25598AE0D00D8B900BB825C /* WKArithmeticFilter.cikernel */; };
                B25599490D00D8BA00BB825C /* WKArithmeticFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = B25598AF0D00D8B900BB825C /* WKArithmeticFilter.h */; };
                B25598970D00D8B800BB825C /* SVGResourceClipperCg.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = SVGResourceClipperCg.cpp; sourceTree = "<group>"; };
                B25598990D00D8B800BB825C /* SVGResourceFilterCg.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = SVGResourceFilterCg.mm; sourceTree = "<group>"; };
                B255989B0D00D8B800BB825C /* SVGResourceMaskerCg.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = SVGResourceMaskerCg.mm; sourceTree = "<group>"; };
-               B25598A20D00D8B800BB825C /* SVGFEDiffuseLightingCg.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = SVGFEDiffuseLightingCg.mm; sourceTree = "<group>"; };
-               B25598A30D00D8B800BB825C /* SVGFEDisplacementMapCg.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = SVGFEDisplacementMapCg.mm; sourceTree = "<group>"; };
-               B25598A40D00D8B800BB825C /* SVGFEFloodCg.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = SVGFEFloodCg.mm; sourceTree = "<group>"; };
-               B25598A50D00D8B800BB825C /* SVGFEGaussianBlurCg.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = SVGFEGaussianBlurCg.mm; sourceTree = "<group>"; };
                B25598A60D00D8B800BB825C /* SVGFEHelpersCg.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SVGFEHelpersCg.h; sourceTree = "<group>"; };
                B25598A70D00D8B800BB825C /* SVGFEHelpersCg.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = SVGFEHelpersCg.mm; sourceTree = "<group>"; };
-               B25598A80D00D8B800BB825C /* SVGFEImageCg.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = SVGFEImageCg.mm; sourceTree = "<group>"; };
-               B25598A90D00D8B800BB825C /* SVGFEMergeCg.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = SVGFEMergeCg.mm; sourceTree = "<group>"; };
-               B25598AA0D00D8B800BB825C /* SVGFEOffsetCg.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = SVGFEOffsetCg.mm; sourceTree = "<group>"; };
-               B25598AB0D00D8B800BB825C /* SVGFESpecularLightingCg.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = SVGFESpecularLightingCg.mm; sourceTree = "<group>"; };
-               B25598AC0D00D8B800BB825C /* SVGFETileCg.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = SVGFETileCg.mm; sourceTree = "<group>"; };
                B25598AD0D00D8B800BB825C /* SVGFilterEffectCg.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = SVGFilterEffectCg.mm; sourceTree = "<group>"; };
                B25598AE0D00D8B900BB825C /* WKArithmeticFilter.cikernel */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = WKArithmeticFilter.cikernel; sourceTree = "<group>"; };
                B25598AF0D00D8B900BB825C /* WKArithmeticFilter.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = WKArithmeticFilter.h; sourceTree = "<group>"; };
                B255989D0D00D8B800BB825C /* cg */ = {
                        isa = PBXGroup;
                        children = (
-                               B25598A20D00D8B800BB825C /* SVGFEDiffuseLightingCg.mm */,
-                               B25598A30D00D8B800BB825C /* SVGFEDisplacementMapCg.mm */,
-                               B25598A40D00D8B800BB825C /* SVGFEFloodCg.mm */,
-                               B25598A50D00D8B800BB825C /* SVGFEGaussianBlurCg.mm */,
                                B25598A60D00D8B800BB825C /* SVGFEHelpersCg.h */,
                                B25598A70D00D8B800BB825C /* SVGFEHelpersCg.mm */,
-                               B25598A80D00D8B800BB825C /* SVGFEImageCg.mm */,
-                               B25598A90D00D8B800BB825C /* SVGFEMergeCg.mm */,
-                               B25598AA0D00D8B800BB825C /* SVGFEOffsetCg.mm */,
-                               B25598AB0D00D8B800BB825C /* SVGFESpecularLightingCg.mm */,
-                               B25598AC0D00D8B800BB825C /* SVGFETileCg.mm */,
                                B25598AD0D00D8B800BB825C /* SVGFilterEffectCg.mm */,
                                B25598AE0D00D8B900BB825C /* WKArithmeticFilter.cikernel */,
                                B25598AF0D00D8B900BB825C /* WKArithmeticFilter.h */,
                                B22279D00D00BF220071B782 /* SVGFECompositeElement.cpp in Sources */,
                                B255997A0D00D8BA00BB825C /* SVGFEConvolveMatrix.cpp in Sources */,
                                B255997C0D00D8BA00BB825C /* SVGFEDiffuseLighting.cpp in Sources */,
-                               B255993C0D00D8BA00BB825C /* SVGFEDiffuseLightingCg.mm in Sources */,
                                B22279D30D00BF220071B782 /* SVGFEDiffuseLightingElement.cpp in Sources */,
                                B255997E0D00D8BA00BB825C /* SVGFEDisplacementMap.cpp in Sources */,
-                               B255993D0D00D8BA00BB825C /* SVGFEDisplacementMapCg.mm in Sources */,
                                B22279D60D00BF220071B782 /* SVGFEDisplacementMapElement.cpp in Sources */,
                                B22279D90D00BF220071B782 /* SVGFEDistantLightElement.cpp in Sources */,
                                B25599800D00D8BA00BB825C /* SVGFEFlood.cpp in Sources */,
-                               B255993E0D00D8BA00BB825C /* SVGFEFloodCg.mm in Sources */,
                                B22279DC0D00BF220071B782 /* SVGFEFloodElement.cpp in Sources */,
                                B22279DF0D00BF220071B782 /* SVGFEFuncAElement.cpp in Sources */,
                                B22279E20D00BF220071B782 /* SVGFEFuncBElement.cpp in Sources */,
                                B22279E50D00BF220071B782 /* SVGFEFuncGElement.cpp in Sources */,
                                B22279E80D00BF220071B782 /* SVGFEFuncRElement.cpp in Sources */,
                                B25599820D00D8BA00BB825C /* SVGFEGaussianBlur.cpp in Sources */,
-                               B255993F0D00D8BA00BB825C /* SVGFEGaussianBlurCg.mm in Sources */,
                                B22279EB0D00BF220071B782 /* SVGFEGaussianBlurElement.cpp in Sources */,
                                B25599410D00D8BA00BB825C /* SVGFEHelpersCg.mm in Sources */,
                                B25599840D00D8BA00BB825C /* SVGFEImage.cpp in Sources */,
-                               B25599420D00D8BA00BB825C /* SVGFEImageCg.mm in Sources */,
                                B22279EE0D00BF220071B782 /* SVGFEImageElement.cpp in Sources */,
                                B22279F10D00BF220071B782 /* SVGFELightElement.cpp in Sources */,
                                B25599860D00D8BA00BB825C /* SVGFEMerge.cpp in Sources */,
-                               B25599430D00D8BA00BB825C /* SVGFEMergeCg.mm in Sources */,
                                B22279F30D00BF220071B782 /* SVGFEMergeElement.cpp in Sources */,
                                B22279F60D00BF220071B782 /* SVGFEMergeNodeElement.cpp in Sources */,
                                B25599880D00D8BA00BB825C /* SVGFEMorphology.cpp in Sources */,
                                B255998A0D00D8BA00BB825C /* SVGFEOffset.cpp in Sources */,
-                               B25599440D00D8BA00BB825C /* SVGFEOffsetCg.mm in Sources */,
                                B22279F90D00BF220071B782 /* SVGFEOffsetElement.cpp in Sources */,
                                B22279FC0D00BF220071B782 /* SVGFEPointLightElement.cpp in Sources */,
                                B255998C0D00D8BA00BB825C /* SVGFESpecularLighting.cpp in Sources */,
-                               B25599450D00D8BA00BB825C /* SVGFESpecularLightingCg.mm in Sources */,
                                B22279FF0D00BF220071B782 /* SVGFESpecularLightingElement.cpp in Sources */,
                                B2227A020D00BF220071B782 /* SVGFESpotLightElement.cpp in Sources */,
-                               B25599460D00D8BA00BB825C /* SVGFETileCg.mm in Sources */,
                                B2227A050D00BF220071B782 /* SVGFETileElement.cpp in Sources */,
                                B255998F0D00D8BA00BB825C /* SVGFETurbulence.cpp in Sources */,
                                B2227A080D00BF220071B782 /* SVGFETurbulenceElement.cpp in Sources */,
index 2722613..e23b82c 100644 (file)
@@ -97,6 +97,13 @@ TextStream& operator<<(TextStream& ts, const Vector<Item>& v)
     return ts;
 }
 
+template<typename Pointer>
+TextStream& operator<<(TextStream& ts, Pointer* t)
+{
+    ts << reinterpret_cast<intptr_t>(t);
+    return ts;
+}
+
 } // namespace WebCore
 
 #endif // ENABLE(SVG)
index c47d40c..24c187c 100644 (file)
@@ -32,6 +32,11 @@ FilterEffect::~FilterEffect()
 {
 }
 
+TextStream& FilterEffect::externalRepresentation(TextStream& ts) const
+{
+    return ts;
+}
+
 } // namespace WebCore
 
 #endif // ENABLE(SVG) && ENABLE(SVG_FILTERS)
index b014409..8f53ae1 100644 (file)
@@ -21,6 +21,8 @@
 #define FilterEffect_h
 
 #if ENABLE(SVG) && ENABLE(SVG_FILTERS)
+#include "TextStream.h"
+
 #include <wtf/PassRefPtr.h>
 #include <wtf/RefCounted.h>
 #include <wtf/RefPtr.h>
@@ -34,6 +36,7 @@ namespace WebCore {
         virtual void apply() = 0;
         virtual void dump() = 0;
         
+        virtual TextStream& externalRepresentation(TextStream&) const;
     protected:
         FilterEffect();
     };
index c1a2a09..1398bb8 100644 (file)
@@ -76,13 +76,12 @@ bool SVGFEBlendElement::build(FilterBuilder* builder)
 {
     FilterEffect* input1 = builder->getEffectById(in1());
     FilterEffect* input2 = builder->getEffectById(in2());
-    
+
     if(!input1 || !input2)
         return false;
 
-    RefPtr<FilterEffect> addedEffect = FEBlend::create(input1, input2, static_cast<BlendModeType> (mode()));
-    builder->add(result(), addedEffect.release());
-    
+    builder->add(result(), FEBlend::create(input1, input2, static_cast<BlendModeType> (mode())));
+
     return true;
 }
 
index 4660b01..5427f39 100644 (file)
@@ -24,7 +24,6 @@
 #define SVGFEBlendElement_h
 
 #if ENABLE(SVG) && ENABLE(SVG_FILTERS)
-#include "FilterBuilder.h"
 #include "FEBlend.h"
 #include "SVGFilterPrimitiveStandardAttributes.h"
 
index f2495f6..bad6f6c 100644 (file)
@@ -77,10 +77,10 @@ SVGFilterEffect* SVGFEColorMatrixElement::filterEffect(SVGResourceFilter* filter
 bool SVGFEColorMatrixElement::build(FilterBuilder* builder)
 {
     FilterEffect* input1 = builder->getEffectById(in1());
-    
+
     if(!input1)
         return false;
-    
+
     Vector<float> _values;
     SVGNumberList* numbers = values();
 
@@ -89,8 +89,7 @@ bool SVGFEColorMatrixElement::build(FilterBuilder* builder)
     for (unsigned int i = 0;i < nr;i++)
         _values.append(numbers->getItem(i, ec));
 
-    RefPtr<FilterEffect> addedEffect = FEColorMatrix::create(input1, static_cast<ColorMatrixType> (type()), _values);
-    builder->add(result(), addedEffect.release());
+    builder->add(result(), FEColorMatrix::create(input1, static_cast<ColorMatrixType> (type()), _values));
     
     return true;
 }
index 1780f23..57f8669 100644 (file)
@@ -24,7 +24,6 @@
 #define SVGFEColorMatrixElement_h
 
 #if ENABLE(SVG) && ENABLE(SVG_FILTERS)
-#include "FilterBuilder.h"
 #include "FEColorMatrix.h"
 #include "SVGFilterPrimitiveStandardAttributes.h"
 
index ebe7c13..a819923 100644 (file)
@@ -86,8 +86,7 @@ bool SVGFEComponentTransferElement::build(FilterBuilder* builder)
             alpha = static_cast<SVGFEFuncAElement*>(n)->transferFunction();
     }
     
-    RefPtr<FilterEffect> addedEffect = FEComponentTransfer::create(input1, red, green, blue, alpha);
-    builder->add(result(), addedEffect.release());
+    builder->add(result(), FEComponentTransfer::create(input1, red, green, blue, alpha));
     
     return true;
 }
index a722149..4bbcc3a 100644 (file)
@@ -24,7 +24,6 @@
 #define SVGFEComponentTransferElement_h
 
 #if ENABLE(SVG) && ENABLE(SVG_FILTERS)
-#include "FilterBuilder.h"
 #include "SVGFilterPrimitiveStandardAttributes.h"
 #include "FEComponentTransfer.h"
 
index 166d522..e3b5b72 100644 (file)
@@ -101,7 +101,7 @@ bool SVGFECompositeElement::build(FilterBuilder* builder)
         return false;
     
     RefPtr<FilterEffect> addedEffect = FEComposite::create(input1, input2, static_cast<CompositeOperationType> (_operator()),
-        k1(), k2(), k3(), k4());
+                                        k1(), k2(), k3(), k4());
     builder->add(result(), addedEffect.release());
 
     return true;
index 1d3e30f..72584d3 100644 (file)
@@ -24,7 +24,6 @@
 #define SVGFECompositeElement_h
 
 #if ENABLE(SVG) && ENABLE(SVG_FILTERS)
-#include "FilterBuilder.h"
 #include "FEComposite.h"
 #include "SVGFilterPrimitiveStandardAttributes.h"
 
index bb57d0d..df47733 100644 (file)
@@ -75,35 +75,33 @@ void SVGFEDiffuseLightingElement::parseMappedAttribute(MappedAttribute *attr)
 
 SVGFilterEffect* SVGFEDiffuseLightingElement::filterEffect(SVGResourceFilter* filter) const
 {
-    if (!m_filterEffect) 
-        m_filterEffect = SVGFEDiffuseLighting::create(filter);
-
-    m_filterEffect->setIn(in1());
-    m_filterEffect->setDiffuseConstant(diffuseConstant());
-    m_filterEffect->setSurfaceScale(surfaceScale());
-    m_filterEffect->setKernelUnitLengthX(kernelUnitLengthX());
-    m_filterEffect->setKernelUnitLengthY(kernelUnitLengthY());
-
-    SVGFEDiffuseLightingElement* nonConstThis = const_cast<SVGFEDiffuseLightingElement*>(this);
+    ASSERT_NOT_REACHED();
+    return 0;
+}
 
-    RenderStyle* parentStyle = nonConstThis->styleForRenderer(parent()->renderer());
-    RenderStyle* filterStyle = nonConstThis->resolveStyle(parentStyle);
+bool SVGFEDiffuseLightingElement::build(FilterBuilder* builder)
+{
+    FilterEffect* input1 = builder->getEffectById(in1());
+    
+    if(!input1)
+        return false;
+    
+    RenderStyle* parentStyle = this->styleForRenderer(parent()->renderer());
+    RenderStyle* filterStyle = this->resolveStyle(parentStyle);
+    Color color = filterStyle->svgStyle()->lightingColor();
     
-    m_filterEffect->setLightingColor(filterStyle->svgStyle()->lightingColor());
-    setStandardAttributes(m_filterEffect.get());
     parentStyle->deref(document()->renderArena());
     filterStyle->deref(document()->renderArena());
     
-    updateLights();
-    return m_filterEffect.get();
+    RefPtr<FilterEffect> addedEffect = FEDiffuseLighting::create(input1, color, surfaceScale(), diffuseConstant(), 
+                                            kernelUnitLengthX(), kernelUnitLengthY(), findLights());
+    builder->add(result(), addedEffect.release());
+    
+    return true;
 }
 
-void SVGFEDiffuseLightingElement::updateLights() const
+LightSource* SVGFEDiffuseLightingElement::findLights() const
 {
-    if (!m_filterEffect)
-        return;
-    
     LightSource* light = 0;
     for (Node* n = firstChild(); n; n = n->nextSibling()) {
         if (n->hasTagName(SVGNames::feDistantLightTag) ||
@@ -115,7 +113,7 @@ void SVGFEDiffuseLightingElement::updateLights() const
         }
     }
 
-    m_filterEffect->setLightSource(light);
+    return light;
 }
 
 }
index bfc3521..4655da9 100644 (file)
 #define SVGFEDiffuseLightingElement_h
 
 #if ENABLE(SVG) && ENABLE(SVG_FILTERS)
+#include "SVGFELightElement.h"
 #include "SVGFilterPrimitiveStandardAttributes.h"
 
 namespace WebCore {
-    class SVGFEDiffuseLighting;
+    class FEDiffuseLighting;
     class SVGColor;
 
     class SVGFEDiffuseLightingElement : public SVGFilterPrimitiveStandardAttributes
@@ -37,6 +38,7 @@ namespace WebCore {
 
         virtual void parseMappedAttribute(MappedAttribute*);
         virtual SVGFilterEffect* filterEffect(SVGResourceFilter*) const;
+        bool build(FilterBuilder*);
 
     protected:
         virtual const SVGElement* contextElement() const { return this; }
@@ -48,9 +50,9 @@ namespace WebCore {
         ANIMATED_PROPERTY_DECLARATIONS(SVGFEDiffuseLightingElement, float, KernelUnitLengthX, kernelUnitLengthX)
         ANIMATED_PROPERTY_DECLARATIONS(SVGFEDiffuseLightingElement, float, KernelUnitLengthY, kernelUnitLengthY)
 
-        mutable RefPtr<SVGFEDiffuseLighting> m_filterEffect;
+        LightSource* findLights() const;
         
-        void updateLights() const;
+        mutable RefPtr<FEDiffuseLighting> m_filterEffect;
     };
 
 } // namespace WebCore
index 31e9fd9..f698c27 100644 (file)
@@ -29,8 +29,8 @@ namespace WebCore {
 
 SVGFEDisplacementMapElement::SVGFEDisplacementMapElement(const QualifiedName& tagName, Document* doc)
     : SVGFilterPrimitiveStandardAttributes(tagName, doc)
-    , m_xChannelSelector(SVG_CHANNEL_A)
-    , m_yChannelSelector(SVG_CHANNEL_A)
+    , m_xChannelSelector(CHANNEL_A)
+    , m_yChannelSelector(CHANNEL_A)
     , m_scale(0.0f)
     , m_filterEffect(0)
 {
@@ -46,18 +46,18 @@ ANIMATED_PROPERTY_DEFINITIONS(SVGFEDisplacementMapElement, int, XChannelSelector
 ANIMATED_PROPERTY_DEFINITIONS(SVGFEDisplacementMapElement, int, YChannelSelector, yChannelSelector, SVGNames::yChannelSelectorAttr)
 ANIMATED_PROPERTY_DEFINITIONS(SVGFEDisplacementMapElement, float, Scale, scale, SVGNames::scaleAttr)
 
-SVGChannelSelectorType SVGFEDisplacementMapElement::stringToChannel(const String& key)
+ChannelSelectorType SVGFEDisplacementMapElement::stringToChannel(const String& key)
 {
     if (key == "R")
-        return SVG_CHANNEL_R;
+        return CHANNEL_R;
     else if (key == "G")
-        return SVG_CHANNEL_G;
+        return CHANNEL_G;
     else if (key == "B")
-        return SVG_CHANNEL_B;
+        return CHANNEL_B;
     else if (key == "A")
-        return SVG_CHANNEL_A;
+        return CHANNEL_A;
 
-    return SVG_CHANNEL_UNKNOWN;
+    return CHANNEL_UNKNOWN;
 }
 
 void SVGFEDisplacementMapElement::parseMappedAttribute(MappedAttribute* attr)
@@ -77,19 +77,26 @@ void SVGFEDisplacementMapElement::parseMappedAttribute(MappedAttribute* attr)
         SVGFilterPrimitiveStandardAttributes::parseMappedAttribute(attr);
 }
 
-SVGFEDisplacementMap* SVGFEDisplacementMapElement::filterEffect(SVGResourceFilter* filter) const
+SVGFilterEffect* SVGFEDisplacementMapElement::filterEffect(SVGResourceFilter* filter) const
 {
-    if (!m_filterEffect)
-        m_filterEffect = SVGFEDisplacementMap::create(filter);
-
-    m_filterEffect->setXChannelSelector((SVGChannelSelectorType) xChannelSelector());
-    m_filterEffect->setYChannelSelector((SVGChannelSelectorType) yChannelSelector());
-    m_filterEffect->setIn(in1());
-    m_filterEffect->setIn2(in2());
-    m_filterEffect->setScale(scale());
+    ASSERT_NOT_REACHED();
+    return 0;
+}
 
-    setStandardAttributes(m_filterEffect.get());
-    return m_filterEffect.get();
+bool SVGFEDisplacementMapElement::build(FilterBuilder* builder)
+{
+    FilterEffect* input1 = builder->getEffectById(in1());
+    FilterEffect* input2 = builder->getEffectById(in2());
+    
+    if(!input1 || !input2)
+        return false;
+        
+    
+    RefPtr<FilterEffect> addedEffect = FEDisplacementMap::create(input1, input2, static_cast<ChannelSelectorType> (xChannelSelector()), 
+                                        static_cast<ChannelSelectorType> (yChannelSelector()), scale());
+    builder->add(result(), addedEffect.release());
+    
+    return true;
 }
 
 }
index 78af6b5..1035e66 100644 (file)
@@ -31,10 +31,11 @@ namespace WebCore {
         SVGFEDisplacementMapElement(const QualifiedName& tagName, Document*);
         virtual ~SVGFEDisplacementMapElement();
         
-        static SVGChannelSelectorType stringToChannel(const String&);
+        static ChannelSelectorType stringToChannel(const String&);
         
         virtual void parseMappedAttribute(MappedAttribute*);
-        virtual SVGFEDisplacementMap* filterEffect(SVGResourceFilter*) const;
+        virtual SVGFilterEffect* filterEffect(SVGResourceFilter*) const;
+        bool build(FilterBuilder*);
         
     protected:
         virtual const SVGElement* contextElement() const { return this; }
@@ -46,7 +47,7 @@ namespace WebCore {
         ANIMATED_PROPERTY_DECLARATIONS(SVGFEDisplacementMapElement, int, YChannelSelector, yChannelSelector)
         ANIMATED_PROPERTY_DECLARATIONS(SVGFEDisplacementMapElement, float, Scale, scale)
 
-        mutable RefPtr<SVGFEDisplacementMap> m_filterEffect;
+        mutable RefPtr<FEDisplacementMap> m_filterEffect;
     };
 
 } // namespace WebCore
index 07de8c5..47b8844 100644 (file)
@@ -48,25 +48,26 @@ void SVGFEFloodElement::parseMappedAttribute(MappedAttribute* attr)
     SVGFilterPrimitiveStandardAttributes::parseMappedAttribute(attr);
 }
 
-SVGFEFlood* SVGFEFloodElement::filterEffect(SVGResourceFilter* filter) const
+SVGFilterEffect* SVGFEFloodElement::filterEffect(SVGResourceFilter* filter) const
 {
-    if (!m_filterEffect)
-        m_filterEffect = SVGFEFlood::create(filter);
-    
-    setStandardAttributes(m_filterEffect.get());
+    ASSERT_NOT_REACHED();
+    return 0;
+}
 
-    SVGFEFloodElement* nonConstThis = const_cast<SVGFEFloodElement*>(this);
+bool SVGFEFloodElement::build(FilterBuilder* builder)
+{
+    RenderStyle* parentStyle = this->styleForRenderer(parent()->renderer());
+    RenderStyle* filterStyle = this->resolveStyle(parentStyle);
+
+    Color color = filterStyle->svgStyle()->floodColor();
+    float opacity = filterStyle->svgStyle()->floodOpacity();
 
-    RenderStyle* parentStyle = nonConstThis->styleForRenderer(parent()->renderer());
-    RenderStyle* filterStyle = nonConstThis->resolveStyle(parentStyle);
-    
-    m_filterEffect->setFloodColor(filterStyle->svgStyle()->floodColor());
-    m_filterEffect->setFloodOpacity(filterStyle->svgStyle()->floodOpacity());
-    
     parentStyle->deref(document()->renderArena());
     filterStyle->deref(document()->renderArena());
+
+    builder->add(result(), FEFlood::create(color, opacity));
     
-    return m_filterEffect.get();
+    return true;
 }
 
 }
index af4e982..c69324e 100644 (file)
@@ -36,13 +36,14 @@ namespace WebCore
         virtual ~SVGFEFloodElement();
 
         virtual void parseMappedAttribute(MappedAttribute*);
-        virtual SVGFEFlood* filterEffect(SVGResourceFilter*) const;
+        virtual SVGFilterEffect* filterEffect(SVGResourceFilter*) const;
+        bool build(FilterBuilder*);
 
     protected:
         virtual const SVGElement* contextElement() const { return this; }
 
     private:
-        mutable RefPtr<SVGFEFlood> m_filterEffect;
+        mutable RefPtr<FEFlood> m_filterEffect;
     };
 
 } // namespace WebCore
index 42a6754..8e35032 100644 (file)
@@ -66,17 +66,22 @@ void SVGFEGaussianBlurElement::parseMappedAttribute(MappedAttribute* attr)
         SVGFilterPrimitiveStandardAttributes::parseMappedAttribute(attr);
 }
 
-SVGFEGaussianBlur* SVGFEGaussianBlurElement::filterEffect(SVGResourceFilter* filter) const
+SVGFilterEffect* SVGFEGaussianBlurElement::filterEffect(SVGResourceFilter* filter) const
 {
-    if (!m_filterEffect)
-        m_filterEffect = SVGFEGaussianBlur::create(filter);
-    
-    m_filterEffect->setIn(in1());
-    m_filterEffect->setStdDeviationX(stdDeviationX());
-    m_filterEffect->setStdDeviationY(stdDeviationY());
-
-    setStandardAttributes(m_filterEffect.get()); 
-    return m_filterEffect.get();
+    ASSERT_NOT_REACHED();
+    return 0;
+}
+
+bool SVGFEGaussianBlurElement::build(FilterBuilder* builder)
+{
+    FilterEffect* input1 = builder->getEffectById(in1());
+
+    if(!input1)
+        return false;
+
+    builder->add(result(), FEGaussianBlur::create(input1, stdDeviationX(), stdDeviationY()));
+
+    return true;
 }
 
 }
index ce41b92..8752a43 100644 (file)
@@ -39,7 +39,8 @@ namespace WebCore
         void setStdDeviation(float stdDeviationX, float stdDeviationY);
 
         virtual void parseMappedAttribute(MappedAttribute*);
-        virtual SVGFEGaussianBlur* filterEffect(SVGResourceFilter*) const;
+        virtual SVGFilterEffect* filterEffect(SVGResourceFilter*) const;
+        bool build(FilterBuilder*);
 
     protected:
         virtual const SVGElement* contextElement() const { return this; }
@@ -49,7 +50,7 @@ namespace WebCore
         ANIMATED_PROPERTY_DECLARATIONS(SVGFEGaussianBlurElement, float, StdDeviationX, stdDeviationX)
         ANIMATED_PROPERTY_DECLARATIONS(SVGFEGaussianBlurElement, float, StdDeviationY, stdDeviationY)
 
-        mutable RefPtr<SVGFEGaussianBlur> m_filterEffect;
+        mutable RefPtr<FEGaussianBlur> m_filterEffect;
     };
 
 } // namespace WebCore
index 3b219c8..b1e1c29 100644 (file)
@@ -89,17 +89,20 @@ void SVGFEImageElement::notifyFinished(CachedResource* finishedObj)
         m_filterEffect->setCachedImage(m_cachedImage);
 }
 
-SVGFEImage* SVGFEImageElement::filterEffect(SVGResourceFilter* filter) const
+SVGFilterEffect* SVGFEImageElement::filterEffect(SVGResourceFilter* filter) const
 {
-    if (!m_filterEffect)
-        m_filterEffect = SVGFEImage::create(filter);
-    
-    // The resource may already be loaded!
-    if (m_cachedImage)
-        m_filterEffect->setCachedImage(m_cachedImage);
+    ASSERT_NOT_REACHED();
+    return 0;
+}
+
+bool SVGFEImageElement::build(FilterBuilder* builder)
+{
+    if(!m_cachedImage)
+        return false;
+
+    builder->add(result(), FEImage::create(m_cachedImage));
 
-    setStandardAttributes(m_filterEffect.get());
-    return m_filterEffect.get();
+    return true;
 }
 
 void SVGFEImageElement::getSubresourceAttributeStrings(Vector<String>& urls) const
index 85c9c90..d6a4307 100644 (file)
@@ -47,9 +47,10 @@ namespace WebCore {
         virtual void notifyFinished(CachedResource*);
 
         virtual void getSubresourceAttributeStrings(Vector<String>&) const;
+        bool build(FilterBuilder*);
 
     protected:
-        virtual SVGFEImage* filterEffect(SVGResourceFilter*) const;
+        virtual SVGFilterEffect* filterEffect(SVGResourceFilter*) const;
 
     protected:
         virtual const SVGElement* contextElement() const { return this; }
@@ -61,7 +62,7 @@ namespace WebCore {
         ANIMATED_PROPERTY_DECLARATIONS_REFCOUNTED(SVGFEImageElement, SVGPreserveAspectRatio, PreserveAspectRatio, preserveAspectRatio)
 
         CachedImage* m_cachedImage;
-        mutable RefPtr<SVGFEImage> m_filterEffect;
+        mutable RefPtr<FEImage> m_filterEffect;
     };
 
 } // namespace WebCore
index 447b727..5ccf403 100644 (file)
@@ -40,21 +40,28 @@ SVGFEMergeElement::~SVGFEMergeElement()
 {
 }
 
-SVGFEMerge* SVGFEMergeElement::filterEffect(SVGResourceFilter* filter) const
+SVGFilterEffect* SVGFEMergeElement::filterEffect(SVGResourceFilter* filter) const
 {
-    if (!m_filterEffect)
-        m_filterEffect = SVGFEMerge::create(filter);
-        
-    setStandardAttributes(m_filterEffect.get());
+    ASSERT_NOT_REACHED();
+    return 0;
+}
 
-    Vector<String> mergeInputs;
+bool SVGFEMergeElement::build(FilterBuilder* builder)
+{
+    Vector<FilterEffect*> mergeInputs;
     for (Node* n = firstChild(); n != 0; n = n->nextSibling()) {
-        if (n->hasTagName(SVGNames::feMergeNodeTag))
-            mergeInputs.append(static_cast<SVGFEMergeNodeElement*>(n)->in1());
+        if (n->hasTagName(SVGNames::feMergeNodeTag)) {
+            FilterEffect* mergeEffect = builder->getEffectById(static_cast<SVGFEMergeNodeElement*>(n)->in1());
+            mergeInputs.append(mergeEffect);
+        }
     }
 
-    m_filterEffect->setMergeInputs(mergeInputs);
-    return m_filterEffect.get();
+    if(mergeInputs.isEmpty())
+        return false;
+
+    builder->add(result(), FEMerge::create(mergeInputs));
+
+    return true;
 }
 
 }
index eefedee..6b217e9 100644 (file)
@@ -35,13 +35,14 @@ namespace WebCore
         SVGFEMergeElement(const QualifiedName&, Document*);
         virtual ~SVGFEMergeElement();
 
-        virtual SVGFEMerge* filterEffect(SVGResourceFilter*) const;
+        virtual SVGFilterEffect* filterEffect(SVGResourceFilter*) const;
+        bool build(FilterBuilder*);
 
     protected:
         virtual const SVGElement* contextElement() const { return this; }
 
     private:
-        mutable RefPtr<SVGFEMerge> m_filterEffect;
+        mutable RefPtr<FEMerge> m_filterEffect;
     };
 
 } // namespace WebCore
index 92d64cc..ea20f0e 100644 (file)
@@ -59,17 +59,22 @@ void SVGFEOffsetElement::parseMappedAttribute(MappedAttribute* attr)
         SVGFilterPrimitiveStandardAttributes::parseMappedAttribute(attr);
 }
 
-SVGFEOffset* SVGFEOffsetElement::filterEffect(SVGResourceFilter* filter) const
+SVGFilterEffect* SVGFEOffsetElement::filterEffect(SVGResourceFilter* filter) const
 {
-    if (!m_filterEffect)
-        m_filterEffect = SVGFEOffset::create(filter);
-    
-    m_filterEffect->setIn(in1());
-    m_filterEffect->setDx(dx());
-    m_filterEffect->setDy(dy());
-
-    setStandardAttributes(m_filterEffect.get()); 
-    return m_filterEffect.get();
+    ASSERT_NOT_REACHED();
+    return 0;
+}
+
+bool SVGFEOffsetElement::build(FilterBuilder* builder)
+{
+    FilterEffect* input1 = builder->getEffectById(in1());
+
+    if(!input1)
+        return false;
+
+    builder->add(result(), FEOffset::create(input1, dx(), dy()));
+
+    return true;
 }
 
 }
index e70f92d..c4accf4 100644 (file)
@@ -37,7 +37,8 @@ namespace WebCore
         virtual ~SVGFEOffsetElement();
 
         virtual void parseMappedAttribute(MappedAttribute*);
-        virtual SVGFEOffset* filterEffect(SVGResourceFilter*) const;
+        virtual SVGFilterEffect* filterEffect(SVGResourceFilter*) const;
+        bool build(FilterBuilder*);
 
     protected:
         virtual const SVGElement* contextElement() const { return this; }
@@ -47,7 +48,7 @@ namespace WebCore
         ANIMATED_PROPERTY_DECLARATIONS(SVGFEOffsetElement, float, Dx, dx)
         ANIMATED_PROPERTY_DECLARATIONS(SVGFEOffsetElement, float, Dy, dy)
 
-        mutable RefPtr<SVGFEOffset> m_filterEffect;
+        mutable RefPtr<FEOffset> m_filterEffect;
     };
 
 } // namespace WebCore
index cf2b903..8fba0b4 100644 (file)
@@ -76,42 +76,17 @@ void SVGFESpecularLightingElement::parseMappedAttribute(MappedAttribute* attr)
         SVGFilterPrimitiveStandardAttributes::parseMappedAttribute(attr);
 }
 
-SVGFESpecularLighting* SVGFESpecularLightingElement::filterEffect(SVGResourceFilter* filter) const
+SVGFilterEffect* SVGFESpecularLightingElement::filterEffect(SVGResourceFilter* filter) const
 {
-    if (!m_filterEffect) 
-        m_filterEffect = SVGFESpecularLighting::create(filter);
-
-    m_filterEffect->setIn(in1());
-    m_filterEffect->setSpecularConstant((specularConstant()));
-    m_filterEffect->setSpecularExponent((specularExponent()));
-    m_filterEffect->setSurfaceScale((surfaceScale()));
-    m_filterEffect->setKernelUnitLengthX((kernelUnitLengthX()));
-    m_filterEffect->setKernelUnitLengthY((kernelUnitLengthY()));
-
-    SVGFESpecularLightingElement* nonConstThis = const_cast<SVGFESpecularLightingElement*>(this);
-
-    RenderStyle* parentStyle = nonConstThis->styleForRenderer(parent()->renderer());    
-    RenderStyle* filterStyle = nonConstThis->resolveStyle(parentStyle);
-    
-    m_filterEffect->setLightingColor(filterStyle->svgStyle()->lightingColor());
-    
-    parentStyle->deref(document()->renderArena());
-    filterStyle->deref(document()->renderArena());
-
-    setStandardAttributes(m_filterEffect.get());
-
-    updateLights();
-    return m_filterEffect.get();
+    ASSERT_NOT_REACHED();
+    return 0;
 }
 
-void SVGFESpecularLightingElement::updateLights() const
+LightSource* SVGFESpecularLightingElement::findLights() const
 {
-    if (!m_filterEffect)
-        return;
-
-    LightSource* light = 0;    
+    LightSource* light = 0;
     for (Node* n = firstChild(); n; n = n->nextSibling()) {
-        if (n->hasTagName(SVGNames::feDistantLightTag) || 
+        if (n->hasTagName(SVGNames::feDistantLightTag) ||
             n->hasTagName(SVGNames::fePointLightTag) ||
             n->hasTagName(SVGNames::feSpotLightTag)) {
             SVGFELightElement* lightNode = static_cast<SVGFELightElement*>(n); 
@@ -120,7 +95,29 @@ void SVGFESpecularLightingElement::updateLights() const
         }
     }
 
-    m_filterEffect->setLightSource(light);
+    return light;
+}
+
+bool SVGFESpecularLightingElement::build(FilterBuilder* builder)
+{
+    FilterEffect* input1 = builder->getEffectById(in1());
+    
+    if(!input1)
+        return false;
+        
+    RenderStyle* parentStyle = this->styleForRenderer(parent()->renderer());    
+    RenderStyle* filterStyle = this->resolveStyle(parentStyle);
+    
+    Color color = filterStyle->svgStyle()->lightingColor();
+    
+    parentStyle->deref(document()->renderArena());
+    filterStyle->deref(document()->renderArena());
+    
+    RefPtr<FilterEffect> addedEffect = FESpecularLighting::create(input1, color, surfaceScale(), specularConstant(), 
+                                        specularExponent(), kernelUnitLengthX(), kernelUnitLengthY(), findLights());
+    builder->add(result(), addedEffect.release());
+
+    return true;
 }
 
 }
index 83bb0ee..a2fab0e 100644 (file)
@@ -37,7 +37,8 @@ namespace WebCore
         virtual ~SVGFESpecularLightingElement();
         
         virtual void parseMappedAttribute(MappedAttribute*);
-        virtual SVGFESpecularLighting* filterEffect(SVGResourceFilter*) const;
+        virtual SVGFilterEffect* filterEffect(SVGResourceFilter*) const;
+        bool build(FilterBuilder*);
 
     protected:
         virtual const SVGElement* contextElement() const { return this; }
@@ -50,9 +51,9 @@ namespace WebCore
         ANIMATED_PROPERTY_DECLARATIONS(SVGFESpecularLightingElement, float, KernelUnitLengthX, kernelUnitLengthX)
         ANIMATED_PROPERTY_DECLARATIONS(SVGFESpecularLightingElement, float, KernelUnitLengthY, kernelUnitLengthY)
 
-        mutable RefPtr<SVGFESpecularLighting> m_filterEffect;
+        mutable RefPtr<FESpecularLighting> m_filterEffect;
         
-        void updateLights() const;
+        LightSource* findLights() const;
     };
 
 } // namespace WebCore
index 23e65a0..63ecb52 100644 (file)
@@ -52,15 +52,22 @@ void SVGFETileElement::parseMappedAttribute(MappedAttribute* attr)
         SVGFilterPrimitiveStandardAttributes::parseMappedAttribute(attr);
 }
 
-SVGFETile* SVGFETileElement::filterEffect(SVGResourceFilter* filter) const
+SVGFilterEffect* SVGFETileElement::filterEffect(SVGResourceFilter* filter) const
 {
-    if (!m_filterEffect)
-        m_filterEffect = SVGFETile::create(filter);
+   ASSERT_NOT_REACHED();
+   return 0;
+}
+
+bool SVGFETileElement::build(FilterBuilder* builder)
+{
+    FilterEffect* input1 = builder->getEffectById(in1());
 
-    m_filterEffect->setIn(in1());
+    if(!input1)
+        return false;
 
-    setStandardAttributes(m_filterEffect.get());
-    return m_filterEffect.get();
+    builder->add(result(), FETile::create(input1));
+    
+    return true;
 }
 
 }
index 9359189..5010e8a 100644 (file)
@@ -36,7 +36,8 @@ namespace WebCore
         virtual ~SVGFETileElement();
 
         virtual void parseMappedAttribute(MappedAttribute*);
-        virtual SVGFETile* filterEffect(SVGResourceFilter*) const;
+        virtual SVGFilterEffect* filterEffect(SVGResourceFilter*) const;
+        bool build(FilterBuilder*);
 
     protected:
         virtual const SVGElement* contextElement() const { return this; }
@@ -44,7 +45,7 @@ namespace WebCore
     private:
         ANIMATED_PROPERTY_DECLARATIONS(SVGFETileElement, String, In1, in1)
 
-        mutable RefPtr<SVGFETile> m_filterEffect;
+        mutable RefPtr<FETile> m_filterEffect;
     };
 
 } // namespace WebCore
index 989c31f..da3fc63 100644 (file)
@@ -37,7 +37,7 @@ SVGFETurbulenceElement::SVGFETurbulenceElement(const QualifiedName& tagName, Doc
     , m_numOctaves(1)
     , m_seed(0.0f)
     , m_stitchTiles(SVG_STITCHTYPE_NOSTITCH)
-    , m_type(SVG_TURBULENCE_TYPE_TURBULENCE)
+    , m_type(FETURBULENCE_TYPE_TURBULENCE)
     , m_filterEffect(0)
 {
 }
@@ -58,9 +58,9 @@ void SVGFETurbulenceElement::parseMappedAttribute(MappedAttribute* attr)
     const String& value = attr->value();
     if (attr->name() == SVGNames::typeAttr) {
         if (value == "fractalNoise")
-            setTypeBaseValue(SVG_TURBULENCE_TYPE_FRACTALNOISE);
+            setTypeBaseValue(FETURBULENCE_TYPE_FRACTALNOISE);
         else if (value == "turbulence")
-            setTypeBaseValue(SVG_TURBULENCE_TYPE_TURBULENCE);
+            setTypeBaseValue(FETURBULENCE_TYPE_TURBULENCE);
     } else if (attr->name() == SVGNames::stitchTilesAttr) {
         if (value == "stitch")
             setStitchTilesBaseValue(SVG_STITCHTYPE_STITCH);
@@ -80,21 +80,19 @@ void SVGFETurbulenceElement::parseMappedAttribute(MappedAttribute* attr)
         SVGFilterPrimitiveStandardAttributes::parseMappedAttribute(attr);
 }
 
-SVGFETurbulence* SVGFETurbulenceElement::filterEffect(SVGResourceFilter* filter) const
+SVGFilterEffect* SVGFETurbulenceElement::filterEffect(SVGResourceFilter* filter) const
 {
-    
-    if (!m_filterEffect)
-        m_filterEffect = SVGFETurbulence::create(filter);
-    
-    m_filterEffect->setType((SVGTurbulanceType) type());
-    m_filterEffect->setBaseFrequencyX(baseFrequencyX());
-    m_filterEffect->setBaseFrequencyY(baseFrequencyY());
-    m_filterEffect->setNumOctaves(numOctaves());
-    m_filterEffect->setSeed(seed());
-    m_filterEffect->setStitchTiles(stitchTiles() == SVG_STITCHTYPE_STITCH);
-
-    setStandardAttributes(m_filterEffect.get()); 
-    return m_filterEffect.get();
+    ASSERT_NOT_REACHED();
+    return 0;
+}
+
+bool SVGFETurbulenceElement::build(FilterBuilder* builder)
+{
+    RefPtr<FilterEffect> addedEffect = FETurbulence::create(static_cast<TurbulanceType> (type()), baseFrequencyX(), 
+                                        baseFrequencyY(), numOctaves(), seed(), stitchTiles() == SVG_STITCHTYPE_STITCH);
+    builder->add(result(), addedEffect.release());
+
+    return true;
 }
 
 }
index 3dc23c1..02fcb40 100644 (file)
@@ -42,7 +42,8 @@ namespace WebCore
         virtual ~SVGFETurbulenceElement();
 
         virtual void parseMappedAttribute(MappedAttribute*);
-        virtual SVGFETurbulence* filterEffect(SVGResourceFilter*) const;
+        virtual SVGFilterEffect* filterEffect(SVGResourceFilter*) const;
+        bool build(FilterBuilder*);
 
     protected:
         virtual const SVGElement* contextElement() const { return this; }
@@ -55,7 +56,7 @@ namespace WebCore
         ANIMATED_PROPERTY_DECLARATIONS(SVGFETurbulenceElement, int, StitchTiles, stitchTiles)
         ANIMATED_PROPERTY_DECLARATIONS(SVGFETurbulenceElement, int, Type, type)
 
-        mutable RefPtr<SVGFETurbulence> m_filterEffect;
+        mutable RefPtr<FETurbulence> m_filterEffect;
     };
 
 } // namespace WebCore
index ecdb3b5..90f4236 100644 (file)
@@ -24,6 +24,7 @@
 #define SVGFilterPrimitiveStandardAttributes_h
 
 #if ENABLE(SVG)
+#include "FilterBuilder.h"
 #include "SVGStyledElement.h"
 
 namespace WebCore {
index 0d526f7..4b82e5a 100644 (file)
 #include "config.h"
 
 #if ENABLE(SVG) && ENABLE(SVG_FILTERS)
-#include "SVGRenderTreeAsText.h"
 #include "SVGFEConvolveMatrix.h"
+#include "SVGRenderTreeAsText.h"
 
 namespace WebCore {
 
-SVGFEConvolveMatrix::SVGFEConvolveMatrix(SVGResourceFilter* filter)
-    : SVGFilterEffect(filter)
-    , m_kernelSize()
-    , m_divisor(0.0f)
-    , m_bias(0.0f)
-    , m_targetOffset()
-    , m_edgeMode(SVG_EDGEMODE_UNKNOWN)
-    , m_kernelUnitLength()
-    , m_preserveAlpha(false)
+FEConvolveMatrix::FEConvolveMatrix(FilterEffect* in, FilterEffect* in2, const FloatSize& kernelSize, 
+    const float& divisor, const float& bias, const FloatSize& targetOffset, EdgeModeType edgeMode,
+    const FloatPoint& kernelUnitLength, bool preserveAlpha, const Vector<float>& kernelMatrix)
+    : FilterEffect()
+    , m_in(in)
+    , m_in2(in2)
+    , m_kernelSize(kernelSize)
+    , m_divisor(divisor)
+    , m_bias(bias)
+    , m_targetOffset(targetOffset)
+    , m_edgeMode(edgeMode)
+    , m_kernelUnitLength(kernelUnitLength)
+    , m_preserveAlpha(preserveAlpha)
+    , m_kernelMatrix(kernelMatrix)
 {
 }
 
-PassRefPtr<SVGFEConvolveMatrix> SVGFEConvolveMatrix::create(SVGResourceFilter* filter)
+PassRefPtr<FEConvolveMatrix> FEConvolveMatrix::create(FilterEffect* in, FilterEffect* in2, const FloatSize& kernelSize, 
+    const float& divisor, const float& bias, const FloatSize& targetOffset, EdgeModeType edgeMode, 
+    const FloatPoint& kernelUnitLength, bool preserveAlpha, const Vector<float>& kernelMatrix)
 {
-    return adoptRef(new SVGFEConvolveMatrix(filter));
+    return adoptRef(new FEConvolveMatrix(in, in2, kernelSize, divisor, bias, targetOffset, edgeMode, kernelUnitLength,
+        preserveAlpha, kernelMatrix));
 }
 
-FloatSize SVGFEConvolveMatrix::kernelSize() const
+
+FloatSize FEConvolveMatrix::kernelSize() const
 {
     return m_kernelSize;
 }
 
-void SVGFEConvolveMatrix::setKernelSize(FloatSize kernelSize)
+void FEConvolveMatrix::setKernelSize(FloatSize kernelSize)
 {
     m_kernelSize = kernelSize; 
 }
 
-const Vector<float>& SVGFEConvolveMatrix::kernel() const
+const Vector<float>& FEConvolveMatrix::kernel() const
 {
     return m_kernelMatrix; 
 }
 
-void SVGFEConvolveMatrix::setKernel(const Vector<float>& kernel)
+void FEConvolveMatrix::setKernel(const Vector<float>& kernel)
 {
     m_kernelMatrix = kernel; 
 }
 
-float SVGFEConvolveMatrix::divisor() const
+float FEConvolveMatrix::divisor() const
 {
     return m_divisor; 
 }
 
-void SVGFEConvolveMatrix::setDivisor(float divisor)
+void FEConvolveMatrix::setDivisor(float divisor)
 {
     m_divisor = divisor; 
 }
 
-float SVGFEConvolveMatrix::bias() const
+float FEConvolveMatrix::bias() const
 {
     return m_bias; 
 }
 
-void SVGFEConvolveMatrix::setBias(float bias)
+void FEConvolveMatrix::setBias(float bias)
 {
     m_bias = bias; 
 }
 
-FloatSize SVGFEConvolveMatrix::targetOffset() const
+FloatSize FEConvolveMatrix::targetOffset() const
 {
     return m_targetOffset; 
 }
 
-void SVGFEConvolveMatrix::setTargetOffset(FloatSize targetOffset)
+void FEConvolveMatrix::setTargetOffset(FloatSize targetOffset)
 {
     m_targetOffset = targetOffset; 
 }
 
-SVGEdgeModeType SVGFEConvolveMatrix::edgeMode() const
+EdgeModeType FEConvolveMatrix::edgeMode() const
 {
     return m_edgeMode; 
 }
 
-void SVGFEConvolveMatrix::setEdgeMode(SVGEdgeModeType edgeMode)
+void FEConvolveMatrix::setEdgeMode(EdgeModeType edgeMode)
 {
     m_edgeMode = edgeMode; 
 }
 
-FloatPoint SVGFEConvolveMatrix::kernelUnitLength() const
+FloatPoint FEConvolveMatrix::kernelUnitLength() const
 {
     return m_kernelUnitLength; 
 }
 
-void SVGFEConvolveMatrix::setKernelUnitLength(FloatPoint kernelUnitLength)
+void FEConvolveMatrix::setKernelUnitLength(FloatPoint kernelUnitLength)
 {
     m_kernelUnitLength = kernelUnitLength; 
 }
 
-bool SVGFEConvolveMatrix::preserveAlpha() const
+bool FEConvolveMatrix::preserveAlpha() const
 {
     return m_preserveAlpha; 
 }
 
-void SVGFEConvolveMatrix::setPreserveAlpha(bool preserveAlpha)
+void FEConvolveMatrix::setPreserveAlpha(bool preserveAlpha)
 {
     m_preserveAlpha = preserveAlpha; 
 }
 
-static TextStream& operator<<(TextStream& ts, SVGEdgeModeType t)
+void FEConvolveMatrix::apply()
+{
+}
+
+void FEConvolveMatrix::dump()
+{
+}
+
+static TextStream& operator<<(TextStream& ts, EdgeModeType t)
 {
     switch (t)
     {
-        case SVG_EDGEMODE_UNKNOWN:
+        case EDGEMODE_UNKNOWN:
             ts << "UNKNOWN";break;
-        case SVG_EDGEMODE_DUPLICATE:
+        case EDGEMODE_DUPLICATE:
             ts << "DUPLICATE";break;
-        case SVG_EDGEMODE_WRAP:
+        case EDGEMODE_WRAP:
             ts << "WRAP"; break;
-        case SVG_EDGEMODE_NONE:
+        case EDGEMODE_NONE:
             ts << "NONE"; break;
     }
     return ts;
 }
 
-TextStream& SVGFEConvolveMatrix::externalRepresentation(TextStream& ts) const
+TextStream& FEConvolveMatrix::externalRepresentation(TextStream& ts) const
 {
     ts << "[type=CONVOLVE-MATRIX] ";
-    SVGFilterEffect::externalRepresentation(ts);
+    FilterEffect::externalRepresentation(ts);
     ts << " [order " << m_kernelSize << "]"
-        << " [kernel matrix=" << m_kernelMatrix  << "]"
-        << " [divisor=" << m_divisor << "]"
-        << " [bias=" << m_bias << "]"
-        << " [target " << m_targetOffset << "]"
-        << " [edge mode=" << m_edgeMode << "]"
-        << " [kernel unit length " << m_kernelUnitLength << "]"
-        << " [preserve alpha=" << m_preserveAlpha << "]";
+       << " [kernel matrix=" << m_kernelMatrix  << "]"
+       << " [divisor=" << m_divisor << "]"
+       << " [bias=" << m_bias << "]"
+       << " [target " << m_targetOffset << "]"
+       << " [edge mode=" << m_edgeMode << "]"
+       << " [kernel unit length " << m_kernelUnitLength << "]"
+       << " [preserve alpha=" << m_preserveAlpha << "]";
     return ts;
 }
 
index 75f827e..c3eea2b 100644 (file)
 #define SVGFEConvolveMatrix_h
 
 #if ENABLE(SVG) && ENABLE(SVG_FILTERS)
-#include "SVGFilterEffect.h"
+#include "FilterEffect.h"
+#include "FloatPoint.h"
+#include "FloatSize.h"
 
-namespace WebCore {
-
-enum SVGEdgeModeType {
-    SVG_EDGEMODE_UNKNOWN   = 0,
-    SVG_EDGEMODE_DUPLICATE = 1,
-    SVG_EDGEMODE_WRAP      = 2,
-    SVG_EDGEMODE_NONE      = 3
-};
-
-class SVGFEConvolveMatrix : public SVGFilterEffect {
-public:
-    static PassRefPtr<SVGFEConvolveMatrix> create(SVGResourceFilter*);
-
-    FloatSize kernelSize() const;
-    void setKernelSize(FloatSize);
-
-    const Vector<float>& kernel() const;
-    void setKernel(const Vector<float>&);
-
-    float divisor() const;
-    void setDivisor(float);
-
-    float bias() const;
-    void setBias(float);
+#include <wtf/Vector.h>
 
-    FloatSize targetOffset() const;
-    void setTargetOffset(FloatSize);
-
-    SVGEdgeModeType edgeMode() const;
-    void setEdgeMode(SVGEdgeModeType);
-
-    FloatPoint kernelUnitLength() const;
-    void setKernelUnitLength(FloatPoint);
-
-    bool preserveAlpha() const;
-    void setPreserveAlpha(bool);
-
-    virtual TextStream& externalRepresentation(TextStream&) const;
-
-private:
-    SVGFEConvolveMatrix(SVGResourceFilter*);
+namespace WebCore {
 
-    FloatSize m_kernelSize;
-    float m_divisor;
-    float m_bias;
-    FloatSize m_targetOffset;
-    SVGEdgeModeType m_edgeMode;
-    FloatPoint m_kernelUnitLength;
-    bool m_preserveAlpha;
-    Vector<float> m_kernelMatrix; // maybe should be a real matrix?
-};
+    enum EdgeModeType {
+        EDGEMODE_UNKNOWN   = 0,
+        EDGEMODE_DUPLICATE = 1,
+        EDGEMODE_WRAP      = 2,
+        EDGEMODE_NONE      = 3
+    };
+
+    class FEConvolveMatrix : public FilterEffect {
+    public:
+        static PassRefPtr<FEConvolveMatrix> create(FilterEffect*, FilterEffect*, const FloatSize&, 
+                const float&, const float&, const FloatSize&, EdgeModeType, const FloatPoint&,
+                bool, const Vector<float>&);
+
+        FloatSize kernelSize() const;
+        void setKernelSize(FloatSize);
+
+        const Vector<float>& kernel() const;
+        void setKernel(const Vector<float>&);
+
+        float divisor() const;
+        void setDivisor(float);
+
+        float bias() const;
+        void setBias(float);
+
+        FloatSize targetOffset() const;
+        void setTargetOffset(FloatSize);
+
+        EdgeModeType edgeMode() const;
+        void setEdgeMode(EdgeModeType);
+
+        FloatPoint kernelUnitLength() const;
+        void setKernelUnitLength(FloatPoint);
+
+        bool preserveAlpha() const;
+        void setPreserveAlpha(bool);
+
+        virtual void apply();
+        virtual void dump();
+        TextStream& externalRepresentation(TextStream& ts) const;
+
+    private:
+        FEConvolveMatrix(FilterEffect*, FilterEffect*, const FloatSize&, const float&, const float&,
+                const FloatSize&, EdgeModeType, const FloatPoint&, bool, const Vector<float>&);
+
+        RefPtr<FilterEffect> m_in;
+        RefPtr<FilterEffect> m_in2;
+        FloatSize m_kernelSize;
+        float m_divisor;
+        float m_bias;
+        FloatSize m_targetOffset;
+        EdgeModeType m_edgeMode;
+        FloatPoint m_kernelUnitLength;
+        bool m_preserveAlpha;
+        Vector<float> m_kernelMatrix;
+    };
 
 } // namespace WebCore
 
index 9f71fa9..6399c5e 100644 (file)
 #if ENABLE(SVG) && ENABLE(SVG_FILTERS)
 #include "SVGLightSource.h"
 #include "SVGFEDiffuseLighting.h"
-#include "TextStream.h"
+#include "SVGRenderTreeAsText.h"
 
 namespace WebCore {
 
-SVGFEDiffuseLighting::SVGFEDiffuseLighting(SVGResourceFilter* filter)
-    : SVGFilterEffect(filter)
-    , m_lightingColor()
-    , m_surfaceScale(0.0f)
-    , m_diffuseConstant(0.0f)
-    , m_kernelUnitLengthX(0.0f)
-    , m_kernelUnitLengthY(0.0f)
-    , m_lightSource(0)
+FEDiffuseLighting::FEDiffuseLighting(FilterEffect* in , const Color& lightingColor, const float& surfaceScale,
+    const float& diffuseConstant, const float& kernelUnitLengthX, const float& kernelUnitLengthY, LightSource* lightSource)
+    : FilterEffect()
+    , m_in(in)
+    , m_lightingColor(lightingColor)
+    , m_surfaceScale(surfaceScale)
+    , m_diffuseConstant(diffuseConstant)
+    , m_kernelUnitLengthX(kernelUnitLengthX)
+    , m_kernelUnitLengthY(kernelUnitLengthY)
+    , m_lightSource(lightSource)
 {
 }
 
-PassRefPtr<SVGFEDiffuseLighting> SVGFEDiffuseLighting::create(SVGResourceFilter* filter)
+PassRefPtr<FEDiffuseLighting> FEDiffuseLighting::create(FilterEffect* in , const Color& lightingColor,
+    const float& surfaceScale, const float& diffuseConstant, const float& kernelUnitLengthX,
+    const float& kernelUnitLengthY, LightSource* lightSource)
 {
-    return adoptRef(new SVGFEDiffuseLighting(filter));
+    return adoptRef(new FEDiffuseLighting(in, lightingColor, surfaceScale, diffuseConstant, kernelUnitLengthX, kernelUnitLengthY, lightSource));
 }
 
-SVGFEDiffuseLighting::~SVGFEDiffuseLighting()
+FEDiffuseLighting::~FEDiffuseLighting()
 {
 }
 
-Color SVGFEDiffuseLighting::lightingColor() const
+Color FEDiffuseLighting::lightingColor() const
 {
     return m_lightingColor;
 }
 
-void SVGFEDiffuseLighting::setLightingColor(const Color& lightingColor)
+void FEDiffuseLighting::setLightingColor(const Color& lightingColor)
 {
     m_lightingColor = lightingColor;
 }
 
-float SVGFEDiffuseLighting::surfaceScale() const 
+float FEDiffuseLighting::surfaceScale() const 
 {
     return m_surfaceScale;
 }
 
-void SVGFEDiffuseLighting::setSurfaceScale(float surfaceScale)
+void FEDiffuseLighting::setSurfaceScale(float surfaceScale)
 {
     m_surfaceScale = surfaceScale;
 }
 
-float SVGFEDiffuseLighting::diffuseConstant() const
+float FEDiffuseLighting::diffuseConstant() const
 {
     return m_diffuseConstant;
 }
 
-void SVGFEDiffuseLighting::setDiffuseConstant(float diffuseConstant)
+void FEDiffuseLighting::setDiffuseConstant(float diffuseConstant)
 {
     m_diffuseConstant = diffuseConstant;
 }
 
-float SVGFEDiffuseLighting::kernelUnitLengthX() const
+float FEDiffuseLighting::kernelUnitLengthX() const
 {
     return m_kernelUnitLengthX;
 }
 
-void SVGFEDiffuseLighting::setKernelUnitLengthX(float kernelUnitLengthX)
+void FEDiffuseLighting::setKernelUnitLengthX(float kernelUnitLengthX)
 {
     m_kernelUnitLengthX = kernelUnitLengthX;
 }
 
-float SVGFEDiffuseLighting::kernelUnitLengthY() const
+float FEDiffuseLighting::kernelUnitLengthY() const
 {
     return m_kernelUnitLengthY;
 }
 
-void SVGFEDiffuseLighting::setKernelUnitLengthY(float kernelUnitLengthY)
+void FEDiffuseLighting::setKernelUnitLengthY(float kernelUnitLengthY)
 {
     m_kernelUnitLengthY = kernelUnitLengthY;
 }
 
-const LightSource* SVGFEDiffuseLighting::lightSource() const
+const LightSource* FEDiffuseLighting::lightSource() const
 {
     return m_lightSource.get();
 }
 
-void SVGFEDiffuseLighting::setLightSource(LightSource* lightSource)
+void FEDiffuseLighting::setLightSource(LightSource* lightSource)
 {    
     m_lightSource = lightSource;
 }
 
-TextStream& SVGFEDiffuseLighting::externalRepresentation(TextStream& ts) const
+void FEDiffuseLighting::apply()
+{
+}
+
+void FEDiffuseLighting::dump()
+{
+}
+
+TextStream& FEDiffuseLighting::externalRepresentation(TextStream& ts) const
 {
     ts << "[type=DIFFUSE-LIGHTING] ";
-    SVGFilterEffect::externalRepresentation(ts);
+    FilterEffect::externalRepresentation(ts);
     ts << " [surface scale=" << m_surfaceScale << "]"
         << " [diffuse constant=" << m_diffuseConstant << "]"
         << " [kernel unit length " << m_kernelUnitLengthX << ", " << m_kernelUnitLengthY << "]";
index c487fb8..a817ce2 100644 (file)
 
 #if ENABLE(SVG) && ENABLE(SVG_FILTERS)
 #include "Color.h"
-#include "SVGFilterEffect.h"
+#include "FilterEffect.h"
 
 namespace WebCore {
 
-class LightSource;
+    class LightSource;
 
-class SVGFEDiffuseLighting : public SVGFilterEffect {
-public:
-    static PassRefPtr<SVGFEDiffuseLighting> create(SVGResourceFilter*);
-    virtual ~SVGFEDiffuseLighting();
+    class FEDiffuseLighting : public FilterEffect {
+    public:
+        static PassRefPtr<FEDiffuseLighting> create(FilterEffect*, const Color&, const float&, const float&,
+                const float&, const float&, LightSource*);
+        virtual ~FEDiffuseLighting();
 
-    Color lightingColor() const;
-    void setLightingColor(const Color&);
+        Color lightingColor() const;
+        void setLightingColor(const Color&);
 
-    float surfaceScale() const;
-    void setSurfaceScale(float);
+        float surfaceScale() const;
+        void setSurfaceScale(float);
 
-    float diffuseConstant() const;
-    void setDiffuseConstant(float);
+        float diffuseConstant() const;
+        void setDiffuseConstant(float);
 
-    float kernelUnitLengthX() const;
-    void setKernelUnitLengthX(float);
+        float kernelUnitLengthX() const;
+        void setKernelUnitLengthX(float);
 
-    float kernelUnitLengthY() const;
-    void setKernelUnitLengthY(float);
+        float kernelUnitLengthY() const;
+        void setKernelUnitLengthY(float);
 
-    const LightSource* lightSource() const;
-    void setLightSource(LightSource*);
+        const LightSource* lightSource() const;
+        void setLightSource(LightSource*);
 
-    virtual TextStream& externalRepresentation(TextStream&) const;
+        virtual void apply();
+        virtual void dump();
+        TextStream& externalRepresentation(TextStream& ts) const;
+        
+    private:
+        FEDiffuseLighting(FilterEffect*, const Color&, const float&, const float&,
+                const float&, const float&, LightSource*);
 
-#if PLATFORM(CI)
-    virtual CIFilter* getCIFilter(const FloatRect& bbox) const;
-#endif
-
-private:
-    SVGFEDiffuseLighting(SVGResourceFilter*);
-    
-    Color m_lightingColor;
-    float m_surfaceScale;
-    float m_diffuseConstant;
-    float m_kernelUnitLengthX;
-    float m_kernelUnitLengthY;
-    RefPtr<LightSource> m_lightSource;
-};
+        RefPtr<FilterEffect> m_in;
+        Color m_lightingColor;
+        float m_surfaceScale;
+        float m_diffuseConstant;
+        float m_kernelUnitLengthX;
+        float m_kernelUnitLengthY;
+        RefPtr<LightSource> m_lightSource;
+    };
 
 } // namespace WebCore
 
index ebb23bb..f7996e3 100644 (file)
 #include "config.h"
 
 #if ENABLE(SVG) && ENABLE(SVG_FILTERS)
-#include "SVGRenderTreeAsText.h"
 #include "SVGFEDisplacementMap.h"
+#include "SVGRenderTreeAsText.h"
 
 namespace WebCore {
 
-SVGFEDisplacementMap::SVGFEDisplacementMap(SVGResourceFilter* filter)
-    : SVGFilterEffect(filter)
-    , m_xChannelSelector(SVG_CHANNEL_UNKNOWN)
-    , m_yChannelSelector(SVG_CHANNEL_UNKNOWN)
-    , m_scale(0)
-{
-}
-
-PassRefPtr<SVGFEDisplacementMap> SVGFEDisplacementMap::create(SVGResourceFilter* filter)
-{
-    return adoptRef(new SVGFEDisplacementMap(filter));
-}
-
-String SVGFEDisplacementMap::in2() const
+FEDisplacementMap::FEDisplacementMap(FilterEffect* in, FilterEffect* in2, ChannelSelectorType xChannelSelector,
+    ChannelSelectorType yChannelSelector, const float& scale)
+    : FilterEffect()
+    , m_in(in)
+    , m_in2(in2)
+    , m_xChannelSelector(xChannelSelector)
+    , m_yChannelSelector(yChannelSelector)
+    , m_scale(scale)
 {
-    return m_in2;
 }
 
-void SVGFEDisplacementMap::setIn2(const String &in2)
+PassRefPtr<FEDisplacementMap> FEDisplacementMap::create(FilterEffect* in, FilterEffect* in2,
+    ChannelSelectorType xChannelSelector, ChannelSelectorType yChannelSelector, const float& scale)
 {
-    m_in2 = in2;
+    return adoptRef(new FEDisplacementMap(in, in2, xChannelSelector, yChannelSelector, scale));
 }
 
-SVGChannelSelectorType SVGFEDisplacementMap::xChannelSelector() const
+ChannelSelectorType FEDisplacementMap::xChannelSelector() const
 {
     return m_xChannelSelector;
 }
 
-void SVGFEDisplacementMap::setXChannelSelector(const SVGChannelSelectorType xChannelSelector)
+void FEDisplacementMap::setXChannelSelector(const ChannelSelectorType xChannelSelector)
 {
     m_xChannelSelector = xChannelSelector;
 }
 
-SVGChannelSelectorType SVGFEDisplacementMap::yChannelSelector() const
+ChannelSelectorType FEDisplacementMap::yChannelSelector() const
 {
     return m_yChannelSelector;
 }
 
-void SVGFEDisplacementMap::setYChannelSelector(const SVGChannelSelectorType yChannelSelector)
+void FEDisplacementMap::setYChannelSelector(const ChannelSelectorType yChannelSelector)
 {
     m_yChannelSelector = yChannelSelector;
 }
 
-float SVGFEDisplacementMap::scale() const
+float FEDisplacementMap::scale() const
 {
     return m_scale;
 }
 
-void SVGFEDisplacementMap::setScale(float scale)
+void FEDisplacementMap::setScale(float scale)
 {
     m_scale = scale;
 }
 
-static TextStream& operator<<(TextStream& ts, SVGChannelSelectorType t)
+void FEDisplacementMap::apply()
+{
+}
+
+void FEDisplacementMap::dump()
+{
+}
+
+static TextStream& operator<<(TextStream& ts, ChannelSelectorType t)
 {
     switch (t)
     {
-        case SVG_CHANNEL_UNKNOWN:
+        case CHANNEL_UNKNOWN:
             ts << "UNKNOWN"; break;
-        case SVG_CHANNEL_R:
+        case CHANNEL_R:
             ts << "RED"; break;
-        case SVG_CHANNEL_G:
+        case CHANNEL_G:
             ts << "GREEN"; break;
-        case SVG_CHANNEL_B:
+        case CHANNEL_B:
             ts << "BLUE"; break;
-        case SVG_CHANNEL_A:
+        case CHANNEL_A:
             ts << "ALPHA"; break;
     }
     return ts;
 }
 
-TextStream& SVGFEDisplacementMap::externalRepresentation(TextStream& ts) const
+TextStream& FEDisplacementMap::externalRepresentation(TextStream& ts) const
 {
     ts << "[type=DISPLACEMENT-MAP] ";
-    SVGFilterEffect::externalRepresentation(ts);
-    if (!in2().isEmpty())
-        ts << " [in2=" << in2() << "]";
-    ts << " [scale=" << m_scale << "]"
+    FilterEffect::externalRepresentation(ts);
+    ts << " [in2=" << m_in2.get() << "]"
+        << " [scale=" << m_scale << "]"
         << " [x channel selector=" << m_xChannelSelector << "]"
         << " [y channel selector=" << m_yChannelSelector << "]";
     return ts;
index 038f6ef..0218d57 100644 (file)
 #define SVGFEDisplacementMap_h
 
 #if ENABLE(SVG) && ENABLE(SVG_FILTERS)
-#include "SVGFilterEffect.h"
+#include "PlatformString.h"
+#include "FilterEffect.h"
 
 namespace WebCore {
 
-enum SVGChannelSelectorType {
-    SVG_CHANNEL_UNKNOWN = 0,
-    SVG_CHANNEL_R       = 1,
-    SVG_CHANNEL_G       = 2,
-    SVG_CHANNEL_B       = 3,
-    SVG_CHANNEL_A       = 4
-};
-
-class SVGFEDisplacementMap : public SVGFilterEffect {
-public:
-    static PassRefPtr<SVGFEDisplacementMap> create(SVGResourceFilter*);
-
-    String in2() const;
-    void setIn2(const String&);
-
-    SVGChannelSelectorType xChannelSelector() const;
-    void setXChannelSelector(const SVGChannelSelectorType);
-
-    SVGChannelSelectorType yChannelSelector() const;
-    void setYChannelSelector(const SVGChannelSelectorType);
-
-    float scale() const;
-    void setScale(float scale);
-
-    virtual TextStream& externalRepresentation(TextStream&) const;
-
-#if PLATFORM(CI)
-    virtual CIFilter* getCIFilter(const FloatRect& bbox) const;
-#endif
-
-private:
-    SVGFEDisplacementMap(SVGResourceFilter*);
-
-    SVGChannelSelectorType m_xChannelSelector;
-    SVGChannelSelectorType m_yChannelSelector;
-    float m_scale;
-    String m_in2;
-};
+    enum ChannelSelectorType {
+        CHANNEL_UNKNOWN = 0,
+        CHANNEL_R       = 1,
+        CHANNEL_G       = 2,
+        CHANNEL_B       = 3,
+        CHANNEL_A       = 4
+    };
+    
+    class FEDisplacementMap : public FilterEffect {
+    public:
+        static PassRefPtr<FEDisplacementMap> create(FilterEffect*, FilterEffect*, ChannelSelectorType,
+                ChannelSelectorType, const float&);
+
+        ChannelSelectorType xChannelSelector() const;
+        void setXChannelSelector(const ChannelSelectorType);
+
+        ChannelSelectorType yChannelSelector() const;
+        void setYChannelSelector(const ChannelSelectorType);
+
+        float scale() const;
+        void setScale(float scale);
+
+        virtual void apply();
+        virtual void dump();
+        TextStream& externalRepresentation(TextStream& ts) const;
+
+    private:
+        FEDisplacementMap(FilterEffect*, FilterEffect*, ChannelSelectorType,
+            ChannelSelectorType, const float&);
+
+        RefPtr<FilterEffect> m_in;
+        RefPtr<FilterEffect> m_in2;
+        ChannelSelectorType m_xChannelSelector;
+        ChannelSelectorType m_yChannelSelector;
+        float m_scale;
+    };
 
 } // namespace WebCore
 
index 51d4e58..3d52f63 100644 (file)
 #include "config.h"
 
 #if ENABLE(SVG) && ENABLE(SVG_FILTERS)
-#include "SVGRenderTreeAsText.h"
 #include "SVGFEFlood.h"
+#include "SVGRenderTreeAsText.h"
 
 namespace WebCore {
 
-SVGFEFlood::SVGFEFlood(SVGResourceFilter* filter)
-    : SVGFilterEffect(filter)
-    , m_floodColor()
-    , m_floodOpacity(0.0f)
+FEFlood::FEFlood(const Color& floodColor, const float& floodOpacity)
+    : FilterEffect()
+    , m_floodColor(floodColor)
+    , m_floodOpacity(floodOpacity)
 {
 }
 
-PassRefPtr<SVGFEFlood> SVGFEFlood::create(SVGResourceFilter* filter)
+PassRefPtr<FEFlood> FEFlood::create(const Color& floodColor, const float& floodOpacity)
 {
-    return adoptRef(new SVGFEFlood(filter));
+    return adoptRef(new FEFlood(floodColor, floodOpacity));
 }
 
-Color SVGFEFlood::floodColor() const
+Color FEFlood::floodColor() const
 {
     return m_floodColor;
 }
 
-void SVGFEFlood::setFloodColor(const Color& color)
+void FEFlood::setFloodColor(const Color& color)
 {
     m_floodColor = color;
 }
 
-float SVGFEFlood::floodOpacity() const
+float FEFlood::floodOpacity() const
 {
     return m_floodOpacity;
 }
 
-void SVGFEFlood::setFloodOpacity(float floodOpacity)
+void FEFlood::setFloodOpacity(float floodOpacity)
 {
     m_floodOpacity = floodOpacity;
 }
 
-TextStream& SVGFEFlood::externalRepresentation(TextStream& ts) const
+void FEFlood::apply()
+{
+}
+
+void FEFlood::dump()
+{
+}
+
+TextStream& FEFlood::externalRepresentation(TextStream& ts) const
 {
     ts << "[type=FLOOD] ";
-    SVGFilterEffect::externalRepresentation(ts);
+    FilterEffect::externalRepresentation(ts);
     ts << " [color=" << floodColor() << "]"
         << " [opacity=" << floodOpacity() << "]";
     return ts;
index 1c7362f..0558774 100644 (file)
 
 #if ENABLE(SVG) && ENABLE(SVG_FILTERS)
 #include "Color.h"
-#include "SVGFilterEffect.h"
+#include "FilterEffect.h"
 
 namespace WebCore {
 
-class SVGFEFlood : public SVGFilterEffect {
-public:
-    static PassRefPtr<SVGFEFlood> create(SVGResourceFilter*);
+    class FEFlood : public FilterEffect {
+    public:
+        static PassRefPtr<FEFlood> create(const Color&, const float&);
 
-    Color floodColor() const;
-    void setFloodColor(const Color &);
+        Color floodColor() const;
+        void setFloodColor(const Color &);
 
-    float floodOpacity() const;
-    void setFloodOpacity(float);
+        float floodOpacity() const;
+        void setFloodOpacity(float);
 
-    virtual TextStream& externalRepresentation(TextStream&) const;
+        virtual void apply();
+        virtual void dump();
+        TextStream& externalRepresentation(TextStream& ts) const;
 
-#if PLATFORM(CI)
-    virtual CIFilter* getCIFilter(const FloatRect& bbox) const;
-#endif
+    private:
+        FEFlood(const Color&, const float&);
 
-private:
-    SVGFEFlood(SVGResourceFilter*);
-
-    Color m_floodColor;
-    float m_floodOpacity;
-};
+        Color m_floodColor;
+        float m_floodOpacity;
+    };
 
 } // namespace WebCore
 
index 58a8807..4e64c58 100644 (file)
 
 #if ENABLE(SVG) && ENABLE(SVG_FILTERS)
 #include "SVGFEGaussianBlur.h"
-#include "TextStream.h"
+#include "SVGRenderTreeAsText.h"
 
 namespace WebCore {
 
-SVGFEGaussianBlur::SVGFEGaussianBlur(SVGResourceFilter* filter)
-    : SVGFilterEffect(filter)
-    , m_x(0.0f)
-    , m_y(0.0f)
+FEGaussianBlur::FEGaussianBlur(FilterEffect* in, const float& x, const float& y)
+    : FilterEffect()
+    , m_in(in)
+    , m_x(x)
+    , m_y(y)
 {
 }
 
-PassRefPtr<SVGFEGaussianBlur> SVGFEGaussianBlur::create(SVGResourceFilter* filter)
+PassRefPtr<FEGaussianBlur> FEGaussianBlur::create(FilterEffect* in, const float& x, const float& y)
 {
-    return adoptRef(new SVGFEGaussianBlur(filter));
+    return adoptRef(new FEGaussianBlur(in, x, y));
 }
 
-float SVGFEGaussianBlur::stdDeviationX() const
+float FEGaussianBlur::stdDeviationX() const
 {
     return m_x;
 }
 
-void SVGFEGaussianBlur::setStdDeviationX(float x)
+void FEGaussianBlur::setStdDeviationX(float x)
 {
     m_x = x;
 }
 
-float SVGFEGaussianBlur::stdDeviationY() const
+float FEGaussianBlur::stdDeviationY() const
 {
     return m_y;
 }
 
-void SVGFEGaussianBlur::setStdDeviationY(float y)
+void FEGaussianBlur::setStdDeviationY(float y)
 {
     m_y = y;
 }
 
-TextStream& SVGFEGaussianBlur::externalRepresentation(TextStream& ts) const
+void FEGaussianBlur::apply()
+{
+}
+
+void FEGaussianBlur::dump()
+{
+}
+
+TextStream& FEGaussianBlur::externalRepresentation(TextStream& ts) const
 {
     ts << "[type=GAUSSIAN-BLUR] ";
-    SVGFilterEffect::externalRepresentation(ts);
+    FilterEffect::externalRepresentation(ts);
     ts << " [std dev. x=" << stdDeviationX() << " y=" << stdDeviationY() << "]";
     return ts;
 }
index 814653e..33ad0c7 100644 (file)
 #define SVGFEGaussianBlur_h
 
 #if ENABLE(SVG) && ENABLE(SVG_FILTERS)
-#include "SVGFilterEffect.h"
+#include "FilterEffect.h"
 
 namespace WebCore {
 
-class SVGFEGaussianBlur : public SVGFilterEffect {
-public:
-    static PassRefPtr<SVGFEGaussianBlur> create(SVGResourceFilter*);
+    class FEGaussianBlur : public FilterEffect {
+    public:
+        static PassRefPtr<FEGaussianBlur> create(FilterEffect*, const float&, const float&);
 
-    float stdDeviationX() const;
-    void setStdDeviationX(float);
+        float stdDeviationX() const;
+        void setStdDeviationX(float);
 
-    float stdDeviationY() const;
-    void setStdDeviationY(float);
+        float stdDeviationY() const;
+        void setStdDeviationY(float);
 
-    virtual TextStream& externalRepresentation(TextStream&) const;
+        virtual void apply();
+        virtual void dump();
+        TextStream& externalRepresentation(TextStream& ts) const;
 
-#if PLATFORM(CI)
-    virtual CIFilter* getCIFilter(const FloatRect& bbox) const;
-#endif
+    private:
+        FEGaussianBlur(FilterEffect*, const float&, const float&);
 
-private:
-    SVGFEGaussianBlur(SVGResourceFilter*);
-
-    float m_x;
-    float m_y;
-};
+        RefPtr<FilterEffect> m_in;
+        float m_x;
+        float m_y;
+    };
 
 } // namespace WebCore
 
index 2efaa2e..5ed5abb 100644 (file)
 
 #if ENABLE(SVG) && ENABLE(SVG_FILTERS)
 #include "SVGFEImage.h"
-
-#include "SVGResourceFilter.h"
-#include "TextStream.h"
+#include "SVGRenderTreeAsText.h"
 
 namespace WebCore {
 
-SVGFEImage::SVGFEImage(SVGResourceFilter* filter)
-    : SVGFilterEffect(filter)
-    , m_cachedImage(0)
+FEImage::FEImage(CachedImage* cachedImage)
+    : FilterEffect()
+    , m_cachedImage(cachedImage)
 {
 }
 
-PassRefPtr<SVGFEImage> SVGFEImage::create(SVGResourceFilter* filter)
+PassRefPtr<FEImage> FEImage::create(CachedImage* cachedImage)
 {
-    return adoptRef(new SVGFEImage(filter));
+    return adoptRef(new FEImage(cachedImage));
 }
 
-SVGFEImage::~SVGFEImage()
+FEImage::~FEImage()
 {
     if (m_cachedImage)
         m_cachedImage->removeClient(this);
 }
 
-CachedImage* SVGFEImage::cachedImage() const
+CachedImage* FEImage::cachedImage() const
 {
     return m_cachedImage;
 }
 
-void SVGFEImage::setCachedImage(CachedImage* image)
+void FEImage::setCachedImage(CachedImage* image)
 {
     if (m_cachedImage == image)
         return;
@@ -65,19 +63,20 @@ void SVGFEImage::setCachedImage(CachedImage* image)
         m_cachedImage->addClient(this);
 }
 
-TextStream& SVGFEImage::externalRepresentation(TextStream& ts) const
+void FEImage::apply()
 {
-    ts << "[type=IMAGE] ";
-    SVGFilterEffect::externalRepresentation(ts);
-    // FIXME: should this dump also object returned by SVGFEImage::image() ?
-    return ts;
+}
 
+void FEImage::dump()
+{
 }
 
-void SVGFEImage::imageChanged(CachedImage*)
+TextStream& FEImage::externalRepresentation(TextStream& ts) const
 {
-    if (SVGResourceFilter* filterResource = filter())
-        filterResource->invalidate();
+    ts << "[type=IMAGE] ";
+    FilterEffect::externalRepresentation(ts);
+    // FIXME: should this dump also object returned by SVGFEImage::image() ?
+    return ts;
 }
 
 } // namespace WebCore
index 48157d3..5c6a8a8 100644 (file)
 #if ENABLE(SVG) && ENABLE(SVG_FILTERS)
 #include "CachedImage.h"
 #include "CachedResourceClient.h"
-#include "SVGFilterEffect.h"
+#include "FilterEffect.h"
 
 namespace WebCore {
 
-class SVGFEImage : public SVGFilterEffect
-                 , public CachedResourceClient {
-public:
-    static PassRefPtr<SVGFEImage> create(SVGResourceFilter*);
-    virtual ~SVGFEImage();
-
-    // FIXME: We need to support <svg> (RenderObject*) as well as image data.
-
-    CachedImage* cachedImage() const;
-    void setCachedImage(CachedImage*);
-
-    virtual TextStream& externalRepresentation(TextStream&) const;
-
-#if PLATFORM(CI)
-    virtual CIFilter* getCIFilter(const FloatRect& bbox) const;
-#endif
-
-    virtual void imageChanged(CachedImage*);
-    
-private:
-    SVGFEImage(SVGResourceFilter*);
-
-    CachedImage* m_cachedImage;
-};
+    class FEImage : public FilterEffect
+                     , public CachedResourceClient {
+    public:
+        static PassRefPtr<FEImage> create(CachedImage*);
+        virtual ~FEImage();
+
+        // FIXME: We need to support <svg> (RenderObject*) as well as image data.
+
+        CachedImage* cachedImage() const;
+        void setCachedImage(CachedImage*);
+        
+        virtual void apply();
+        virtual void dump();
+        TextStream& externalRepresentation(TextStream& ts) const;
+        
+    private:
+        FEImage(CachedImage*);
+
+        CachedImage* m_cachedImage;
+    };
 
 } // namespace WebCore
 
index ac41b01..8ce15a7 100644 (file)
 
 #if ENABLE(SVG) && ENABLE(SVG_FILTERS)
 #include "SVGFEMerge.h"
-#include "TextStream.h"
+#include "SVGRenderTreeAsText.h"
 
 namespace WebCore {
 
-SVGFEMerge::SVGFEMerge(SVGResourceFilter* filter) 
-    : SVGFilterEffect(filter) 
+FEMerge::FEMerge(const Vector<FilterEffect*>& mergeInputs) 
+    : FilterEffect()
+    , m_mergeInputs(mergeInputs)
 {
 }
 
-PassRefPtr<SVGFEMerge> SVGFEMerge::create(SVGResourceFilter* filter)
+PassRefPtr<FEMerge> FEMerge::create(const Vector<FilterEffect*>& mergeInputs)
 {
-    return adoptRef(new SVGFEMerge(filter));
+    return adoptRef(new FEMerge(mergeInputs));
 }
 
-const Vector<String>& SVGFEMerge::mergeInputs() const
+const Vector<FilterEffect*>& FEMerge::mergeInputs() const
 {
     return m_mergeInputs;
 }
 
-void SVGFEMerge::setMergeInputs(const Vector<String>& mergeInputs)
+void FEMerge::setMergeInputs(const Vector<FilterEffect*>& mergeInputs)
 {
     m_mergeInputs = mergeInputs;
 }
 
-TextStream& SVGFEMerge::externalRepresentation(TextStream& ts) const
+void FEMerge::apply()
+{
+}
+
+void FEMerge::dump()
+{
+}
+
+TextStream& FEMerge::externalRepresentation(TextStream& ts) const
 {
     ts << "[type=MERGE] ";
-    SVGFilterEffect::externalRepresentation(ts);
+    FilterEffect::externalRepresentation(ts);
     ts << "[merge inputs=[";
     unsigned x = 0;
     unsigned size = m_mergeInputs.size();
index 1038404..6415c9f 100644 (file)
 #define SVGFEMerge_h
 
 #if ENABLE(SVG) && ENABLE(SVG_FILTERS)
-#include "SVGFilterEffect.h"
+#include "FilterEffect.h"
 
-namespace WebCore {
-
-class SVGFEMerge : public SVGFilterEffect {
-public:
-    static PassRefPtr<SVGFEMerge> create(SVGResourceFilter*);
+#include <wtf/Vector.h>
 
-    const Vector<String>& mergeInputs() const;
-    void setMergeInputs(const Vector<String>& mergeInputs);
+namespace WebCore {
 
-    virtual TextStream& externalRepresentation(TextStream&) const;
+    class FEMerge : public FilterEffect {
+    public:
+        static PassRefPtr<FEMerge> create(const Vector<FilterEffect*>&);
 
-#if PLATFORM(CI)
-    virtual CIFilter* getCIFilter(const FloatRect& bbox) const;
-#endif
+        const Vector<FilterEffect*>& mergeInputs() const;
+        void setMergeInputs(const Vector<FilterEffect*>& mergeInputs);
+        
+        virtual void apply();
+        virtual void dump();
+        TextStream& externalRepresentation(TextStream& ts) const;
 
-private:
-    SVGFEMerge(SVGResourceFilter*);
+    private:
+        FEMerge(const Vector<FilterEffect*>&);
 
-    Vector<String> m_mergeInputs;
-};
+        Vector<FilterEffect*> m_mergeInputs;
+    };
 
 } // namespace WebCore
 
index 4eaad67..7838a8c 100644 (file)
 
 #if ENABLE(SVG) && ENABLE(SVG_FILTERS)
 #include "SVGFEMorphology.h"
-#include "TextStream.h"
+#include "SVGRenderTreeAsText.h"
 
 namespace WebCore {
 
-SVGFEMorphology::SVGFEMorphology(SVGResourceFilter* filter)
-    : SVGFilterEffect(filter)
-    , m_operator(SVG_MORPHOLOGY_OPERATOR_UNKNOWN)
-    , m_radiusX(0.0f)
-    , m_radiusY(0.0f)
+FEMorphology::FEMorphology(FilterEffect* in, MorphologyOperatorType type, const float& radiusX, const float& radiusY)
+    : FilterEffect()
+    , m_in(in)
+    , m_type(type)
+    , m_radiusX(radiusX)
+    , m_radiusY(radiusY)
 {
 }
 
-SVGMorphologyOperatorType SVGFEMorphology::morphologyOperator() const
+PassRefPtr<FEMorphology> FEMorphology::create(FilterEffect* in, MorphologyOperatorType type, const float& radiusX, const float& radiusY)
 {
-    return m_operator;
+    return adoptRef(new FEMorphology(in, type, radiusX, radiusY));
 }
 
-void SVGFEMorphology::setMorphologyOperator(SVGMorphologyOperatorType _operator)
+MorphologyOperatorType FEMorphology::morphologyOperator() const
 {
-    m_operator = _operator;
+    return m_type;
 }
 
-float SVGFEMorphology::radiusX() const
+void FEMorphology::setMorphologyOperator(MorphologyOperatorType type)
+{
+    m_type = type;
+}
+
+float FEMorphology::radiusX() const
 {
     return m_radiusX;
 }
 
-void SVGFEMorphology::setRadiusX(float radiusX)
+void FEMorphology::setRadiusX(float radiusX)
 {
     m_radiusX = radiusX;
 }
 
-float SVGFEMorphology::radiusY() const
+float FEMorphology::radiusY() const
 {
     return m_radiusY;
 }
 
-void SVGFEMorphology::setRadiusY(float radiusY)
+void FEMorphology::setRadiusY(float radiusY)
 {
     m_radiusY = radiusY;
 }
 
-static TextStream& operator<<(TextStream& ts, SVGMorphologyOperatorType t)
+void FEMorphology::apply()
+{
+}
+
+void FEMorphology::dump()
+{
+}
+
+static TextStream& operator<<(TextStream& ts, MorphologyOperatorType t)
 {
     switch (t)
     {
-        case SVG_MORPHOLOGY_OPERATOR_UNKNOWN:
+        case FEMORPHOLOGY_OPERATOR_UNKNOWN:
             ts << "UNKNOWN"; break;
-        case SVG_MORPHOLOGY_OPERATOR_ERODE:
+        case FEMORPHOLOGY_OPERATOR_ERODE:
             ts << "ERODE"; break;
-        case SVG_MORPHOLOGY_OPERATOR_DIALATE:
+        case FEMORPHOLOGY_OPERATOR_DIALATE:
             ts << "DIALATE"; break;
     }
     return ts;
 }
 
-TextStream& SVGFEMorphology::externalRepresentation(TextStream& ts) const
+TextStream& FEMorphology::externalRepresentation(TextStream& ts) const
 {
-    ts << "[type=MORPHOLOGY-OPERATOR] ";
-    SVGFilterEffect::externalRepresentation(ts);
+    ts << "[type=MORPHOLOGY] ";
+    FilterEffect::externalRepresentation(ts);
     ts << " [operator type=" << morphologyOperator() << "]"
-        << " [radius x=" << radiusX() << " y=" << radiusY() << "]";
+        << " [radius x=" << radiusX() << " y=" << radiusY() << "]";        
     return ts;
 }
 
index 4ba7131..98ab633 100644 (file)
 #define SVGFEMorphology_h
 
 #if ENABLE(SVG) && ENABLE(SVG_FILTERS)
-#include "SVGFilterEffect.h"
+#include "FilterEffect.h"
 
 namespace WebCore {
 
-enum SVGMorphologyOperatorType {
-    SVG_MORPHOLOGY_OPERATOR_UNKNOWN = 0,
-    SVG_MORPHOLOGY_OPERATOR_ERODE   = 1,
-    SVG_MORPHOLOGY_OPERATOR_DIALATE = 2
-};
-
-class SVGFEMorphology : public SVGFilterEffect {
-public:
-    SVGFEMorphology(SVGResourceFilter*);
-
-    SVGMorphologyOperatorType morphologyOperator() const;
-    void setMorphologyOperator(SVGMorphologyOperatorType);
-
-    float radiusX() const;
-    void setRadiusX(float);
-
-    float radiusY() const;
-    void setRadiusY(float);
-
-    virtual TextStream& externalRepresentation(TextStream&) const;
-
-private:
-    SVGMorphologyOperatorType m_operator;
-    float m_radiusX;
-    float m_radiusY;
-};
+    enum MorphologyOperatorType {
+        FEMORPHOLOGY_OPERATOR_UNKNOWN = 0,
+        FEMORPHOLOGY_OPERATOR_ERODE   = 1,
+        FEMORPHOLOGY_OPERATOR_DIALATE = 2
+    };
+
+    class FEMorphology : public FilterEffect {
+    public:
+        PassRefPtr<FEMorphology> create(FilterEffect*, MorphologyOperatorType, const float&, const float&);  
+        MorphologyOperatorType morphologyOperator() const;
+        void setMorphologyOperator(MorphologyOperatorType);
+
+        float radiusX() const;
+        void setRadiusX(float);
+
+        float radiusY() const;
+        void setRadiusY(float);
+
+        virtual void apply();
+        virtual void dump();
+        TextStream& externalRepresentation(TextStream& ts) const;
+
+    private:
+        FEMorphology(FilterEffect*, MorphologyOperatorType, const float&, const float&);
+        
+        RefPtr<FilterEffect> m_in;
+        MorphologyOperatorType m_type;
+        float m_radiusX;
+        float m_radiusY;
+    };
 
 } // namespace WebCore
 
index 97ccf43..c2a0fc9 100644 (file)
 
 #if ENABLE(SVG) && ENABLE(SVG_FILTERS)
 #include "SVGFEOffset.h"
-#include "TextStream.h"
+#include "SVGRenderTreeAsText.h"
 
 namespace WebCore {
 
-SVGFEOffset::SVGFEOffset(SVGResourceFilter* filter)
-    : SVGFilterEffect(filter)
-    , m_dx(0.0f)
-    , m_dy(0.0f)
+FEOffset::FEOffset(FilterEffect* in, const float& dx, const float& dy)
+    : FilterEffect()
+    , m_in(in)
+    , m_dx(dx)
+    , m_dy(dy)
 {
 }
 
-PassRefPtr<SVGFEOffset> SVGFEOffset::create(SVGResourceFilter* filter)
+PassRefPtr<FEOffset> FEOffset::create(FilterEffect* in, const float& dx, const float& dy)
 {
-    return adoptRef(new SVGFEOffset(filter));
+    return adoptRef(new FEOffset(in, dx, dy));
 }
 
-float SVGFEOffset::dx() const
+float FEOffset::dx() const
 {
     return m_dx;
 }
 
-void SVGFEOffset::setDx(float dx)
+void FEOffset::setDx(float dx)
 {
     m_dx = dx;
 }
 
-float SVGFEOffset::dy() const
+float FEOffset::dy() const
 {
     return m_dy;
 }
 
-void SVGFEOffset::setDy(float dy)
+void FEOffset::setDy(float dy)
 {
     m_dy = dy;
 }
 
-TextStream& SVGFEOffset::externalRepresentation(TextStream& ts) const
+void FEOffset::apply()
 {
-    ts << "[type=OFFSET] "; SVGFilterEffect::externalRepresentation(ts)
-        << " [dx=" << dx() << " dy=" << dy() << "]";
+}
+
+void FEOffset::dump()
+{
+}
+
+TextStream& FEOffset::externalRepresentation(TextStream& ts) const
+{
+    ts << "[type=OFFSET] "; 
+    FilterEffect::externalRepresentation(ts);
+    ts << " [dx=" << dx() << " dy=" << dy() << "]";
     return ts;
 }
 
index 6a79f8d..86128da 100644 (file)
 #define SVGFEOffset_h
 
 #if ENABLE(SVG) && ENABLE(SVG_FILTERS)
-#include "SVGFilterEffect.h"
+#include "FilterEffect.h"
 
 namespace WebCore {
 
-class SVGFEOffset : public SVGFilterEffect {
-public:
-    static PassRefPtr<SVGFEOffset> create(SVGResourceFilter*);
+    class FEOffset : public FilterEffect {
+    public:
+        static PassRefPtr<FEOffset> create(FilterEffect*, const float&, const float&);
 
-    float dx() const;
-    void setDx(float);
+        float dx() const;
+        void setDx(float);
 
-    float dy() const;
-    void setDy(float);
+        float dy() const;
+        void setDy(float);
 
-    virtual TextStream& externalRepresentation(TextStream&) const;
+        virtual void apply();
+        virtual void dump();
+        TextStream& externalRepresentation(TextStream& ts) const;
 
-#if PLATFORM(CI)
-    virtual CIFilter* getCIFilter(const FloatRect& bbox) const;
-#endif
+    private:
+        FEOffset(FilterEffect*, const float&, const float&);
 
-private:
-    SVGFEOffset(SVGResourceFilter*);
-
-    float m_dx;
-    float m_dy;
-};
+        RefPtr<FilterEffect> m_in;
+        float m_dx;
+        float m_dy;
+    };
 
 } // namespace WebCore
 
index 14f496c..e3446ed 100644 (file)
 
 #if ENABLE(SVG) && ENABLE(SVG_FILTERS)
 #include "SVGFESpecularLighting.h"
-#include "TextStream.h"
+#include "SVGRenderTreeAsText.h"
 
 namespace WebCore {
 
-SVGFESpecularLighting::SVGFESpecularLighting(SVGResourceFilter* filter)
-    : SVGFilterEffect(filter)
-    , m_lightingColor()
-    , m_surfaceScale(0.0f)
-    , m_specularConstant(0.0f)
-    , m_specularExponent(0.0f)
-    , m_kernelUnitLengthX(0.0f)
-    , m_kernelUnitLengthY(0.0f)
-    , m_lightSource(0)
+FESpecularLighting::FESpecularLighting(FilterEffect* in, const Color& lightingColor, const float& surfaceScale,
+    const float& specularConstant, const float& specularExponent, const float& kernelUnitLengthX,
+    const float& kernelUnitLengthY, LightSource* lightSource)
+    : FilterEffect()
+    , m_in(in)
+    , m_lightingColor(lightingColor)
+    , m_surfaceScale(surfaceScale)
+    , m_specularConstant(specularConstant)
+    , m_specularExponent(specularExponent)
+    , m_kernelUnitLengthX(kernelUnitLengthX)
+    , m_kernelUnitLengthY(kernelUnitLengthY)
+    , m_lightSource(lightSource)
 {
 }
 
-PassRefPtr<SVGFESpecularLighting> SVGFESpecularLighting::create(SVGResourceFilter* filter)
+PassRefPtr<FESpecularLighting> FESpecularLighting::create(FilterEffect* in, const Color& lightingColor,
+    const float& surfaceScale, const float& specularConstant, const float& specularExponent,
+    const float& kernelUnitLengthX, const float& kernelUnitLengthY, LightSource* lightSource)
 {
-    return adoptRef(new SVGFESpecularLighting(filter));
+    return adoptRef(new FESpecularLighting(in, lightingColor, surfaceScale, specularConstant, specularExponent,
+        kernelUnitLengthX, kernelUnitLengthY, lightSource));
 }
 
-SVGFESpecularLighting::~SVGFESpecularLighting()
+FESpecularLighting::~FESpecularLighting()
 {
 }
 
-Color SVGFESpecularLighting::lightingColor() const
+Color FESpecularLighting::lightingColor() const
 {
     return m_lightingColor;
 }
 
-void SVGFESpecularLighting::setLightingColor(const Color& lightingColor)
+void FESpecularLighting::setLightingColor(const Color& lightingColor)
 {
     m_lightingColor = lightingColor;
 }
 
-float SVGFESpecularLighting::surfaceScale() const
+float FESpecularLighting::surfaceScale() const
 {
     return m_surfaceScale;
 }
 
-void SVGFESpecularLighting::setSurfaceScale(float surfaceScale)
+void FESpecularLighting::setSurfaceScale(float surfaceScale)
 {
     m_surfaceScale = surfaceScale;
 }
 
-float SVGFESpecularLighting::specularConstant() const
+float FESpecularLighting::specularConstant() const
 {
     return m_specularConstant;
 }
 
-void SVGFESpecularLighting::setSpecularConstant(float specularConstant)
+void FESpecularLighting::setSpecularConstant(float specularConstant)
 {
     m_specularConstant = specularConstant;
 }
 
-float SVGFESpecularLighting::specularExponent() const
+float FESpecularLighting::specularExponent() const
 {
     return m_specularExponent;
 }
 
-void SVGFESpecularLighting::setSpecularExponent(float specularExponent)
+void FESpecularLighting::setSpecularExponent(float specularExponent)
 {
     m_specularExponent = specularExponent;
 }
 
-float SVGFESpecularLighting::kernelUnitLengthX() const
+float FESpecularLighting::kernelUnitLengthX() const
 {
     return m_kernelUnitLengthX;
 }
 
-void SVGFESpecularLighting::setKernelUnitLengthX(float kernelUnitLengthX)
+void FESpecularLighting::setKernelUnitLengthX(float kernelUnitLengthX)
 {
     m_kernelUnitLengthX = kernelUnitLengthX;
 }
 
-float SVGFESpecularLighting::kernelUnitLengthY() const
+float FESpecularLighting::kernelUnitLengthY() const
 {
     return m_kernelUnitLengthY;
 }
 
-void SVGFESpecularLighting::setKernelUnitLengthY(float kernelUnitLengthY)
+void FESpecularLighting::setKernelUnitLengthY(float kernelUnitLengthY)
 {
     m_kernelUnitLengthY = kernelUnitLengthY;
 }
 
-const LightSource* SVGFESpecularLighting::lightSource() const
+const LightSource* FESpecularLighting::lightSource() const
 {
     return m_lightSource.get();
 }
 
-void SVGFESpecularLighting::setLightSource(LightSource* lightSource)
+void FESpecularLighting::setLightSource(LightSource* lightSource)
 {
     m_lightSource = lightSource;
 }
 
-TextStream& SVGFESpecularLighting::externalRepresentation(TextStream& ts) const
+void FESpecularLighting::apply()
+{
+}
+
+void FESpecularLighting::dump()
+{
+}
+
+TextStream& FESpecularLighting::externalRepresentation(TextStream& ts) const
 {
     ts << "[type=SPECULAR-LIGHTING] ";
-    SVGFilterEffect::externalRepresentation(ts);
+    FilterEffect::externalRepresentation(ts);
     ts << " [surface scale=" << m_surfaceScale << "]"
         << " [specual constant=" << m_specularConstant << "]"
         << " [specular exponent=" << m_specularExponent << "]";
index 5276339..e1c1930 100644 (file)
 #if ENABLE(SVG) && ENABLE(SVG_FILTERS)
 #include "Color.h"
 #include "SVGLightSource.h"
-#include "SVGFilterEffect.h"
+#include "FilterEffect.h"
 
 namespace WebCore {
 
-class SVGFESpecularLighting : public SVGFilterEffect {
-public:
-    static PassRefPtr<SVGFESpecularLighting> create(SVGResourceFilter*);
-    virtual ~SVGFESpecularLighting();
+    class FESpecularLighting : public FilterEffect {
+    public:
+        static PassRefPtr<FESpecularLighting> create(FilterEffect*, const Color&, const float&, const float&,
+            const float&, const float&, const float&, LightSource*);
+        virtual ~FESpecularLighting();
 
-    Color lightingColor() const;
-    void setLightingColor(const Color&);
+        Color lightingColor() const;
+        void setLightingColor(const Color&);
 
-    float surfaceScale() const;
-    void setSurfaceScale(float);
+        float surfaceScale() const;
+        void setSurfaceScale(float);
 
-    float specularConstant() const;
-    void setSpecularConstant(float);
+        float specularConstant() const;
+        void setSpecularConstant(float);
 
-    float specularExponent() const;
-    void setSpecularExponent(float);
+        float specularExponent() const;
+        void setSpecularExponent(float);
 
-    float kernelUnitLengthX() const;
-    void setKernelUnitLengthX(float);
+        float kernelUnitLengthX() const;
+        void setKernelUnitLengthX(float);
 
-    float kernelUnitLengthY() const;
-    void setKernelUnitLengthY(float);
+        float kernelUnitLengthY() const;
+        void setKernelUnitLengthY(float);
 
-    const LightSource* lightSource() const;
-    void setLightSource(LightSource*);
+        const LightSource* lightSource() const;
+        void setLightSource(LightSource*);
 
-    virtual TextStream& externalRepresentation(TextStream&) const;
+        virtual void apply();
+        virtual void dump();
+        TextStream& externalRepresentation(TextStream& ts) const;
 
-#if PLATFORM(CI)
-    virtual CIFilter* getCIFilter(const FloatRect& bbox) const;
-#endif
+    private:
+        FESpecularLighting(FilterEffect*, const Color&, const float&, const float&, const float&,
+            const float&, const float&, LightSource*);
 
-private:
-    SVGFESpecularLighting(SVGResourceFilter*);
-
-    Color m_lightingColor;
-    float m_surfaceScale;
-    float m_specularConstant;
-    float m_specularExponent;
-    float m_kernelUnitLengthX;
-    float m_kernelUnitLengthY;
-    RefPtr<LightSource> m_lightSource;
-};
+        RefPtr<FilterEffect> m_in;
+        Color m_lightingColor;
+        float m_surfaceScale;
+        float m_specularConstant;
+        float m_specularExponent;
+        float m_kernelUnitLengthX;
+        float m_kernelUnitLengthY;
+        RefPtr<LightSource> m_lightSource;
+    };
 
 } // namespace WebCore
 
index 9746f66..773a5cd 100644 (file)
 
 #if ENABLE(SVG) && ENABLE(SVG_FILTERS)
 #include "SVGFETile.h"
+#include "SVGRenderTreeAsText.h"
 
 namespace WebCore {
 
-SVGFETile::SVGFETile(SVGResourceFilter* filter)
-    : SVGFilterEffect(filter)
+FETile::FETile(FilterEffect* in)
+    : FilterEffect()
+    , m_in(in)
 {
 }
 
-PassRefPtr<SVGFETile> SVGFETile::create(SVGResourceFilter* filter)
+PassRefPtr<FETile> FETile::create(FilterEffect* in)
 {
-    return adoptRef(new SVGFETile(filter));
+    return adoptRef(new FETile(in));
+}
+
+void FETile::apply()
+{
+}
+
+void FETile::dump()
+{
+}
+
+TextStream& FETile::externalRepresentation(TextStream& ts) const
+{
+    ts << "[type=TILE]";
+    FilterEffect::externalRepresentation(ts);
+    return ts;
 }
 
 } // namespace WebCore
index 3e51791..986f6fd 100644 (file)
 #define SVGFETile_h
 
 #if ENABLE(SVG) && ENABLE(SVG_FILTERS)
-#include "SVGFilterEffect.h"
+#include "FilterEffect.h"
 
 namespace WebCore {
     
-    class SVGFETile : public SVGFilterEffect {
+    class FETile : public FilterEffect {
     public:
-        static PassRefPtr<SVGFETile> create(SVGResourceFilter*);
+        static PassRefPtr<FETile> create(FilterEffect*);
 
-    #if PLATFORM(CI)
-        virtual CIFilter* getCIFilter(const FloatRect& bbox) const;
-    #endif
+        virtual void apply();
+        virtual void dump();
+        TextStream& externalRepresentation(TextStream& ts) const;
+        
     private:
-        SVGFETile(SVGResourceFilter*);
-
+        FETile(FilterEffect*);
+        
+        RefPtr<FilterEffect> m_in;
     };
 
 } // namespace WebCore
index 567a7d3..9731c49 100644 (file)
 
 #if ENABLE(SVG) && ENABLE(SVG_FILTERS)
 #include "SVGFETurbulence.h"
-#include "TextStream.h"
+#include "SVGRenderTreeAsText.h"
 
 namespace WebCore {
 
-SVGFETurbulence::SVGFETurbulence(SVGResourceFilter* filter)
-    : SVGFilterEffect(filter)
-    , m_baseFrequencyX(0.0f)
-    , m_baseFrequencyY(0.0f)
-    , m_numOctaves(0)
-    , m_seed(0)
-    , m_stitchTiles(false)
-    , m_type(SVG_TURBULENCE_TYPE_UNKNOWN)
+FETurbulence::FETurbulence(TurbulanceType type, const float& baseFrequencyX, const float& baseFrequencyY,
+    const int& numOctaves, const float& seed, bool stitchTiles)
+    : FilterEffect()
+    , m_type(type)
+    , m_baseFrequencyX(baseFrequencyX)
+    , m_baseFrequencyY(baseFrequencyY)
+    , m_numOctaves(numOctaves)
+    , m_seed(seed)
+    , m_stitchTiles(stitchTiles)
 {
 }
 
-PassRefPtr<SVGFETurbulence> SVGFETurbulence::create(SVGResourceFilter* filter)
+PassRefPtr<FETurbulence> FETurbulence::create(TurbulanceType type, const float& baseFrequencyX, const float& baseFrequencyY,
+    const int& numOctaves, const float& seed, bool stitchTiles)
 {
-    return adoptRef(new SVGFETurbulence(filter));
+    return adoptRef(new FETurbulence(type, baseFrequencyX, baseFrequencyY, numOctaves, seed, stitchTiles));
 }
 
-SVGTurbulanceType SVGFETurbulence::type() const
+TurbulanceType FETurbulence::type() const
 {
     return m_type;
 }
 
-void SVGFETurbulence::setType(SVGTurbulanceType type)
+void FETurbulence::setType(TurbulanceType type)
 {
     m_type = type;
 }
 
-float SVGFETurbulence::baseFrequencyY() const
+float FETurbulence::baseFrequencyY() const
 {
     return m_baseFrequencyY;
 }
 
-void SVGFETurbulence::setBaseFrequencyY(float baseFrequencyY)
+void FETurbulence::setBaseFrequencyY(float baseFrequencyY)
 {
     m_baseFrequencyY = baseFrequencyY;
 }
 
-float SVGFETurbulence::baseFrequencyX() const
+float FETurbulence::baseFrequencyX() const
 {
     return m_baseFrequencyX;
 }
 
-void SVGFETurbulence::setBaseFrequencyX(float baseFrequencyX)
+void FETurbulence::setBaseFrequencyX(float baseFrequencyX)
 {
        m_baseFrequencyX = baseFrequencyX;
 }
 
-float SVGFETurbulence::seed() const
+float FETurbulence::seed() const
 {
     return m_seed; 
 }
 
-void SVGFETurbulence::setSeed(float seed)
+void FETurbulence::setSeed(float seed)
 {
     m_seed = seed;
 }
 
-int SVGFETurbulence::numOctaves() const
+int FETurbulence::numOctaves() const
 {
     return m_numOctaves;
 }
 
-void SVGFETurbulence::setNumOctaves(bool numOctaves)
+void FETurbulence::setNumOctaves(bool numOctaves)
 {
     m_numOctaves = numOctaves;
 }
 
-bool SVGFETurbulence::stitchTiles() const
+bool FETurbulence::stitchTiles() const
 {
     return m_stitchTiles;
 }
 
-void SVGFETurbulence::setStitchTiles(bool stitch)
+void FETurbulence::setStitchTiles(bool stitch)
 {
     m_stitchTiles = stitch;
 }
 
-static TextStream& operator<<(TextStream& ts, SVGTurbulanceType t)
+void FETurbulence::apply()
+{
+}
+
+void FETurbulence::dump()
+{
+}
+
+static TextStream& operator<<(TextStream& ts, TurbulanceType t)
 {
     switch (t)
     {
-        case SVG_TURBULENCE_TYPE_UNKNOWN:
+        case FETURBULENCE_TYPE_UNKNOWN:
             ts << "UNKNOWN"; break;
-        case SVG_TURBULENCE_TYPE_TURBULENCE:
+        case FETURBULENCE_TYPE_TURBULENCE:
             ts << "TURBULANCE"; break;
-        case SVG_TURBULENCE_TYPE_FRACTALNOISE:
+        case FETURBULENCE_TYPE_FRACTALNOISE:
             ts << "NOISE"; break;
     }
     return ts;
 }
 
-TextStream& SVGFETurbulence::externalRepresentation(TextStream& ts) const
+TextStream& FETurbulence::externalRepresentation(TextStream& ts) const
 {
     ts << "[type=TURBULENCE] ";
-    SVGFilterEffect::externalRepresentation(ts);
+    FilterEffect::externalRepresentation(ts);
     ts << " [turbulence type=" << type() << "]"
         << " [base frequency x=" << baseFrequencyX() << " y=" << baseFrequencyY() << "]"
         << " [seed=" << seed() << "]"
         << " [num octaves=" << numOctaves() << "]"
         << " [stitch tiles=" << stitchTiles() << "]";
-    return ts;
 
+    return ts;
 }
 
 } // namespace WebCore
index 2fd964f..6977460 100644 (file)
 #define SVGFETurbulence_h
 
 #if ENABLE(SVG) && ENABLE(SVG_FILTERS)
-#include "SVGFilterEffect.h"
+#include "FilterEffect.h"
 
 namespace WebCore {
 
-enum SVGTurbulanceType {
-    SVG_TURBULENCE_TYPE_UNKNOWN      = 0,
-    SVG_TURBULENCE_TYPE_FRACTALNOISE = 1,
-    SVG_TURBULENCE_TYPE_TURBULENCE   = 2
-};
+    enum TurbulanceType {
+        FETURBULENCE_TYPE_UNKNOWN      = 0,
+        FETURBULENCE_TYPE_FRACTALNOISE = 1,
+        FETURBULENCE_TYPE_TURBULENCE   = 2
+    };
 
-class SVGFETurbulence : public SVGFilterEffect {
-public:
-    static PassRefPtr<SVGFETurbulence> create(SVGResourceFilter*);
+    class FETurbulence : public FilterEffect {
+    public:
+        static PassRefPtr<FETurbulence> create(TurbulanceType, const float&, const float&, const int&, const float&,
+                bool);
 
-    SVGTurbulanceType type() const;
-    void setType(SVGTurbulanceType);
+        TurbulanceType type() const;
+        void setType(TurbulanceType);
 
-    float baseFrequencyY() const;
-    void setBaseFrequencyY(float);
+        float baseFrequencyY() const;
+        void setBaseFrequencyY(float);
 
-    float baseFrequencyX() const;
-    void setBaseFrequencyX(float);
+        float baseFrequencyX() const;
+        void setBaseFrequencyX(float);
 
-    float seed() const;
-    void setSeed(float);
+        float seed() const;
+        void setSeed(float);
 
-    int numOctaves() const;
-    void setNumOctaves(bool);
+        int numOctaves() const;
+        void setNumOctaves(bool);
 
-    bool stitchTiles() const;
-    void setStitchTiles(bool);
+        bool stitchTiles() const;
+        void setStitchTiles(bool);
 
-    virtual TextStream& externalRepresentation(TextStream&) const;
+        virtual void apply();
+        virtual void dump();
+        TextStream& externalRepresentation(TextStream& ts) const;
 
-private:
-    SVGFETurbulence(SVGResourceFilter*);
+    private:
+        FETurbulence(TurbulanceType, const float&, const float&, const int&, const float&,
+                bool);
 
-    float m_baseFrequencyX;
-    float m_baseFrequencyY;
-    int m_numOctaves;
-    float m_seed;
-    bool m_stitchTiles;
-    SVGTurbulanceType m_type;
-};
+        TurbulanceType m_type;
+        float m_baseFrequencyX;
+        float m_baseFrequencyY;
+        int m_numOctaves;
+        float m_seed;
+        bool m_stitchTiles;
+    };
 
 } // namespace WebCore
 
diff --git a/WebCore/svg/graphics/filters/cg/SVGFEDiffuseLightingCg.mm b/WebCore/svg/graphics/filters/cg/SVGFEDiffuseLightingCg.mm
deleted file mode 100644 (file)
index b329943..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
-    Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org>
-
-    This file is part of the KDE project
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Library General Public
-    License as published by the Free Software Foundation; either
-    version 2 of the License, or (at your option) any later version.
-
-    This library is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-    Library General Public License for more details.
-
-    You should have received a copy of the GNU Library General Public License
-    aint with this library; see the file COPYING.LIB.  If not, write to
-    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-    Boston, MA 02110-1301, USA.
-*/
-
-#include "config.h"
-
-#if ENABLE(SVG) && ENABLE(SVG_FILTERS)
-#include "SVGFEDiffuseLighting.h"
-#include "SVGFEHelpersCg.h"
-
-#import "WKDiffuseLightingFilter.h"
-
-namespace WebCore {
-
-CIFilter* SVGFEDiffuseLighting::getCIFilter(const FloatRect& bbox) const
-{
-    const LightSource* light = lightSource();
-    if (!light)
-        return nil;
-
-    [WKDiffuseLightingFilter class];
-
-    SVGResourceFilter* svgFilter = filter();
-    SVGResourceFilterPlatformDataMac* filterPlatformData = static_cast<SVGResourceFilterPlatformDataMac*>(svgFilter->platformData());
-
-    CIFilter* filter;
-    BEGIN_BLOCK_OBJC_EXCEPTIONS;
-    filter = [CIFilter filterWithName:@"WKDiffuseLighting"];
-    if (!filter)
-        return nil;
-
-    [filter setDefaults];
-    CIImage* inputImage = filterPlatformData->inputImage(this);
-    FE_QUARTZ_CHECK_INPUT(inputImage);
-    CIFilter* normals = getNormalMap(inputImage, surfaceScale());
-    if (!normals)
-        return nil;
-
-    CIFilter* lightVectors = getLightVectors(normals, light, surfaceScale());
-    if (!lightVectors)
-        return nil;
-
-    [filter setValue:[normals valueForKey:@"outputImage"] forKey:@"inputNormalMap"];
-    [filter setValue:[lightVectors valueForKey:@"outputImage"] forKey:@"inputLightVectors"];
-    [filter setValue:ciColor(lightingColor()) forKey:@"inputLightingColor"];
-    [filter setValue:[NSNumber numberWithFloat:surfaceScale()] forKey:@"inputSurfaceScale"];
-    [filter setValue:[NSNumber numberWithFloat:diffuseConstant()] forKey:@"inputDiffuseConstant"];
-    [filter setValue:[NSNumber numberWithFloat:kernelUnitLengthX()] forKey:@"inputKernelUnitLengthX"];
-    [filter setValue:[NSNumber numberWithFloat:kernelUnitLengthY()] forKey:@"inputKernelUnitLengthY"];
-
-    FE_QUARTZ_MAP_TO_SUBREGION(bbox);
-    FE_QUARTZ_OUTPUT_RETURN;
-}
-
-}
-
-#endif // ENABLE(SVG) && ENABLE(SVG_FILTERS)
diff --git a/WebCore/svg/graphics/filters/cg/SVGFEDisplacementMapCg.mm b/WebCore/svg/graphics/filters/cg/SVGFEDisplacementMapCg.mm
deleted file mode 100644 (file)
index 9d482e2..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
-    Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org>
-
-    This file is part of the KDE project
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Library General Public
-    License as published by the Free Software Foundation; either
-    version 2 of the License, or (at your option) any later version.
-
-    This library is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-    Library General Public License for more details.
-
-    You should have received a copy of the GNU Library General Public License
-    aint with this library; see the file COPYING.LIB.  If not, write to
-    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-    Boston, MA 02110-1301, USA.
-*/
-
-#include "config.h"
-
-#if ENABLE(SVG) && ENABLE(SVG_FILTERS)
-#include "SVGFEDisplacementMap.h"
-#include "SVGFEHelpersCg.h"
-
-#import "WKDisplacementMapFilter.h"
-
-namespace WebCore {
-
-CIFilter* SVGFEDisplacementMap::getCIFilter(const FloatRect& bbox) const
-{
-    SVGResourceFilter* svgFilter = filter();
-    SVGResourceFilterPlatformDataMac* filterPlatformData = static_cast<SVGResourceFilterPlatformDataMac*>(svgFilter->platformData());
-
-    CIFilter* filter = nil;
-    BEGIN_BLOCK_OBJC_EXCEPTIONS;
-    [WKDisplacementMapFilter class];
-    filter = [CIFilter filterWithName:@"WKDisplacementMapFilter"];
-    [filter setDefaults];
-    CIImage* inputImage = filterPlatformData->inputImage(this);
-    CIImage* displacementMap = filterPlatformData->imageForName(in2());
-    FE_QUARTZ_CHECK_INPUT(inputImage);
-    FE_QUARTZ_CHECK_INPUT(displacementMap);
-    [filter setValue:inputImage forKey:@"inputImage"];
-    [filter setValue:displacementMap forKey:@"inputDisplacementMap"];
-    [filter setValue:getVectorForChannel(xChannelSelector()) forKey:@"inputXChannelSelector"];
-    [filter setValue:getVectorForChannel(yChannelSelector()) forKey:@"inputYChannelSelector"];
-    [filter setValue:[NSNumber numberWithFloat:scale()] forKey:@"inputScale"];
-
-    FE_QUARTZ_MAP_TO_SUBREGION(bbox);
-    FE_QUARTZ_OUTPUT_RETURN;
-}
-
-}
-
-#endif // ENABLE(SVG) && ENABLE(SVG_FILTERS)
diff --git a/WebCore/svg/graphics/filters/cg/SVGFEFloodCg.mm b/WebCore/svg/graphics/filters/cg/SVGFEFloodCg.mm
deleted file mode 100644 (file)
index db46f5b..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
-    Copyright (C) 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
-
-    This file is part of the KDE project
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Library General Public
-    License as published by the Free Software Foundation; either
-    version 2 of the License, or (at your option) any later version.
-
-    This library is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-    Library General Public License for more details.
-
-    You should have received a copy of the GNU Library General Public License
-    aint with this library; see the file COPYING.LIB.  If not, write to
-    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-    Boston, MA 02110-1301, USA.
-*/
-
-#include "config.h"
-
-#if ENABLE(SVG) && ENABLE(SVG_FILTERS)
-#include "SVGFEFlood.h"
-
-#include "AffineTransform.h"
-#include "SVGFEHelpersCg.h"
-#include "CgSupport.h"
-
-namespace WebCore {
-
-CIFilter* SVGFEFlood::getCIFilter(const FloatRect& bbox) const
-{
-    SVGResourceFilter* svgFilter = filter();
-    SVGResourceFilterPlatformDataMac* filterPlatformData = static_cast<SVGResourceFilterPlatformDataMac*>(svgFilter->platformData());
-    CIFilter* filter;
-    BEGIN_BLOCK_OBJC_EXCEPTIONS;
-    filter = [CIFilter filterWithName:@"CIConstantColorGenerator"];
-    [filter setDefaults];
-    CGColorRef color = cgColor(floodColor());
-    CGColorRef withAlpha = CGColorCreateCopyWithAlpha(color, CGColorGetAlpha(color) * floodOpacity());
-    CIColor* inputColor = [CIColor colorWithCGColor:withAlpha];
-    CGColorRelease(color);
-    CGColorRelease(withAlpha);
-    [filter setValue:inputColor forKey:@"inputColor"];
-
-    FE_QUARTZ_MAP_TO_SUBREGION(bbox);
-    FE_QUARTZ_OUTPUT_RETURN;
-}
-
-}
-
-#endif // ENABLE(SVG) && ENABLE(SVG_FILTERS)
diff --git a/WebCore/svg/graphics/filters/cg/SVGFEGaussianBlurCg.mm b/WebCore/svg/graphics/filters/cg/SVGFEGaussianBlurCg.mm
deleted file mode 100644 (file)
index 13140b6..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
-    Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org>
-
-    This file is part of the KDE project
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Library General Public
-    License as published by the Free Software Foundation; either
-    version 2 of the License, or (at your option) any later version.
-
-    This library is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-    Library General Public License for more details.
-
-    You should have received a copy of the GNU Library General Public License
-    aint with this library; see the file COPYING.LIB.  If not, write to
-    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-    Boston, MA 02110-1301, USA.
-*/
-
-#include "config.h"
-
-#if ENABLE(SVG) && ENABLE(SVG_FILTERS)
-#include "SVGFEGaussianBlur.h"
-#include "SVGFEHelpersCg.h"
-
-namespace WebCore {
-
-CIFilter* SVGFEGaussianBlur::getCIFilter(const FloatRect& bbox) const
-{
-    SVGResourceFilter* svgFilter = filter();
-    FE_QUARTZ_SETUP_INPUT(@"CIGaussianPyramid");
-
-    float inputRadius = stdDeviationX();
-    if (inputRadius != stdDeviationY()) {
-        float inputAspectRatio = stdDeviationX()/stdDeviationY();
-        // FIXME: inputAspectRatio only support the range .5 to 2.0!
-        [filter setValue:[NSNumber numberWithFloat:inputAspectRatio] forKey:@"inputAspectRatio"];
-    }
-    [filter setValue:[NSNumber numberWithFloat:inputRadius] forKey:@"inputRadius"];
-
-    FE_QUARTZ_MAP_TO_SUBREGION(bbox);
-    FE_QUARTZ_OUTPUT_RETURN;
-}
-
-}
-
-#endif // ENABLE(SVG) && ENABLE(SVG_FILTERS)
index f17e7ad..f35e028 100644 (file)
@@ -33,7 +33,7 @@ class LightSource;
 
 namespace WebCore {
 
-CIVector* getVectorForChannel(SVGChannelSelectorType channel);
+CIVector* getVectorForChannel(ChannelSelectorType channel);
 CIColor* ciColor(const Color& c);
 
 // Lighting
index 92f044d..0f2eb75 100644 (file)
 
 namespace WebCore {
 
-CIVector* getVectorForChannel(SVGChannelSelectorType channel)
+CIVector* getVectorForChannel(ChannelSelectorType channel)
 {
     switch (channel) {
-    case SVG_CHANNEL_UNKNOWN:
+    case CHANNEL_UNKNOWN:
         return nil;    
-    case SVG_CHANNEL_R:
+    case CHANNEL_R:
         return [CIVector vectorWithX:1.0f Y:0.0f Z:0.0f W:0.0f];
-    case SVG_CHANNEL_G:
+    case CHANNEL_G:
         return [CIVector vectorWithX:0.0f Y:1.0f Z:0.0f W:0.0f];
-    case SVG_CHANNEL_B:
+    case CHANNEL_B:
         return [CIVector vectorWithX:0.0f Y:0.0f Z:1.0f W:0.0f];
-    case SVG_CHANNEL_A:
+    case CHANNEL_A:
         return [CIVector vectorWithX:0.0f Y:0.0f Z:0.0f W:1.0f];
     default:
         return [CIVector vectorWithX:0.0f Y:0.0f Z:0.0f W:0.0f];
diff --git a/WebCore/svg/graphics/filters/cg/SVGFEImageCg.mm b/WebCore/svg/graphics/filters/cg/SVGFEImageCg.mm
deleted file mode 100644 (file)
index 2f12274..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
-    Copyright (C) 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
-
-    This file is part of the KDE project
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Library General Public
-    License as published by the Free Software Foundation; either
-    version 2 of the License, or (at your option) any later version.
-
-    This library is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-    Library General Public License for more details.
-
-    You should have received a copy of the GNU Library General Public License
-    aint with this library; see the file COPYING.LIB.  If not, write to
-    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-    Boston, MA 02110-1301, USA.
-*/
-
-#include "config.h"
-
-#if ENABLE(SVG) && ENABLE(SVG_FILTERS)
-#include "SVGFEImage.h"
-
-#include "Image.h"
-#include "SVGFEHelpersCg.h"
-#include "CgSupport.h"
-
-namespace WebCore {
-
-CIFilter* SVGFEImage::getCIFilter(const FloatRect& bbox) const
-{
-    if (!cachedImage())
-        return nil;
-
-    SVGResourceFilter* svgFilter = filter();
-    SVGResourceFilterPlatformDataMac* filterPlatformData = static_cast<SVGResourceFilterPlatformDataMac*>(svgFilter->platformData());
-
-    CIFilter* filter;
-    BEGIN_BLOCK_OBJC_EXCEPTIONS;
-    CIImage* ciImage = [CIImage imageWithCGImage:cachedImage()->image()->getCGImageRef()];
-
-    filter = [CIFilter filterWithName:@"CIAffineTransform"];
-    [filter setDefaults];
-    [filter setValue:ciImage forKey:@"inputImage"];
-
-    FloatRect imageRect = cachedImage()->image()->rect();
-
-    // Flip image into right origin
-    CGAffineTransform cgTransform = CGAffineTransformMake(1.0f, 0.0f, 0.0f, -1.0f, 0.0f, imageRect.bottom());
-    NSAffineTransform* nsTransform = [NSAffineTransform transform];
-    [nsTransform setTransformStruct:*((NSAffineTransformStruct *)&cgTransform)];
-    [filter setValue:nsTransform forKey:@"inputTransform"];
-
-    // Calculate crop rect
-    FE_QUARTZ_MAP_TO_SUBREGION_PREPARE(bbox);
-
-    // Map between the image rectangle and the crop rect
-    if (!cropRect.isEmpty()) {
-        CIFilter* scaleImage = [CIFilter filterWithName:@"CIAffineTransform"];
-        [scaleImage setDefaults];
-        [scaleImage setValue:[filter valueForKey:@"outputImage"] forKey:@"inputImage"];
-
-        cgTransform = CGAffineTransformMakeMapBetweenRects(CGRect(imageRect), CGRect(cropRect));
-        [nsTransform setTransformStruct:*((NSAffineTransformStruct *)&cgTransform)];
-        [scaleImage setValue:nsTransform forKey:@"inputTransform"];
-
-        filter = scaleImage;
-    }
-
-    // Actually apply cropping
-    FE_QUARTZ_MAP_TO_SUBREGION_APPLY(cropRect);
-    FE_QUARTZ_OUTPUT_RETURN;
-}
-
-}
-
-#endif // ENABLE(SVG) && ENABLE(SVG_FILTERS)
diff --git a/WebCore/svg/graphics/filters/cg/SVGFEMergeCg.mm b/WebCore/svg/graphics/filters/cg/SVGFEMergeCg.mm
deleted file mode 100644 (file)
index 30a981a..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
-    Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org>
-
-    This file is part of the KDE project
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Library General Public
-    License as published by the Free Software Foundation; either
-    version 2 of the License, or (at your option) any later version.
-
-    This library is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-    Library General Public License for more details.
-
-    You should have received a copy of the GNU Library General Public License
-    aint with this library; see the file COPYING.LIB.  If not, write to
-    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-    Boston, MA 02110-1301, USA.
-*/
-
-#include "config.h"
-
-#if ENABLE(SVG) && ENABLE(SVG_FILTERS)
-#include "SVGFEMerge.h"
-#include "SVGFEHelpersCg.h"
-
-namespace WebCore {
-
-CIFilter* SVGFEMerge::getCIFilter(const FloatRect& bbox) const
-{
-    SVGResourceFilter* svgFilter = filter();
-    SVGResourceFilterPlatformDataMac* filterPlatformData = static_cast<SVGResourceFilterPlatformDataMac*>(svgFilter->platformData());
-
-    CIFilter* filter = nil;
-    BEGIN_BLOCK_OBJC_EXCEPTIONS;
-    const Vector<String>& inputs = mergeInputs();
-
-    CIImage* previousOutput = filterPlatformData->inputImage(this);
-    for (unsigned x = 0; x < inputs.size(); x++) {
-        CIImage* inputImage = filterPlatformData->imageForName(inputs[x]);
-        FE_QUARTZ_CHECK_INPUT(inputImage);
-        FE_QUARTZ_CHECK_INPUT(previousOutput);
-        filter = [CIFilter filterWithName:@"CISourceOverCompositing"];
-        [filter setDefaults];
-        [filter setValue:inputImage forKey:@"inputImage"];
-        [filter setValue:previousOutput forKey:@"inputBackgroundImage"];
-        previousOutput = [filter valueForKey:@"outputImage"];
-    }
-
-    FE_QUARTZ_MAP_TO_SUBREGION(bbox);
-    FE_QUARTZ_OUTPUT_RETURN;
-}
-
-}
-
-#endif // ENABLE(SVG) && ENABLE(SVG_FILTERS)
diff --git a/WebCore/svg/graphics/filters/cg/SVGFEOffsetCg.mm b/WebCore/svg/graphics/filters/cg/SVGFEOffsetCg.mm
deleted file mode 100644 (file)
index 46fb045..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
-    Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org>
-
-    This file is part of the KDE project
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Library General Public
-    License as published by the Free Software Foundation; either
-    version 2 of the License, or (at your option) any later version.
-
-    This library is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-    Library General Public License for more details.
-
-    You should have received a copy of the GNU Library General Public License
-    aint with this library; see the file COPYING.LIB.  If not, write to
-    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-    Boston, MA 02110-1301, USA.
-*/
-
-#include "config.h"
-
-#if ENABLE(SVG) && ENABLE(SVG_FILTERS)
-#include "SVGFEOffset.h"
-#include "SVGFEHelpersCg.h"
-
-namespace WebCore {
-
-CIFilter* SVGFEOffset::getCIFilter(const FloatRect& bbox) const
-{
-    SVGResourceFilter* svgFilter = filter();
-    FE_QUARTZ_SETUP_INPUT(@"CIAffineTransform");
-    NSAffineTransform* offsetTransform = [NSAffineTransform transform];
-    [offsetTransform translateXBy:dx() yBy:dy()];
-    [filter setValue:offsetTransform  forKey:@"inputTransform"];
-
-    FE_QUARTZ_MAP_TO_SUBREGION(bbox);
-    FE_QUARTZ_OUTPUT_RETURN;
-}
-
-}
-
-#endif // ENABLE(SVG) && ENABLE(SVG_FILTERS)
diff --git a/WebCore/svg/graphics/filters/cg/SVGFESpecularLightingCg.mm b/WebCore/svg/graphics/filters/cg/SVGFESpecularLightingCg.mm
deleted file mode 100644 (file)
index 493bce6..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
-    Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org>
-
-    This file is part of the KDE project
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Library General Public
-    License as published by the Free Software Foundation; either
-    version 2 of the License, or (at your option) any later version.
-
-    This library is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-    Library General Public License for more details.
-
-    You should have received a copy of the GNU Library General Public License
-    aint with this library; see the file COPYING.LIB.  If not, write to
-    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-    Boston, MA 02110-1301, USA.
-*/
-
-#include "config.h"
-
-#if ENABLE(SVG) && ENABLE(SVG_FILTERS)
-#include "SVGFESpecularLighting.h"
-#include "SVGFEHelpersCg.h"
-
-#import "WKSpecularLightingFilter.h"
-
-namespace WebCore {
-
-CIFilter* SVGFESpecularLighting::getCIFilter(const FloatRect& bbox) const
-{
-    const LightSource* light = lightSource();
-    if (!light)
-        return nil;
-
-    [WKSpecularLightingFilter class];
-
-    SVGResourceFilter* svgFilter = filter();
-    SVGResourceFilterPlatformDataMac* filterPlatformData = static_cast<SVGResourceFilterPlatformDataMac*>(svgFilter->platformData());
-    CIFilter* filter;
-    BEGIN_BLOCK_OBJC_EXCEPTIONS;
-    filter = [CIFilter filterWithName:@"WKSpecularLighting"];
-    [filter setDefaults];
-    CIImage* inputImage = filterPlatformData->inputImage(this);
-    FE_QUARTZ_CHECK_INPUT(inputImage);
-    CIFilter* normals = getNormalMap(inputImage, surfaceScale());
-    if (!normals)
-        return nil;
-    CIFilter* lightVectors = getLightVectors(normals, light, surfaceScale());
-    if (!lightVectors)
-        return nil;
-    [filter setValue:[normals valueForKey:@"outputImage"] forKey:@"inputNormalMap"];
-    [filter setValue:[lightVectors valueForKey:@"outputImage"] forKey:@"inputLightVectors"];
-    [filter setValue:ciColor(lightingColor()) forKey:@"inputLightingColor"];
-    [filter setValue:[NSNumber numberWithFloat:surfaceScale()] forKey:@"inputSurfaceScale"];
-    [filter setValue:[NSNumber numberWithFloat:specularConstant()] forKey:@"inputSpecularConstant"];
-    [filter setValue:[NSNumber numberWithFloat:specularExponent()] forKey:@"inputSpecularExponent"];
-    [filter setValue:[NSNumber numberWithFloat:kernelUnitLengthX()] forKey:@"inputKernelUnitLengthX"];
-    [filter setValue:[NSNumber numberWithFloat:kernelUnitLengthY()] forKey:@"inputKernelUnitLengthY"];
-
-    FE_QUARTZ_MAP_TO_SUBREGION(bbox);
-    FE_QUARTZ_OUTPUT_RETURN;
-}
-
-}
-
-#endif // ENABLE(SVG) && ENABLE(SVG_FILTERS)
diff --git a/WebCore/svg/graphics/filters/cg/SVGFETileCg.mm b/WebCore/svg/graphics/filters/cg/SVGFETileCg.mm
deleted file mode 100644 (file)
index dea9854..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
-    Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org>
-
-    This file is part of the KDE project
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Library General Public
-    License as published by the Free Software Foundation; either
-    version 2 of the License, or (at your option) any later version.
-
-    This library is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-    Library General Public License for more details.
-
-    You should have received a copy of the GNU Library General Public License
-    aint with this library; see the file COPYING.LIB.  If not, write to
-    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-    Boston, MA 02110-1301, USA.
-*/
-
-#include "config.h"
-
-#if ENABLE(SVG) && ENABLE(SVG_FILTERS)
-#include "SVGFETile.h"
-#include "SVGFEHelpersCg.h"
-
-namespace WebCore {
-
-CIFilter* SVGFETile::getCIFilter(const FloatRect& bbox) const
-{
-    SVGResourceFilter* svgFilter = filter();
-    FE_QUARTZ_SETUP_INPUT(@"CIAffineTile");
-
-    FE_QUARTZ_MAP_TO_SUBREGION(bbox);
-    FE_QUARTZ_OUTPUT_RETURN;
-}
-
-}
-
-#endif // ENABLE(SVG) && ENABLE(SVG_FILTERS)