[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
krit at webkit.org
krit at webkit.org
Wed Dec 22 13:36:12 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit d569727debcc1c8477c91da77f94528709351cf4
Author: krit at webkit.org <krit at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Tue Sep 21 07:36:13 2010 +0000
2010-09-21 Dirk Schulze <krit at webkit.org>
Reviewed by Nikolas Zimmermann.
SVG Filter cleanup
https://bugs.webkit.org/show_bug.cgi?id=45612
Second cleanup patch. Modified files to follow webkit style. Removed dependencies
to SVG of most of the filter effects and prepared them to move from WebCore/svg/graphics/filters
to WebCore/platform/graphics/filters/.
Renamed calculateDrawingIntRect and calculateDrawingRect to requestedRegionOfInputImageData and
drawingRegionOfInputImage to clarify the functionality and make both functions distinguishable.
* platform/graphics/filters/FEBlend.cpp:
(WebCore::FEBlend::apply):
* platform/graphics/filters/FEBlend.h:
* platform/graphics/filters/FEColorMatrix.cpp:
(WebCore::FEColorMatrix::apply):
* platform/graphics/filters/FEColorMatrix.h:
* platform/graphics/filters/FEComponentTransfer.cpp:
(WebCore::FEComponentTransfer::apply):
* platform/graphics/filters/FEComponentTransfer.h:
(WebCore::ComponentTransferFunction::ComponentTransferFunction):
* platform/graphics/filters/FEComposite.cpp:
(WebCore::FEComposite::apply):
* platform/graphics/filters/FEComposite.h:
* platform/graphics/filters/FEGaussianBlur.cpp:
(WebCore::FEGaussianBlur::apply):
* platform/graphics/filters/FEGaussianBlur.h:
* platform/graphics/filters/Filter.h:
* platform/graphics/filters/FilterEffect.cpp:
(WebCore::FilterEffect::requestedRegionOfInputImageData):
(WebCore::FilterEffect::drawingRegionOfInputImage):
(WebCore::FilterEffect::effectContext):
* platform/graphics/filters/FilterEffect.h:
* platform/graphics/filters/ImageBufferFilter.cpp:
* platform/graphics/filters/ImageBufferFilter.h:
* platform/graphics/filters/SourceAlpha.cpp:
(WebCore::SourceAlpha::apply):
* platform/graphics/filters/SourceAlpha.h:
(WebCore::SourceAlpha::isSourceInput):
(WebCore::SourceAlpha::SourceAlpha):
* platform/graphics/filters/SourceGraphic.cpp:
(WebCore::SourceGraphic::apply):
* platform/graphics/filters/SourceGraphic.h:
(WebCore::SourceGraphic::isSourceInput):
(WebCore::SourceGraphic::SourceGraphic):
* rendering/RenderTreeAsText.cpp:
(WebCore::hasFractions):
(WebCore::operator<<):
* rendering/RenderTreeAsText.h:
(WebCore::operator<<):
* rendering/SVGRenderTreeAsText.cpp:
* rendering/SVGRenderTreeAsText.h:
* svg/graphics/filters/SVGFEConvolveMatrix.cpp:
(WebCore::FEConvolveMatrix::apply):
* svg/graphics/filters/SVGFEConvolveMatrix.h:
* svg/graphics/filters/SVGFEDiffuseLighting.cpp:
* svg/graphics/filters/SVGFEDiffuseLighting.h:
* svg/graphics/filters/SVGFEDisplacementMap.cpp:
(WebCore::FEDisplacementMap::apply):
* svg/graphics/filters/SVGFEDisplacementMap.h:
* svg/graphics/filters/SVGFEFlood.cpp:
(WebCore::FEFlood::apply):
(WebCore::FEFlood::externalRepresentation):
* svg/graphics/filters/SVGFEFlood.h:
* svg/graphics/filters/SVGFEImage.cpp:
(WebCore::FEImage::apply):
* svg/graphics/filters/SVGFEImage.h:
* svg/graphics/filters/SVGFELighting.cpp:
(WebCore::FELighting::apply):
* svg/graphics/filters/SVGFELighting.h:
* svg/graphics/filters/SVGFEMerge.cpp:
(WebCore::FEMerge::apply):
* svg/graphics/filters/SVGFEMerge.h:
* svg/graphics/filters/SVGFEMorphology.cpp:
(WebCore::FEMorphology::apply):
* svg/graphics/filters/SVGFEMorphology.h:
* svg/graphics/filters/SVGFEOffset.cpp:
(WebCore::FEOffset::apply):
* svg/graphics/filters/SVGFEOffset.h:
* svg/graphics/filters/SVGFESpecularLighting.cpp:
* svg/graphics/filters/SVGFESpecularLighting.h:
* svg/graphics/filters/SVGFETile.cpp:
(WebCore::FETile::apply):
* svg/graphics/filters/SVGFETile.h:
* svg/graphics/filters/SVGFETurbulence.cpp:
(WebCore::FETurbulence::apply):
* svg/graphics/filters/SVGFETurbulence.h:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@67929 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 2904549..7f16a3b 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,93 @@
+2010-09-21 Dirk Schulze <krit at webkit.org>
+
+ Reviewed by Nikolas Zimmermann.
+
+ SVG Filter cleanup
+ https://bugs.webkit.org/show_bug.cgi?id=45612
+
+ Second cleanup patch. Modified files to follow webkit style. Removed dependencies
+ to SVG of most of the filter effects and prepared them to move from WebCore/svg/graphics/filters
+ to WebCore/platform/graphics/filters/.
+ Renamed calculateDrawingIntRect and calculateDrawingRect to requestedRegionOfInputImageData and
+ drawingRegionOfInputImage to clarify the functionality and make both functions distinguishable.
+
+ * platform/graphics/filters/FEBlend.cpp:
+ (WebCore::FEBlend::apply):
+ * platform/graphics/filters/FEBlend.h:
+ * platform/graphics/filters/FEColorMatrix.cpp:
+ (WebCore::FEColorMatrix::apply):
+ * platform/graphics/filters/FEColorMatrix.h:
+ * platform/graphics/filters/FEComponentTransfer.cpp:
+ (WebCore::FEComponentTransfer::apply):
+ * platform/graphics/filters/FEComponentTransfer.h:
+ (WebCore::ComponentTransferFunction::ComponentTransferFunction):
+ * platform/graphics/filters/FEComposite.cpp:
+ (WebCore::FEComposite::apply):
+ * platform/graphics/filters/FEComposite.h:
+ * platform/graphics/filters/FEGaussianBlur.cpp:
+ (WebCore::FEGaussianBlur::apply):
+ * platform/graphics/filters/FEGaussianBlur.h:
+ * platform/graphics/filters/Filter.h:
+ * platform/graphics/filters/FilterEffect.cpp:
+ (WebCore::FilterEffect::requestedRegionOfInputImageData):
+ (WebCore::FilterEffect::drawingRegionOfInputImage):
+ (WebCore::FilterEffect::effectContext):
+ * platform/graphics/filters/FilterEffect.h:
+ * platform/graphics/filters/ImageBufferFilter.cpp:
+ * platform/graphics/filters/ImageBufferFilter.h:
+ * platform/graphics/filters/SourceAlpha.cpp:
+ (WebCore::SourceAlpha::apply):
+ * platform/graphics/filters/SourceAlpha.h:
+ (WebCore::SourceAlpha::isSourceInput):
+ (WebCore::SourceAlpha::SourceAlpha):
+ * platform/graphics/filters/SourceGraphic.cpp:
+ (WebCore::SourceGraphic::apply):
+ * platform/graphics/filters/SourceGraphic.h:
+ (WebCore::SourceGraphic::isSourceInput):
+ (WebCore::SourceGraphic::SourceGraphic):
+ * rendering/RenderTreeAsText.cpp:
+ (WebCore::hasFractions):
+ (WebCore::operator<<):
+ * rendering/RenderTreeAsText.h:
+ (WebCore::operator<<):
+ * rendering/SVGRenderTreeAsText.cpp:
+ * rendering/SVGRenderTreeAsText.h:
+ * svg/graphics/filters/SVGFEConvolveMatrix.cpp:
+ (WebCore::FEConvolveMatrix::apply):
+ * svg/graphics/filters/SVGFEConvolveMatrix.h:
+ * svg/graphics/filters/SVGFEDiffuseLighting.cpp:
+ * svg/graphics/filters/SVGFEDiffuseLighting.h:
+ * svg/graphics/filters/SVGFEDisplacementMap.cpp:
+ (WebCore::FEDisplacementMap::apply):
+ * svg/graphics/filters/SVGFEDisplacementMap.h:
+ * svg/graphics/filters/SVGFEFlood.cpp:
+ (WebCore::FEFlood::apply):
+ (WebCore::FEFlood::externalRepresentation):
+ * svg/graphics/filters/SVGFEFlood.h:
+ * svg/graphics/filters/SVGFEImage.cpp:
+ (WebCore::FEImage::apply):
+ * svg/graphics/filters/SVGFEImage.h:
+ * svg/graphics/filters/SVGFELighting.cpp:
+ (WebCore::FELighting::apply):
+ * svg/graphics/filters/SVGFELighting.h:
+ * svg/graphics/filters/SVGFEMerge.cpp:
+ (WebCore::FEMerge::apply):
+ * svg/graphics/filters/SVGFEMerge.h:
+ * svg/graphics/filters/SVGFEMorphology.cpp:
+ (WebCore::FEMorphology::apply):
+ * svg/graphics/filters/SVGFEMorphology.h:
+ * svg/graphics/filters/SVGFEOffset.cpp:
+ (WebCore::FEOffset::apply):
+ * svg/graphics/filters/SVGFEOffset.h:
+ * svg/graphics/filters/SVGFESpecularLighting.cpp:
+ * svg/graphics/filters/SVGFESpecularLighting.h:
+ * svg/graphics/filters/SVGFETile.cpp:
+ (WebCore::FETile::apply):
+ * svg/graphics/filters/SVGFETile.h:
+ * svg/graphics/filters/SVGFETurbulence.cpp:
+ (WebCore::FETurbulence::apply):
+ * svg/graphics/filters/SVGFETurbulence.h:
+
2010-09-20 Philippe Normand <pnormand at igalia.com>
Reviewed by Eric Carlson.
diff --git a/WebCore/platform/graphics/filters/FEBlend.cpp b/WebCore/platform/graphics/filters/FEBlend.cpp
index acd6545..4185f61 100644
--- a/WebCore/platform/graphics/filters/FEBlend.cpp
+++ b/WebCore/platform/graphics/filters/FEBlend.cpp
@@ -1,24 +1,24 @@
/*
- Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann at kde.org>
- 2004, 2005 Rob Buis <buis at kde.org>
- 2005 Eric Seidel <eric at webkit.org>
- 2009 Dirk Schulze <krit at 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.
-*/
+ * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann at kde.org>
+ * Copyright (C) 2004, 2005 Rob Buis <buis at kde.org>
+ * Copyright (C) 2005 Eric Seidel <eric at webkit.org>
+ * Copyright (C) 2009 Dirk Schulze <krit at 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
+ * along 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"
@@ -98,13 +98,13 @@ void FEBlend::apply(Filter* filter)
if (m_mode == FEBLEND_MODE_UNKNOWN)
return;
- if (!getEffectContext())
+ if (!effectContext())
return;
- IntRect effectADrawingRect = calculateDrawingIntRect(in->repaintRectInLocalCoordinates());
+ IntRect effectADrawingRect = requestedRegionOfInputImageData(in->repaintRectInLocalCoordinates());
RefPtr<CanvasPixelArray> srcPixelArrayA(in->resultImage()->getPremultipliedImageData(effectADrawingRect)->data());
- IntRect effectBDrawingRect = calculateDrawingIntRect(in2->repaintRectInLocalCoordinates());
+ IntRect effectBDrawingRect = requestedRegionOfInputImageData(in2->repaintRectInLocalCoordinates());
RefPtr<CanvasPixelArray> srcPixelArrayB(in2->resultImage()->getPremultipliedImageData(effectBDrawingRect)->data());
IntRect imageRect(IntPoint(), resultImage()->size());
diff --git a/WebCore/platform/graphics/filters/FEBlend.h b/WebCore/platform/graphics/filters/FEBlend.h
index 2e67588..a6569e2 100644
--- a/WebCore/platform/graphics/filters/FEBlend.h
+++ b/WebCore/platform/graphics/filters/FEBlend.h
@@ -1,23 +1,23 @@
/*
- Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann at kde.org>
- 2004, 2005 Rob Buis <buis at kde.org>
- 2005 Eric Seidel <eric at 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.
-*/
+ * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann at kde.org>
+ * Copyright (C) 2004, 2005 Rob Buis <buis at kde.org>
+ * Copyright (C) 2005 Eric Seidel <eric at 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
+ * along 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 FEBlend_h
#define FEBlend_h
@@ -29,31 +29,32 @@
namespace WebCore {
- enum BlendModeType {
- FEBLEND_MODE_UNKNOWN = 0,
- FEBLEND_MODE_NORMAL = 1,
- FEBLEND_MODE_MULTIPLY = 2,
- FEBLEND_MODE_SCREEN = 3,
- FEBLEND_MODE_DARKEN = 4,
- FEBLEND_MODE_LIGHTEN = 5
- };
+enum BlendModeType {
+ FEBLEND_MODE_UNKNOWN = 0,
+ FEBLEND_MODE_NORMAL = 1,
+ FEBLEND_MODE_MULTIPLY = 2,
+ FEBLEND_MODE_SCREEN = 3,
+ FEBLEND_MODE_DARKEN = 4,
+ FEBLEND_MODE_LIGHTEN = 5
+};
- class FEBlend : public FilterEffect {
- public:
- static PassRefPtr<FEBlend> create(BlendModeType);
+class FEBlend : public FilterEffect {
+public:
+ static PassRefPtr<FEBlend> create(BlendModeType);
- BlendModeType blendMode() const;
- void setBlendMode(BlendModeType);
+ BlendModeType blendMode() const;
+ void setBlendMode(BlendModeType);
- void apply(Filter*);
- void dump();
- TextStream& externalRepresentation(TextStream&, int indent) const;
+ virtual void apply(Filter*);
+ virtual void dump();
- private:
- FEBlend(BlendModeType);
+ virtual TextStream& externalRepresentation(TextStream&, int indention) const;
- BlendModeType m_mode;
- };
+private:
+ FEBlend(BlendModeType);
+
+ BlendModeType m_mode;
+};
} // namespace WebCore
diff --git a/WebCore/platform/graphics/filters/FEColorMatrix.cpp b/WebCore/platform/graphics/filters/FEColorMatrix.cpp
index 1d9c66b..86c37c2 100644
--- a/WebCore/platform/graphics/filters/FEColorMatrix.cpp
+++ b/WebCore/platform/graphics/filters/FEColorMatrix.cpp
@@ -1,24 +1,24 @@
/*
- Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann at kde.org>
- 2004, 2005 Rob Buis <buis at kde.org>
- 2005 Eric Seidel <eric at webkit.org>
- 2009 Dirk Schulze <krit at 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.
-*/
+ * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann at kde.org>
+ * Copyright (C) 2004, 2005 Rob Buis <buis at kde.org>
+ * Copyright (C) 2005 Eric Seidel <eric at webkit.org>
+ * Copyright (C) 2009 Dirk Schulze <krit at 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
+ * along 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"
@@ -160,11 +160,11 @@ void FEColorMatrix::apply(Filter* filter)
if (!in->resultImage())
return;
- GraphicsContext* filterContext = getEffectContext();
+ GraphicsContext* filterContext = effectContext();
if (!filterContext)
return;
- filterContext->drawImageBuffer(in->resultImage(), DeviceColorSpace, calculateDrawingRect(in->repaintRectInLocalCoordinates()));
+ filterContext->drawImageBuffer(in->resultImage(), DeviceColorSpace, drawingRegionOfInputImage(in->repaintRectInLocalCoordinates()));
IntRect imageRect(IntPoint(), resultImage()->size());
PassRefPtr<ImageData> imageData(resultImage()->getUnmultipliedImageData(imageRect));
diff --git a/WebCore/platform/graphics/filters/FEColorMatrix.h b/WebCore/platform/graphics/filters/FEColorMatrix.h
index 9b9084c..b898b17 100644
--- a/WebCore/platform/graphics/filters/FEColorMatrix.h
+++ b/WebCore/platform/graphics/filters/FEColorMatrix.h
@@ -1,23 +1,23 @@
/*
- Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann at kde.org>
- 2004, 2005 Rob Buis <buis at kde.org>
- 2005 Eric Seidel <eric at 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.
-*/
+ * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann at kde.org>
+ * Copyright (C) 2004, 2005 Rob Buis <buis at kde.org>
+ * Copyright (C) 2005 Eric Seidel <eric at 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
+ * along 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 FEColorMatrix_h
#define FEColorMatrix_h
@@ -30,34 +30,35 @@
namespace WebCore {
- enum ColorMatrixType {
- FECOLORMATRIX_TYPE_UNKNOWN = 0,
- FECOLORMATRIX_TYPE_MATRIX = 1,
- FECOLORMATRIX_TYPE_SATURATE = 2,
- FECOLORMATRIX_TYPE_HUEROTATE = 3,
- FECOLORMATRIX_TYPE_LUMINANCETOALPHA = 4
- };
+enum ColorMatrixType {
+ FECOLORMATRIX_TYPE_UNKNOWN = 0,
+ FECOLORMATRIX_TYPE_MATRIX = 1,
+ FECOLORMATRIX_TYPE_SATURATE = 2,
+ FECOLORMATRIX_TYPE_HUEROTATE = 3,
+ FECOLORMATRIX_TYPE_LUMINANCETOALPHA = 4
+};
+
+class FEColorMatrix : public FilterEffect {
+public:
+ static PassRefPtr<FEColorMatrix> create(ColorMatrixType, const Vector<float>&);
- class FEColorMatrix : public FilterEffect {
- public:
- static PassRefPtr<FEColorMatrix> create(ColorMatrixType, const Vector<float>&);
+ ColorMatrixType type() const;
+ void setType(ColorMatrixType);
- ColorMatrixType type() const;
- void setType(ColorMatrixType);
+ const Vector<float>& values() const;
+ void setValues(const Vector<float>&);
- const Vector<float>& values() const;
- void setValues(const Vector<float>&);
+ virtual void apply(Filter*);
+ virtual void dump();
- void apply(Filter*);
- void dump();
- TextStream& externalRepresentation(TextStream&, int indent) const;
+ virtual TextStream& externalRepresentation(TextStream&, int indention) const;
- private:
- FEColorMatrix(ColorMatrixType, const Vector<float>&);
+private:
+ FEColorMatrix(ColorMatrixType, const Vector<float>&);
- ColorMatrixType m_type;
- Vector<float> m_values;
- };
+ ColorMatrixType m_type;
+ Vector<float> m_values;
+};
} // namespace WebCore
diff --git a/WebCore/platform/graphics/filters/FEComponentTransfer.cpp b/WebCore/platform/graphics/filters/FEComponentTransfer.cpp
index 471fec8..6fe38e4 100644
--- a/WebCore/platform/graphics/filters/FEComponentTransfer.cpp
+++ b/WebCore/platform/graphics/filters/FEComponentTransfer.cpp
@@ -1,25 +1,25 @@
/*
- Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann at kde.org>
- 2004, 2005 Rob Buis <buis at kde.org>
- 2005 Eric Seidel <eric at webkit.org>
- 2009 Dirk Schulze <krit at webkit.org>
- Copyright (C) Research In Motion Limited 2010. All rights reserved.
-
- 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.
-*/
+ * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann at kde.org>
+ * Copyright (C) 2004, 2005 Rob Buis <buis at kde.org>
+ * Copyright (C) 2005 Eric Seidel <eric at webkit.org>
+ * Copyright (C) 2009 Dirk Schulze <krit at webkit.org>
+ * Copyright (C) Research In Motion Limited 2010. All rights reserved.
+ *
+ * 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
+ * along 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"
@@ -36,8 +36,8 @@ namespace WebCore {
typedef void (*TransferType)(unsigned char*, const ComponentTransferFunction&);
-FEComponentTransfer::FEComponentTransfer(const ComponentTransferFunction& redFunc,
- const ComponentTransferFunction& greenFunc, const ComponentTransferFunction& blueFunc, const ComponentTransferFunction& alphaFunc)
+FEComponentTransfer::FEComponentTransfer(const ComponentTransferFunction& redFunc, const ComponentTransferFunction& greenFunc,
+ const ComponentTransferFunction& blueFunc, const ComponentTransferFunction& alphaFunc)
: FilterEffect()
, m_redFunc(redFunc)
, m_greenFunc(greenFunc)
@@ -154,7 +154,7 @@ void FEComponentTransfer::apply(Filter* filter)
if (!in->resultImage())
return;
- if (!getEffectContext())
+ if (!effectContext())
return;
unsigned char rValues[256], gValues[256], bValues[256], aValues[256];
@@ -167,7 +167,7 @@ void FEComponentTransfer::apply(Filter* filter)
for (unsigned channel = 0; channel < 4; channel++)
(*callEffect[transferFunction[channel].type])(tables[channel], transferFunction[channel]);
- IntRect drawingRect = calculateDrawingIntRect(in->repaintRectInLocalCoordinates());
+ IntRect drawingRect = requestedRegionOfInputImageData(in->repaintRectInLocalCoordinates());
RefPtr<ImageData> imageData(in->resultImage()->getUnmultipliedImageData(drawingRect));
CanvasPixelArray* srcPixelArray(imageData->data());
diff --git a/WebCore/platform/graphics/filters/FEComponentTransfer.h b/WebCore/platform/graphics/filters/FEComponentTransfer.h
index 55724db..d3145d4 100644
--- a/WebCore/platform/graphics/filters/FEComponentTransfer.h
+++ b/WebCore/platform/graphics/filters/FEComponentTransfer.h
@@ -1,23 +1,23 @@
/*
- Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann at kde.org>
- 2004, 2005 Rob Buis <buis at kde.org>
- 2005 Eric Seidel <eric at 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.
-*/
+ * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann at kde.org>
+ * Copyright (C) 2004, 2005 Rob Buis <buis at kde.org>
+ * Copyright (C) 2005 Eric Seidel <eric at 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
+ * along 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 FEComponentTransfer_h
#define FEComponentTransfer_h
@@ -30,67 +30,68 @@
namespace WebCore {
- enum ComponentTransferType {
- FECOMPONENTTRANSFER_TYPE_UNKNOWN = 0,
- FECOMPONENTTRANSFER_TYPE_IDENTITY = 1,
- FECOMPONENTTRANSFER_TYPE_TABLE = 2,
- FECOMPONENTTRANSFER_TYPE_DISCRETE = 3,
- FECOMPONENTTRANSFER_TYPE_LINEAR = 4,
- FECOMPONENTTRANSFER_TYPE_GAMMA = 5
- };
-
- struct ComponentTransferFunction {
- ComponentTransferFunction()
- : type(FECOMPONENTTRANSFER_TYPE_UNKNOWN)
- , slope(0.0f)
- , intercept(0.0f)
- , amplitude(0.0f)
- , exponent(0.0f)
- , offset(0.0f)
- {
- }
-
- ComponentTransferType type;
-
- float slope;
- float intercept;
- float amplitude;
- float exponent;
- float offset;
-
- Vector<float> tableValues;
- };
-
- class FEComponentTransfer : public FilterEffect {
- public:
- static PassRefPtr<FEComponentTransfer> create(const ComponentTransferFunction&,
- const ComponentTransferFunction&, const ComponentTransferFunction&, const ComponentTransferFunction&);
-
- ComponentTransferFunction redFunction() const;
- void setRedFunction(const ComponentTransferFunction&);
-
- ComponentTransferFunction greenFunction() const;
- void setGreenFunction(const ComponentTransferFunction&);
-
- ComponentTransferFunction blueFunction() const;
- void setBlueFunction(const ComponentTransferFunction&);
-
- ComponentTransferFunction alphaFunction() const;
- void setAlphaFunction(const ComponentTransferFunction&);
-
- void apply(Filter*);
- void dump();
- TextStream& externalRepresentation(TextStream&, int indent) const;
-
- private:
- FEComponentTransfer(const ComponentTransferFunction&, const ComponentTransferFunction&,
- const ComponentTransferFunction&, const ComponentTransferFunction&);
-
- ComponentTransferFunction m_redFunc;
- ComponentTransferFunction m_greenFunc;
- ComponentTransferFunction m_blueFunc;
- ComponentTransferFunction m_alphaFunc;
- };
+enum ComponentTransferType {
+ FECOMPONENTTRANSFER_TYPE_UNKNOWN = 0,
+ FECOMPONENTTRANSFER_TYPE_IDENTITY = 1,
+ FECOMPONENTTRANSFER_TYPE_TABLE = 2,
+ FECOMPONENTTRANSFER_TYPE_DISCRETE = 3,
+ FECOMPONENTTRANSFER_TYPE_LINEAR = 4,
+ FECOMPONENTTRANSFER_TYPE_GAMMA = 5
+};
+
+struct ComponentTransferFunction {
+ ComponentTransferFunction()
+ : type(FECOMPONENTTRANSFER_TYPE_UNKNOWN)
+ , slope(0)
+ , intercept(0)
+ , amplitude(0)
+ , exponent(0)
+ , offset(0)
+ {
+ }
+
+ ComponentTransferType type;
+
+ float slope;
+ float intercept;
+ float amplitude;
+ float exponent;
+ float offset;
+
+ Vector<float> tableValues;
+};
+
+class FEComponentTransfer : public FilterEffect {
+public:
+ static PassRefPtr<FEComponentTransfer> create(const ComponentTransferFunction& redFunc, const ComponentTransferFunction& greenFunc,
+ const ComponentTransferFunction& blueFunc, const ComponentTransferFunction& alphaFunc);
+
+ ComponentTransferFunction redFunction() const;
+ void setRedFunction(const ComponentTransferFunction&);
+
+ ComponentTransferFunction greenFunction() const;
+ void setGreenFunction(const ComponentTransferFunction&);
+
+ ComponentTransferFunction blueFunction() const;
+ void setBlueFunction(const ComponentTransferFunction&);
+
+ ComponentTransferFunction alphaFunction() const;
+ void setAlphaFunction(const ComponentTransferFunction&);
+
+ virtual void apply(Filter*);
+ virtual void dump();
+
+ virtual TextStream& externalRepresentation(TextStream&, int indention) const;
+
+private:
+ FEComponentTransfer(const ComponentTransferFunction& redFunc, const ComponentTransferFunction& greenFunc,
+ const ComponentTransferFunction& blueFunc, const ComponentTransferFunction& alphaFunc);
+
+ ComponentTransferFunction m_redFunc;
+ ComponentTransferFunction m_greenFunc;
+ ComponentTransferFunction m_blueFunc;
+ ComponentTransferFunction m_alphaFunc;
+};
} // namespace WebCore
diff --git a/WebCore/platform/graphics/filters/FEComposite.cpp b/WebCore/platform/graphics/filters/FEComposite.cpp
index c10a0f2..94e2524 100644
--- a/WebCore/platform/graphics/filters/FEComposite.cpp
+++ b/WebCore/platform/graphics/filters/FEComposite.cpp
@@ -1,24 +1,24 @@
/*
- Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann at kde.org>
- 2004, 2005 Rob Buis <buis at kde.org>
- 2005 Eric Seidel <eric at webkit.org>
- 2009 Dirk Schulze <krit at 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.
-*/
+ * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann at kde.org>
+ * Copyright (C) 2004, 2005 Rob Buis <buis at kde.org>
+ * Copyright (C) 2005 Eric Seidel <eric at webkit.org>
+ * Copyright (C) 2009 Dirk Schulze <krit at 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
+ * along 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"
@@ -122,39 +122,39 @@ void FEComposite::apply(Filter* filter)
if (!in->resultImage() || !in2->resultImage())
return;
- GraphicsContext* filterContext = getEffectContext();
+ GraphicsContext* filterContext = effectContext();
if (!filterContext)
return;
- FloatRect srcRect = FloatRect(0.f, 0.f, -1.f, -1.f);
+ FloatRect srcRect = FloatRect(0, 0, -1, -1);
switch (m_type) {
case FECOMPOSITE_OPERATOR_OVER:
- filterContext->drawImageBuffer(in2->resultImage(), DeviceColorSpace, calculateDrawingRect(in2->repaintRectInLocalCoordinates()));
- filterContext->drawImageBuffer(in->resultImage(), DeviceColorSpace, calculateDrawingRect(in->repaintRectInLocalCoordinates()));
+ filterContext->drawImageBuffer(in2->resultImage(), DeviceColorSpace, drawingRegionOfInputImage(in2->repaintRectInLocalCoordinates()));
+ filterContext->drawImageBuffer(in->resultImage(), DeviceColorSpace, drawingRegionOfInputImage(in->repaintRectInLocalCoordinates()));
break;
case FECOMPOSITE_OPERATOR_IN:
filterContext->save();
- filterContext->clipToImageBuffer(in2->resultImage(), calculateDrawingRect(in2->repaintRectInLocalCoordinates()));
- filterContext->drawImageBuffer(in->resultImage(), DeviceColorSpace, calculateDrawingRect(in->repaintRectInLocalCoordinates()));
+ filterContext->clipToImageBuffer(in2->resultImage(), drawingRegionOfInputImage(in2->repaintRectInLocalCoordinates()));
+ filterContext->drawImageBuffer(in->resultImage(), DeviceColorSpace, drawingRegionOfInputImage(in->repaintRectInLocalCoordinates()));
filterContext->restore();
break;
case FECOMPOSITE_OPERATOR_OUT:
- filterContext->drawImageBuffer(in->resultImage(), DeviceColorSpace, calculateDrawingRect(in->repaintRectInLocalCoordinates()));
- filterContext->drawImageBuffer(in2->resultImage(), DeviceColorSpace, calculateDrawingRect(in2->repaintRectInLocalCoordinates()), srcRect, CompositeDestinationOut);
+ filterContext->drawImageBuffer(in->resultImage(), DeviceColorSpace, drawingRegionOfInputImage(in->repaintRectInLocalCoordinates()));
+ filterContext->drawImageBuffer(in2->resultImage(), DeviceColorSpace, drawingRegionOfInputImage(in2->repaintRectInLocalCoordinates()), srcRect, CompositeDestinationOut);
break;
case FECOMPOSITE_OPERATOR_ATOP:
- filterContext->drawImageBuffer(in2->resultImage(), DeviceColorSpace, calculateDrawingRect(in2->repaintRectInLocalCoordinates()));
- filterContext->drawImageBuffer(in->resultImage(), DeviceColorSpace, calculateDrawingRect(in->repaintRectInLocalCoordinates()), srcRect, CompositeSourceAtop);
+ filterContext->drawImageBuffer(in2->resultImage(), DeviceColorSpace, drawingRegionOfInputImage(in2->repaintRectInLocalCoordinates()));
+ filterContext->drawImageBuffer(in->resultImage(), DeviceColorSpace, drawingRegionOfInputImage(in->repaintRectInLocalCoordinates()), srcRect, CompositeSourceAtop);
break;
case FECOMPOSITE_OPERATOR_XOR:
- filterContext->drawImageBuffer(in2->resultImage(), DeviceColorSpace, calculateDrawingRect(in2->repaintRectInLocalCoordinates()));
- filterContext->drawImageBuffer(in->resultImage(), DeviceColorSpace, calculateDrawingRect(in->repaintRectInLocalCoordinates()), srcRect, CompositeXOR);
+ filterContext->drawImageBuffer(in2->resultImage(), DeviceColorSpace, drawingRegionOfInputImage(in2->repaintRectInLocalCoordinates()));
+ filterContext->drawImageBuffer(in->resultImage(), DeviceColorSpace, drawingRegionOfInputImage(in->repaintRectInLocalCoordinates()), srcRect, CompositeXOR);
break;
case FECOMPOSITE_OPERATOR_ARITHMETIC: {
- IntRect effectADrawingRect = calculateDrawingIntRect(in->repaintRectInLocalCoordinates());
+ IntRect effectADrawingRect = requestedRegionOfInputImageData(in->repaintRectInLocalCoordinates());
RefPtr<CanvasPixelArray> srcPixelArrayA(in->resultImage()->getPremultipliedImageData(effectADrawingRect)->data());
- IntRect effectBDrawingRect = calculateDrawingIntRect(in2->repaintRectInLocalCoordinates());
+ IntRect effectBDrawingRect = requestedRegionOfInputImageData(in2->repaintRectInLocalCoordinates());
RefPtr<ImageData> imageData(in2->resultImage()->getPremultipliedImageData(effectBDrawingRect));
CanvasPixelArray* srcPixelArrayB(imageData->data());
diff --git a/WebCore/platform/graphics/filters/FEComposite.h b/WebCore/platform/graphics/filters/FEComposite.h
index 448d036..82a3b06 100644
--- a/WebCore/platform/graphics/filters/FEComposite.h
+++ b/WebCore/platform/graphics/filters/FEComposite.h
@@ -1,23 +1,23 @@
/*
- Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann at kde.org>
- 2004, 2005 Rob Buis <buis at kde.org>
- 2005 Eric Seidel <eric at 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.
-*/
+ * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann at kde.org>
+ * Copyright (C) 2004, 2005 Rob Buis <buis at kde.org>
+ * Copyright (C) 2005 Eric Seidel <eric at 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
+ * along 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 FEComposite_h
#define FEComposite_h
@@ -59,9 +59,10 @@ public:
float k4() const;
void setK4(float);
- void apply(Filter*);
- void dump();
- TextStream& externalRepresentation(TextStream&, int indent) const;
+ virtual void apply(Filter*);
+ virtual void dump();
+
+ virtual TextStream& externalRepresentation(TextStream&, int indention) const;
private:
FEComposite(const CompositeOperationType&, float, float, float, float);
diff --git a/WebCore/platform/graphics/filters/FEGaussianBlur.cpp b/WebCore/platform/graphics/filters/FEGaussianBlur.cpp
index 72a5a04..fd9a3d8 100644
--- a/WebCore/platform/graphics/filters/FEGaussianBlur.cpp
+++ b/WebCore/platform/graphics/filters/FEGaussianBlur.cpp
@@ -1,25 +1,25 @@
/*
- Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann at kde.org>
- 2004, 2005 Rob Buis <buis at kde.org>
- 2005 Eric Seidel <eric at webkit.org>
- 2009 Dirk Schulze <krit at webkit.org>
- 2010 Igalia, S.L.
-
- 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.
-*/
+ * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann at kde.org>
+ * Copyright (C) 2004, 2005 Rob Buis <buis at kde.org>
+ * Copyright (C) 2005 Eric Seidel <eric at webkit.org>
+ * Copyright (C) 2009 Dirk Schulze <krit at webkit.org>
+ * Copyright (C) 2010 Igalia, S.L.
+ *
+ * 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
+ * along 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"
@@ -132,12 +132,12 @@ void FEGaussianBlur::apply(Filter* filter)
if (!in->resultImage())
return;
- if (!getEffectContext())
+ if (!effectContext())
return;
setIsAlphaImage(in->isAlphaImage());
- IntRect effectDrawingRect = calculateDrawingIntRect(in->repaintRectInLocalCoordinates());
+ IntRect effectDrawingRect = requestedRegionOfInputImageData(in->repaintRectInLocalCoordinates());
RefPtr<ImageData> srcImageData(in->resultImage()->getPremultipliedImageData(effectDrawingRect));
IntRect imageRect(IntPoint(), resultImage()->size());
diff --git a/WebCore/platform/graphics/filters/FEGaussianBlur.h b/WebCore/platform/graphics/filters/FEGaussianBlur.h
index 63d763e..745bcc8 100644
--- a/WebCore/platform/graphics/filters/FEGaussianBlur.h
+++ b/WebCore/platform/graphics/filters/FEGaussianBlur.h
@@ -1,23 +1,23 @@
/*
- Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann at kde.org>
- 2004, 2005 Rob Buis <buis at kde.org>
- 2005 Eric Seidel <eric at 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.
-*/
+ * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann at kde.org>
+ * Copyright (C) 2004, 2005 Rob Buis <buis at kde.org>
+ * Copyright (C) 2005 Eric Seidel <eric at 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
+ * along 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 FEGaussianBlur_h
#define FEGaussianBlur_h
@@ -38,12 +38,13 @@ public:
float stdDeviationY() const;
void setStdDeviationY(float);
- void apply(Filter*);
- void dump();
- TextStream& externalRepresentation(TextStream&, int indent) const;
-
static float calculateStdDeviation(float);
+ virtual void apply(Filter*);
+ virtual void dump();
+
+ virtual TextStream& externalRepresentation(TextStream&, int indention) const;
+
private:
FEGaussianBlur(float, float);
static void kernelPosition(int boxBlur, unsigned& std, int& dLeft, int& dRight);
diff --git a/WebCore/platform/graphics/filters/Filter.h b/WebCore/platform/graphics/filters/Filter.h
index 7ad25aa..bce4be3 100644
--- a/WebCore/platform/graphics/filters/Filter.h
+++ b/WebCore/platform/graphics/filters/Filter.h
@@ -1,20 +1,20 @@
/*
- * Copyright (C) 2009 Dirk Schulze <krit at webkit.org>
+ * Copyright (C) 2009 Dirk Schulze <krit at 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 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.
+ * 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.
+ * You should have received a copy of the GNU Library General Public License
+ * along 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 Filter_h
diff --git a/WebCore/platform/graphics/filters/FilterEffect.cpp b/WebCore/platform/graphics/filters/FilterEffect.cpp
index b6278b2..461b22a 100644
--- a/WebCore/platform/graphics/filters/FilterEffect.cpp
+++ b/WebCore/platform/graphics/filters/FilterEffect.cpp
@@ -56,7 +56,7 @@ FloatRect FilterEffect::determineFilterPrimitiveSubregion(Filter* filter)
return m_filterPrimitiveSubregion;
}
-IntRect FilterEffect::calculateDrawingIntRect(const FloatRect& effectRect) const
+IntRect FilterEffect::requestedRegionOfInputImageData(const FloatRect& effectRect) const
{
ASSERT(m_effectBuffer);
FloatPoint location = m_repaintRectInLocalCoordinates.location();
@@ -64,7 +64,7 @@ IntRect FilterEffect::calculateDrawingIntRect(const FloatRect& effectRect) const
return IntRect(roundedIntPoint(location), m_effectBuffer->size());
}
-FloatRect FilterEffect::calculateDrawingRect(const FloatRect& srcRect) const
+FloatRect FilterEffect::drawingRegionOfInputImage(const FloatRect& srcRect) const
{
return FloatRect(FloatPoint(srcRect.x() - m_repaintRectInLocalCoordinates.x(),
srcRect.y() - m_repaintRectInLocalCoordinates.y()), srcRect.size());
@@ -76,7 +76,7 @@ FilterEffect* FilterEffect::inputEffect(unsigned number) const
return m_inputEffects.at(number).get();
}
-GraphicsContext* FilterEffect::getEffectContext()
+GraphicsContext* FilterEffect::effectContext()
{
IntRect bufferRect = enclosingIntRect(m_repaintRectInLocalCoordinates);
m_effectBuffer = ImageBuffer::create(bufferRect.size(), LinearRGB);
diff --git a/WebCore/platform/graphics/filters/FilterEffect.h b/WebCore/platform/graphics/filters/FilterEffect.h
index 91c52f3..ebe1880 100644
--- a/WebCore/platform/graphics/filters/FilterEffect.h
+++ b/WebCore/platform/graphics/filters/FilterEffect.h
@@ -49,14 +49,14 @@ 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* getEffectContext();
+ GraphicsContext* effectContext();
FilterEffectVector& inputEffects() { return m_inputEffects; }
FilterEffect* inputEffect(unsigned) const;
unsigned numberOfEffectInputs() const { return m_inputEffects.size(); }
- FloatRect calculateDrawingRect(const FloatRect&) const;
- IntRect calculateDrawingIntRect(const FloatRect&) const;
+ FloatRect drawingRegionOfInputImage(const FloatRect&) const;
+ IntRect requestedRegionOfInputImageData(const FloatRect&) const;
// Solid black image with different alpha values.
bool isAlphaImage() const { return m_alphaImage; }
diff --git a/WebCore/platform/graphics/filters/ImageBufferFilter.cpp b/WebCore/platform/graphics/filters/ImageBufferFilter.cpp
index 33953d6..12407f8 100644
--- a/WebCore/platform/graphics/filters/ImageBufferFilter.cpp
+++ b/WebCore/platform/graphics/filters/ImageBufferFilter.cpp
@@ -1,21 +1,21 @@
/*
- * Copyright (C) 2009 Dirk Schulze <krit at webkit.org>
- * Copyright (C) 2009 Brent Fulgham <bfulgham at webkit.org>
+ * Copyright (C) 2009 Dirk Schulze <krit at webkit.org>
+ * Copyright (C) 2009 Brent Fulgham <bfulgham at 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 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.
+ * 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.
+ * You should have received a copy of the GNU Library General Public License
+ * along 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"
diff --git a/WebCore/platform/graphics/filters/ImageBufferFilter.h b/WebCore/platform/graphics/filters/ImageBufferFilter.h
index a2775ea..cd4bc2f 100644
--- a/WebCore/platform/graphics/filters/ImageBufferFilter.h
+++ b/WebCore/platform/graphics/filters/ImageBufferFilter.h
@@ -1,21 +1,21 @@
/*
- * Copyright (C) 2009 Dirk Schulze <krit at webkit.org>
- * Copyright (C) 2009 Brent Fulgham <bfulgham at webkit.org>
+ * Copyright (C) 2009 Dirk Schulze <krit at webkit.org>
+ * Copyright (C) 2009 Brent Fulgham <bfulgham at 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 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.
+ * 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.
+ * You should have received a copy of the GNU Library General Public License
+ * along 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 ImageBufferFilter_h
diff --git a/WebCore/platform/graphics/filters/SourceAlpha.cpp b/WebCore/platform/graphics/filters/SourceAlpha.cpp
index 9c6a953..beaf2e7 100644
--- a/WebCore/platform/graphics/filters/SourceAlpha.cpp
+++ b/WebCore/platform/graphics/filters/SourceAlpha.cpp
@@ -1,20 +1,20 @@
/*
- * Copyright (C) 2009 Dirk Schulze <krit at webkit.org>
+ * Copyright (C) 2009 Dirk Schulze <krit at 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 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.
+ * 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.
+ * You should have received a copy of the GNU Library General Public License
+ * along 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"
@@ -57,7 +57,7 @@ FloatRect SourceAlpha::determineFilterPrimitiveSubregion(Filter* filter)
void SourceAlpha::apply(Filter* filter)
{
- GraphicsContext* filterContext = getEffectContext();
+ GraphicsContext* filterContext = effectContext();
if (!filterContext)
return;
diff --git a/WebCore/platform/graphics/filters/SourceAlpha.h b/WebCore/platform/graphics/filters/SourceAlpha.h
index 25a17b2..f0fa319 100644
--- a/WebCore/platform/graphics/filters/SourceAlpha.h
+++ b/WebCore/platform/graphics/filters/SourceAlpha.h
@@ -1,21 +1,21 @@
/*
- Copyright (C) 2009 Dirk Schulze <krit at 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.
-*/
+ * Copyright (C) 2009 Dirk Schulze <krit at 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
+ * along 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 SourceAlpha_h
#define SourceAlpha_h
@@ -28,22 +28,25 @@
namespace WebCore {
- class SourceAlpha : public FilterEffect {
- public:
- static PassRefPtr<SourceAlpha> create();
+class SourceAlpha : public FilterEffect {
+public:
+ static PassRefPtr<SourceAlpha> create();
+
+ static const AtomicString& effectName();
+
+ virtual FloatRect determineFilterPrimitiveSubregion(Filter*);
+
+ virtual void apply(Filter*);
+ virtual void dump();
+
+ virtual bool isSourceInput() const { return true; }
- static const AtomicString& effectName();
+ virtual TextStream& externalRepresentation(TextStream&, int indention) const;
- void apply(Filter*);
- void dump();
- TextStream& externalRepresentation(TextStream&, int indent) const;
+private:
+ SourceAlpha() { }
+};
- virtual bool isSourceInput() const { return true; }
- virtual FloatRect determineFilterPrimitiveSubregion(Filter*);
-
- private:
- SourceAlpha() { }
- };
} //namespace WebCore
#endif // ENABLE(FILTERS)
diff --git a/WebCore/platform/graphics/filters/SourceGraphic.cpp b/WebCore/platform/graphics/filters/SourceGraphic.cpp
index 6a32e36..c014e68 100644
--- a/WebCore/platform/graphics/filters/SourceGraphic.cpp
+++ b/WebCore/platform/graphics/filters/SourceGraphic.cpp
@@ -1,20 +1,20 @@
/*
- * Copyright (C) 2009 Dirk Schulze <krit at webkit.org>
+ * Copyright (C) 2009 Dirk Schulze <krit at 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 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.
+ * 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.
+ * You should have received a copy of the GNU Library General Public License
+ * along 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"
@@ -56,7 +56,7 @@ FloatRect SourceGraphic::determineFilterPrimitiveSubregion(Filter* filter)
void SourceGraphic::apply(Filter* filter)
{
- GraphicsContext* filterContext = getEffectContext();
+ GraphicsContext* filterContext = effectContext();
if (!filterContext)
return;
diff --git a/WebCore/platform/graphics/filters/SourceGraphic.h b/WebCore/platform/graphics/filters/SourceGraphic.h
index 911648c..2378798 100644
--- a/WebCore/platform/graphics/filters/SourceGraphic.h
+++ b/WebCore/platform/graphics/filters/SourceGraphic.h
@@ -1,22 +1,22 @@
/*
- Copyright (C) 2008 Alex Mathews <possessedpenguinbob at gmail.com>
- 2009 Dirk Schulze <krit at 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.
-*/
+ * Copyright (C) 2008 Alex Mathews <possessedpenguinbob at gmail.com>
+ * Copyright (C) 2009 Dirk Schulze <krit at 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
+ * along 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 SourceGraphic_h
#define SourceGrahpic_h
@@ -29,22 +29,25 @@
namespace WebCore {
- class SourceGraphic : public FilterEffect {
- public:
- static PassRefPtr<SourceGraphic> create();
+class SourceGraphic : public FilterEffect {
+public:
+ static PassRefPtr<SourceGraphic> create();
+
+ static const AtomicString& effectName();
+
+ virtual FloatRect determineFilterPrimitiveSubregion(Filter*);
+
+ virtual void apply(Filter*);
+ virtual void dump();
- static const AtomicString& effectName();
+ virtual bool isSourceInput() const { return true; }
- void apply(Filter*);
- void dump();
- TextStream& externalRepresentation(TextStream&, int indent) const;
+ virtual TextStream& externalRepresentation(TextStream&, int indention) const;
- virtual bool isSourceInput() const { return true; }
- virtual FloatRect determineFilterPrimitiveSubregion(Filter*);
+private:
+ SourceGraphic() { }
+};
- private:
- SourceGraphic() { }
- };
} //namespace WebCore
#endif // ENABLE(FILTERS)
diff --git a/WebCore/rendering/RenderTreeAsText.cpp b/WebCore/rendering/RenderTreeAsText.cpp
index e10c2f1..be1e8d0 100644
--- a/WebCore/rendering/RenderTreeAsText.cpp
+++ b/WebCore/rendering/RenderTreeAsText.cpp
@@ -46,7 +46,6 @@
#include "RenderView.h"
#include "RenderWidget.h"
#include "SelectionController.h"
-#include "TextStream.h"
#include <wtf/UnusedParam.h>
#include <wtf/Vector.h>
@@ -75,12 +74,52 @@ using namespace HTMLNames;
static void writeLayers(TextStream&, const RenderLayer* rootLayer, RenderLayer*, const IntRect& paintDirtyRect, int indent = 0, RenderAsTextBehavior behavior = RenderAsTextBehaviorNormal);
-#if !ENABLE(SVG)
-static TextStream &operator<<(TextStream& ts, const IntRect& r)
+bool hasFractions(double val)
+{
+ int ival = static_cast<int>(val);
+ double dval = static_cast<double>(ival);
+ return fabs(val - dval) > std::numeric_limits<double>::epsilon();
+}
+
+TextStream& operator<<(TextStream& ts, const IntRect& r)
{
return ts << "at (" << r.x() << "," << r.y() << ") size " << r.width() << "x" << r.height();
}
-#endif
+
+TextStream& operator<<(TextStream& ts, const IntPoint& p)
+{
+ return ts << "(" << p.x() << "," << p.y() << ")";
+}
+
+TextStream& operator<<(TextStream& ts, const FloatPoint& p)
+{
+ ts << "(";
+ if (hasFractions(p.x()))
+ ts << p.x();
+ else
+ ts << int(p.x());
+ ts << ",";
+ if (hasFractions(p.y()))
+ ts << p.y();
+ else
+ ts << int(p.y());
+ return ts << ")";
+}
+
+TextStream& operator<<(TextStream& ts, const FloatSize& s)
+{
+ ts << "width=";
+ if (hasFractions(s.width()))
+ ts << s.width();
+ else
+ ts << int(s.width());
+ ts << " height=";
+ if (hasFractions(s.height()))
+ ts << s.height();
+ else
+ ts << int(s.height());
+ return ts;
+}
void writeIndent(TextStream& ts, int indent)
{
diff --git a/WebCore/rendering/RenderTreeAsText.h b/WebCore/rendering/RenderTreeAsText.h
index 722736b..59a0abb 100644
--- a/WebCore/rendering/RenderTreeAsText.h
+++ b/WebCore/rendering/RenderTreeAsText.h
@@ -25,13 +25,19 @@
#ifndef RenderTreeAsText_h
#define RenderTreeAsText_h
+#include "TextStream.h"
#include <wtf/Forward.h>
+#include <wtf/MathExtras.h>
namespace WebCore {
class Element;
+class FloatPoint;
+class FloatSize;
class Frame;
+class IntPoint;
+class IntRect;
class RenderObject;
class TextStream;
@@ -59,6 +65,27 @@ public:
static void writeRenderObject(TextStream& ts, const RenderObject& o, RenderAsTextBehavior behavior);
};
+TextStream& operator<<(TextStream&, const IntPoint&);
+TextStream& operator<<(TextStream&, const IntRect&);
+TextStream& operator<<(TextStream&, const FloatPoint&);
+TextStream& operator<<(TextStream&, const FloatSize&);
+
+template<typename Item>
+TextStream& operator<<(TextStream& ts, const Vector<Item>& vector)
+{
+ ts << "[";
+
+ unsigned size = vector.size();
+ for (unsigned i = 0; i < size; ++i) {
+ ts << vector[i];
+ if (i < size - 1)
+ ts << ", ";
+ }
+
+ ts << "]";
+ return ts;
+}
+
// Helper function shared with SVGRenderTreeAsText
String quoteAndEscapeNonPrintables(const String&);
@@ -66,6 +93,8 @@ String counterValueForElement(Element*);
String markerTextForListItem(Element*);
+bool hasFractions(double val);
+
} // namespace WebCore
#endif // RenderTreeAsText_h
diff --git a/WebCore/rendering/SVGRenderTreeAsText.cpp b/WebCore/rendering/SVGRenderTreeAsText.cpp
index 20d7220..238f31d 100644
--- a/WebCore/rendering/SVGRenderTreeAsText.cpp
+++ b/WebCore/rendering/SVGRenderTreeAsText.cpp
@@ -124,24 +124,6 @@ static void writeIfNotDefault(TextStream& ts, const char* name, ValueType value,
writeNameValuePair(ts, name, value);
}
-TextStream& operator<<(TextStream& ts, const IntPoint& p)
-{
- return ts << "(" << p.x() << "," << p.y() << ")";
-}
-
-TextStream& operator<<(TextStream& ts, const IntRect& r)
-{
- return ts << "at (" << r.x() << "," << r.y() << ") size " << r.width() << "x" << r.height();
-}
-
-static bool hasFractions(double val)
-{
- double epsilon = 0.0001;
- int ival = static_cast<int>(val);
- double dval = static_cast<double>(ival);
- return fabs(val - dval) > epsilon;
-}
-
TextStream& operator<<(TextStream& ts, const FloatRect &r)
{
ts << "at (";
@@ -167,36 +149,6 @@ TextStream& operator<<(TextStream& ts, const FloatRect &r)
return ts;
}
-TextStream& operator<<(TextStream& ts, const FloatPoint& p)
-{
- ts << "(";
- if (hasFractions(p.x()))
- ts << p.x();
- else
- ts << int(p.x());
- ts << ",";
- if (hasFractions(p.y()))
- ts << p.y();
- else
- ts << int(p.y());
- return ts << ")";
-}
-
-TextStream& operator<<(TextStream& ts, const FloatSize& s)
-{
- ts << "width=";
- if (hasFractions(s.width()))
- ts << s.width();
- else
- ts << int(s.width());
- ts << " height=";
- if (hasFractions(s.height()))
- ts << s.height();
- else
- ts << int(s.height());
- return ts;
-}
-
TextStream& operator<<(TextStream& ts, const AffineTransform& transform)
{
if (transform.isIdentity())
diff --git a/WebCore/rendering/SVGRenderTreeAsText.h b/WebCore/rendering/SVGRenderTreeAsText.h
index d4aeaac..e279cfe 100644
--- a/WebCore/rendering/SVGRenderTreeAsText.h
+++ b/WebCore/rendering/SVGRenderTreeAsText.h
@@ -33,11 +33,8 @@
namespace WebCore {
class Color;
- class FloatPoint;
class FloatRect;
class FloatSize;
- class IntPoint;
- class IntRect;
class Node;
class RenderBlock;
class RenderImage;
@@ -63,12 +60,8 @@ void writeResources(TextStream&, const RenderObject&, int indent);
// helper operators defined used in various classes to dump the render tree.
TextStream& operator<<(TextStream&, const AffineTransform&);
-TextStream& operator<<(TextStream&, const IntRect&);
TextStream& operator<<(TextStream&, const Color&);
-TextStream& operator<<(TextStream&, const IntPoint&);
-TextStream& operator<<(TextStream&, const FloatSize&);
TextStream& operator<<(TextStream&, const FloatRect&);
-TextStream& operator<<(TextStream&, const FloatPoint&);
// helper operators specific to dumping the render tree. these are used in various classes to dump the render tree
// these could be defined in separate namespace to avoid matching these generic signatures unintentionally.
@@ -88,21 +81,6 @@ TextStream& operator<<(TextStream& ts, const Vector<Item*>& v)
return ts;
}
-template<typename Item>
-TextStream& operator<<(TextStream& ts, const Vector<Item>& v)
-{
- ts << "[";
-
- for (unsigned i = 0; i < v.size(); i++) {
- ts << v[i];
- if (i < v.size() - 1)
- ts << ", ";
- }
-
- ts << "]";
- return ts;
-}
-
template<typename Pointer>
TextStream& operator<<(TextStream& ts, Pointer* t)
{
diff --git a/WebCore/svg/graphics/filters/SVGFEConvolveMatrix.cpp b/WebCore/svg/graphics/filters/SVGFEConvolveMatrix.cpp
index 2dbc7ab..5c0c175 100644
--- a/WebCore/svg/graphics/filters/SVGFEConvolveMatrix.cpp
+++ b/WebCore/svg/graphics/filters/SVGFEConvolveMatrix.cpp
@@ -29,7 +29,6 @@
#include "CanvasPixelArray.h"
#include "Filter.h"
#include "ImageData.h"
-#include "SVGRenderTreeAsText.h"
namespace WebCore {
@@ -378,11 +377,11 @@ void FEConvolveMatrix::apply(Filter* filter)
if (!in->resultImage())
return;
- if (!getEffectContext())
+ if (!effectContext())
return;
IntRect imageRect(IntPoint(), resultImage()->size());
- IntRect effectDrawingRect = calculateDrawingIntRect(in->filterPrimitiveSubregion());
+ IntRect effectDrawingRect = requestedRegionOfInputImageData(in->filterPrimitiveSubregion());
RefPtr<CanvasPixelArray> srcPixelArray;
if (m_preserveAlpha)
diff --git a/WebCore/svg/graphics/filters/SVGFEConvolveMatrix.h b/WebCore/svg/graphics/filters/SVGFEConvolveMatrix.h
index 736933c..04dd59c 100644
--- a/WebCore/svg/graphics/filters/SVGFEConvolveMatrix.h
+++ b/WebCore/svg/graphics/filters/SVGFEConvolveMatrix.h
@@ -72,9 +72,10 @@ public:
bool preserveAlpha() const;
void setPreserveAlpha(bool);
- void apply(Filter*);
- void dump();
- TextStream& externalRepresentation(TextStream&, int indent) const;
+ virtual void apply(Filter*);
+ virtual void dump();
+
+ virtual TextStream& externalRepresentation(TextStream&, int indention) const;
private:
FEConvolveMatrix(const IntSize&, float, float,
diff --git a/WebCore/svg/graphics/filters/SVGFEDiffuseLighting.cpp b/WebCore/svg/graphics/filters/SVGFEDiffuseLighting.cpp
index b439c46..0d6f04f 100644
--- a/WebCore/svg/graphics/filters/SVGFEDiffuseLighting.cpp
+++ b/WebCore/svg/graphics/filters/SVGFEDiffuseLighting.cpp
@@ -25,7 +25,6 @@
#include "SVGFEDiffuseLighting.h"
#include "SVGLightSource.h"
-#include "SVGRenderTreeAsText.h"
namespace WebCore {
diff --git a/WebCore/svg/graphics/filters/SVGFEDiffuseLighting.h b/WebCore/svg/graphics/filters/SVGFEDiffuseLighting.h
index 0cdeae3..90db35d 100644
--- a/WebCore/svg/graphics/filters/SVGFEDiffuseLighting.h
+++ b/WebCore/svg/graphics/filters/SVGFEDiffuseLighting.h
@@ -53,12 +53,12 @@ public:
const LightSource* lightSource() const;
void setLightSource(PassRefPtr<LightSource>);
- void dump();
- TextStream& externalRepresentation(TextStream&, int indent) const;
+ virtual void dump();
+
+ virtual TextStream& externalRepresentation(TextStream&, int indention) const;
private:
- FEDiffuseLighting(const Color&, float, float,
- float, float, PassRefPtr<LightSource>);
+ FEDiffuseLighting(const Color&, float, float, float, float, PassRefPtr<LightSource>);
};
} // namespace WebCore
diff --git a/WebCore/svg/graphics/filters/SVGFEDisplacementMap.cpp b/WebCore/svg/graphics/filters/SVGFEDisplacementMap.cpp
index 9d9857e..202e37f 100644
--- a/WebCore/svg/graphics/filters/SVGFEDisplacementMap.cpp
+++ b/WebCore/svg/graphics/filters/SVGFEDisplacementMap.cpp
@@ -29,7 +29,6 @@
#include "Filter.h"
#include "GraphicsContext.h"
#include "ImageData.h"
-#include "SVGRenderTreeAsText.h"
namespace WebCore {
@@ -89,13 +88,13 @@ void FEDisplacementMap::apply(Filter* filter)
if (m_xChannelSelector == CHANNEL_UNKNOWN || m_yChannelSelector == CHANNEL_UNKNOWN)
return;
- if (!getEffectContext())
+ if (!effectContext())
return;
- IntRect effectADrawingRect = calculateDrawingIntRect(in->repaintRectInLocalCoordinates());
+ IntRect effectADrawingRect = requestedRegionOfInputImageData(in->repaintRectInLocalCoordinates());
RefPtr<CanvasPixelArray> srcPixelArrayA(in->resultImage()->getPremultipliedImageData(effectADrawingRect)->data());
- IntRect effectBDrawingRect = calculateDrawingIntRect(in2->repaintRectInLocalCoordinates());
+ IntRect effectBDrawingRect = requestedRegionOfInputImageData(in2->repaintRectInLocalCoordinates());
RefPtr<CanvasPixelArray> srcPixelArrayB(in2->resultImage()->getUnmultipliedImageData(effectBDrawingRect)->data());
IntRect imageRect(IntPoint(), resultImage()->size());
diff --git a/WebCore/svg/graphics/filters/SVGFEDisplacementMap.h b/WebCore/svg/graphics/filters/SVGFEDisplacementMap.h
index 9e17da4..d99677f 100644
--- a/WebCore/svg/graphics/filters/SVGFEDisplacementMap.h
+++ b/WebCore/svg/graphics/filters/SVGFEDisplacementMap.h
@@ -29,38 +29,39 @@
namespace WebCore {
- enum ChannelSelectorType {
- CHANNEL_UNKNOWN = 0,
- CHANNEL_R = 1,
- CHANNEL_G = 2,
- CHANNEL_B = 3,
- CHANNEL_A = 4
- };
-
- class FEDisplacementMap : public FilterEffect {
- public:
- static PassRefPtr<FEDisplacementMap> create(ChannelSelectorType, ChannelSelectorType, float);
+enum ChannelSelectorType {
+ CHANNEL_UNKNOWN = 0,
+ CHANNEL_R = 1,
+ CHANNEL_G = 2,
+ CHANNEL_B = 3,
+ CHANNEL_A = 4
+};
- ChannelSelectorType xChannelSelector() const;
- void setXChannelSelector(const ChannelSelectorType);
+class FEDisplacementMap : public FilterEffect {
+public:
+ static PassRefPtr<FEDisplacementMap> create(ChannelSelectorType xChannelSelector, ChannelSelectorType yChannelSelector, float);
- ChannelSelectorType yChannelSelector() const;
- void setYChannelSelector(const ChannelSelectorType);
+ ChannelSelectorType xChannelSelector() const;
+ void setXChannelSelector(const ChannelSelectorType);
- float scale() const;
- void setScale(float scale);
+ ChannelSelectorType yChannelSelector() const;
+ void setYChannelSelector(const ChannelSelectorType);
- void apply(Filter*);
- void dump();
- TextStream& externalRepresentation(TextStream&, int indent) const;
+ float scale() const;
+ void setScale(float scale);
- private:
- FEDisplacementMap(ChannelSelectorType, ChannelSelectorType, float);
+ virtual void apply(Filter*);
+ virtual void dump();
- ChannelSelectorType m_xChannelSelector;
- ChannelSelectorType m_yChannelSelector;
- float m_scale;
- };
+ virtual TextStream& externalRepresentation(TextStream&, int indention) const;
+
+private:
+ FEDisplacementMap(ChannelSelectorType xChannelSelector, ChannelSelectorType yChannelSelector, float);
+
+ ChannelSelectorType m_xChannelSelector;
+ ChannelSelectorType m_yChannelSelector;
+ float m_scale;
+};
} // namespace WebCore
diff --git a/WebCore/svg/graphics/filters/SVGFEFlood.cpp b/WebCore/svg/graphics/filters/SVGFEFlood.cpp
index a2b2cd2..e538304 100644
--- a/WebCore/svg/graphics/filters/SVGFEFlood.cpp
+++ b/WebCore/svg/graphics/filters/SVGFEFlood.cpp
@@ -27,18 +27,17 @@
#include "Filter.h"
#include "GraphicsContext.h"
-#include "SVGRenderTreeAsText.h"
namespace WebCore {
-FEFlood::FEFlood(const Color& floodColor, const float& floodOpacity)
+FEFlood::FEFlood(const Color& floodColor, float floodOpacity)
: FilterEffect()
, m_floodColor(floodColor)
, m_floodOpacity(floodOpacity)
{
}
-PassRefPtr<FEFlood> FEFlood::create(const Color& floodColor, const float& floodOpacity)
+PassRefPtr<FEFlood> FEFlood::create(const Color& floodColor, float floodOpacity)
{
return adoptRef(new FEFlood(floodColor, floodOpacity));
}
@@ -65,7 +64,7 @@ void FEFlood::setFloodOpacity(float floodOpacity)
void FEFlood::apply(Filter*)
{
- GraphicsContext* filterContext = getEffectContext();
+ GraphicsContext* filterContext = effectContext();
if (!filterContext)
return;
@@ -82,7 +81,7 @@ TextStream& FEFlood::externalRepresentation(TextStream& ts, int indent) const
writeIndent(ts, indent);
ts << "[feFlood";
FilterEffect::externalRepresentation(ts);
- ts << " flood-color=\"" << floodColor() << "\" "
+ ts << " flood-color=\"" << floodColor().name() << "\" "
<< "flood-opacity=\"" << floodOpacity() << "\"]\n";
return ts;
}
diff --git a/WebCore/svg/graphics/filters/SVGFEFlood.h b/WebCore/svg/graphics/filters/SVGFEFlood.h
index 8ae251d..e81506d 100644
--- a/WebCore/svg/graphics/filters/SVGFEFlood.h
+++ b/WebCore/svg/graphics/filters/SVGFEFlood.h
@@ -29,26 +29,27 @@
namespace WebCore {
- class FEFlood : public FilterEffect {
- public:
- static PassRefPtr<FEFlood> create(const Color&, const float&);
+class FEFlood : public FilterEffect {
+public:
+ static PassRefPtr<FEFlood> create(const Color&, float);
- Color floodColor() const;
- void setFloodColor(const Color &);
+ Color floodColor() const;
+ void setFloodColor(const Color &);
- float floodOpacity() const;
- void setFloodOpacity(float);
+ float floodOpacity() const;
+ void setFloodOpacity(float);
- void apply(Filter*);
- void dump();
- TextStream& externalRepresentation(TextStream&, int indent) const;
+ virtual void apply(Filter*);
+ virtual void dump();
- private:
- FEFlood(const Color&, const float&);
+ virtual TextStream& externalRepresentation(TextStream&, int indention) const;
- Color m_floodColor;
- float m_floodOpacity;
- };
+private:
+ FEFlood(const Color&, float);
+
+ Color m_floodColor;
+ float m_floodOpacity;
+};
} // namespace WebCore
diff --git a/WebCore/svg/graphics/filters/SVGFEImage.cpp b/WebCore/svg/graphics/filters/SVGFEImage.cpp
index a3ac882..c94547b 100644
--- a/WebCore/svg/graphics/filters/SVGFEImage.cpp
+++ b/WebCore/svg/graphics/filters/SVGFEImage.cpp
@@ -29,18 +29,17 @@
#include "Filter.h"
#include "GraphicsContext.h"
#include "SVGPreserveAspectRatio.h"
-#include "SVGRenderTreeAsText.h"
namespace WebCore {
-FEImage::FEImage(RefPtr<Image> image, SVGPreserveAspectRatio preserveAspectRatio)
+FEImage::FEImage(RefPtr<Image> image, const SVGPreserveAspectRatio& preserveAspectRatio)
: FilterEffect()
, m_image(image)
, m_preserveAspectRatio(preserveAspectRatio)
{
}
-PassRefPtr<FEImage> FEImage::create(RefPtr<Image> image, SVGPreserveAspectRatio preserveAspectRatio)
+PassRefPtr<FEImage> FEImage::create(RefPtr<Image> image, const SVGPreserveAspectRatio& preserveAspectRatio)
{
return adoptRef(new FEImage(image, preserveAspectRatio));
}
@@ -50,7 +49,7 @@ void FEImage::apply(Filter*)
if (!m_image.get())
return;
- GraphicsContext* filterContext = getEffectContext();
+ GraphicsContext* filterContext = effectContext();
if (!filterContext)
return;
diff --git a/WebCore/svg/graphics/filters/SVGFEImage.h b/WebCore/svg/graphics/filters/SVGFEImage.h
index 97a9cda..fe2d8c4 100644
--- a/WebCore/svg/graphics/filters/SVGFEImage.h
+++ b/WebCore/svg/graphics/filters/SVGFEImage.h
@@ -29,20 +29,21 @@
namespace WebCore {
- class FEImage : public FilterEffect {
- public:
- static PassRefPtr<FEImage> create(RefPtr<Image>, SVGPreserveAspectRatio);
-
- void apply(Filter*);
- void dump();
- TextStream& externalRepresentation(TextStream&, int indent) const;
-
- private:
- FEImage(RefPtr<Image>, SVGPreserveAspectRatio);
-
- RefPtr<Image> m_image;
- SVGPreserveAspectRatio m_preserveAspectRatio;
- };
+class FEImage : public FilterEffect {
+public:
+ static PassRefPtr<FEImage> create(RefPtr<Image>, const SVGPreserveAspectRatio&);
+
+ virtual void apply(Filter*);
+ virtual void dump();
+
+ virtual TextStream& externalRepresentation(TextStream&, int indention) const;
+
+private:
+ FEImage(RefPtr<Image>, const SVGPreserveAspectRatio&);
+
+ RefPtr<Image> m_image;
+ SVGPreserveAspectRatio m_preserveAspectRatio;
+};
} // namespace WebCore
diff --git a/WebCore/svg/graphics/filters/SVGFELighting.cpp b/WebCore/svg/graphics/filters/SVGFELighting.cpp
index dc82840..369889f 100644
--- a/WebCore/svg/graphics/filters/SVGFELighting.cpp
+++ b/WebCore/svg/graphics/filters/SVGFELighting.cpp
@@ -247,12 +247,12 @@ void FELighting::apply(Filter* filter)
if (!in->resultImage())
return;
- if (!getEffectContext())
+ if (!effectContext())
return;
setIsAlphaImage(false);
- IntRect effectDrawingRect = calculateDrawingIntRect(in->repaintRectInLocalCoordinates());
+ IntRect effectDrawingRect = requestedRegionOfInputImageData(in->repaintRectInLocalCoordinates());
RefPtr<ImageData> srcImageData(in->resultImage()->getUnmultipliedImageData(effectDrawingRect));
CanvasPixelArray* srcPixelArray(srcImageData->data());
diff --git a/WebCore/svg/graphics/filters/SVGFELighting.h b/WebCore/svg/graphics/filters/SVGFELighting.h
index 55802ca..c99f3c5 100644
--- a/WebCore/svg/graphics/filters/SVGFELighting.h
+++ b/WebCore/svg/graphics/filters/SVGFELighting.h
@@ -42,7 +42,7 @@ class CanvasPixelArray;
class FELighting : public FilterEffect {
public:
- void apply(Filter*);
+ virtual void apply(Filter*);
protected:
enum LightingType {
diff --git a/WebCore/svg/graphics/filters/SVGFEMerge.cpp b/WebCore/svg/graphics/filters/SVGFEMerge.cpp
index e92ce4c..42d2b10 100644
--- a/WebCore/svg/graphics/filters/SVGFEMerge.cpp
+++ b/WebCore/svg/graphics/filters/SVGFEMerge.cpp
@@ -26,7 +26,6 @@
#include "Filter.h"
#include "GraphicsContext.h"
-#include "SVGRenderTreeAsText.h"
namespace WebCore {
@@ -51,13 +50,13 @@ void FEMerge::apply(Filter* filter)
return;
}
- GraphicsContext* filterContext = getEffectContext();
+ GraphicsContext* filterContext = effectContext();
if (!filterContext)
return;
for (unsigned i = 0; i < size; ++i) {
FilterEffect* in = inputEffect(i);
- filterContext->drawImageBuffer(in->resultImage(), DeviceColorSpace, calculateDrawingRect(in->repaintRectInLocalCoordinates()));
+ filterContext->drawImageBuffer(in->resultImage(), DeviceColorSpace, drawingRegionOfInputImage(in->repaintRectInLocalCoordinates()));
}
}
diff --git a/WebCore/svg/graphics/filters/SVGFEMerge.h b/WebCore/svg/graphics/filters/SVGFEMerge.h
index 439d789..7b83113 100644
--- a/WebCore/svg/graphics/filters/SVGFEMerge.h
+++ b/WebCore/svg/graphics/filters/SVGFEMerge.h
@@ -29,17 +29,18 @@
namespace WebCore {
- class FEMerge : public FilterEffect {
- public:
- static PassRefPtr<FEMerge> create();
+class FEMerge : public FilterEffect {
+public:
+ static PassRefPtr<FEMerge> create();
- void apply(Filter*);
- void dump();
- TextStream& externalRepresentation(TextStream&, int indent) const;
+ virtual void apply(Filter*);
+ virtual void dump();
- private:
- FEMerge();
- };
+ virtual TextStream& externalRepresentation(TextStream&, int indention) const;
+
+private:
+ FEMerge();
+};
} // namespace WebCore
diff --git a/WebCore/svg/graphics/filters/SVGFEMorphology.cpp b/WebCore/svg/graphics/filters/SVGFEMorphology.cpp
index 6645259..7e031d4 100644
--- a/WebCore/svg/graphics/filters/SVGFEMorphology.cpp
+++ b/WebCore/svg/graphics/filters/SVGFEMorphology.cpp
@@ -28,7 +28,6 @@
#include "CanvasPixelArray.h"
#include "Filter.h"
#include "ImageData.h"
-#include "SVGRenderTreeAsText.h"
#include <wtf/Vector.h>
@@ -87,7 +86,7 @@ void FEMorphology::apply(Filter* filter)
if (!in->resultImage())
return;
- if (!getEffectContext())
+ if (!effectContext())
return;
setIsAlphaImage(in->isAlphaImage());
@@ -98,7 +97,7 @@ void FEMorphology::apply(Filter* filter)
return;
IntRect imageRect(IntPoint(), resultImage()->size());
- IntRect effectDrawingRect = calculateDrawingIntRect(in->repaintRectInLocalCoordinates());
+ IntRect effectDrawingRect = requestedRegionOfInputImageData(in->repaintRectInLocalCoordinates());
RefPtr<CanvasPixelArray> srcPixelArray(in->resultImage()->getPremultipliedImageData(effectDrawingRect)->data());
RefPtr<ImageData> imageData = ImageData::create(imageRect.width(), imageRect.height());
diff --git a/WebCore/svg/graphics/filters/SVGFEMorphology.h b/WebCore/svg/graphics/filters/SVGFEMorphology.h
index 9743d2b..56fdd3d 100644
--- a/WebCore/svg/graphics/filters/SVGFEMorphology.h
+++ b/WebCore/svg/graphics/filters/SVGFEMorphology.h
@@ -28,35 +28,36 @@
namespace WebCore {
- enum MorphologyOperatorType {
- FEMORPHOLOGY_OPERATOR_UNKNOWN = 0,
- FEMORPHOLOGY_OPERATOR_ERODE = 1,
- FEMORPHOLOGY_OPERATOR_DILATE = 2
- };
+enum MorphologyOperatorType {
+ FEMORPHOLOGY_OPERATOR_UNKNOWN = 0,
+ FEMORPHOLOGY_OPERATOR_ERODE = 1,
+ FEMORPHOLOGY_OPERATOR_DILATE = 2
+};
- class FEMorphology : public FilterEffect {
- public:
- static PassRefPtr<FEMorphology> create(MorphologyOperatorType, float radiusX, float radiusY);
- MorphologyOperatorType morphologyOperator() const;
- void setMorphologyOperator(MorphologyOperatorType);
+class FEMorphology : public FilterEffect {
+public:
+ static PassRefPtr<FEMorphology> create(MorphologyOperatorType, float radiusX, float radiusY);
+ MorphologyOperatorType morphologyOperator() const;
+ void setMorphologyOperator(MorphologyOperatorType);
- float radiusX() const;
- void setRadiusX(float);
+ float radiusX() const;
+ void setRadiusX(float);
- float radiusY() const;
- void setRadiusY(float);
+ float radiusY() const;
+ void setRadiusY(float);
- void apply(Filter*);
- void dump();
- TextStream& externalRepresentation(TextStream&, int indent) const;
+ virtual void apply(Filter*);
+ virtual void dump();
- private:
- FEMorphology(MorphologyOperatorType, float radiusX, float radiusY);
-
- MorphologyOperatorType m_type;
- float m_radiusX;
- float m_radiusY;
- };
+ virtual TextStream& externalRepresentation(TextStream&, int indention) const;
+
+private:
+ FEMorphology(MorphologyOperatorType, float radiusX, float radiusY);
+
+ MorphologyOperatorType m_type;
+ float m_radiusX;
+ float m_radiusY;
+};
} // namespace WebCore
diff --git a/WebCore/svg/graphics/filters/SVGFEOffset.cpp b/WebCore/svg/graphics/filters/SVGFEOffset.cpp
index 685bd7b..037602a 100644
--- a/WebCore/svg/graphics/filters/SVGFEOffset.cpp
+++ b/WebCore/svg/graphics/filters/SVGFEOffset.cpp
@@ -27,7 +27,6 @@
#include "Filter.h"
#include "GraphicsContext.h"
-#include "SVGRenderTreeAsText.h"
namespace WebCore {
@@ -70,7 +69,7 @@ void FEOffset::apply(Filter* filter)
if (!in->resultImage())
return;
- GraphicsContext* filterContext = getEffectContext();
+ GraphicsContext* filterContext = effectContext();
if (!filterContext)
return;
diff --git a/WebCore/svg/graphics/filters/SVGFEOffset.h b/WebCore/svg/graphics/filters/SVGFEOffset.h
index 34ed97b..6857e14 100644
--- a/WebCore/svg/graphics/filters/SVGFEOffset.h
+++ b/WebCore/svg/graphics/filters/SVGFEOffset.h
@@ -28,26 +28,27 @@
namespace WebCore {
- class FEOffset : public FilterEffect {
- public:
- static PassRefPtr<FEOffset> create(float, float);
+class FEOffset : public FilterEffect {
+public:
+ static PassRefPtr<FEOffset> create(float dx, float dy);
- float dx() const;
- void setDx(float);
+ float dx() const;
+ void setDx(float);
- float dy() const;
- void setDy(float);
+ float dy() const;
+ void setDy(float);
- void apply(Filter*);
- void dump();
- TextStream& externalRepresentation(TextStream&, int indent) const;
+ virtual void apply(Filter*);
+ virtual void dump();
- private:
- FEOffset(float, float);
+ virtual TextStream& externalRepresentation(TextStream&, int indention) const;
- float m_dx;
- float m_dy;
- };
+private:
+ FEOffset(float dx, float dy);
+
+ float m_dx;
+ float m_dy;
+};
} // namespace WebCore
diff --git a/WebCore/svg/graphics/filters/SVGFESpecularLighting.cpp b/WebCore/svg/graphics/filters/SVGFESpecularLighting.cpp
index 33f7b6c..113ae14 100644
--- a/WebCore/svg/graphics/filters/SVGFESpecularLighting.cpp
+++ b/WebCore/svg/graphics/filters/SVGFESpecularLighting.cpp
@@ -25,7 +25,6 @@
#include "SVGFESpecularLighting.h"
#include "SVGLightSource.h"
-#include "SVGRenderTreeAsText.h"
namespace WebCore {
diff --git a/WebCore/svg/graphics/filters/SVGFESpecularLighting.h b/WebCore/svg/graphics/filters/SVGFESpecularLighting.h
index 6067a76..00a5f8a 100644
--- a/WebCore/svg/graphics/filters/SVGFESpecularLighting.h
+++ b/WebCore/svg/graphics/filters/SVGFESpecularLighting.h
@@ -54,8 +54,9 @@ public:
const LightSource* lightSource() const;
void setLightSource(PassRefPtr<LightSource>);
- void dump();
- TextStream& externalRepresentation(TextStream&, int indent) const;
+ virtual void dump();
+
+ virtual TextStream& externalRepresentation(TextStream&, int indention) const;
private:
FESpecularLighting(const Color&, float, float, float, float, float, PassRefPtr<LightSource>);
diff --git a/WebCore/svg/graphics/filters/SVGFETile.cpp b/WebCore/svg/graphics/filters/SVGFETile.cpp
index 80eb9b3..f8f0adc 100644
--- a/WebCore/svg/graphics/filters/SVGFETile.cpp
+++ b/WebCore/svg/graphics/filters/SVGFETile.cpp
@@ -27,7 +27,6 @@
#include "Filter.h"
#include "GraphicsContext.h"
#include "Pattern.h"
-#include "SVGRenderTreeAsText.h"
namespace WebCore {
@@ -56,7 +55,7 @@ void FETile::apply(Filter* filter)
if (!in->resultImage())
return;
- GraphicsContext* filterContext = getEffectContext();
+ GraphicsContext* filterContext = effectContext();
if (!filterContext)
return;
diff --git a/WebCore/svg/graphics/filters/SVGFETile.h b/WebCore/svg/graphics/filters/SVGFETile.h
index 128c9cb..e587683 100644
--- a/WebCore/svg/graphics/filters/SVGFETile.h
+++ b/WebCore/svg/graphics/filters/SVGFETile.h
@@ -28,19 +28,20 @@
namespace WebCore {
- class FETile : public FilterEffect {
- public:
- static PassRefPtr<FETile> create();
-
- void apply(Filter*);
- void dump();
- TextStream& externalRepresentation(TextStream&, int indent) const;
-
- virtual FloatRect determineFilterPrimitiveSubregion(Filter*);
-
- private:
- FETile();
- };
+class FETile : public FilterEffect {
+public:
+ static PassRefPtr<FETile> create();
+
+ virtual void apply(Filter*);
+ virtual void dump();
+
+ virtual TextStream& externalRepresentation(TextStream&, int indention) const;
+
+ virtual FloatRect determineFilterPrimitiveSubregion(Filter*);
+
+private:
+ FETile();
+};
} // namespace WebCore
diff --git a/WebCore/svg/graphics/filters/SVGFETurbulence.cpp b/WebCore/svg/graphics/filters/SVGFETurbulence.cpp
index 399f7fc..8e9a6f7 100644
--- a/WebCore/svg/graphics/filters/SVGFETurbulence.cpp
+++ b/WebCore/svg/graphics/filters/SVGFETurbulence.cpp
@@ -29,7 +29,6 @@
#include "CanvasPixelArray.h"
#include "Filter.h"
#include "ImageData.h"
-#include "SVGRenderTreeAsText.h"
#include <wtf/MathExtras.h>
@@ -322,7 +321,7 @@ unsigned char FETurbulence::calculateTurbulenceValueForPoint(PaintingData& paint
void FETurbulence::apply(Filter* filter)
{
- if (!getEffectContext())
+ if (!effectContext())
return;
IntRect imageRect(IntPoint(), resultImage()->size());
diff --git a/WebCore/svg/graphics/filters/SVGFETurbulence.h b/WebCore/svg/graphics/filters/SVGFETurbulence.h
index d27b7f6..68719ad 100644
--- a/WebCore/svg/graphics/filters/SVGFETurbulence.h
+++ b/WebCore/svg/graphics/filters/SVGFETurbulence.h
@@ -58,9 +58,10 @@ public:
bool stitchTiles() const;
void setStitchTiles(bool);
- void apply(Filter*);
- void dump();
- TextStream& externalRepresentation(TextStream&, int indent) const;
+ virtual void apply(Filter*);
+ virtual void dump();
+
+ virtual TextStream& externalRepresentation(TextStream&, int indention) const;
private:
static const int s_blockSize = 256;
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list