summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/webkit/WebCore/svg/graphics/filters
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdparty/webkit/WebCore/svg/graphics/filters')
-rw-r--r--src/3rdparty/webkit/WebCore/svg/graphics/filters/SVGFEFlood.cpp7
-rw-r--r--src/3rdparty/webkit/WebCore/svg/graphics/filters/SVGFEFlood.h5
-rw-r--r--src/3rdparty/webkit/WebCore/svg/graphics/filters/SVGFEGaussianBlur.cpp82
-rw-r--r--src/3rdparty/webkit/WebCore/svg/graphics/filters/SVGFEGaussianBlur.h58
-rw-r--r--src/3rdparty/webkit/WebCore/svg/graphics/filters/SVGFEMorphology.cpp8
-rw-r--r--src/3rdparty/webkit/WebCore/svg/graphics/filters/SVGFEMorphology.h6
-rw-r--r--src/3rdparty/webkit/WebCore/svg/graphics/filters/SVGFETile.cpp2
-rw-r--r--src/3rdparty/webkit/WebCore/svg/graphics/filters/SVGFilter.cpp24
-rw-r--r--src/3rdparty/webkit/WebCore/svg/graphics/filters/SVGFilter.h5
9 files changed, 26 insertions, 171 deletions
diff --git a/src/3rdparty/webkit/WebCore/svg/graphics/filters/SVGFEFlood.cpp b/src/3rdparty/webkit/WebCore/svg/graphics/filters/SVGFEFlood.cpp
index 3f4a6d7b2..668209fa6 100644
--- a/src/3rdparty/webkit/WebCore/svg/graphics/filters/SVGFEFlood.cpp
+++ b/src/3rdparty/webkit/WebCore/svg/graphics/filters/SVGFEFlood.cpp
@@ -31,17 +31,16 @@
namespace WebCore {
-FEFlood::FEFlood(FilterEffect* in, const Color& floodColor, const float& floodOpacity)
+FEFlood::FEFlood(const Color& floodColor, const float& floodOpacity)
: FilterEffect()
- , m_in(in)
, m_floodColor(floodColor)
, m_floodOpacity(floodOpacity)
{
}
-PassRefPtr<FEFlood> FEFlood::create(FilterEffect* in, const Color& floodColor, const float& floodOpacity)
+PassRefPtr<FEFlood> FEFlood::create(const Color& floodColor, const float& floodOpacity)
{
- return adoptRef(new FEFlood(in, floodColor, floodOpacity));
+ return adoptRef(new FEFlood(floodColor, floodOpacity));
}
Color FEFlood::floodColor() const
diff --git a/src/3rdparty/webkit/WebCore/svg/graphics/filters/SVGFEFlood.h b/src/3rdparty/webkit/WebCore/svg/graphics/filters/SVGFEFlood.h
index 21985db56..91795dd37 100644
--- a/src/3rdparty/webkit/WebCore/svg/graphics/filters/SVGFEFlood.h
+++ b/src/3rdparty/webkit/WebCore/svg/graphics/filters/SVGFEFlood.h
@@ -31,7 +31,7 @@ namespace WebCore {
class FEFlood : public FilterEffect {
public:
- static PassRefPtr<FEFlood> create(FilterEffect*, const Color&, const float&);
+ static PassRefPtr<FEFlood> create(const Color&, const float&);
Color floodColor() const;
void setFloodColor(const Color &);
@@ -44,9 +44,8 @@ namespace WebCore {
TextStream& externalRepresentation(TextStream& ts) const;
private:
- FEFlood(FilterEffect*, const Color&, const float&);
+ FEFlood(const Color&, const float&);
- RefPtr<FilterEffect> m_in;
Color m_floodColor;
float m_floodOpacity;
};
diff --git a/src/3rdparty/webkit/WebCore/svg/graphics/filters/SVGFEGaussianBlur.cpp b/src/3rdparty/webkit/WebCore/svg/graphics/filters/SVGFEGaussianBlur.cpp
deleted file mode 100644
index 601c39ec7..000000000
--- a/src/3rdparty/webkit/WebCore/svg/graphics/filters/SVGFEGaussianBlur.cpp
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
- 2004, 2005 Rob Buis <buis@kde.org>
- 2005 Eric Seidel <eric@webkit.org>
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public License
- aint with this library; see the file COPYING.LIB. If not, write to
- the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "config.h"
-
-#if ENABLE(SVG) && ENABLE(FILTERS)
-#include "SVGFEGaussianBlur.h"
-#include "SVGRenderTreeAsText.h"
-#include "Filter.h"
-
-namespace WebCore {
-
-FEGaussianBlur::FEGaussianBlur(FilterEffect* in, const float& x, const float& y)
- : FilterEffect()
- , m_in(in)
- , m_x(x)
- , m_y(y)
-{
-}
-
-PassRefPtr<FEGaussianBlur> FEGaussianBlur::create(FilterEffect* in, const float& x, const float& y)
-{
- return adoptRef(new FEGaussianBlur(in, x, y));
-}
-
-float FEGaussianBlur::stdDeviationX() const
-{
- return m_x;
-}
-
-void FEGaussianBlur::setStdDeviationX(float x)
-{
- m_x = x;
-}
-
-float FEGaussianBlur::stdDeviationY() const
-{
- return m_y;
-}
-
-void FEGaussianBlur::setStdDeviationY(float y)
-{
- m_y = y;
-}
-
-void FEGaussianBlur::apply(Filter*)
-{
-}
-
-void FEGaussianBlur::dump()
-{
-}
-
-TextStream& FEGaussianBlur::externalRepresentation(TextStream& ts) const
-{
- ts << "[type=GAUSSIAN-BLUR] ";
- FilterEffect::externalRepresentation(ts);
- ts << " [std dev. x=" << stdDeviationX() << " y=" << stdDeviationY() << "]";
- return ts;
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(SVG) && ENABLE(FILTERS)
diff --git a/src/3rdparty/webkit/WebCore/svg/graphics/filters/SVGFEGaussianBlur.h b/src/3rdparty/webkit/WebCore/svg/graphics/filters/SVGFEGaussianBlur.h
deleted file mode 100644
index 69f1cc517..000000000
--- a/src/3rdparty/webkit/WebCore/svg/graphics/filters/SVGFEGaussianBlur.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
- 2004, 2005 Rob Buis <buis@kde.org>
- 2005 Eric Seidel <eric@webkit.org>
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public License
- aint with this library; see the file COPYING.LIB. If not, write to
- the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#ifndef SVGFEGaussianBlur_h
-#define SVGFEGaussianBlur_h
-
-#if ENABLE(SVG) && ENABLE(FILTERS)
-#include "FilterEffect.h"
-#include "Filter.h"
-
-namespace WebCore {
-
- class FEGaussianBlur : public FilterEffect {
- public:
- static PassRefPtr<FEGaussianBlur> create(FilterEffect*, const float&, const float&);
-
- float stdDeviationX() const;
- void setStdDeviationX(float);
-
- float stdDeviationY() const;
- void setStdDeviationY(float);
-
- virtual FloatRect uniteChildEffectSubregions(Filter* filter) { return calculateUnionOfChildEffectSubregions(filter, m_in.get()); }
- void apply(Filter*);
- void dump();
- TextStream& externalRepresentation(TextStream& ts) const;
-
- private:
- FEGaussianBlur(FilterEffect*, const float&, const float&);
-
- RefPtr<FilterEffect> m_in;
- float m_x;
- float m_y;
- };
-
-} // namespace WebCore
-
-#endif // ENABLE(SVG) && ENABLE(FILTERS)
-
-#endif // SVGFEGaussianBlur_h
diff --git a/src/3rdparty/webkit/WebCore/svg/graphics/filters/SVGFEMorphology.cpp b/src/3rdparty/webkit/WebCore/svg/graphics/filters/SVGFEMorphology.cpp
index 37677347f..f7fc5d807 100644
--- a/src/3rdparty/webkit/WebCore/svg/graphics/filters/SVGFEMorphology.cpp
+++ b/src/3rdparty/webkit/WebCore/svg/graphics/filters/SVGFEMorphology.cpp
@@ -28,7 +28,7 @@
namespace WebCore {
-FEMorphology::FEMorphology(FilterEffect* in, MorphologyOperatorType type, const float& radiusX, const float& radiusY)
+FEMorphology::FEMorphology(FilterEffect* in, MorphologyOperatorType type, float radiusX, float radiusY)
: FilterEffect()
, m_in(in)
, m_type(type)
@@ -37,7 +37,7 @@ FEMorphology::FEMorphology(FilterEffect* in, MorphologyOperatorType type, const
{
}
-PassRefPtr<FEMorphology> FEMorphology::create(FilterEffect* in, MorphologyOperatorType type, const float& radiusX, const float& radiusY)
+PassRefPtr<FEMorphology> FEMorphology::create(FilterEffect* in, MorphologyOperatorType type, float radiusX, float radiusY)
{
return adoptRef(new FEMorphology(in, type, radiusX, radiusY));
}
@@ -88,8 +88,8 @@ static TextStream& operator<<(TextStream& ts, MorphologyOperatorType t)
ts << "UNKNOWN"; break;
case FEMORPHOLOGY_OPERATOR_ERODE:
ts << "ERODE"; break;
- case FEMORPHOLOGY_OPERATOR_DIALATE:
- ts << "DIALATE"; break;
+ case FEMORPHOLOGY_OPERATOR_DILATE:
+ ts << "DILATE"; break;
}
return ts;
}
diff --git a/src/3rdparty/webkit/WebCore/svg/graphics/filters/SVGFEMorphology.h b/src/3rdparty/webkit/WebCore/svg/graphics/filters/SVGFEMorphology.h
index bdc2b9be2..6a321c841 100644
--- a/src/3rdparty/webkit/WebCore/svg/graphics/filters/SVGFEMorphology.h
+++ b/src/3rdparty/webkit/WebCore/svg/graphics/filters/SVGFEMorphology.h
@@ -31,12 +31,12 @@ namespace WebCore {
enum MorphologyOperatorType {
FEMORPHOLOGY_OPERATOR_UNKNOWN = 0,
FEMORPHOLOGY_OPERATOR_ERODE = 1,
- FEMORPHOLOGY_OPERATOR_DIALATE = 2
+ FEMORPHOLOGY_OPERATOR_DILATE = 2
};
class FEMorphology : public FilterEffect {
public:
- PassRefPtr<FEMorphology> create(FilterEffect*, MorphologyOperatorType, const float&, const float&);
+ static PassRefPtr<FEMorphology> create(FilterEffect*, MorphologyOperatorType, float radiusX, float radiusY);
MorphologyOperatorType morphologyOperator() const;
void setMorphologyOperator(MorphologyOperatorType);
@@ -52,7 +52,7 @@ namespace WebCore {
TextStream& externalRepresentation(TextStream& ts) const;
private:
- FEMorphology(FilterEffect*, MorphologyOperatorType, const float&, const float&);
+ FEMorphology(FilterEffect*, MorphologyOperatorType, float radiusX, float radiusY);
RefPtr<FilterEffect> m_in;
MorphologyOperatorType m_type;
diff --git a/src/3rdparty/webkit/WebCore/svg/graphics/filters/SVGFETile.cpp b/src/3rdparty/webkit/WebCore/svg/graphics/filters/SVGFETile.cpp
index 4d7ddf026..3071501d9 100644
--- a/src/3rdparty/webkit/WebCore/svg/graphics/filters/SVGFETile.cpp
+++ b/src/3rdparty/webkit/WebCore/svg/graphics/filters/SVGFETile.cpp
@@ -65,7 +65,7 @@ void FETile::apply(Filter* filter)
if (m_in->isSourceInput())
tileRect = enclosingIntRect(filter->filterRegion());
- OwnPtr<ImageBuffer> tileImage = ImageBuffer::create(tileRect.size(), false);
+ OwnPtr<ImageBuffer> tileImage = ImageBuffer::create(tileRect.size());
GraphicsContext* tileImageContext = tileImage->context();
tileImageContext->drawImage(m_in->resultImage()->image(), IntPoint());
RefPtr<Pattern> pattern = Pattern::create(tileImage->image(), true, true);
diff --git a/src/3rdparty/webkit/WebCore/svg/graphics/filters/SVGFilter.cpp b/src/3rdparty/webkit/WebCore/svg/graphics/filters/SVGFilter.cpp
index c892ee9a8..6bfcf3943 100644
--- a/src/3rdparty/webkit/WebCore/svg/graphics/filters/SVGFilter.cpp
+++ b/src/3rdparty/webkit/WebCore/svg/graphics/filters/SVGFilter.cpp
@@ -24,12 +24,11 @@
namespace WebCore {
-SVGFilter::SVGFilter(const FloatRect& itemBox, const FloatRect& filterRect, bool effectBBoxMode, bool filterBBoxMode)
+SVGFilter::SVGFilter(const FloatRect& itemBox, const FloatRect& filterRect, bool effectBBoxMode)
: Filter()
, m_itemBox(itemBox)
, m_filterRect(filterRect)
, m_effectBBoxMode(effectBBoxMode)
- , m_filterBBoxMode(filterBBoxMode)
{
}
@@ -37,7 +36,6 @@ void SVGFilter::calculateEffectSubRegion(FilterEffect* effect)
{
FloatRect subRegionBBox = effect->subRegion();
FloatRect useBBox = effect->unionOfChildEffectSubregions();
-
FloatRect newSubRegion = subRegionBBox;
if (m_effectBBoxMode) {
@@ -55,17 +53,17 @@ void SVGFilter::calculateEffectSubRegion(FilterEffect* effect)
if (effect->hasHeight())
newSubRegion.setHeight(subRegionBBox.height() * m_itemBox.height());
} else {
- if (effect->xBoundingBoxMode())
- newSubRegion.setX(useBBox.x() + subRegionBBox.x() * useBBox.width());
+ if (!effect->hasX())
+ newSubRegion.setX(useBBox.x());
- if (effect->yBoundingBoxMode())
- newSubRegion.setY(useBBox.y() + subRegionBBox.y() * useBBox.height());
+ if (!effect->hasY())
+ newSubRegion.setY(useBBox.y());
- if (effect->widthBoundingBoxMode())
- newSubRegion.setWidth(subRegionBBox.width() * useBBox.width());
+ if (!effect->hasWidth())
+ newSubRegion.setWidth(useBBox.width());
- if (effect->heightBoundingBoxMode())
- newSubRegion.setHeight(subRegionBBox.height() * useBBox.height());
+ if (!effect->hasHeight())
+ newSubRegion.setHeight(useBBox.height());
}
// clip every filter effect to the filter region
@@ -74,9 +72,9 @@ void SVGFilter::calculateEffectSubRegion(FilterEffect* effect)
effect->setSubRegion(newSubRegion);
}
-PassRefPtr<SVGFilter> SVGFilter::create(const FloatRect& itemBox, const FloatRect& filterRect, bool effectBBoxMode, bool filterBBoxMode)
+PassRefPtr<SVGFilter> SVGFilter::create(const FloatRect& itemBox, const FloatRect& filterRect, bool effectBBoxMode)
{
- return adoptRef(new SVGFilter(itemBox, filterRect, effectBBoxMode, filterBBoxMode));
+ return adoptRef(new SVGFilter(itemBox, filterRect, effectBBoxMode));
}
} // namespace WebCore
diff --git a/src/3rdparty/webkit/WebCore/svg/graphics/filters/SVGFilter.h b/src/3rdparty/webkit/WebCore/svg/graphics/filters/SVGFilter.h
index d6e5f77dd..f23d1ea99 100644
--- a/src/3rdparty/webkit/WebCore/svg/graphics/filters/SVGFilter.h
+++ b/src/3rdparty/webkit/WebCore/svg/graphics/filters/SVGFilter.h
@@ -33,7 +33,7 @@ namespace WebCore {
class SVGFilter : public Filter {
public:
- static PassRefPtr<SVGFilter> create(const FloatRect&, const FloatRect&, bool, bool);
+ static PassRefPtr<SVGFilter> create(const FloatRect&, const FloatRect&, bool);
bool effectBoundingBoxMode() { return m_effectBBoxMode; }
@@ -42,12 +42,11 @@ namespace WebCore {
void calculateEffectSubRegion(FilterEffect*);
private:
- SVGFilter(const FloatRect& itemBox, const FloatRect& filterRect, bool itemBBoxMode, bool filterBBoxMode);
+ SVGFilter(const FloatRect& itemBox, const FloatRect& filterRect, bool effectBBoxMode);
FloatRect m_itemBox;
FloatRect m_filterRect;
bool m_effectBBoxMode;
- bool m_filterBBoxMode;
};
} // namespace WebCore