FilterPrimitives should have a pointer to its Filter object.
authorreni@webkit.org <reni@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 20 Nov 2010 14:21:43 +0000 (14:21 +0000)
committerreni@webkit.org <reni@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 20 Nov 2010 14:21:43 +0000 (14:21 +0000)
https://bugs.webkit.org/show_bug.cgi?id=49863

Reviewed by Dirk Schulze.

FilterPrimitives should have a renderer, and they need a member pointer to their Filter objects for Layout() calls.
This patch adds this member to FilterEffect.

No new test is needed because these modifications are covered by all of SVG Filter tests.

* platform/graphics/filters/FEBlend.cpp:
(WebCore::FEBlend::FEBlend):
(WebCore::FEBlend::create):
(WebCore::FEBlend::apply):
* platform/graphics/filters/FEBlend.h:
* platform/graphics/filters/FEColorMatrix.cpp:
(WebCore::FEColorMatrix::FEColorMatrix):
(WebCore::FEColorMatrix::create):
(WebCore::FEColorMatrix::apply):
* platform/graphics/filters/FEColorMatrix.h:
* platform/graphics/filters/FEComponentTransfer.cpp:
(WebCore::FEComponentTransfer::FEComponentTransfer):
(WebCore::FEComponentTransfer::create):
(WebCore::FEComponentTransfer::apply):
* platform/graphics/filters/FEComponentTransfer.h:
* platform/graphics/filters/FEComposite.cpp:
(WebCore::FEComposite::FEComposite):
(WebCore::FEComposite::create):
(WebCore::FEComposite::determineAbsolutePaintRect):
(WebCore::FEComposite::apply):
* platform/graphics/filters/FEComposite.h:
* platform/graphics/filters/FEConvolveMatrix.cpp:
(WebCore::FEConvolveMatrix::FEConvolveMatrix):
(WebCore::FEConvolveMatrix::create):
(WebCore::FEConvolveMatrix::apply):
* platform/graphics/filters/FEConvolveMatrix.h:
(WebCore::FEConvolveMatrix::determineAbsolutePaintRect):
* platform/graphics/filters/FEDiffuseLighting.cpp:
(WebCore::FEDiffuseLighting::FEDiffuseLighting):
(WebCore::FEDiffuseLighting::create):
* platform/graphics/filters/FEDiffuseLighting.h:
* platform/graphics/filters/FEDisplacementMap.cpp:
(WebCore::FEDisplacementMap::FEDisplacementMap):
(WebCore::FEDisplacementMap::create):
(WebCore::FEDisplacementMap::apply):
* platform/graphics/filters/FEDisplacementMap.h:
(WebCore::FEDisplacementMap::determineAbsolutePaintRect):
* platform/graphics/filters/FEFlood.cpp:
(WebCore::FEFlood::FEFlood):
(WebCore::FEFlood::create):
(WebCore::FEFlood::apply):
* platform/graphics/filters/FEFlood.h:
(WebCore::FEFlood::determineAbsolutePaintRect):
* platform/graphics/filters/FEGaussianBlur.cpp:
(WebCore::FEGaussianBlur::FEGaussianBlur):
(WebCore::FEGaussianBlur::create):
(WebCore::FEGaussianBlur::determineAbsolutePaintRect):
(WebCore::FEGaussianBlur::apply):
* platform/graphics/filters/FEGaussianBlur.h:
* platform/graphics/filters/FELighting.cpp:
(WebCore::FELighting::FELighting):
(WebCore::FELighting::apply):
* platform/graphics/filters/FELighting.h:
(WebCore::FELighting::determineAbsolutePaintRect):
* platform/graphics/filters/FEMerge.cpp:
(WebCore::FEMerge::FEMerge):
(WebCore::FEMerge::create):
(WebCore::FEMerge::apply):
* platform/graphics/filters/FEMerge.h:
* platform/graphics/filters/FEMorphology.cpp:
(WebCore::FEMorphology::FEMorphology):
(WebCore::FEMorphology::create):
(WebCore::FEMorphology::determineAbsolutePaintRect):
(WebCore::FEMorphology::apply):
* platform/graphics/filters/FEMorphology.h:
* platform/graphics/filters/FEOffset.cpp:
(WebCore::FEOffset::FEOffset):
(WebCore::FEOffset::create):
(WebCore::FEOffset::determineAbsolutePaintRect):
(WebCore::FEOffset::apply):
* platform/graphics/filters/FEOffset.h:
* platform/graphics/filters/FESpecularLighting.cpp:
(WebCore::FESpecularLighting::FESpecularLighting):
(WebCore::FESpecularLighting::create):
* platform/graphics/filters/FESpecularLighting.h:
* platform/graphics/filters/FETile.cpp:
(WebCore::FETile::FETile):
(WebCore::FETile::create):
(WebCore::FETile::apply):
* platform/graphics/filters/FETile.h:
(WebCore::FETile::determineAbsolutePaintRect):
* platform/graphics/filters/FETurbulence.cpp:
(WebCore::FETurbulence::FETurbulence):
(WebCore::FETurbulence::create):
(WebCore::FETurbulence::apply):
* platform/graphics/filters/FETurbulence.h:
(WebCore::FETurbulence::determineAbsolutePaintRect):
* platform/graphics/filters/FilterEffect.cpp:
(WebCore::FilterEffect::FilterEffect):
(WebCore::FilterEffect::determineAbsolutePaintRect):
(WebCore::FilterEffect::effectContext):
* platform/graphics/filters/FilterEffect.h:
(WebCore::FilterEffect::filter):
* platform/graphics/filters/SourceAlpha.cpp:
(WebCore::SourceAlpha::create):
(WebCore::SourceAlpha::determineAbsolutePaintRect):
(WebCore::SourceAlpha::apply):
* platform/graphics/filters/SourceAlpha.h:
(WebCore::SourceAlpha::SourceAlpha):
* platform/graphics/filters/SourceGraphic.cpp:
(WebCore::SourceGraphic::create):
(WebCore::SourceGraphic::determineAbsolutePaintRect):
(WebCore::SourceGraphic::apply):
* platform/graphics/filters/SourceGraphic.h:
(WebCore::SourceGraphic::SourceGraphic):
* rendering/RenderSVGResourceFilter.cpp:
(WebCore::RenderSVGResourceFilter::buildPrimitives):
(WebCore::RenderSVGResourceFilter::applyResource):
(WebCore::RenderSVGResourceFilter::postApplyResource):
* rendering/RenderSVGResourceFilter.h:
* rendering/SVGRenderTreeAsText.cpp:
(WebCore::writeSVGResourceContainer):
* 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/SVGFEConvolveMatrixElement.cpp:
(WebCore::SVGFEConvolveMatrixElement::build):
* svg/SVGFEConvolveMatrixElement.h:
* svg/SVGFEDiffuseLightingElement.cpp:
(WebCore::SVGFEDiffuseLightingElement::build):
* svg/SVGFEDiffuseLightingElement.h:
* svg/SVGFEDisplacementMapElement.cpp:
(WebCore::SVGFEDisplacementMapElement::build):
* svg/SVGFEDisplacementMapElement.h:
* svg/SVGFEFloodElement.cpp:
(WebCore::SVGFEFloodElement::build):
* svg/SVGFEFloodElement.h:
* svg/SVGFEGaussianBlurElement.cpp:
(WebCore::SVGFEGaussianBlurElement::build):
* svg/SVGFEGaussianBlurElement.h:
* svg/SVGFEImageElement.cpp:
(WebCore::SVGFEImageElement::build):
* svg/SVGFEImageElement.h:
* svg/SVGFEMergeElement.cpp:
(WebCore::SVGFEMergeElement::build):
* svg/SVGFEMergeElement.h:
* svg/SVGFEMorphologyElement.cpp:
(WebCore::SVGFEMorphologyElement::build):
* svg/SVGFEMorphologyElement.h:
* svg/SVGFEOffsetElement.cpp:
(WebCore::SVGFEOffsetElement::build):
* svg/SVGFEOffsetElement.h:
* svg/SVGFESpecularLightingElement.cpp:
(WebCore::SVGFESpecularLightingElement::build):
* svg/SVGFESpecularLightingElement.h:
* svg/SVGFETileElement.cpp:
(WebCore::SVGFETileElement::build):
* svg/SVGFETileElement.h:
* svg/SVGFETurbulenceElement.cpp:
(WebCore::SVGFETurbulenceElement::build):
* svg/SVGFETurbulenceElement.h:
* svg/SVGFilterPrimitiveStandardAttributes.h:
* svg/graphics/filters/SVGFEImage.cpp:
(WebCore::FEImage::FEImage):
(WebCore::FEImage::create):
(WebCore::FEImage::determineAbsolutePaintRect):
(WebCore::FEImage::apply):
* svg/graphics/filters/SVGFEImage.h:
* svg/graphics/filters/SVGFilterBuilder.cpp:
(WebCore::SVGFilterBuilder::SVGFilterBuilder):
* svg/graphics/filters/SVGFilterBuilder.h:
(WebCore::SVGFilterBuilder::create):

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

79 files changed:
WebCore/ChangeLog
WebCore/platform/graphics/filters/FEBlend.cpp
WebCore/platform/graphics/filters/FEBlend.h
WebCore/platform/graphics/filters/FEColorMatrix.cpp
WebCore/platform/graphics/filters/FEColorMatrix.h
WebCore/platform/graphics/filters/FEComponentTransfer.cpp
WebCore/platform/graphics/filters/FEComponentTransfer.h
WebCore/platform/graphics/filters/FEComposite.cpp
WebCore/platform/graphics/filters/FEComposite.h
WebCore/platform/graphics/filters/FEConvolveMatrix.cpp
WebCore/platform/graphics/filters/FEConvolveMatrix.h
WebCore/platform/graphics/filters/FEDiffuseLighting.cpp
WebCore/platform/graphics/filters/FEDiffuseLighting.h
WebCore/platform/graphics/filters/FEDisplacementMap.cpp
WebCore/platform/graphics/filters/FEDisplacementMap.h
WebCore/platform/graphics/filters/FEFlood.cpp
WebCore/platform/graphics/filters/FEFlood.h
WebCore/platform/graphics/filters/FEGaussianBlur.cpp
WebCore/platform/graphics/filters/FEGaussianBlur.h
WebCore/platform/graphics/filters/FELighting.cpp
WebCore/platform/graphics/filters/FELighting.h
WebCore/platform/graphics/filters/FEMerge.cpp
WebCore/platform/graphics/filters/FEMerge.h
WebCore/platform/graphics/filters/FEMorphology.cpp
WebCore/platform/graphics/filters/FEMorphology.h
WebCore/platform/graphics/filters/FEOffset.cpp
WebCore/platform/graphics/filters/FEOffset.h
WebCore/platform/graphics/filters/FESpecularLighting.cpp
WebCore/platform/graphics/filters/FESpecularLighting.h
WebCore/platform/graphics/filters/FETile.cpp
WebCore/platform/graphics/filters/FETile.h
WebCore/platform/graphics/filters/FETurbulence.cpp
WebCore/platform/graphics/filters/FETurbulence.h
WebCore/platform/graphics/filters/FilterEffect.cpp
WebCore/platform/graphics/filters/FilterEffect.h
WebCore/platform/graphics/filters/SourceAlpha.cpp
WebCore/platform/graphics/filters/SourceAlpha.h
WebCore/platform/graphics/filters/SourceGraphic.cpp
WebCore/platform/graphics/filters/SourceGraphic.h
WebCore/rendering/RenderSVGResourceFilter.cpp
WebCore/rendering/RenderSVGResourceFilter.h
WebCore/rendering/SVGRenderTreeAsText.cpp
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/SVGFEConvolveMatrixElement.cpp
WebCore/svg/SVGFEConvolveMatrixElement.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/SVGFEMorphologyElement.cpp
WebCore/svg/SVGFEMorphologyElement.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/SVGFEImage.cpp
WebCore/svg/graphics/filters/SVGFEImage.h
WebCore/svg/graphics/filters/SVGFilterBuilder.cpp
WebCore/svg/graphics/filters/SVGFilterBuilder.h

index c11e329..6b67002 100644 (file)
@@ -1,3 +1,187 @@
+2010-11-20  Renata Hodovan  <reni@inf.u-szeged.hu>
+
+        Reviewed by Dirk Schulze.
+
+        FilterPrimitives should have a pointer to its Filter object.
+        https://bugs.webkit.org/show_bug.cgi?id=49863
+
+        FilterPrimitives should have a renderer, and they need a member pointer to their Filter objects for Layout() calls.
+        This patch adds this member to FilterEffect.
+
+        No new test is needed because these modifications are covered by all of SVG Filter tests.
+
+        * platform/graphics/filters/FEBlend.cpp:
+        (WebCore::FEBlend::FEBlend):
+        (WebCore::FEBlend::create):
+        (WebCore::FEBlend::apply):
+        * platform/graphics/filters/FEBlend.h:
+        * platform/graphics/filters/FEColorMatrix.cpp:
+        (WebCore::FEColorMatrix::FEColorMatrix):
+        (WebCore::FEColorMatrix::create):
+        (WebCore::FEColorMatrix::apply):
+        * platform/graphics/filters/FEColorMatrix.h:
+        * platform/graphics/filters/FEComponentTransfer.cpp:
+        (WebCore::FEComponentTransfer::FEComponentTransfer):
+        (WebCore::FEComponentTransfer::create):
+        (WebCore::FEComponentTransfer::apply):
+        * platform/graphics/filters/FEComponentTransfer.h:
+        * platform/graphics/filters/FEComposite.cpp:
+        (WebCore::FEComposite::FEComposite):
+        (WebCore::FEComposite::create):
+        (WebCore::FEComposite::determineAbsolutePaintRect):
+        (WebCore::FEComposite::apply):
+        * platform/graphics/filters/FEComposite.h:
+        * platform/graphics/filters/FEConvolveMatrix.cpp:
+        (WebCore::FEConvolveMatrix::FEConvolveMatrix):
+        (WebCore::FEConvolveMatrix::create):
+        (WebCore::FEConvolveMatrix::apply):
+        * platform/graphics/filters/FEConvolveMatrix.h:
+        (WebCore::FEConvolveMatrix::determineAbsolutePaintRect):
+        * platform/graphics/filters/FEDiffuseLighting.cpp:
+        (WebCore::FEDiffuseLighting::FEDiffuseLighting):
+        (WebCore::FEDiffuseLighting::create):
+        * platform/graphics/filters/FEDiffuseLighting.h:
+        * platform/graphics/filters/FEDisplacementMap.cpp:
+        (WebCore::FEDisplacementMap::FEDisplacementMap):
+        (WebCore::FEDisplacementMap::create):
+        (WebCore::FEDisplacementMap::apply):
+        * platform/graphics/filters/FEDisplacementMap.h:
+        (WebCore::FEDisplacementMap::determineAbsolutePaintRect):
+        * platform/graphics/filters/FEFlood.cpp:
+        (WebCore::FEFlood::FEFlood):
+        (WebCore::FEFlood::create):
+        (WebCore::FEFlood::apply):
+        * platform/graphics/filters/FEFlood.h:
+        (WebCore::FEFlood::determineAbsolutePaintRect):
+        * platform/graphics/filters/FEGaussianBlur.cpp:
+        (WebCore::FEGaussianBlur::FEGaussianBlur):
+        (WebCore::FEGaussianBlur::create):
+        (WebCore::FEGaussianBlur::determineAbsolutePaintRect):
+        (WebCore::FEGaussianBlur::apply):
+        * platform/graphics/filters/FEGaussianBlur.h:
+        * platform/graphics/filters/FELighting.cpp:
+        (WebCore::FELighting::FELighting):
+        (WebCore::FELighting::apply):
+        * platform/graphics/filters/FELighting.h:
+        (WebCore::FELighting::determineAbsolutePaintRect):
+        * platform/graphics/filters/FEMerge.cpp:
+        (WebCore::FEMerge::FEMerge):
+        (WebCore::FEMerge::create):
+        (WebCore::FEMerge::apply):
+        * platform/graphics/filters/FEMerge.h:
+        * platform/graphics/filters/FEMorphology.cpp:
+        (WebCore::FEMorphology::FEMorphology):
+        (WebCore::FEMorphology::create):
+        (WebCore::FEMorphology::determineAbsolutePaintRect):
+        (WebCore::FEMorphology::apply):
+        * platform/graphics/filters/FEMorphology.h:
+        * platform/graphics/filters/FEOffset.cpp:
+        (WebCore::FEOffset::FEOffset):
+        (WebCore::FEOffset::create):
+        (WebCore::FEOffset::determineAbsolutePaintRect):
+        (WebCore::FEOffset::apply):
+        * platform/graphics/filters/FEOffset.h:
+        * platform/graphics/filters/FESpecularLighting.cpp:
+        (WebCore::FESpecularLighting::FESpecularLighting):
+        (WebCore::FESpecularLighting::create):
+        * platform/graphics/filters/FESpecularLighting.h:
+        * platform/graphics/filters/FETile.cpp:
+        (WebCore::FETile::FETile):
+        (WebCore::FETile::create):
+        (WebCore::FETile::apply):
+        * platform/graphics/filters/FETile.h:
+        (WebCore::FETile::determineAbsolutePaintRect):
+        * platform/graphics/filters/FETurbulence.cpp:
+        (WebCore::FETurbulence::FETurbulence):
+        (WebCore::FETurbulence::create):
+        (WebCore::FETurbulence::apply):
+        * platform/graphics/filters/FETurbulence.h:
+        (WebCore::FETurbulence::determineAbsolutePaintRect):
+        * platform/graphics/filters/FilterEffect.cpp:
+        (WebCore::FilterEffect::FilterEffect):
+        (WebCore::FilterEffect::determineAbsolutePaintRect):
+        (WebCore::FilterEffect::effectContext):
+        * platform/graphics/filters/FilterEffect.h:
+        (WebCore::FilterEffect::filter):
+        * platform/graphics/filters/SourceAlpha.cpp:
+        (WebCore::SourceAlpha::create):
+        (WebCore::SourceAlpha::determineAbsolutePaintRect):
+        (WebCore::SourceAlpha::apply):
+        * platform/graphics/filters/SourceAlpha.h:
+        (WebCore::SourceAlpha::SourceAlpha):
+        * platform/graphics/filters/SourceGraphic.cpp:
+        (WebCore::SourceGraphic::create):
+        (WebCore::SourceGraphic::determineAbsolutePaintRect):
+        (WebCore::SourceGraphic::apply):
+        * platform/graphics/filters/SourceGraphic.h:
+        (WebCore::SourceGraphic::SourceGraphic):
+        * rendering/RenderSVGResourceFilter.cpp:
+        (WebCore::RenderSVGResourceFilter::buildPrimitives):
+        (WebCore::RenderSVGResourceFilter::applyResource):
+        (WebCore::RenderSVGResourceFilter::postApplyResource):
+        * rendering/RenderSVGResourceFilter.h:
+        * rendering/SVGRenderTreeAsText.cpp:
+        (WebCore::writeSVGResourceContainer):
+        * 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/SVGFEConvolveMatrixElement.cpp:
+        (WebCore::SVGFEConvolveMatrixElement::build):
+        * svg/SVGFEConvolveMatrixElement.h:
+        * svg/SVGFEDiffuseLightingElement.cpp:
+        (WebCore::SVGFEDiffuseLightingElement::build):
+        * svg/SVGFEDiffuseLightingElement.h:
+        * svg/SVGFEDisplacementMapElement.cpp:
+        (WebCore::SVGFEDisplacementMapElement::build):
+        * svg/SVGFEDisplacementMapElement.h:
+        * svg/SVGFEFloodElement.cpp:
+        (WebCore::SVGFEFloodElement::build):
+        * svg/SVGFEFloodElement.h:
+        * svg/SVGFEGaussianBlurElement.cpp:
+        (WebCore::SVGFEGaussianBlurElement::build):
+        * svg/SVGFEGaussianBlurElement.h:
+        * svg/SVGFEImageElement.cpp:
+        (WebCore::SVGFEImageElement::build):
+        * svg/SVGFEImageElement.h:
+        * svg/SVGFEMergeElement.cpp:
+        (WebCore::SVGFEMergeElement::build):
+        * svg/SVGFEMergeElement.h:
+        * svg/SVGFEMorphologyElement.cpp:
+        (WebCore::SVGFEMorphologyElement::build):
+        * svg/SVGFEMorphologyElement.h:
+        * svg/SVGFEOffsetElement.cpp:
+        (WebCore::SVGFEOffsetElement::build):
+        * svg/SVGFEOffsetElement.h:
+        * svg/SVGFESpecularLightingElement.cpp:
+        (WebCore::SVGFESpecularLightingElement::build):
+        * svg/SVGFESpecularLightingElement.h:
+        * svg/SVGFETileElement.cpp:
+        (WebCore::SVGFETileElement::build):
+        * svg/SVGFETileElement.h:
+        * svg/SVGFETurbulenceElement.cpp:
+        (WebCore::SVGFETurbulenceElement::build):
+        * svg/SVGFETurbulenceElement.h:
+        * svg/SVGFilterPrimitiveStandardAttributes.h:
+        * svg/graphics/filters/SVGFEImage.cpp:
+        (WebCore::FEImage::FEImage):
+        (WebCore::FEImage::create):
+        (WebCore::FEImage::determineAbsolutePaintRect):
+        (WebCore::FEImage::apply):
+        * svg/graphics/filters/SVGFEImage.h:
+        * svg/graphics/filters/SVGFilterBuilder.cpp:
+        (WebCore::SVGFilterBuilder::SVGFilterBuilder):
+        * svg/graphics/filters/SVGFilterBuilder.h:
+        (WebCore::SVGFilterBuilder::create):
+
 2010-11-20  Helder Correia  <helder@sencha.com>
 
         Reviewed by Andreas Kling.
index 03b95c3..89b44e0 100644 (file)
@@ -35,15 +35,15 @@ typedef unsigned char (*BlendType)(unsigned char colorA, unsigned char colorB, u
 
 namespace WebCore {
 
-FEBlend::FEBlend(BlendModeType mode)
-    : FilterEffect()
+FEBlend::FEBlend(Filter* filter, BlendModeType mode)
+    : FilterEffect(filter)
     , m_mode(mode)
 {
 }
 
-PassRefPtr<FEBlend> FEBlend::create(BlendModeType mode)
+PassRefPtr<FEBlend> FEBlend::create(Filter* filter, BlendModeType mode)
 {
-    return adoptRef(new FEBlend(mode));
+    return adoptRef(new FEBlend(filter, mode));
 }
 
 BlendModeType FEBlend::blendMode() const
@@ -86,19 +86,19 @@ static unsigned char lighten(unsigned char colorA, unsigned char colorB, unsigne
     return ((std::max((255 - alphaA) * colorB + colorA * 255, (255 - alphaB) * colorA + colorB * 255)) / 255);
 }
 
-void FEBlend::apply(Filter* filter)
+void FEBlend::apply()
 {
     FilterEffect* in = inputEffect(0);
     FilterEffect* in2 = inputEffect(1);
-    in->apply(filter);
-    in2->apply(filter);
+    in->apply();
+    in2->apply();
     if (!in->resultImage() || !in2->resultImage())
         return;
 
     if (m_mode <= FEBLEND_MODE_UNKNOWN || m_mode > FEBLEND_MODE_LIGHTEN)
         return;
 
-    if (!effectContext(filter))
+    if (!effectContext())
         return;
 
     IntRect effectADrawingRect = requestedRegionOfInputImageData(in->absolutePaintRect());
index a6569e2..4c59578 100644 (file)
@@ -40,18 +40,18 @@ enum BlendModeType {
 
 class FEBlend : public FilterEffect {
 public:
-    static PassRefPtr<FEBlend> create(BlendModeType);
+    static PassRefPtr<FEBlend> create(Filter*, BlendModeType);
 
     BlendModeType blendMode() const;
     void setBlendMode(BlendModeType);
 
-    virtual void apply(Filter*);
+    virtual void apply();
     virtual void dump();
 
     virtual TextStream& externalRepresentation(TextStream&, int indention) const;
 
 private:
-    FEBlend(BlendModeType);
+    FEBlend(Filter*, BlendModeType);
 
     BlendModeType m_mode;
 };
index acf7d4a..1c99b1e 100644 (file)
 
 namespace WebCore {
 
-FEColorMatrix::FEColorMatrix(ColorMatrixType type, const Vector<float>& values)
-    : FilterEffect()
+FEColorMatrix::FEColorMatrix(Filter* filter, ColorMatrixType type, const Vector<float>& values)
+    : FilterEffect(filter)
     , m_type(type)
     , m_values(values)
 {
 }
 
-PassRefPtr<FEColorMatrix> FEColorMatrix::create(ColorMatrixType type, const Vector<float>& values)
+PassRefPtr<FEColorMatrix> FEColorMatrix::create(Filter* filter, ColorMatrixType type, const Vector<float>& values)
 {
-    return adoptRef(new FEColorMatrix(type, values));
+    return adoptRef(new FEColorMatrix(filter, type, values));
 }
 
 ColorMatrixType FEColorMatrix::type() const
@@ -148,14 +148,14 @@ void effectType(ByteArray* pixelArray, const Vector<float>& values)
     }
 }
 
-void FEColorMatrix::apply(Filter* filter)
+void FEColorMatrix::apply()
 {
     FilterEffect* in = inputEffect(0);
-    in->apply(filter);
+    in->apply();
     if (!in->resultImage())
         return;
 
-    GraphicsContext* filterContext = effectContext(filter);
+    GraphicsContext* filterContext = effectContext();
     if (!filterContext)
         return;
 
index b898b17..a3ced7e 100644 (file)
@@ -40,7 +40,7 @@ enum ColorMatrixType {
 
 class FEColorMatrix : public FilterEffect {
 public:
-    static PassRefPtr<FEColorMatrix> create(ColorMatrixType, const Vector<float>&);
+    static PassRefPtr<FEColorMatrix> create(Filter*, ColorMatrixType, const Vector<float>&);
 
     ColorMatrixType type() const;
     void setType(ColorMatrixType);
@@ -48,13 +48,13 @@ public:
     const Vector<float>& values() const;
     void setValues(const Vector<float>&);
 
-    virtual void apply(Filter*);
+    virtual void apply();
     virtual void dump();
 
     virtual TextStream& externalRepresentation(TextStream&, int indention) const;
 
 private:
-    FEColorMatrix(ColorMatrixType, const Vector<float>&);
+    FEColorMatrix(Filter*, ColorMatrixType, const Vector<float>&);
 
     ColorMatrixType m_type;
     Vector<float> m_values;
index 5cffac7..cfab50b 100644 (file)
@@ -36,9 +36,9 @@ namespace WebCore {
 
 typedef void (*TransferType)(unsigned char*, const ComponentTransferFunction&);
 
-FEComponentTransfer::FEComponentTransfer(const ComponentTransferFunction& redFunc, const ComponentTransferFunction& greenFunc,
+FEComponentTransfer::FEComponentTransfer(Filter* filter, const ComponentTransferFunction& redFunc, const ComponentTransferFunction& greenFunc,
                                          const ComponentTransferFunction& blueFunc, const ComponentTransferFunction& alphaFunc)
-    : FilterEffect()
+    : FilterEffect(filter)
     , m_redFunc(redFunc)
     , m_greenFunc(greenFunc)
     , m_blueFunc(blueFunc)
@@ -46,10 +46,10 @@ FEComponentTransfer::FEComponentTransfer(const ComponentTransferFunction& redFun
 {
 }
 
-PassRefPtr<FEComponentTransfer> FEComponentTransfer::create(const ComponentTransferFunction& redFunc, 
+PassRefPtr<FEComponentTransfer> FEComponentTransfer::create(Filter* filter, const ComponentTransferFunction& redFunc, 
     const ComponentTransferFunction& greenFunc, const ComponentTransferFunction& blueFunc, const ComponentTransferFunction& alphaFunc)
 {
-    return adoptRef(new FEComponentTransfer(redFunc, greenFunc, blueFunc, alphaFunc));
+    return adoptRef(new FEComponentTransfer(filter, redFunc, greenFunc, blueFunc, alphaFunc));
 }
 
 ComponentTransferFunction FEComponentTransfer::redFunction() const
@@ -147,14 +147,14 @@ static void gamma(unsigned char* values, const ComponentTransferFunction& transf
     }
 }
 
-void FEComponentTransfer::apply(Filter* filter)
+void FEComponentTransfer::apply()
 {
     FilterEffect* in = inputEffect(0);
-    in->apply(filter);
+    in->apply();
     if (!in->resultImage())
         return;
 
-    if (!effectContext(filter))
+    if (!effectContext())
         return;
 
     unsigned char rValues[256], gValues[256], bValues[256], aValues[256];
index d3145d4..bbe3ebb 100644 (file)
@@ -63,7 +63,7 @@ struct ComponentTransferFunction {
 
 class FEComponentTransfer : public FilterEffect {
 public:
-    static PassRefPtr<FEComponentTransfer> create(const ComponentTransferFunction& redFunc, const ComponentTransferFunction& greenFunc,
+    static PassRefPtr<FEComponentTransfer> create(Filter*, const ComponentTransferFunction& redFunc, const ComponentTransferFunction& greenFunc,
                                                   const ComponentTransferFunction& blueFunc, const ComponentTransferFunction& alphaFunc);
 
     ComponentTransferFunction redFunction() const;
@@ -78,13 +78,13 @@ public:
     ComponentTransferFunction alphaFunction() const;
     void setAlphaFunction(const ComponentTransferFunction&);
 
-    virtual void apply(Filter*);
+    virtual void apply();
     virtual void dump();
 
     virtual TextStream& externalRepresentation(TextStream&, int indention) const;
 
 private:
-    FEComponentTransfer(const ComponentTransferFunction& redFunc, const ComponentTransferFunction& greenFunc,
+    FEComponentTransfer(Filter*, const ComponentTransferFunction& redFunc, const ComponentTransferFunction& greenFunc,
                         const ComponentTransferFunction& blueFunc, const ComponentTransferFunction& alphaFunc);
 
     ComponentTransferFunction m_redFunc;
index aad71e3..d27321f 100644 (file)
@@ -32,8 +32,8 @@
 
 namespace WebCore {
 
-FEComposite::FEComposite(const CompositeOperationType& type, float k1, float k2, float k3, float k4)
-    : FilterEffect()
+FEComposite::FEComposite(Filter* filter, const CompositeOperationType& type, float k1, float k2, float k3, float k4)
+    : FilterEffect(filter)
     , m_type(type)
     , m_k1(k1)
     , m_k2(k2)
@@ -42,9 +42,9 @@ FEComposite::FEComposite(const CompositeOperationType& type, float k1, float k2,
 {
 }
 
-PassRefPtr<FEComposite> FEComposite::create(const CompositeOperationType& type, float k1, float k2, float k3, float k4)
+PassRefPtr<FEComposite> FEComposite::create(Filter* filter, const CompositeOperationType& type, float k1, float k2, float k3, float k4)
 {
-    return adoptRef(new FEComposite(type, k1, k2, k3, k4));
+    return adoptRef(new FEComposite(filter, type, k1, k2, k3, k4));
 }
 
 CompositeOperationType FEComposite::operation() const
@@ -114,7 +114,7 @@ inline void arithmetic(const ByteArray* srcPixelArrayA, ByteArray* srcPixelArray
     }
 }
     
-void FEComposite::determineAbsolutePaintRect(Filter* filter)
+void FEComposite::determineAbsolutePaintRect()
 {
     switch (m_type) {
     case FECOMPOSITE_OPERATOR_IN:
@@ -130,21 +130,21 @@ void FEComposite::determineAbsolutePaintRect(Filter* filter)
         return;
     default:
         // Take the union of both input effects.
-        FilterEffect::determineAbsolutePaintRect(filter);
+        FilterEffect::determineAbsolutePaintRect();
         return;
     }
 }
 
-void FEComposite::apply(Filter* filter)
+void FEComposite::apply()
 {
     FilterEffect* in = inputEffect(0);
     FilterEffect* in2 = inputEffect(1);
-    in->apply(filter);
-    in2->apply(filter);
+    in->apply();
+    in2->apply();
     if (!in->resultImage() || !in2->resultImage())
         return;
 
-    GraphicsContext* filterContext = effectContext(filter);
+    GraphicsContext* filterContext = effectContext();
     if (!filterContext)
         return;
 
index ecdb037..b846902 100644 (file)
@@ -42,7 +42,7 @@ enum CompositeOperationType {
 
 class FEComposite : public FilterEffect {
 public:
-    static PassRefPtr<FEComposite> create(const CompositeOperationType&, float, float, float, float);
+    static PassRefPtr<FEComposite> create(Filter*, const CompositeOperationType&, float, float, float, float);
 
     CompositeOperationType operation() const;
     void setOperation(CompositeOperationType);
@@ -59,15 +59,15 @@ public:
     float k4() const;
     void setK4(float);
 
-    virtual void apply(Filter*);
+    virtual void apply();
     virtual void dump();
     
-    virtual void determineAbsolutePaintRect(Filter*);
+    virtual void determineAbsolutePaintRect();
 
     virtual TextStream& externalRepresentation(TextStream&, int indention) const;
 
 private:
-    FEComposite(const CompositeOperationType&, float, float, float, float);
+    FEComposite(Filter*, const CompositeOperationType&, float, float, float, float);
 
     CompositeOperationType m_type;
     float m_k1;
index d487a47..198d764 100644 (file)
 
 namespace WebCore {
 
-FEConvolveMatrix::FEConvolveMatrix(const IntSize& kernelSize,
+FEConvolveMatrix::FEConvolveMatrix(Filter* filter, const IntSize& kernelSize,
     float divisor, float bias, const IntPoint& targetOffset, EdgeModeType edgeMode,
     const FloatPoint& kernelUnitLength, bool preserveAlpha, const Vector<float>& kernelMatrix)
-    : FilterEffect()
+    : FilterEffect(filter)
     , m_kernelSize(kernelSize)
     , m_divisor(divisor)
     , m_bias(bias)
@@ -47,11 +47,11 @@ FEConvolveMatrix::FEConvolveMatrix(const IntSize& kernelSize,
 {
 }
 
-PassRefPtr<FEConvolveMatrix> FEConvolveMatrix::create(const IntSize& kernelSize,
+PassRefPtr<FEConvolveMatrix> FEConvolveMatrix::create(Filter* filter, const IntSize& kernelSize,
     float divisor, float bias, const IntPoint& targetOffset, EdgeModeType edgeMode,
     const FloatPoint& kernelUnitLength, bool preserveAlpha, const Vector<float>& kernelMatrix)
 {
-    return adoptRef(new FEConvolveMatrix(kernelSize, divisor, bias, targetOffset, edgeMode, kernelUnitLength,
+    return adoptRef(new FEConvolveMatrix(filter, kernelSize, divisor, bias, targetOffset, edgeMode, kernelUnitLength,
         preserveAlpha, kernelMatrix));
 }
 
@@ -370,14 +370,14 @@ ALWAYS_INLINE void FEConvolveMatrix::setOuterPixels(PaintingData& paintingData,
         fastSetOuterPixels<false>(paintingData, x1, y1, x2, y2);
 }
 
-void FEConvolveMatrix::apply(Filter* filter)
+void FEConvolveMatrix::apply()
 {
     FilterEffect* in = inputEffect(0);
-    in->apply(filter);
+    in->apply();
     if (!in->resultImage())
         return;
 
-    if (!effectContext(filter))
+    if (!effectContext())
         return;
 
     IntRect imageRect(IntPoint(), resultImage()->size());
index 8d3439e..6811a1b 100644 (file)
@@ -44,7 +44,7 @@ class CanvasPixelArray;
 
 class FEConvolveMatrix : public FilterEffect {
 public:
-    static PassRefPtr<FEConvolveMatrix> create(const IntSize&,
+    static PassRefPtr<FEConvolveMatrix> create(Filter*, const IntSize&,
             float, float, const IntPoint&, EdgeModeType, const FloatPoint&,
             bool, const Vector<float>&);
 
@@ -72,15 +72,15 @@ public:
     bool preserveAlpha() const;
     void setPreserveAlpha(bool);
 
-    virtual void apply(Filter*);
+    virtual void apply();
     virtual void dump();
 
-    virtual void determineAbsolutePaintRect(Filter*) { setAbsolutePaintRect(maxEffectRect()); }
+    virtual void determineAbsolutePaintRect() { setAbsolutePaintRect(maxEffectRect()); }
 
     virtual TextStream& externalRepresentation(TextStream&, int indention) const;
 
 private:
-    FEConvolveMatrix(const IntSize&, float, float,
+    FEConvolveMatrix(Filter*, const IntSize&, float, float,
             const IntPoint&, EdgeModeType, const FloatPoint&, bool, const Vector<float>&);
 
     struct PaintingData {
index 98b5adf..14d57f4 100644 (file)
 
 namespace WebCore {
 
-FEDiffuseLighting::FEDiffuseLighting(const Color& lightingColor, float surfaceScale,
+FEDiffuseLighting::FEDiffuseLighting(Filter* filter, const Color& lightingColor, float surfaceScale,
     float diffuseConstant, float kernelUnitLengthX, float kernelUnitLengthY, PassRefPtr<LightSource> lightSource)
-    : FELighting(DiffuseLighting, lightingColor, surfaceScale, diffuseConstant, 0, 0, kernelUnitLengthX, kernelUnitLengthY, lightSource)
+    : FELighting(filter, DiffuseLighting, lightingColor, surfaceScale, diffuseConstant, 0, 0, kernelUnitLengthX, kernelUnitLengthY, lightSource)
 {
 }
 
-PassRefPtr<FEDiffuseLighting> FEDiffuseLighting::create(const Color& lightingColor,
+PassRefPtr<FEDiffuseLighting> FEDiffuseLighting::create(Filter* filter, const Color& lightingColor,
     float surfaceScale, float diffuseConstant, float kernelUnitLengthX,
     float kernelUnitLengthY, PassRefPtr<LightSource> lightSource)
 {
-    return adoptRef(new FEDiffuseLighting(lightingColor, surfaceScale, diffuseConstant, kernelUnitLengthX, kernelUnitLengthY, lightSource));
+    return adoptRef(new FEDiffuseLighting(filter, lightingColor, surfaceScale, diffuseConstant, kernelUnitLengthX, kernelUnitLengthY, lightSource));
 }
 
 FEDiffuseLighting::~FEDiffuseLighting()
index 5273144..b58b47a 100644 (file)
@@ -31,7 +31,7 @@ class LightSource;
 
 class FEDiffuseLighting : public FELighting {
 public:
-    static PassRefPtr<FEDiffuseLighting> create(const Color&, float, float,
+    static PassRefPtr<FEDiffuseLighting> create(Filter*, const Color&, float, float,
         float, float, PassRefPtr<LightSource>);
     virtual ~FEDiffuseLighting();
 
@@ -58,7 +58,7 @@ public:
     virtual TextStream& externalRepresentation(TextStream&, int indention) const;
 
 private:
-    FEDiffuseLighting(const Color&, float, float, float, float, PassRefPtr<LightSource>);
+    FEDiffuseLighting(Filter*, const Color&, float, float, float, float, PassRefPtr<LightSource>);
 };
 
 } // namespace WebCore
index 4c62ca7..55321e6 100644 (file)
 
 namespace WebCore {
 
-FEDisplacementMap::FEDisplacementMap(ChannelSelectorType xChannelSelector, ChannelSelectorType yChannelSelector, float scale)
-    : FilterEffect()
+FEDisplacementMap::FEDisplacementMap(Filter* filter, ChannelSelectorType xChannelSelector, ChannelSelectorType yChannelSelector, float scale)
+    : FilterEffect(filter)
     , m_xChannelSelector(xChannelSelector)
     , m_yChannelSelector(yChannelSelector)
     , m_scale(scale)
 {
 }
 
-PassRefPtr<FEDisplacementMap> FEDisplacementMap::create(ChannelSelectorType xChannelSelector,
+PassRefPtr<FEDisplacementMap> FEDisplacementMap::create(Filter* filter, ChannelSelectorType xChannelSelector,
     ChannelSelectorType yChannelSelector, float scale)
 {
-    return adoptRef(new FEDisplacementMap(xChannelSelector, yChannelSelector, scale));
+    return adoptRef(new FEDisplacementMap(filter, xChannelSelector, yChannelSelector, scale));
 }
 
 ChannelSelectorType FEDisplacementMap::xChannelSelector() const
@@ -76,19 +76,19 @@ void FEDisplacementMap::setScale(float scale)
     m_scale = scale;
 }
 
-void FEDisplacementMap::apply(Filter* filter)
+void FEDisplacementMap::apply()
 {
     FilterEffect* in = inputEffect(0);
     FilterEffect* in2 = inputEffect(1);
-    in->apply(filter);
-    in2->apply(filter);
+    in->apply();
+    in2->apply();
     if (!in->resultImage() || !in2->resultImage())
         return;
 
     if (m_xChannelSelector == CHANNEL_UNKNOWN || m_yChannelSelector == CHANNEL_UNKNOWN)
         return;
 
-    if (!effectContext(filter))
+    if (!effectContext())
         return;
 
     IntRect effectADrawingRect = requestedRegionOfInputImageData(in->absolutePaintRect());
@@ -105,6 +105,7 @@ void FEDisplacementMap::apply(Filter* filter)
 
     ASSERT(srcPixelArrayA->length() == srcPixelArrayB->length());
 
+    Filter* filter = this->filter();
     float scaleX = filter->applyHorizontalScale(m_scale / 255);
     float scaleY = filter->applyVerticalScale(m_scale / 255);
     float scaleAdjustmentX = filter->applyHorizontalScale(0.5f - 0.5f * m_scale);
index c5b97a7..ffb8f0e 100644 (file)
@@ -39,7 +39,7 @@ enum ChannelSelectorType {
 
 class FEDisplacementMap : public FilterEffect {
 public:
-    static PassRefPtr<FEDisplacementMap> create(ChannelSelectorType xChannelSelector, ChannelSelectorType yChannelSelector, float);
+    static PassRefPtr<FEDisplacementMap> create(Filter*, ChannelSelectorType xChannelSelector, ChannelSelectorType yChannelSelector, float);
 
     ChannelSelectorType xChannelSelector() const;
     void setXChannelSelector(const ChannelSelectorType);
@@ -50,15 +50,15 @@ public:
     float scale() const;
     void setScale(float scale);
 
-    virtual void apply(Filter*);
+    virtual void apply();
     virtual void dump();
 
-    virtual void determineAbsolutePaintRect(Filter*) { setAbsolutePaintRect(maxEffectRect()); }
+    virtual void determineAbsolutePaintRect() { setAbsolutePaintRect(maxEffectRect()); }
 
     virtual TextStream& externalRepresentation(TextStream&, int indention) const;
 
 private:
-    FEDisplacementMap(ChannelSelectorType xChannelSelector, ChannelSelectorType yChannelSelector, float);
+    FEDisplacementMap(Filter*, ChannelSelectorType xChannelSelector, ChannelSelectorType yChannelSelector, float);
 
     ChannelSelectorType m_xChannelSelector;
     ChannelSelectorType m_yChannelSelector;
index b51a422..bc6721b 100644 (file)
 
 namespace WebCore {
 
-FEFlood::FEFlood(const Color& floodColor, float floodOpacity)
-    : FilterEffect()
+FEFlood::FEFlood(Filter* filter, const Color& floodColor, float floodOpacity)
+    : FilterEffect(filter)
     , m_floodColor(floodColor)
     , m_floodOpacity(floodOpacity)
 {
 }
 
-PassRefPtr<FEFlood> FEFlood::create(const Color& floodColor, float floodOpacity)
+PassRefPtr<FEFlood> FEFlood::create(Filter* filter, const Color& floodColor, float floodOpacity)
 {
-    return adoptRef(new FEFlood(floodColor, floodOpacity));
+    return adoptRef(new FEFlood(filter, floodColor, floodOpacity));
 }
 
 Color FEFlood::floodColor() const
@@ -62,9 +62,9 @@ void FEFlood::setFloodOpacity(float floodOpacity)
     m_floodOpacity = floodOpacity;
 }
 
-void FEFlood::apply(Filter* filter)
+void FEFlood::apply()
 {
-    GraphicsContext* filterContext = effectContext(filter);
+    GraphicsContext* filterContext = effectContext();
     if (!filterContext)
         return;
 
index e6a9574..2e8824f 100644 (file)
@@ -31,7 +31,7 @@ namespace WebCore {
 
 class FEFlood : public FilterEffect {
 public:
-    static PassRefPtr<FEFlood> create(const Color&, float);
+    static PassRefPtr<FEFlood> create(Filter* filter, const Color&, float);
 
     Color floodColor() const;
     void setFloodColor(const Color &);
@@ -39,15 +39,15 @@ public:
     float floodOpacity() const;
     void setFloodOpacity(float);
 
-    virtual void apply(Filter*);
+    virtual void apply();
     virtual void dump();
 
-    virtual void determineAbsolutePaintRect(Filter*) { setAbsolutePaintRect(maxEffectRect()); }
+    virtual void determineAbsolutePaintRect() { setAbsolutePaintRect(maxEffectRect()); }
 
     virtual TextStream& externalRepresentation(TextStream&, int indention) const;
 
 private:
-    FEFlood(const Color&, float);
+    FEFlood(Filter*, const Color&, float);
 
     Color m_floodColor;
     float m_floodOpacity;
index bb70537..876e4b3 100644 (file)
@@ -40,16 +40,16 @@ static const unsigned gMaxKernelSize = 1000;
 
 namespace WebCore {
 
-FEGaussianBlur::FEGaussianBlur(float x, float y)
-    : FilterEffect()
+FEGaussianBlur::FEGaussianBlur(Filter* filter, float x, float y)
+    : FilterEffect(filter)
     , m_stdX(x)
     , m_stdY(y)
 {
 }
 
-PassRefPtr<FEGaussianBlur> FEGaussianBlur::create(float x, float y)
+PassRefPtr<FEGaussianBlur> FEGaussianBlur::create(Filter* filter, float x, float y)
 {
-    return adoptRef(new FEGaussianBlur(x, y));
+    return adoptRef(new FEGaussianBlur(filter, x, y));
 }
 
 float FEGaussianBlur::stdDeviationX() const
@@ -147,14 +147,14 @@ inline void calculateKernelSize(Filter* filter, unsigned& kernelSizeX, unsigned&
         kernelSizeY = gMaxKernelSize;
 }
 
-void FEGaussianBlur::determineAbsolutePaintRect(Filter* filter)
+void FEGaussianBlur::determineAbsolutePaintRect()
 {
     FloatRect absolutePaintRect = inputEffect(0)->absolutePaintRect();
     absolutePaintRect.intersect(maxEffectRect());
 
     unsigned kernelSizeX = 0;
     unsigned kernelSizeY = 0;
-    calculateKernelSize(filter, kernelSizeX, kernelSizeY, m_stdX, m_stdY);
+    calculateKernelSize(filter(), kernelSizeX, kernelSizeY, m_stdX, m_stdY);
 
     // We take the half kernel size and multiply it with three, because we run box blur three times.
     absolutePaintRect.inflateX(3 * kernelSizeX * 0.5f);
@@ -162,14 +162,14 @@ void FEGaussianBlur::determineAbsolutePaintRect(Filter* filter)
     setAbsolutePaintRect(enclosingIntRect(absolutePaintRect));
 }
 
-void FEGaussianBlur::apply(Filter* filter)
+void FEGaussianBlur::apply()
 {
     FilterEffect* in = inputEffect(0);
-    in->apply(filter);
+    in->apply();
     if (!in->resultImage())
         return;
 
-    if (!effectContext(filter))
+    if (!effectContext())
         return;
 
     setIsAlphaImage(in->isAlphaImage());
@@ -185,7 +185,7 @@ void FEGaussianBlur::apply(Filter* filter)
 
     unsigned kernelSizeX = 0;
     unsigned kernelSizeY = 0;
-    calculateKernelSize(filter, kernelSizeX, kernelSizeY, m_stdX, m_stdY);
+    calculateKernelSize(filter(), kernelSizeX, kernelSizeY, m_stdX, m_stdY);
 
     ByteArray* srcPixelArray = srcImageData->data()->data();
     RefPtr<ImageData> tmpImageData = ImageData::create(imageRect.width(), imageRect.height());
index 50fc610..79f9a45 100644 (file)
@@ -30,7 +30,7 @@ namespace WebCore {
 
 class FEGaussianBlur : public FilterEffect {
 public:
-    static PassRefPtr<FEGaussianBlur> create(float, float);
+    static PassRefPtr<FEGaussianBlur> create(Filter*, float, float);
 
     float stdDeviationX() const;
     void setStdDeviationX(float);
@@ -40,15 +40,15 @@ public:
 
     static float calculateStdDeviation(float);
 
-    virtual void apply(Filter*);
+    virtual void apply();
     virtual void dump();
     
-    virtual void determineAbsolutePaintRect(Filter*);
+    virtual void determineAbsolutePaintRect();
 
     virtual TextStream& externalRepresentation(TextStream&, int indention) const;
 
 private:
-    FEGaussianBlur(float, float);
+    FEGaussianBlur(Filter*, float, float);
 
     float m_stdX;
     float m_stdY;
index 803b9c1..812920c 100644 (file)
 
 namespace WebCore {
 
-FELighting::FELighting(LightingType lightingType, const Color& lightingColor, float surfaceScale,
+FELighting::FELighting(Filter* filter, LightingType lightingType, const Color& lightingColor, float surfaceScale,
     float diffuseConstant, float specularConstant, float specularExponent,
     float kernelUnitLengthX, float kernelUnitLengthY, PassRefPtr<LightSource> lightSource)
-    : FilterEffect()
+    : FilterEffect(filter)
     , m_lightingType(lightingType)
     , m_lightSource(lightSource)
     , m_lightingColor(lightingColor)
@@ -329,14 +329,14 @@ bool FELighting::drawLighting(ByteArray* pixels, int width, int height)
     return true;
 }
 
-void FELighting::apply(Filter* filter)
+void FELighting::apply()
 {
     FilterEffect* in = inputEffect(0);
-    in->apply(filter);
+    in->apply();
     if (!in->resultImage())
         return;
 
-    if (!effectContext(filter))
+    if (!effectContext())
         return;
 
     setIsAlphaImage(false);
index c0f62ab..fa1c0aa 100644 (file)
@@ -40,9 +40,9 @@ namespace WebCore {
 
 class FELighting : public FilterEffect {
 public:
-    virtual void apply(Filter*);
+    virtual void apply();
 
-    virtual void determineAbsolutePaintRect(Filter*) { setAbsolutePaintRect(maxEffectRect()); }
+    virtual void determineAbsolutePaintRect() { setAbsolutePaintRect(maxEffectRect()); }
 
 protected:
     enum LightingType {
@@ -69,7 +69,7 @@ protected:
         inline void bottomRight(int offset, IntPoint& normalVector);
     };
 
-    FELighting(LightingType, const Color&, float, float, float, float, float, float, PassRefPtr<LightSource>);
+    FELighting(Filter*, LightingType, const Color&, float, float, float, float, float, float, PassRefPtr<LightSource>);
 
     bool drawLighting(ByteArray*, int, int);
     inline void inlineSetPixel(int offset, LightingData&, LightSource::PaintingData&,
index b136af3..ca53a86 100644 (file)
 
 namespace WebCore {
 
-FEMerge::FEMerge() 
-    : FilterEffect()
+FEMerge::FEMerge(Filter* filter
+    : FilterEffect(filter)
 {
 }
 
-PassRefPtr<FEMerge> FEMerge::create()
+PassRefPtr<FEMerge> FEMerge::create(Filter* filter)
 {
-    return adoptRef(new FEMerge);
+    return adoptRef(new FEMerge(filter));
 }
 
-void FEMerge::apply(Filter* filter)
+void FEMerge::apply()
 {
     unsigned size = numberOfEffectInputs();
     ASSERT(size > 0);
     for (unsigned i = 0; i < size; ++i) {
         FilterEffect* in = inputEffect(i);
-        in->apply(filter);
+        in->apply();
         if (!in->resultImage())
             return;
     }
 
-    GraphicsContext* filterContext = effectContext(filter);
+    GraphicsContext* filterContext = effectContext();
     if (!filterContext)
         return;
 
index 46b882f..24d071e 100644 (file)
@@ -31,15 +31,15 @@ namespace WebCore {
 
 class FEMerge : public FilterEffect {
 public:
-    static PassRefPtr<FEMerge> create();
+    static PassRefPtr<FEMerge> create(Filter*);
 
-    virtual void apply(Filter*);
+    virtual void apply();
     virtual void dump();
 
     virtual TextStream& externalRepresentation(TextStream&, int indention) const;
 
 private:
-    FEMerge();
+    FEMerge(Filter*);
 };
 
 } // namespace WebCore
index 0b67f9a..dd7659a 100644 (file)
@@ -36,17 +36,17 @@ using std::max;
 
 namespace WebCore {
 
-FEMorphology::FEMorphology(MorphologyOperatorType type, float radiusX, float radiusY)
-    : FilterEffect()
+FEMorphology::FEMorphology(Filter* filter, MorphologyOperatorType type, float radiusX, float radiusY)
+    : FilterEffect(filter)
     , m_type(type)
     , m_radiusX(radiusX)
     , m_radiusY(radiusY)
 {
 }
 
-PassRefPtr<FEMorphology> FEMorphology::create(MorphologyOperatorType type, float radiusX, float radiusY)
+PassRefPtr<FEMorphology> FEMorphology::create(Filter* filter, MorphologyOperatorType type, float radiusX, float radiusY)
 {
-    return adoptRef(new FEMorphology(type, radiusX, radiusY));
+    return adoptRef(new FEMorphology(filter, type, radiusX, radiusY));
 }
 
 MorphologyOperatorType FEMorphology::morphologyOperator() const
@@ -74,9 +74,10 @@ float FEMorphology::radiusY() const
     return m_radiusY;
 }
 
-void FEMorphology::determineAbsolutePaintRect(Filter* filter)
+void FEMorphology::determineAbsolutePaintRect()
 {
     FloatRect paintRect = inputEffect(0)->absolutePaintRect();
+    Filter* filter = this->filter();
     paintRect.inflateX(filter->applyHorizontalScale(m_radiusX));
     paintRect.inflateY(filter->applyVerticalScale(m_radiusY));
     paintRect.intersect(maxEffectRect());
@@ -88,20 +89,21 @@ void FEMorphology::setRadiusY(float radiusY)
     m_radiusY = radiusY;
 }
 
-void FEMorphology::apply(Filter* filter)
+void FEMorphology::apply()
 {
     FilterEffect* in = inputEffect(0);
-    in->apply(filter);
+    in->apply();
     if (!in->resultImage())
         return;
 
-    if (!effectContext(filter))
+    if (!effectContext())
         return;
 
     setIsAlphaImage(in->isAlphaImage());
     if (m_radiusX <= 0 || m_radiusY <= 0)
         return;
 
+    Filter* filter = this->filter();
     int radiusX = static_cast<int>(floorf(filter->applyHorizontalScale(m_radiusX)));
     int radiusY = static_cast<int>(floorf(filter->applyVerticalScale(m_radiusY)));
 
index 913671d..683e7d0 100644 (file)
@@ -36,7 +36,7 @@ enum MorphologyOperatorType {
 
 class FEMorphology : public FilterEffect {
 public:
-    static PassRefPtr<FEMorphology> create(MorphologyOperatorType, float radiusX, float radiusY);  
+    static PassRefPtr<FEMorphology> create(Filter*, MorphologyOperatorType, float radiusX, float radiusY);  
     MorphologyOperatorType morphologyOperator() const;
     void setMorphologyOperator(MorphologyOperatorType);
 
@@ -46,15 +46,15 @@ public:
     float radiusY() const;
     void setRadiusY(float);
 
-    virtual void apply(Filter*);
+    virtual void apply();
     virtual void dump();
 
-    virtual void determineAbsolutePaintRect(Filter*);
+    virtual void determineAbsolutePaintRect();
 
     virtual TextStream& externalRepresentation(TextStream&, int indention) const;
 
 private:
-    FEMorphology(MorphologyOperatorType, float radiusX, float radiusY);
+    FEMorphology(Filter*, MorphologyOperatorType, float radiusX, float radiusY);
     
     MorphologyOperatorType m_type;
     float m_radiusX;
index 6ca56aa..b640054 100644 (file)
 
 namespace WebCore {
 
-FEOffset::FEOffset(float dx, float dy)
-    : FilterEffect()
+FEOffset::FEOffset(Filter* filter, float dx, float dy)
+    : FilterEffect(filter)
     , m_dx(dx)
     , m_dy(dy)
 {
 }
 
-PassRefPtr<FEOffset> FEOffset::create(float dx, float dy)
+PassRefPtr<FEOffset> FEOffset::create(Filter* filter, float dx, float dy)
 {
-    return adoptRef(new FEOffset(dx, dy));
+    return adoptRef(new FEOffset(filter, dx, dy));
 }
 
 float FEOffset::dx() const
@@ -63,28 +63,30 @@ void FEOffset::setDy(float dy)
     m_dy = dy;
 }
 
-void FEOffset::determineAbsolutePaintRect(Filter* filter)
+void FEOffset::determineAbsolutePaintRect()
 {
     FloatRect paintRect = inputEffect(0)->absolutePaintRect();
+    Filter* filter = this->filter();
     paintRect.move(filter->applyHorizontalScale(m_dx), filter->applyVerticalScale(m_dy));
     paintRect.intersect(maxEffectRect());
     setAbsolutePaintRect(enclosingIntRect(paintRect));
 }
 
-void FEOffset::apply(Filter* filter)
+void FEOffset::apply()
 {
     FilterEffect* in = inputEffect(0);
-    in->apply(filter);
+    in->apply();
     if (!in->resultImage())
         return;
 
-    GraphicsContext* filterContext = effectContext(filter);
+    GraphicsContext* filterContext = effectContext();
     if (!filterContext)
         return;
 
     setIsAlphaImage(in->isAlphaImage());
 
     FloatRect drawingRegion = drawingRegionOfInputImage(in->absolutePaintRect());
+    Filter* filter = this->filter();
     drawingRegion.move(filter->applyHorizontalScale(m_dx), filter->applyVerticalScale(m_dy));
     filterContext->drawImageBuffer(in->resultImage(), ColorSpaceDeviceRGB, drawingRegion);
 }
index 36575c5..5aa5c38 100644 (file)
@@ -30,7 +30,7 @@ namespace WebCore {
 
 class FEOffset : public FilterEffect {
 public:
-    static PassRefPtr<FEOffset> create(float dx, float dy);
+    static PassRefPtr<FEOffset> create(Filter*, float dx, float dy);
 
     float dx() const;
     void setDx(float);
@@ -38,15 +38,15 @@ public:
     float dy() const;
     void setDy(float);
 
-    virtual void apply(Filter*);
+    virtual void apply();
     virtual void dump();
     
-    virtual void determineAbsolutePaintRect(Filter*);
+    virtual void determineAbsolutePaintRect();
 
     virtual TextStream& externalRepresentation(TextStream&, int indention) const;
 
 private:
-    FEOffset(float dx, float dy);
+    FEOffset(Filter*, float dx, float dy);
 
     float m_dx;
     float m_dy;
index 2606600..d21dafd 100644 (file)
 
 namespace WebCore {
 
-FESpecularLighting::FESpecularLighting(const Color& lightingColor, float surfaceScale,
+FESpecularLighting::FESpecularLighting(Filter* filter, const Color& lightingColor, float surfaceScale,
     float specularConstant, float specularExponent, float kernelUnitLengthX,
     float kernelUnitLengthY, PassRefPtr<LightSource> lightSource)
-    : FELighting(SpecularLighting, lightingColor, surfaceScale, 0, specularConstant, specularExponent, kernelUnitLengthX, kernelUnitLengthY, lightSource)
+    : FELighting(filter, SpecularLighting, lightingColor, surfaceScale, 0, specularConstant, specularExponent, kernelUnitLengthX, kernelUnitLengthY, lightSource)
 {
 }
 
-PassRefPtr<FESpecularLighting> FESpecularLighting::create(const Color& lightingColor,
+PassRefPtr<FESpecularLighting> FESpecularLighting::create(Filter* filter, const Color& lightingColor,
     float surfaceScale, float specularConstant, float specularExponent,
     float kernelUnitLengthX, float kernelUnitLengthY, PassRefPtr<LightSource> lightSource)
 {
-    return adoptRef(new FESpecularLighting(lightingColor, surfaceScale, specularConstant, specularExponent,
+    return adoptRef(new FESpecularLighting(filter, lightingColor, surfaceScale, specularConstant, specularExponent,
         kernelUnitLengthX, kernelUnitLengthY, lightSource));
 }
 
index f6e7b66..b3ccfbc 100644 (file)
@@ -29,7 +29,7 @@ namespace WebCore {
 
 class FESpecularLighting : public FELighting {
 public:
-    static PassRefPtr<FESpecularLighting> create(const Color&, float, float,
+    static PassRefPtr<FESpecularLighting> create(Filter*, const Color&, float, float,
         float, float, float, PassRefPtr<LightSource>);
     virtual ~FESpecularLighting();
 
@@ -59,7 +59,7 @@ public:
     virtual TextStream& externalRepresentation(TextStream&, int indention) const;
 
 private:
-    FESpecularLighting(const Color&, float, float, float, float, float, PassRefPtr<LightSource>);
+    FESpecularLighting(Filter*, const Color&, float, float, float, float, float, PassRefPtr<LightSource>);
 };
 
 } // namespace WebCore
index 57160ed..6b11401 100644 (file)
 
 namespace WebCore {
 
-FETile::FETile()
-    : FilterEffect()
+FETile::FETile(Filter* filter)
+    : FilterEffect(filter)
 {
 }
 
-PassRefPtr<FETile> FETile::create()
+PassRefPtr<FETile> FETile::create(Filter* filter)
 {
-    return adoptRef(new FETile);
+    return adoptRef(new FETile(filter));
 }
 
-void FETile::apply(Filter* filter)
+void FETile::apply()
 {
 // FIXME: See bug 47315. This is a hack to work around a compile failure, but is incorrect behavior otherwise.
 #if ENABLE(SVG)
     FilterEffect* in = inputEffect(0);
-    in->apply(filter);
+    in->apply();
     if (!in->resultImage())
         return;
 
-    GraphicsContext* filterContext = effectContext(filter);
+    GraphicsContext* filterContext = effectContext();
     if (!filterContext)
         return;
 
@@ -62,6 +62,7 @@ void FETile::apply(Filter* filter)
     FloatPoint inMaxEffectLocation = tileRect.location();
     FloatPoint maxEffectLocation = maxEffectRect().location();
     if (in->filterEffectType() == FilterEffectTypeSourceInput) {
+        Filter* filter = this->filter();
         tileRect = filter->filterRegion();
         tileRect.scale(filter->filterResolution().width(), filter->filterResolution().height());
     }
index 5f21433..9b02b4c 100644 (file)
@@ -30,19 +30,19 @@ namespace WebCore {
     
 class FETile : public FilterEffect {
 public:
-    static PassRefPtr<FETile> create();
+    static PassRefPtr<FETile> create(Filter* filter);
 
-    virtual void apply(Filter*);
+    virtual void apply();
     virtual void dump();
 
-    virtual void determineAbsolutePaintRect(Filter*) { setAbsolutePaintRect(maxEffectRect()); }
+    virtual void determineAbsolutePaintRect() { setAbsolutePaintRect(maxEffectRect()); }
 
     virtual FilterEffectType filterEffectType() const { return FilterEffectTypeTile; }
 
     virtual TextStream& externalRepresentation(TextStream&, int indention) const;
 
 private:
-    FETile();
+    FETile(Filter*);
 };
 
 } // namespace WebCore
index 9ad27cf..8914db7 100644 (file)
@@ -47,8 +47,8 @@ static const int s_randAmplitude = 16807; // 7**5; primitive root of m
 static const int s_randQ = 127773; // m / a
 static const int s_randR = 2836; // m % a
 
-FETurbulence::FETurbulence(TurbulanceType type, float baseFrequencyX, float baseFrequencyY, int numOctaves, float seed, bool stitchTiles)
-    : FilterEffect()
+FETurbulence::FETurbulence(Filter* filter, TurbulanceType type, float baseFrequencyX, float baseFrequencyY, int numOctaves, float seed, bool stitchTiles)
+    : FilterEffect(filter)
     , m_type(type)
     , m_baseFrequencyX(baseFrequencyX)
     , m_baseFrequencyY(baseFrequencyY)
@@ -58,9 +58,9 @@ FETurbulence::FETurbulence(TurbulanceType type, float baseFrequencyX, float base
 {
 }
 
-PassRefPtr<FETurbulence> FETurbulence::create(TurbulanceType type, float baseFrequencyX, float baseFrequencyY, int numOctaves, float seed, bool stitchTiles)
+PassRefPtr<FETurbulence> FETurbulence::create(Filter* filter, TurbulanceType type, float baseFrequencyX, float baseFrequencyY, int numOctaves, float seed, bool stitchTiles)
 {
-    return adoptRef(new FETurbulence(type, baseFrequencyX, baseFrequencyY, numOctaves, seed, stitchTiles));
+    return adoptRef(new FETurbulence(filter, type, baseFrequencyX, baseFrequencyY, numOctaves, seed, stitchTiles));
 }
 
 TurbulanceType FETurbulence::type() const
@@ -318,9 +318,9 @@ unsigned char FETurbulence::calculateTurbulenceValueForPoint(PaintingData& paint
     return static_cast<unsigned char>(turbulenceFunctionResult * 255);
 }
 
-void FETurbulence::apply(Filter* filter)
+void FETurbulence::apply()
 {
-    if (!effectContext(filter))
+    if (!effectContext())
         return;
 
     IntRect imageRect(IntPoint(), resultImage()->size());
@@ -342,7 +342,7 @@ void FETurbulence::apply(Filter* filter)
         for (int x = 0; x < imageRect.width(); ++x) {
             point.setX(point.x() + 1);
             for (paintingData.channel = 0; paintingData.channel < 4; ++paintingData.channel, ++indexOfPixelChannel)
-                pixelArray->set(indexOfPixelChannel, calculateTurbulenceValueForPoint(paintingData, filter->mapAbsolutePointToLocalPoint(point)));
+                pixelArray->set(indexOfPixelChannel, calculateTurbulenceValueForPoint(paintingData, filter()->mapAbsolutePointToLocalPoint(point)));
         }
     }
     resultImage()->putUnmultipliedImageData(imageData.get(), imageRect, IntPoint());
index c15d7d1..1bad123 100644 (file)
@@ -38,7 +38,7 @@ enum TurbulanceType {
 
 class FETurbulence : public FilterEffect {
 public:
-    static PassRefPtr<FETurbulence> create(TurbulanceType, float, float, int, float, bool);
+    static PassRefPtr<FETurbulence> create(Filter*, TurbulanceType, float, float, int, float, bool);
 
     TurbulanceType type() const;
     void setType(TurbulanceType);
@@ -58,10 +58,10 @@ public:
     bool stitchTiles() const;
     void setStitchTiles(bool);
 
-    virtual void apply(Filter*);
+    virtual void apply();
     virtual void dump();
     
-    virtual void determineAbsolutePaintRect(Filter*) { setAbsolutePaintRect(maxEffectRect()); }
+    virtual void determineAbsolutePaintRect() { setAbsolutePaintRect(maxEffectRect()); }
 
     virtual TextStream& externalRepresentation(TextStream&, int indention) const;
 
@@ -84,7 +84,7 @@ private:
         inline long random();
     };
 
-    FETurbulence(TurbulanceType, float, float, int, float, bool);
+    FETurbulence(Filter*, TurbulanceType, float, float, int, float, bool);
 
     inline void initPaint(PaintingData&);
     float noise2D(PaintingData&, const FloatPoint&);
index ad351a5..c228731 100644 (file)
 
 namespace WebCore {
 
-FilterEffect::FilterEffect()
+FilterEffect::FilterEffect(Filter* filter)
     : m_alphaImage(false)
+    , m_filter(filter)
     , m_hasX(false)
     , m_hasY(false)
     , m_hasWidth(false)
     , m_hasHeight(false)
 {
+    ASSERT(m_filter);
 }
 
 FilterEffect::~FilterEffect()
 {
 }
 
-void FilterEffect::determineAbsolutePaintRect(Filter*)
+void FilterEffect::determineAbsolutePaintRect()
 {
     m_absolutePaintRect = IntRect();
     unsigned size = m_inputEffects.size();
@@ -70,9 +72,9 @@ FilterEffect* FilterEffect::inputEffect(unsigned number) const
     return m_inputEffects.at(number).get();
 }
 
-GraphicsContext* FilterEffect::effectContext(Filter* filter)
+GraphicsContext* FilterEffect::effectContext()
 {
-    determineAbsolutePaintRect(filter);
+    determineAbsolutePaintRect();
     if (m_absolutePaintRect.isEmpty())
         return 0;
     m_effectBuffer = ImageBuffer::create(m_absolutePaintRect.size(), ColorSpaceLinearRGB);
index 25db57b..f9674e2 100644 (file)
@@ -56,7 +56,7 @@ public:
 
     // Creates the ImageBuffer for the current filter primitive result in the size of the
     // repaintRect. Gives back the GraphicsContext of the own ImageBuffer.
-    GraphicsContext* effectContext(Filter*);
+    GraphicsContext* effectContext();
 
     FilterEffectVector& inputEffects() { return m_inputEffects; }
     FilterEffect* inputEffect(unsigned) const;
@@ -75,10 +75,10 @@ public:
     IntRect maxEffectRect() const { return m_maxEffectRect; }
     void setMaxEffectRect(const IntRect& maxEffectRect) { m_maxEffectRect = maxEffectRect; } 
 
-    virtual void apply(Filter*) = 0;
+    virtual void apply() = 0;
     virtual void dump() = 0;
 
-    virtual void determineAbsolutePaintRect(Filter*);
+    virtual void determineAbsolutePaintRect();
 
     virtual FilterEffectType filterEffectType() const { return FilterEffectTypeUnknown; }
 
@@ -105,8 +105,10 @@ public:
     FloatRect effectBoundaries() const { return m_effectBoundaries; }
     void setEffectBoundaries(const FloatRect& effectBoundaries) { m_effectBoundaries = effectBoundaries; }
 
+    Filter* filter() { return m_filter; }
+
 protected:
-    FilterEffect();
+    FilterEffect(Filter*);
 
 private:
     OwnPtr<ImageBuffer> m_effectBuffer;
@@ -119,6 +121,7 @@ private:
     // The maximum size of a filter primitive. In SVG this is the primitive subregion in absolute coordinate space.
     // The absolute paint rect should never be bigger than m_maxEffectRect.
     IntRect m_maxEffectRect;
+    Filter* m_filter;
 
 private:
     // The following member variables are SVG specific and will move to RenderSVGResourceFilterPrimitive.
index 7dc56d9..a505b4b 100644 (file)
@@ -31,9 +31,9 @@
 
 namespace WebCore {
 
-PassRefPtr<SourceAlpha> SourceAlpha::create()
+PassRefPtr<SourceAlpha> SourceAlpha::create(Filter* filter)
 {
-    return adoptRef(new SourceAlpha);
+    return adoptRef(new SourceAlpha(filter));
 }
 
 const AtomicString& SourceAlpha::effectName()
@@ -42,16 +42,18 @@ const AtomicString& SourceAlpha::effectName()
     return s_effectName;
 }
 
-void SourceAlpha::determineAbsolutePaintRect(Filter* filter)
+void SourceAlpha::determineAbsolutePaintRect()
 {
+    Filter* filter = this->filter();
     FloatRect paintRect = filter->sourceImageRect();
     paintRect.scale(filter->filterResolution().width(), filter->filterResolution().height());
     setAbsolutePaintRect(enclosingIntRect(paintRect));
 }
 
-void SourceAlpha::apply(Filter* filter)
+void SourceAlpha::apply()
 {
-    GraphicsContext* filterContext = effectContext(filter);
+    GraphicsContext* filterContext = effectContext();
+    Filter* filter = this->filter();
     if (!filterContext || !filter->sourceImage())
         return;
 
index 83704e5..c6f95d3 100644 (file)
@@ -30,21 +30,24 @@ namespace WebCore {
 
 class SourceAlpha : public FilterEffect {
 public:        
-    static PassRefPtr<SourceAlpha> create();
+    static PassRefPtr<SourceAlpha> create(Filter*);
 
     static const AtomicString& effectName();
 
-    virtual void apply(Filter*);
+    virtual void apply();
     virtual void dump();
 
-    virtual void determineAbsolutePaintRect(Filter*);
+    virtual void determineAbsolutePaintRect();
 
     virtual FilterEffectType filterEffectType() const { return FilterEffectTypeSourceInput; }
 
     virtual TextStream& externalRepresentation(TextStream&, int indention) const;
 
 private:
-    SourceAlpha() { }
+    SourceAlpha(Filter* filter)
+        : FilterEffect(filter)
+    {
+    }
 };
 
 } //namespace WebCore
index fbb711a..6aac367 100644 (file)
@@ -30,9 +30,9 @@
 
 namespace WebCore {
 
-PassRefPtr<SourceGraphic> SourceGraphic::create()
+PassRefPtr<SourceGraphic> SourceGraphic::create(Filter* filter)
 {
-    return adoptRef(new SourceGraphic);
+    return adoptRef(new SourceGraphic(filter));
 }
 
 const AtomicString& SourceGraphic::effectName()
@@ -41,16 +41,18 @@ const AtomicString& SourceGraphic::effectName()
     return s_effectName;
 }
 
-void SourceGraphic::determineAbsolutePaintRect(Filter* filter)
+void SourceGraphic::determineAbsolutePaintRect()
 {
+    Filter* filter = this->filter();
     FloatRect paintRect = filter->sourceImageRect();
     paintRect.scale(filter->filterResolution().width(), filter->filterResolution().height());
     setAbsolutePaintRect(enclosingIntRect(paintRect));
 }
 
-void SourceGraphic::apply(Filter* filter)
+void SourceGraphic::apply()
 {
-    GraphicsContext* filterContext = effectContext(filter);
+    GraphicsContext* filterContext = effectContext();
+    Filter* filter = this->filter();
     if (!filterContext || !filter->sourceImage())
         return;
 
index a13337d..fa47f12 100644 (file)
@@ -31,21 +31,24 @@ namespace WebCore {
 
 class SourceGraphic : public FilterEffect {
 public:        
-    static PassRefPtr<SourceGraphic> create();
+    static PassRefPtr<SourceGraphic> create(Filter*);
 
     static const AtomicString& effectName();
 
-    virtual void apply(Filter*);
+    virtual void apply();
     virtual void dump();
 
-    virtual void determineAbsolutePaintRect(Filter*);
+    virtual void determineAbsolutePaintRect();
 
     virtual FilterEffectType filterEffectType() const { return FilterEffectTypeSourceInput; }
 
     virtual TextStream& externalRepresentation(TextStream&, int indention) const;
 
 private:
-    SourceGraphic() { }
+    SourceGraphic(Filter* filter)
+        : FilterEffect(filter)
+    {
+    }
 };
 
 } //namespace WebCore
index 60bf450..72872f6 100644 (file)
@@ -88,13 +88,13 @@ void RenderSVGResourceFilter::removeClientFromCache(RenderObject* client, bool m
     markClientForInvalidation(client, markForInvalidation ? BoundariesInvalidation : ParentOnlyInvalidation);
 }
 
-PassRefPtr<SVGFilterBuilder> RenderSVGResourceFilter::buildPrimitives()
+PassRefPtr<SVGFilterBuilder> RenderSVGResourceFilter::buildPrimitives(Filter* filter)
 {
     SVGFilterElement* filterElement = static_cast<SVGFilterElement*>(node());
     bool primitiveBoundingBoxMode = filterElement->primitiveUnits() == SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX;
 
     // Add effects to the builder
-    RefPtr<SVGFilterBuilder> builder = SVGFilterBuilder::create();
+    RefPtr<SVGFilterBuilder> builder = SVGFilterBuilder::create(filter);
     for (Node* node = filterElement->firstChild(); node; node = node->nextSibling()) {
         if (!node->isSVGElement())
             continue;
@@ -104,7 +104,7 @@ PassRefPtr<SVGFilterBuilder> RenderSVGResourceFilter::buildPrimitives()
             continue;
 
         SVGFilterPrimitiveStandardAttributes* effectElement = static_cast<SVGFilterPrimitiveStandardAttributes*>(element);
-        RefPtr<FilterEffect> effect = effectElement->build(builder.get());
+        RefPtr<FilterEffect> effect = effectElement->build(builder.get(), filter);
         if (!effect) {
             builder->clearEffects();
             return 0;
@@ -179,7 +179,7 @@ bool RenderSVGResourceFilter::applyResource(RenderObject* object, RenderStyle*,
     filterData->filter = SVGFilter::create(filterData->shearFreeAbsoluteTransform, absoluteDrawingRegion, targetBoundingBox, filterData->boundaries, primitiveBoundingBoxMode);
 
     // Create all relevant filter primitives.
-    filterData->builder = buildPrimitives();
+    filterData->builder = buildPrimitives(filterData->filter.get());
     if (!filterData->builder)
         return false;
 
@@ -290,7 +290,7 @@ void RenderSVGResourceFilter::postApplyResource(RenderObject* object, GraphicsCo
         // second drawing.
         if (!filterData->builded) {
             filterData->filter->setSourceImage(filterData->sourceGraphicBuffer.release());
-            lastEffect->apply(filterData->filter.get());
+            lastEffect->apply();
 #if !PLATFORM(CG)
             ImageBuffer* resultImage = lastEffect->resultImage();
             if (resultImage)
index c64f5c6..32f61ea 100644 (file)
@@ -74,7 +74,7 @@ public:
 
     virtual FloatRect resourceBoundingBox(RenderObject*);
 
-    PassRefPtr<SVGFilterBuilder> buildPrimitives();
+    PassRefPtr<SVGFilterBuilder> buildPrimitives(Filter*);
 
     SVGUnitTypes::SVGUnitType filterUnits() const { return toUnitType(static_cast<SVGFilterElement*>(node())->filterUnits()); }
     SVGUnitTypes::SVGUnitType primitiveUnits() const { return toUnitType(static_cast<SVGFilterElement*>(node())->primitiveUnits()); }
index 4e47ec8..9393fd6 100644 (file)
@@ -559,10 +559,13 @@ void writeSVGResourceContainer(TextStream& ts, const RenderObject& object, int i
         writeNameValuePair(ts, "filterUnits", filter->filterUnits());
         writeNameValuePair(ts, "primitiveUnits", filter->primitiveUnits());
         ts << "\n";
-        if (RefPtr<SVGFilterBuilder> builder = filter->buildPrimitives()) {
+        // Creating a placeholder filter which is passed to the builder.
+        FloatRect dummyRect;
+        RefPtr<SVGFilter> dummyFilter = SVGFilter::create(AffineTransform(), dummyRect, dummyRect, dummyRect, true);
+        if (RefPtr<SVGFilterBuilder> builder = filter->buildPrimitives(dummyFilter.get())) {
             if (FilterEffect* lastEffect = builder->lastEffect())
                 lastEffect->externalRepresentation(ts, indent + 1);
-        }      
+        }
 #endif
     } else if (resource->resourceType() == ClipperResourceType) {
         RenderSVGResourceClipper* clipper = static_cast<RenderSVGResourceClipper*>(resource);
index 6c5952f..0e00627 100644 (file)
@@ -89,7 +89,7 @@ void SVGFEBlendElement::synchronizeProperty(const QualifiedName& attrName)
         synchronizeIn2();
 }
 
-PassRefPtr<FilterEffect> SVGFEBlendElement::build(SVGFilterBuilder* filterBuilder)
+PassRefPtr<FilterEffect> SVGFEBlendElement::build(SVGFilterBuilder* filterBuilder, Filter* filter)
 {
     FilterEffect* input1 = filterBuilder->getEffectById(in1());
     FilterEffect* input2 = filterBuilder->getEffectById(in2());
@@ -97,7 +97,7 @@ PassRefPtr<FilterEffect> SVGFEBlendElement::build(SVGFilterBuilder* filterBuilde
     if (!input1 || !input2)
         return 0;
 
-    RefPtr<FilterEffect> effect = FEBlend::create(static_cast<BlendModeType>(mode()));
+    RefPtr<FilterEffect> effect = FEBlend::create(filter, static_cast<BlendModeType>(mode()));
     FilterEffectVector& inputEffects = effect->inputEffects();
     inputEffects.reserveCapacity(2);
     inputEffects.append(input1);
index 44d45bf..e203cd0 100644 (file)
@@ -36,7 +36,7 @@ private:
     virtual void parseMappedAttribute(Attribute*);
     virtual void svgAttributeChanged(const QualifiedName&);
     virtual void synchronizeProperty(const QualifiedName&);
-    virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*);
+    virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*, Filter*);
 
     DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFEBlendElement, SVGNames::inAttr, String, In1, in1)
     DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFEBlendElement, SVGNames::in2Attr, String, In2, in2)
index 680cce7..f02f02e 100644 (file)
@@ -93,7 +93,7 @@ void SVGFEColorMatrixElement::synchronizeProperty(const QualifiedName& attrName)
         synchronizeValues();
 }
 
-PassRefPtr<FilterEffect> SVGFEColorMatrixElement::build(SVGFilterBuilder* filterBuilder)
+PassRefPtr<FilterEffect> SVGFEColorMatrixElement::build(SVGFilterBuilder* filterBuilder, Filter* filter)
 {
     FilterEffect* input1 = filterBuilder->getEffectById(in1());
 
@@ -130,7 +130,7 @@ PassRefPtr<FilterEffect> SVGFEColorMatrixElement::build(SVGFilterBuilder* filter
             return 0;
     }
 
-    RefPtr<FilterEffect> effect = FEColorMatrix::create(filterType, filterValues);
+    RefPtr<FilterEffect> effect = FEColorMatrix::create(filter, filterType, filterValues);
     effect->inputEffects().append(input1);
     return effect.release();
 }
index dcdeb41..1b51932 100644 (file)
@@ -38,7 +38,7 @@ private:
     virtual void parseMappedAttribute(Attribute*);
     virtual void svgAttributeChanged(const QualifiedName&);
     virtual void synchronizeProperty(const QualifiedName&);
-    virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*);
+    virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*, Filter*);
 
     DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFEColorMatrixElement, SVGNames::inAttr, String, In1, in1)
     DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFEColorMatrixElement, SVGNames::typeAttr, int, Type, type)
index f6b26f5..72cefac 100644 (file)
@@ -60,7 +60,7 @@ void SVGFEComponentTransferElement::synchronizeProperty(const QualifiedName& att
         synchronizeIn1();
 }
 
-PassRefPtr<FilterEffect> SVGFEComponentTransferElement::build(SVGFilterBuilder* filterBuilder)
+PassRefPtr<FilterEffect> SVGFEComponentTransferElement::build(SVGFilterBuilder* filterBuilder, Filter* filter)
 {
     FilterEffect* input1 = filterBuilder->getEffectById(in1());
     
@@ -83,7 +83,7 @@ PassRefPtr<FilterEffect> SVGFEComponentTransferElement::build(SVGFilterBuilder*
             alpha = static_cast<SVGFEFuncAElement*>(n)->transferFunction();
     }
     
-    RefPtr<FilterEffect> effect = FEComponentTransfer::create(red, green, blue, alpha);
+    RefPtr<FilterEffect> effect = FEComponentTransfer::create(filter, red, green, blue, alpha);
     effect->inputEffects().append(input1);
     return effect.release();
 }
index fe0e562..e0ad03a 100644 (file)
@@ -36,7 +36,7 @@ private:
 
     virtual void parseMappedAttribute(Attribute*);
     virtual void synchronizeProperty(const QualifiedName&);
-    virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*);
+    virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*, Filter*);
 
     DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFEComponentTransferElement, SVGNames::inAttr, String, In1, in1)
 };
index 6d7e7b2..07c8aee 100644 (file)
@@ -116,7 +116,7 @@ void SVGFECompositeElement::synchronizeProperty(const QualifiedName& attrName)
         synchronizeK4();
 }
 
-PassRefPtr<FilterEffect> SVGFECompositeElement::build(SVGFilterBuilder* filterBuilder)
+PassRefPtr<FilterEffect> SVGFECompositeElement::build(SVGFilterBuilder* filterBuilder, Filter* filter)
 {
     FilterEffect* input1 = filterBuilder->getEffectById(in1());
     FilterEffect* input2 = filterBuilder->getEffectById(in2());
@@ -124,7 +124,7 @@ PassRefPtr<FilterEffect> SVGFECompositeElement::build(SVGFilterBuilder* filterBu
     if (!input1 || !input2)
         return 0;
 
-    RefPtr<FilterEffect> effect = FEComposite::create(static_cast<CompositeOperationType>(_operator()),
+    RefPtr<FilterEffect> effect = FEComposite::create(filter, static_cast<CompositeOperationType>(_operator()),
                                                           k1(), k2(), k3(), k4());
     FilterEffectVector& inputEffects = effect->inputEffects();
     inputEffects.reserveCapacity(2);
index 4870848..52a1762 100644 (file)
@@ -37,7 +37,7 @@ private:
     virtual void parseMappedAttribute(Attribute*);
     virtual void svgAttributeChanged(const QualifiedName&);
     virtual void synchronizeProperty(const QualifiedName&);
-    virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*);
+    virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*, Filter*);
 
     DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFECompositeElement, SVGNames::inAttr, String, In1, in1)
     DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFECompositeElement, SVGNames::in2Attr, String, In2, in2)
index 302e5d4..6c2c248 100644 (file)
@@ -147,7 +147,7 @@ void SVGFEConvolveMatrixElement::svgAttributeChanged(const QualifiedName& attrNa
         invalidate();
 }
 
-PassRefPtr<FilterEffect> SVGFEConvolveMatrixElement::build(SVGFilterBuilder* filterBuilder)
+PassRefPtr<FilterEffect> SVGFEConvolveMatrixElement::build(SVGFilterBuilder* filterBuilder, Filter* filter)
 {
     FilterEffect* input1 = filterBuilder->getEffectById(in1());
 
@@ -189,7 +189,7 @@ PassRefPtr<FilterEffect> SVGFEConvolveMatrixElement::build(SVGFilterBuilder* fil
             divisorValue = 1;
     }
 
-    RefPtr<FilterEffect> effect = FEConvolveMatrix::create(
+    RefPtr<FilterEffect> effect = FEConvolveMatrix::create(filter,
                     IntSize(orderXValue, orderYValue), divisorValue,
                     bias(), IntPoint(targetXValue, targetYValue), static_cast<EdgeModeType>(edgeMode()),
                     FloatPoint(kernelUnitLengthX(), kernelUnitLengthX()), preserveAlpha(), kernelMatrix);
index b36b7f1..c9bc4d8 100644 (file)
@@ -39,7 +39,7 @@ private:
 
     virtual void parseMappedAttribute(Attribute*);
     virtual void svgAttributeChanged(const QualifiedName&);
-    virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*);
+    virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*, Filter*);
     static const AtomicString& orderXIdentifier();
     static const AtomicString& orderYIdentifier();
 
index 6da804f..1f044c0 100644 (file)
@@ -112,7 +112,7 @@ void SVGFEDiffuseLightingElement::synchronizeProperty(const QualifiedName& attrN
     }
 }
 
-PassRefPtr<FilterEffect> SVGFEDiffuseLightingElement::build(SVGFilterBuilder* filterBuilder)
+PassRefPtr<FilterEffect> SVGFEDiffuseLightingElement::build(SVGFilterBuilder* filterBuilder, Filter* filter)
 {
     FilterEffect* input1 = filterBuilder->getEffectById(in1());
     
@@ -122,7 +122,7 @@ PassRefPtr<FilterEffect> SVGFEDiffuseLightingElement::build(SVGFilterBuilder* fi
     RefPtr<RenderStyle> filterStyle = styleForRenderer();
     Color color = filterStyle->svgStyle()->lightingColor();
     
-    RefPtr<FilterEffect> effect = FEDiffuseLighting::create(color, surfaceScale(), diffuseConstant(), 
+    RefPtr<FilterEffect> effect = FEDiffuseLighting::create(filter, color, surfaceScale(), diffuseConstant(), 
                                                                 kernelUnitLengthX(), kernelUnitLengthY(), findLights());
     effect->inputEffects().append(input1);
     return effect.release();
index fa946e6..8ad4f5c 100644 (file)
@@ -41,7 +41,7 @@ private:
     virtual void parseMappedAttribute(Attribute*);
     virtual void svgAttributeChanged(const QualifiedName&);
     virtual void synchronizeProperty(const QualifiedName&);
-    virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*);
+    virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*, Filter*);
 
     static const AtomicString& kernelUnitLengthXIdentifier();
     static const AtomicString& kernelUnitLengthYIdentifier();
index ba3311b..a2a1f88 100644 (file)
@@ -106,7 +106,7 @@ void SVGFEDisplacementMapElement::synchronizeProperty(const QualifiedName& attrN
         synchronizeScale();
 }
 
-PassRefPtr<FilterEffect> SVGFEDisplacementMapElement::build(SVGFilterBuilder* filterBuilder)
+PassRefPtr<FilterEffect> SVGFEDisplacementMapElement::build(SVGFilterBuilder* filterBuilder, Filter* filter)
 {
     FilterEffect* input1 = filterBuilder->getEffectById(in1());
     FilterEffect* input2 = filterBuilder->getEffectById(in2());
@@ -114,7 +114,7 @@ PassRefPtr<FilterEffect> SVGFEDisplacementMapElement::build(SVGFilterBuilder* fi
     if (!input1 || !input2)
         return 0;
 
-    RefPtr<FilterEffect> effect = FEDisplacementMap::create(static_cast<ChannelSelectorType>(xChannelSelector()), 
+    RefPtr<FilterEffect> effect = FEDisplacementMap::create(filter, static_cast<ChannelSelectorType>(xChannelSelector()), 
                                                                 static_cast<ChannelSelectorType>(yChannelSelector()), scale());
     FilterEffectVector& inputEffects = effect->inputEffects();
     inputEffects.reserveCapacity(2);
index 8131d82..296340f 100644 (file)
@@ -38,7 +38,7 @@ private:
     virtual void parseMappedAttribute(Attribute*);
     virtual void svgAttributeChanged(const QualifiedName&);
     virtual void synchronizeProperty(const QualifiedName&);
-    virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*);
+    virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*, Filter*);
     
     DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFEDisplacementMapElement, SVGNames::inAttr, String, In1, in1)
     DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFEDisplacementMapElement, SVGNames::in2Attr, String, In2, in2)
index 321eb8f..53ad910 100644 (file)
@@ -39,14 +39,14 @@ PassRefPtr<SVGFEFloodElement> SVGFEFloodElement::create(const QualifiedName& tag
     return adoptRef(new SVGFEFloodElement(tagName, document));
 }
 
-PassRefPtr<FilterEffect> SVGFEFloodElement::build(SVGFilterBuilder*)
+PassRefPtr<FilterEffect> SVGFEFloodElement::build(SVGFilterBuilder*, Filter* filter)
 {
     RefPtr<RenderStyle> filterStyle = styleForRenderer();
 
     Color color = filterStyle->svgStyle()->floodColor();
     float opacity = filterStyle->svgStyle()->floodOpacity();
 
-    return FEFlood::create(color, opacity);
+    return FEFlood::create(filter, color, opacity);
 }
 
 }
index 10a418f..1485ddd 100644 (file)
@@ -34,7 +34,7 @@ public:
 private:
     SVGFEFloodElement(const QualifiedName&, Document*);
 
-    virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*);
+    virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*, Filter*);
 };
 
 } // namespace WebCore
index c17c748..4b0855c 100644 (file)
@@ -100,14 +100,14 @@ void SVGFEGaussianBlurElement::synchronizeProperty(const QualifiedName& attrName
         synchronizeIn1();
 }
 
-PassRefPtr<FilterEffect> SVGFEGaussianBlurElement::build(SVGFilterBuilder* filterBuilder)
+PassRefPtr<FilterEffect> SVGFEGaussianBlurElement::build(SVGFilterBuilder* filterBuilder, Filter* filter)
 {
     FilterEffect* input1 = filterBuilder->getEffectById(in1());
 
     if (!input1)
         return 0;
 
-    RefPtr<FilterEffect> effect = FEGaussianBlur::create(stdDeviationX(), stdDeviationY());
+    RefPtr<FilterEffect> effect = FEGaussianBlur::create(filter, stdDeviationX(), stdDeviationY());
     effect->inputEffects().append(input1);
     return effect.release();
 }
index 3ddb437..ad06008 100644 (file)
@@ -39,7 +39,7 @@ private:
     virtual void parseMappedAttribute(Attribute*);
     virtual void svgAttributeChanged(const QualifiedName&);
     virtual void synchronizeProperty(const QualifiedName&);
-    virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*);
+    virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*, Filter*);
 
     static const AtomicString& stdDeviationXIdentifier();
     static const AtomicString& stdDeviationYIdentifier();
index 1db8edb..e0ba7a6 100644 (file)
@@ -131,7 +131,7 @@ void SVGFEImageElement::notifyFinished(CachedResource*)
     RenderSVGResource::markForLayoutAndParentResourceInvalidation(parent->renderer());
 }
 
-PassRefPtr<FilterEffect> SVGFEImageElement::build(SVGFilterBuilder*)
+PassRefPtr<FilterEffect> SVGFEImageElement::build(SVGFilterBuilder*, Filter* filter)
 {
     if (!m_cachedImage && !m_targetImage) {
         Element* hrefElement = document()->getElementById(SVGURIReference::getTarget(href()));
@@ -149,7 +149,7 @@ PassRefPtr<FilterEffect> SVGFEImageElement::build(SVGFilterBuilder*)
         SVGImageBufferTools::renderSubtreeToImageBuffer(m_targetImage.get(), renderer, contentTransformation);
     }
 
-    return FEImage::create(m_targetImage ? m_targetImage->copyImage() : m_cachedImage->image(), preserveAspectRatio());
+    return FEImage::create(filter, m_targetImage ? m_targetImage->copyImage() : m_cachedImage->image(), preserveAspectRatio());
 }
 
 void SVGFEImageElement::addSubresourceAttributeURLs(ListHashSet<KURL>& urls) const
index 0b9c5d8..78ba8e3 100644 (file)
@@ -53,7 +53,7 @@ private:
     virtual void notifyFinished(CachedResource*);
 
     virtual void addSubresourceAttributeURLs(ListHashSet<KURL>&) const;
-    virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*);
+    virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*, Filter*);
 
     void requestImageResource();
 
index 49a052e..bc6bed5 100644 (file)
@@ -37,9 +37,9 @@ PassRefPtr<SVGFEMergeElement> SVGFEMergeElement::create(const QualifiedName& tag
     return adoptRef(new SVGFEMergeElement(tagName, document));
 }
 
-PassRefPtr<FilterEffect> SVGFEMergeElement::build(SVGFilterBuilder* filterBuilder)
+PassRefPtr<FilterEffect> SVGFEMergeElement::build(SVGFilterBuilder* filterBuilder, Filter* filter)
 {
-    RefPtr<FilterEffect> effect = FEMerge::create();
+    RefPtr<FilterEffect> effect = FEMerge::create(filter);
     FilterEffectVector& mergeInputs = effect->inputEffects();
     for (Node* n = firstChild(); n != 0; n = n->nextSibling()) {
         if (n->hasTagName(SVGNames::feMergeNodeTag)) {
index da94ac7..2495a56 100644 (file)
@@ -34,7 +34,7 @@ public:
 private:
     SVGFEMergeElement(const QualifiedName&, Document*);
 
-    virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*);
+    virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*, Filter*);
 };
 
 } // namespace WebCore
index c7954b2..5db1807 100644 (file)
@@ -110,7 +110,7 @@ void SVGFEMorphologyElement::synchronizeProperty(const QualifiedName& attrName)
     }
 }
 
-PassRefPtr<FilterEffect> SVGFEMorphologyElement::build(SVGFilterBuilder* filterBuilder)
+PassRefPtr<FilterEffect> SVGFEMorphologyElement::build(SVGFilterBuilder* filterBuilder, Filter* filter)
 {
     FilterEffect* input1 = filterBuilder->getEffectById(in1());
     float xRadius = radiusX();
@@ -122,7 +122,7 @@ PassRefPtr<FilterEffect> SVGFEMorphologyElement::build(SVGFilterBuilder* filterB
     if (xRadius < 0 || yRadius < 0)
         return 0;
 
-    RefPtr<FilterEffect> effect = FEMorphology::create(static_cast<MorphologyOperatorType>(_operator()), xRadius, yRadius);
+    RefPtr<FilterEffect> effect = FEMorphology::create(filter, static_cast<MorphologyOperatorType>(_operator()), xRadius, yRadius);
     effect->inputEffects().append(input1);
     return effect.release();
 }
index 845294b..ba40f32 100644 (file)
@@ -38,7 +38,7 @@ private:
     virtual void parseMappedAttribute(Attribute*);
     virtual void svgAttributeChanged(const QualifiedName&);
     virtual void synchronizeProperty(const QualifiedName&);
-    virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*);
+    virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*, Filter*);
 
     static const AtomicString& radiusXIdentifier();
     static const AtomicString& radiusYIdentifier();
index 65523a5..2119cfb 100644 (file)
@@ -79,14 +79,14 @@ void SVGFEOffsetElement::synchronizeProperty(const QualifiedName& attrName)
         synchronizeIn1();
 }
 
-PassRefPtr<FilterEffect> SVGFEOffsetElement::build(SVGFilterBuilder* filterBuilder)
+PassRefPtr<FilterEffect> SVGFEOffsetElement::build(SVGFilterBuilder* filterBuilder, Filter* filter)
 {
     FilterEffect* input1 = filterBuilder->getEffectById(in1());
 
     if (!input1)
         return 0;
 
-    RefPtr<FilterEffect> effect = FEOffset::create(dx(), dy());
+    RefPtr<FilterEffect> effect = FEOffset::create(filter, dx(), dy());
     effect->inputEffects().append(input1);
     return effect.release();
 }
index 6f5e843..51c2ce0 100644 (file)
@@ -37,7 +37,7 @@ private:
     virtual void parseMappedAttribute(Attribute*);
     virtual void svgAttributeChanged(const QualifiedName&);
     virtual void synchronizeProperty(const QualifiedName&);
-    virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*);
+    virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*, Filter*);
 
     DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFEOffsetElement, SVGNames::inAttr, String, In1, in1)
     DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFEOffsetElement, SVGNames::dxAttr, float, Dx, dx)
index 548eb15..09fb6e0 100644 (file)
@@ -120,7 +120,7 @@ PassRefPtr<LightSource> SVGFESpecularLightingElement::findLights() const
     return 0;
 }
 
-PassRefPtr<FilterEffect> SVGFESpecularLightingElement::build(SVGFilterBuilder* filterBuilder)
+PassRefPtr<FilterEffect> SVGFESpecularLightingElement::build(SVGFilterBuilder* filterBuilder, Filter* filter)
 {
     FilterEffect* input1 = filterBuilder->getEffectById(in1());
     
@@ -131,7 +131,7 @@ PassRefPtr<FilterEffect> SVGFESpecularLightingElement::build(SVGFilterBuilder* f
     
     Color color = filterStyle->svgStyle()->lightingColor();
 
-    RefPtr<FilterEffect> effect = FESpecularLighting::create(color, surfaceScale(), specularConstant(), 
+    RefPtr<FilterEffect> effect = FESpecularLighting::create(filter, color, surfaceScale(), specularConstant(), 
                                           specularExponent(), kernelUnitLengthX(), kernelUnitLengthY(), findLights());
     effect->inputEffects().append(input1);
     return effect.release();
index c5d3ac4..f3ff446 100644 (file)
@@ -37,7 +37,7 @@ private:
     
     virtual void parseMappedAttribute(Attribute*);
     virtual void synchronizeProperty(const QualifiedName&);
-    virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*);
+    virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*, Filter*);
 
     static const AtomicString& kernelUnitLengthXIdentifier();
     static const AtomicString& kernelUnitLengthYIdentifier();
index 590b6b8..9d00a54 100644 (file)
@@ -63,14 +63,14 @@ void SVGFETileElement::synchronizeProperty(const QualifiedName& attrName)
         synchronizeIn1();
 }
 
-PassRefPtr<FilterEffect> SVGFETileElement::build(SVGFilterBuilder* filterBuilder)
+PassRefPtr<FilterEffect> SVGFETileElement::build(SVGFilterBuilder* filterBuilder, Filter* filter)
 {
     FilterEffect* input1 = filterBuilder->getEffectById(in1());
 
     if (!input1)
         return 0;
 
-    RefPtr<FilterEffect> effect = FETile::create();
+    RefPtr<FilterEffect> effect = FETile::create(filter);
     effect->inputEffects().append(input1);
     return effect.release();
 }
index b0c97d2..b4f3380 100644 (file)
@@ -37,7 +37,7 @@ private:
     virtual void parseMappedAttribute(Attribute*);
     virtual void svgAttributeChanged(const QualifiedName&);
     virtual void synchronizeProperty(const QualifiedName&);
-    virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*);
+    virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*, Filter*);
 
     DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFETileElement, SVGNames::inAttr, String, In1, in1)
 };
index 53b8fb0..739f8e5 100644 (file)
@@ -119,12 +119,12 @@ void SVGFETurbulenceElement::synchronizeProperty(const QualifiedName& attrName)
         synchronizeNumOctaves();
 }
 
-PassRefPtr<FilterEffect> SVGFETurbulenceElement::build(SVGFilterBuilder*)
+PassRefPtr<FilterEffect> SVGFETurbulenceElement::build(SVGFilterBuilder*, Filter* filter)
 {
     if (baseFrequencyX() < 0 || baseFrequencyY() < 0)
         return 0;
 
-    return FETurbulence::create(static_cast<TurbulanceType>(type()), baseFrequencyX(), 
+    return FETurbulence::create(filter, static_cast<TurbulanceType>(type()), baseFrequencyX(), 
                 baseFrequencyY(), numOctaves(), seed(), stitchTiles() == SVG_STITCHTYPE_STITCH);
 }
 
index 5c41fdd..1877ad7 100644 (file)
@@ -43,7 +43,7 @@ private:
     virtual void parseMappedAttribute(Attribute*);
     virtual void svgAttributeChanged(const QualifiedName&);
     virtual void synchronizeProperty(const QualifiedName&);
-    virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*);
+    virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*, Filter*);
 
     static const AtomicString& baseFrequencyXIdentifier();
     static const AtomicString& baseFrequencyYIdentifier();
index 6ac1962..d7abc7f 100644 (file)
@@ -40,7 +40,7 @@ class SVGFilterPrimitiveStandardAttributes : public SVGStyledElement {
 public:
     void setStandardAttributes(bool, FilterEffect*) const;
 
-    virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*) = 0;
+    virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*, Filter* filter) = 0;
 
 protected:
     SVGFilterPrimitiveStandardAttributes(const QualifiedName&, Document*);
index ed90588..6a1914a 100644 (file)
 
 namespace WebCore {
 
-FEImage::FEImage(RefPtr<Image> image, const SVGPreserveAspectRatio& preserveAspectRatio)
-    : FilterEffect()
+FEImage::FEImage(Filter* filter, RefPtr<Image> image, const SVGPreserveAspectRatio& preserveAspectRatio)
+    : FilterEffect(filter)
     , m_image(image)
     , m_preserveAspectRatio(preserveAspectRatio)
 {
 }
 
-PassRefPtr<FEImage> FEImage::create(RefPtr<Image> image, const SVGPreserveAspectRatio& preserveAspectRatio)
+PassRefPtr<FEImage> FEImage::create(Filter* filter, RefPtr<Image> image, const SVGPreserveAspectRatio& preserveAspectRatio)
 {
-    return adoptRef(new FEImage(image, preserveAspectRatio));
+    return adoptRef(new FEImage(filter, image, preserveAspectRatio));
 }
 
-void FEImage::determineAbsolutePaintRect(Filter*)
+void FEImage::determineAbsolutePaintRect()
 {
     ASSERT(m_image);
     FloatRect srcRect(FloatPoint(), m_image->size());
@@ -54,12 +54,12 @@ void FEImage::determineAbsolutePaintRect(Filter*)
     setAbsolutePaintRect(enclosingIntRect(paintRect));
 }
 
-void FEImage::apply(Filter* filter)
+void FEImage::apply()
 {
     if (!m_image.get())
         return;
 
-    GraphicsContext* filterContext = effectContext(filter);
+    GraphicsContext* filterContext = effectContext();
     if (!filterContext)
         return;
 
index 9efb5f1..9ac5527 100644 (file)
@@ -31,21 +31,21 @@ namespace WebCore {
 
 class FEImage : public FilterEffect {
 public:
-    static PassRefPtr<FEImage> create(RefPtr<Image>, const SVGPreserveAspectRatio&);
+    static PassRefPtr<FEImage> create(Filter*, RefPtr<Image>, const SVGPreserveAspectRatio&);
 
     void setAbsoluteSubregion(const FloatRect& absoluteSubregion) { m_absoluteSubregion = absoluteSubregion; }
 
-    virtual void apply(Filter*);
+    virtual void apply();
     virtual void dump();
 
-    virtual void determineAbsolutePaintRect(Filter*);
+    virtual void determineAbsolutePaintRect();
 
     virtual FilterEffectType filterEffectType() const { return FilterEffectTypeImage; }
 
     virtual TextStream& externalRepresentation(TextStream&, int indention) const;
     
 private:
-    FEImage(RefPtr<Image>, const SVGPreserveAspectRatio&);
+    FEImage(Filter*, RefPtr<Image>, const SVGPreserveAspectRatio&);
 
     RefPtr<Image> m_image;
     SVGPreserveAspectRatio m_preserveAspectRatio;
index 091379e..b31b994 100644 (file)
 
 namespace WebCore {
 
-SVGFilterBuilder::SVGFilterBuilder()
+SVGFilterBuilder::SVGFilterBuilder(Filter* filter)
     : m_lastEffect(0)
 {
-    m_builtinEffects.add(SourceGraphic::effectName(), SourceGraphic::create());
-    m_builtinEffects.add(SourceAlpha::effectName(), SourceAlpha::create());
+    m_builtinEffects.add(SourceGraphic::effectName(), SourceGraphic::create(filter));
+    m_builtinEffects.add(SourceAlpha::effectName(), SourceAlpha::create(filter));
     addBuiltinEffects();
 }
 
index 320088d..f767cac 100644 (file)
@@ -37,7 +37,7 @@ namespace WebCore {
     public:
         typedef HashSet<FilterEffect*> FilterEffectSet;
 
-        static PassRefPtr<SVGFilterBuilder> create() { return adoptRef(new SVGFilterBuilder); }
+        static PassRefPtr<SVGFilterBuilder> create(Filter* filter) { return adoptRef(new SVGFilterBuilder(filter)); }
 
         void add(const AtomicString& id, RefPtr<FilterEffect> effect);
 
@@ -56,7 +56,7 @@ namespace WebCore {
         void clearEffects();
 
     private:
-        SVGFilterBuilder();
+        SVGFilterBuilder(Filter*);
 
         inline void addBuiltinEffects()
         {