[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:38:26 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit a64eca01be45a39acb6972d8b766da32b3d779a0
Author: krit at webkit.org <krit at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Wed Sep 22 07:42:12 2010 +0000
2010-09-22 Dirk Schulze <krit at webkit.org>
Reviewed by Nikolas Zimmermann.
Make FilterEffects independent of SVG
https://bugs.webkit.org/show_bug.cgi?id=46177
Moving all FilterEffects from svg/graphics/filters to platform/graphics/filters, now that they
are independent of SVG. Removed the SVG prefix of the files and updated the headers.
* Android.mk:
* CMakeLists.txt:
* GNUmakefile.am:
* WebCore.gypi:
* WebCore.pro:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/filters/DistantLightSource.h: Copied from WebCore/svg/graphics/filters/SVGDistantLightSource.h.
* platform/graphics/filters/FEConvolveMatrix.cpp: Copied from WebCore/svg/graphics/filters/SVGFEConvolveMatrix.cpp.
* platform/graphics/filters/FEConvolveMatrix.h: Copied from WebCore/svg/graphics/filters/SVGFEConvolveMatrix.h.
* platform/graphics/filters/FEDiffuseLighting.cpp: Copied from WebCore/svg/graphics/filters/SVGFEDiffuseLighting.cpp.
* platform/graphics/filters/FEDiffuseLighting.h: Copied from WebCore/svg/graphics/filters/SVGFEDiffuseLighting.h.
* platform/graphics/filters/FEDisplacementMap.cpp: Copied from WebCore/svg/graphics/filters/SVGFEDisplacementMap.cpp.
* platform/graphics/filters/FEDisplacementMap.h: Copied from WebCore/svg/graphics/filters/SVGFEDisplacementMap.h.
* platform/graphics/filters/FEFlood.cpp: Copied from WebCore/svg/graphics/filters/SVGFEFlood.cpp.
* platform/graphics/filters/FEFlood.h: Copied from WebCore/svg/graphics/filters/SVGFEFlood.h.
* platform/graphics/filters/FELighting.cpp: Copied from WebCore/svg/graphics/filters/SVGFELighting.cpp.
* platform/graphics/filters/FELighting.h: Copied from WebCore/svg/graphics/filters/SVGFELighting.h.
* platform/graphics/filters/FEMerge.cpp: Copied from WebCore/svg/graphics/filters/SVGFEMerge.cpp.
* platform/graphics/filters/FEMerge.h: Copied from WebCore/svg/graphics/filters/SVGFEMerge.h.
* platform/graphics/filters/FEMorphology.cpp: Copied from WebCore/svg/graphics/filters/SVGFEMorphology.cpp.
* platform/graphics/filters/FEMorphology.h: Copied from WebCore/svg/graphics/filters/SVGFEMorphology.h.
* platform/graphics/filters/FEOffset.cpp: Copied from WebCore/svg/graphics/filters/SVGFEOffset.cpp.
* platform/graphics/filters/FEOffset.h: Copied from WebCore/svg/graphics/filters/SVGFEOffset.h.
* platform/graphics/filters/FESpecularLighting.cpp: Copied from WebCore/svg/graphics/filters/SVGFESpecularLighting.cpp.
* platform/graphics/filters/FESpecularLighting.h: Copied from WebCore/svg/graphics/filters/SVGFESpecularLighting.h.
* platform/graphics/filters/FETile.cpp: Copied from WebCore/svg/graphics/filters/SVGFETile.cpp.
* platform/graphics/filters/FETile.h: Copied from WebCore/svg/graphics/filters/SVGFETile.h.
* platform/graphics/filters/FETurbulence.cpp: Copied from WebCore/svg/graphics/filters/SVGFETurbulence.cpp.
* platform/graphics/filters/FETurbulence.h: Copied from WebCore/svg/graphics/filters/SVGFETurbulence.h.
* platform/graphics/filters/LightSource.cpp: Copied from WebCore/svg/graphics/filters/SVGLightSource.cpp.
* platform/graphics/filters/LightSource.h: Copied from WebCore/svg/graphics/filters/SVGLightSource.h.
* platform/graphics/filters/PointLightSource.h: Copied from WebCore/svg/graphics/filters/SVGPointLightSource.h.
* platform/graphics/filters/SpotLightSource.h: Copied from WebCore/svg/graphics/filters/SVGSpotLightSource.h.
* svg/SVGFEConvolveMatrixElement.h:
* svg/SVGFEDiffuseLightingElement.cpp:
* svg/SVGFEDisplacementMapElement.h:
* svg/SVGFEDistantLightElement.cpp:
* svg/SVGFEFloodElement.h:
* svg/SVGFELightElement.h:
* svg/SVGFEMergeElement.h:
* svg/SVGFEMorphologyElement.h:
* svg/SVGFEOffsetElement.h:
* svg/SVGFEPointLightElement.cpp:
* svg/SVGFESpecularLightingElement.h:
* svg/SVGFESpotLightElement.cpp:
* svg/SVGFETileElement.h:
* svg/SVGFETurbulenceElement.h:
* svg/graphics/filters/SVGDistantLightSource.h: Removed.
* svg/graphics/filters/SVGFEConvolveMatrix.cpp: Removed.
* svg/graphics/filters/SVGFEConvolveMatrix.h: Removed.
* svg/graphics/filters/SVGFEDiffuseLighting.cpp: Removed.
* svg/graphics/filters/SVGFEDiffuseLighting.h: Removed.
* svg/graphics/filters/SVGFEDisplacementMap.cpp: Removed.
* svg/graphics/filters/SVGFEDisplacementMap.h: Removed.
* svg/graphics/filters/SVGFEFlood.cpp: Removed.
* svg/graphics/filters/SVGFEFlood.h: Removed.
* svg/graphics/filters/SVGFELighting.cpp: Removed.
* svg/graphics/filters/SVGFELighting.h: Removed.
* svg/graphics/filters/SVGFEMerge.cpp: Removed.
* svg/graphics/filters/SVGFEMerge.h: Removed.
* svg/graphics/filters/SVGFEMorphology.cpp: Removed.
* svg/graphics/filters/SVGFEMorphology.h: Removed.
* svg/graphics/filters/SVGFEOffset.cpp: Removed.
* svg/graphics/filters/SVGFEOffset.h: Removed.
* svg/graphics/filters/SVGFESpecularLighting.cpp: Removed.
* svg/graphics/filters/SVGFESpecularLighting.h: Removed.
* svg/graphics/filters/SVGFETile.cpp: Removed.
* svg/graphics/filters/SVGFETile.h: Removed.
* svg/graphics/filters/SVGFETurbulence.cpp: Removed.
* svg/graphics/filters/SVGFETurbulence.h: Removed.
* svg/graphics/filters/SVGLightSource.cpp: Removed.
* svg/graphics/filters/SVGLightSource.h: Removed.
* svg/graphics/filters/SVGPointLightSource.h: Removed.
* svg/graphics/filters/SVGSpotLightSource.h: Removed.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@68022 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/Android.mk b/WebCore/Android.mk
index 0d60ab6..cb311e9 100644
--- a/WebCore/Android.mk
+++ b/WebCore/Android.mk
@@ -503,7 +503,18 @@ LOCAL_SRC_FILES := $(LOCAL_SRC_FILES) \
platform/graphics/filters/FEBlend.cpp \
platform/graphics/filters/FEColorMatrix.cpp \
platform/graphics/filters/FEComponentTransfer.cpp \
- platform/graphics/filters/FEComposite.cpp
+ platform/graphics/filters/FEComposite.cpp \
+ platform/graphics/filters/FEConvolveMatrix.cpp \
+ platform/graphics/filters/FEDiffuseLighting.cpp \
+ platform/graphics/filters/FEDisplacementMap.cpp \
+ platform/graphics/filters/FEFlood.cpp \
+ platform/graphics/filters/FEMerge.cpp \
+ platform/graphics/filters/FEMorphology.cpp \
+ platform/graphics/filters/FEOffset.cpp \
+ platform/graphics/filters/FESpecularLighting.cpp \
+ platform/graphics/filters/FETile.cpp \
+ platform/graphics/filters/FETurbulence.cpp \
+ platform/graphics/filters/LightSource.cpp
endif
LOCAL_SRC_FILES := $(LOCAL_SRC_FILES) \
@@ -956,20 +967,9 @@ LOCAL_SRC_FILES := $(LOCAL_SRC_FILES) \
\
svg/graphics/SVGImage.cpp \
\
- svg/graphics/filters/SVGFEConvolveMatrix.cpp \
- svg/graphics/filters/SVGFEDiffuseLighting.cpp \
- svg/graphics/filters/SVGFEDisplacementMap.cpp \
- svg/graphics/filters/SVGFEFlood.cpp \
svg/graphics/filters/SVGFEImage.cpp \
- svg/graphics/filters/SVGFEMerge.cpp \
- svg/graphics/filters/SVGFEMorphology.cpp \
- svg/graphics/filters/SVGFEOffset.cpp \
- svg/graphics/filters/SVGFESpecularLighting.cpp \
- svg/graphics/filters/SVGFETile.cpp \
- svg/graphics/filters/SVGFETurbulence.cpp \
svg/graphics/filters/SVGFilter.cpp \
- svg/graphics/filters/SVGFilterBuilder.cpp \
- svg/graphics/filters/SVGLightSource.cpp
+ svg/graphics/filters/SVGFilterBuilder.cpp
endif
LOCAL_SRC_FILES := $(LOCAL_SRC_FILES) \
diff --git a/WebCore/CMakeLists.txt b/WebCore/CMakeLists.txt
index eeb88b1..faed8ee 100644
--- a/WebCore/CMakeLists.txt
+++ b/WebCore/CMakeLists.txt
@@ -1257,9 +1257,21 @@ SET(WebCore_SOURCES
platform/graphics/filters/FEColorMatrix.cpp
platform/graphics/filters/FEComponentTransfer.cpp
platform/graphics/filters/FEComposite.cpp
+ platform/graphics/filters/FEConvolveMatrix.cpp
+ platform/graphics/filters/FEDiffuseLighting.cpp
+ platform/graphics/filters/FEDisplacementMap.cpp
+ platform/graphics/filters/FEFlood.cpp
platform/graphics/filters/FEGaussianBlur.cpp
+ platform/graphics/filters/FELighting.cpp
+ platform/graphics/filters/FEMerge.cpp
+ platform/graphics/filters/FEMorphology.cpp
+ platform/graphics/filters/FEOffset.cpp
+ platform/graphics/filters/FESpecularLighting.cpp
+ platform/graphics/filters/FETile.cpp
+ platform/graphics/filters/FETurbulence.cpp
platform/graphics/filters/FilterEffect.cpp
platform/graphics/filters/ImageBufferFilter.cpp
+ platform/graphics/filters/LightSource.cpp
platform/graphics/filters/SourceAlpha.cpp
platform/graphics/filters/SourceGraphic.cpp
@@ -1812,21 +1824,9 @@ IF (ENABLE_SVG)
svg/animation/SMILTimeContainer.cpp
svg/animation/SVGSMILElement.cpp
svg/graphics/SVGImage.cpp
- svg/graphics/filters/SVGFEConvolveMatrix.cpp
- svg/graphics/filters/SVGFEDiffuseLighting.cpp
- svg/graphics/filters/SVGFEDisplacementMap.cpp
- svg/graphics/filters/SVGFEFlood.cpp
svg/graphics/filters/SVGFEImage.cpp
- svg/graphics/filters/SVGFELighting.cpp
- svg/graphics/filters/SVGFEMerge.cpp
- svg/graphics/filters/SVGFEMorphology.cpp
- svg/graphics/filters/SVGFEOffset.cpp
- svg/graphics/filters/SVGFESpecularLighting.cpp
- svg/graphics/filters/SVGFETile.cpp
- svg/graphics/filters/SVGFETurbulence.cpp
svg/graphics/filters/SVGFilter.cpp
svg/graphics/filters/SVGFilterBuilder.cpp
- svg/graphics/filters/SVGLightSource.cpp
)
ENDIF()
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 45322c4..3f4ab7f 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,89 @@
+2010-09-22 Dirk Schulze <krit at webkit.org>
+
+ Reviewed by Nikolas Zimmermann.
+
+ Make FilterEffects independent of SVG
+ https://bugs.webkit.org/show_bug.cgi?id=46177
+
+ Moving all FilterEffects from svg/graphics/filters to platform/graphics/filters, now that they
+ are independent of SVG. Removed the SVG prefix of the files and updated the headers.
+
+ * Android.mk:
+ * CMakeLists.txt:
+ * GNUmakefile.am:
+ * WebCore.gypi:
+ * WebCore.pro:
+ * WebCore.vcproj/WebCore.vcproj:
+ * WebCore.xcodeproj/project.pbxproj:
+ * platform/graphics/filters/DistantLightSource.h: Copied from WebCore/svg/graphics/filters/SVGDistantLightSource.h.
+ * platform/graphics/filters/FEConvolveMatrix.cpp: Copied from WebCore/svg/graphics/filters/SVGFEConvolveMatrix.cpp.
+ * platform/graphics/filters/FEConvolveMatrix.h: Copied from WebCore/svg/graphics/filters/SVGFEConvolveMatrix.h.
+ * platform/graphics/filters/FEDiffuseLighting.cpp: Copied from WebCore/svg/graphics/filters/SVGFEDiffuseLighting.cpp.
+ * platform/graphics/filters/FEDiffuseLighting.h: Copied from WebCore/svg/graphics/filters/SVGFEDiffuseLighting.h.
+ * platform/graphics/filters/FEDisplacementMap.cpp: Copied from WebCore/svg/graphics/filters/SVGFEDisplacementMap.cpp.
+ * platform/graphics/filters/FEDisplacementMap.h: Copied from WebCore/svg/graphics/filters/SVGFEDisplacementMap.h.
+ * platform/graphics/filters/FEFlood.cpp: Copied from WebCore/svg/graphics/filters/SVGFEFlood.cpp.
+ * platform/graphics/filters/FEFlood.h: Copied from WebCore/svg/graphics/filters/SVGFEFlood.h.
+ * platform/graphics/filters/FELighting.cpp: Copied from WebCore/svg/graphics/filters/SVGFELighting.cpp.
+ * platform/graphics/filters/FELighting.h: Copied from WebCore/svg/graphics/filters/SVGFELighting.h.
+ * platform/graphics/filters/FEMerge.cpp: Copied from WebCore/svg/graphics/filters/SVGFEMerge.cpp.
+ * platform/graphics/filters/FEMerge.h: Copied from WebCore/svg/graphics/filters/SVGFEMerge.h.
+ * platform/graphics/filters/FEMorphology.cpp: Copied from WebCore/svg/graphics/filters/SVGFEMorphology.cpp.
+ * platform/graphics/filters/FEMorphology.h: Copied from WebCore/svg/graphics/filters/SVGFEMorphology.h.
+ * platform/graphics/filters/FEOffset.cpp: Copied from WebCore/svg/graphics/filters/SVGFEOffset.cpp.
+ * platform/graphics/filters/FEOffset.h: Copied from WebCore/svg/graphics/filters/SVGFEOffset.h.
+ * platform/graphics/filters/FESpecularLighting.cpp: Copied from WebCore/svg/graphics/filters/SVGFESpecularLighting.cpp.
+ * platform/graphics/filters/FESpecularLighting.h: Copied from WebCore/svg/graphics/filters/SVGFESpecularLighting.h.
+ * platform/graphics/filters/FETile.cpp: Copied from WebCore/svg/graphics/filters/SVGFETile.cpp.
+ * platform/graphics/filters/FETile.h: Copied from WebCore/svg/graphics/filters/SVGFETile.h.
+ * platform/graphics/filters/FETurbulence.cpp: Copied from WebCore/svg/graphics/filters/SVGFETurbulence.cpp.
+ * platform/graphics/filters/FETurbulence.h: Copied from WebCore/svg/graphics/filters/SVGFETurbulence.h.
+ * platform/graphics/filters/LightSource.cpp: Copied from WebCore/svg/graphics/filters/SVGLightSource.cpp.
+ * platform/graphics/filters/LightSource.h: Copied from WebCore/svg/graphics/filters/SVGLightSource.h.
+ * platform/graphics/filters/PointLightSource.h: Copied from WebCore/svg/graphics/filters/SVGPointLightSource.h.
+ * platform/graphics/filters/SpotLightSource.h: Copied from WebCore/svg/graphics/filters/SVGSpotLightSource.h.
+ * svg/SVGFEConvolveMatrixElement.h:
+ * svg/SVGFEDiffuseLightingElement.cpp:
+ * svg/SVGFEDisplacementMapElement.h:
+ * svg/SVGFEDistantLightElement.cpp:
+ * svg/SVGFEFloodElement.h:
+ * svg/SVGFELightElement.h:
+ * svg/SVGFEMergeElement.h:
+ * svg/SVGFEMorphologyElement.h:
+ * svg/SVGFEOffsetElement.h:
+ * svg/SVGFEPointLightElement.cpp:
+ * svg/SVGFESpecularLightingElement.h:
+ * svg/SVGFESpotLightElement.cpp:
+ * svg/SVGFETileElement.h:
+ * svg/SVGFETurbulenceElement.h:
+ * svg/graphics/filters/SVGDistantLightSource.h: Removed.
+ * svg/graphics/filters/SVGFEConvolveMatrix.cpp: Removed.
+ * svg/graphics/filters/SVGFEConvolveMatrix.h: Removed.
+ * svg/graphics/filters/SVGFEDiffuseLighting.cpp: Removed.
+ * svg/graphics/filters/SVGFEDiffuseLighting.h: Removed.
+ * svg/graphics/filters/SVGFEDisplacementMap.cpp: Removed.
+ * svg/graphics/filters/SVGFEDisplacementMap.h: Removed.
+ * svg/graphics/filters/SVGFEFlood.cpp: Removed.
+ * svg/graphics/filters/SVGFEFlood.h: Removed.
+ * svg/graphics/filters/SVGFELighting.cpp: Removed.
+ * svg/graphics/filters/SVGFELighting.h: Removed.
+ * svg/graphics/filters/SVGFEMerge.cpp: Removed.
+ * svg/graphics/filters/SVGFEMerge.h: Removed.
+ * svg/graphics/filters/SVGFEMorphology.cpp: Removed.
+ * svg/graphics/filters/SVGFEMorphology.h: Removed.
+ * svg/graphics/filters/SVGFEOffset.cpp: Removed.
+ * svg/graphics/filters/SVGFEOffset.h: Removed.
+ * svg/graphics/filters/SVGFESpecularLighting.cpp: Removed.
+ * svg/graphics/filters/SVGFESpecularLighting.h: Removed.
+ * svg/graphics/filters/SVGFETile.cpp: Removed.
+ * svg/graphics/filters/SVGFETile.h: Removed.
+ * svg/graphics/filters/SVGFETurbulence.cpp: Removed.
+ * svg/graphics/filters/SVGFETurbulence.h: Removed.
+ * svg/graphics/filters/SVGLightSource.cpp: Removed.
+ * svg/graphics/filters/SVGLightSource.h: Removed.
+ * svg/graphics/filters/SVGPointLightSource.h: Removed.
+ * svg/graphics/filters/SVGSpotLightSource.h: Removed.
+
2010-09-22 Patrick Gansterer <paroga at webkit.org>
Reviewed by Adam Roben.
diff --git a/WebCore/GNUmakefile.am b/WebCore/GNUmakefile.am
index 28204d0..e7265b6 100644
--- a/WebCore/GNUmakefile.am
+++ b/WebCore/GNUmakefile.am
@@ -2087,6 +2087,7 @@ webcore_sources += \
WebCore/platform/graphics/Color.h \
WebCore/platform/graphics/ColorSpace.h \
WebCore/platform/graphics/DashArray.h \
+ WebCore/platform/graphics/filters/DistantLightSource.h \
WebCore/platform/graphics/filters/FEBlend.cpp \
WebCore/platform/graphics/filters/FEBlend.h \
WebCore/platform/graphics/filters/FEColorMatrix.cpp \
@@ -2095,17 +2096,43 @@ webcore_sources += \
WebCore/platform/graphics/filters/FEComponentTransfer.h \
WebCore/platform/graphics/filters/FEComposite.cpp \
WebCore/platform/graphics/filters/FEComposite.h \
+ WebCore/platform/graphics/filters/FEConvolveMatrix.cpp \
+ WebCore/platform/graphics/filters/FEConvolveMatrix.h \
+ WebCore/platform/graphics/filters/FEDiffuseLighting.cpp \
+ WebCore/platform/graphics/filters/FEDiffuseLighting.h \
+ WebCore/platform/graphics/filters/FEDisplacementMap.cpp \
+ WebCore/platform/graphics/filters/FEDisplacementMap.h \
WebCore/platform/graphics/filters/FEGaussianBlur.cpp \
WebCore/platform/graphics/filters/FEGaussianBlur.h \
+ WebCore/platform/graphics/filters/FEFlood.cpp \
+ WebCore/platform/graphics/filters/FEFlood.h \
+ WebCore/platform/graphics/filters/FELighting.cpp \
+ WebCore/platform/graphics/filters/FELighting.h \
+ WebCore/platform/graphics/filters/FEMerge.cpp \
+ WebCore/platform/graphics/filters/FEMerge.h \
+ WebCore/platform/graphics/filters/FEMorphology.cpp \
+ WebCore/platform/graphics/filters/FEMorphology.h \
+ WebCore/platform/graphics/filters/FEOffset.cpp \
+ WebCore/platform/graphics/filters/FEOffset.h \
+ WebCore/platform/graphics/filters/FESpecularLighting.cpp \
+ WebCore/platform/graphics/filters/FESpecularLighting.h \
+ WebCore/platform/graphics/filters/FETile.cpp \
+ WebCore/platform/graphics/filters/FETile.h \
+ WebCore/platform/graphics/filters/FETurbulence.cpp \
+ WebCore/platform/graphics/filters/FETurbulence.h \
WebCore/platform/graphics/filters/FilterEffect.cpp \
WebCore/platform/graphics/filters/FilterEffect.h \
WebCore/platform/graphics/filters/Filter.h \
WebCore/platform/graphics/filters/ImageBufferFilter.cpp \
WebCore/platform/graphics/filters/ImageBufferFilter.h \
+ WebCore/platform/graphics/filters/LightSource.cpp \
+ WebCore/platform/graphics/filters/LightSource.h \
+ WebCore/platform/graphics/filters/PointLightSource.h \
WebCore/platform/graphics/filters/SourceAlpha.cpp \
WebCore/platform/graphics/filters/SourceAlpha.h \
WebCore/platform/graphics/filters/SourceGraphic.cpp \
WebCore/platform/graphics/filters/SourceGraphic.h \
+ WebCore/platform/graphics/filters/SpotLightSource.h \
WebCore/platform/graphics/FloatPoint3D.cpp \
WebCore/platform/graphics/FloatPoint3D.h \
WebCore/platform/graphics/FloatPoint.cpp \
@@ -2861,39 +2888,12 @@ webcore_sources += \
WebCore/svg/ColorDistance.h \
WebCore/svg/ElementTimeControl.h \
WebCore/svg/GradientAttributes.h \
- WebCore/svg/graphics/filters/SVGDistantLightSource.h \
- WebCore/svg/graphics/filters/SVGFEConvolveMatrix.cpp \
- WebCore/svg/graphics/filters/SVGFEConvolveMatrix.h \
- WebCore/svg/graphics/filters/SVGFEDiffuseLighting.cpp \
- WebCore/svg/graphics/filters/SVGFEDiffuseLighting.h \
- WebCore/svg/graphics/filters/SVGFEDisplacementMap.cpp \
- WebCore/svg/graphics/filters/SVGFEDisplacementMap.h \
- WebCore/svg/graphics/filters/SVGFEFlood.cpp \
- WebCore/svg/graphics/filters/SVGFEFlood.h \
WebCore/svg/graphics/filters/SVGFEImage.cpp \
WebCore/svg/graphics/filters/SVGFEImage.h \
- WebCore/svg/graphics/filters/SVGFELighting.cpp \
- WebCore/svg/graphics/filters/SVGFELighting.h \
- WebCore/svg/graphics/filters/SVGFEMerge.cpp \
- WebCore/svg/graphics/filters/SVGFEMerge.h \
- WebCore/svg/graphics/filters/SVGFEMorphology.cpp \
- WebCore/svg/graphics/filters/SVGFEMorphology.h \
- WebCore/svg/graphics/filters/SVGFEOffset.cpp \
- WebCore/svg/graphics/filters/SVGFEOffset.h \
- WebCore/svg/graphics/filters/SVGFESpecularLighting.cpp \
- WebCore/svg/graphics/filters/SVGFESpecularLighting.h \
- WebCore/svg/graphics/filters/SVGFETile.cpp \
- WebCore/svg/graphics/filters/SVGFETile.h \
- WebCore/svg/graphics/filters/SVGFETurbulence.cpp \
- WebCore/svg/graphics/filters/SVGFETurbulence.h \
WebCore/svg/graphics/filters/SVGFilterBuilder.cpp \
WebCore/svg/graphics/filters/SVGFilterBuilder.h \
WebCore/svg/graphics/filters/SVGFilter.cpp \
WebCore/svg/graphics/filters/SVGFilter.h \
- WebCore/svg/graphics/filters/SVGLightSource.cpp \
- WebCore/svg/graphics/filters/SVGLightSource.h \
- WebCore/svg/graphics/filters/SVGPointLightSource.h \
- WebCore/svg/graphics/filters/SVGSpotLightSource.h \
WebCore/svg/graphics/SVGImage.cpp \
WebCore/svg/graphics/SVGImage.h \
WebCore/svg/LinearGradientAttributes.h \
diff --git a/WebCore/WebCore.gypi b/WebCore/WebCore.gypi
index a7b093b..c8702fc 100644
--- a/WebCore/WebCore.gypi
+++ b/WebCore/WebCore.gypi
@@ -2352,6 +2352,7 @@
'platform/graphics/chromium/WebGLLayerChromium.h',
'platform/graphics/cocoa/FontPlatformData.h',
'platform/graphics/cocoa/FontPlatformDataCocoa.mm',
+ 'platform/graphics/filters/DistantLightSource.h',
'platform/graphics/filters/FEBlend.cpp',
'platform/graphics/filters/FEBlend.h',
'platform/graphics/filters/FEColorMatrix.cpp',
@@ -2360,8 +2361,34 @@
'platform/graphics/filters/FEComponentTransfer.h',
'platform/graphics/filters/FEComposite.cpp',
'platform/graphics/filters/FEComposite.h',
+ 'platform/graphics/filters/FEConvolveMatrix.cpp',
+ 'platform/graphics/filters/FEConvolveMatrix.h',
+ 'platform/graphics/filters/FEDiffuseLighting.cpp',
+ 'platform/graphics/filters/FEDiffuseLighting.h',
+ 'platform/graphics/filters/FEDisplacementMap.cpp',
+ 'platform/graphics/filters/FEDisplacementMap.h',
+ 'platform/graphics/filters/FEFlood.cpp',
+ 'platform/graphics/filters/FEFlood.h',
'platform/graphics/filters/FEGaussianBlur.cpp',
'platform/graphics/filters/FEGaussianBlur.h',
+ 'platform/graphics/filters/FELighting.cpp',
+ 'platform/graphics/filters/FELighting.h',
+ 'platform/graphics/filters/FEMerge.cpp',
+ 'platform/graphics/filters/FEMerge.h',
+ 'platform/graphics/filters/FEMorphology.cpp',
+ 'platform/graphics/filters/FEMorphology.h',
+ 'platform/graphics/filters/FEOffset.cpp',
+ 'platform/graphics/filters/FEOffset.h',
+ 'platform/graphics/filters/FESpecularLighting.cpp',
+ 'platform/graphics/filters/FESpecularLighting.h',
+ 'platform/graphics/filters/FETile.cpp',
+ 'platform/graphics/filters/FETile.h',
+ 'platform/graphics/filters/FETurbulence.cpp',
+ 'platform/graphics/filters/FETurbulence.h',
+ 'platform/graphics/filters/LightSource.cpp',
+ 'platform/graphics/filters/LightSource.h',
+ 'platform/graphics/filters/PointLightSource.h',
+ 'platform/graphics/filters/SpotLightSource.h',
'platform/graphics/filters/Filter.h',
'platform/graphics/filters/FilterEffect.cpp',
'platform/graphics/filters/FilterEffect.h',
@@ -3771,39 +3798,12 @@
'svg/animation/SMILTimeContainer.h',
'svg/animation/SVGSMILElement.cpp',
'svg/animation/SVGSMILElement.h',
- 'svg/graphics/filters/SVGDistantLightSource.h',
- 'svg/graphics/filters/SVGFEConvolveMatrix.cpp',
- 'svg/graphics/filters/SVGFEConvolveMatrix.h',
- 'svg/graphics/filters/SVGFEDiffuseLighting.cpp',
- 'svg/graphics/filters/SVGFEDiffuseLighting.h',
- 'svg/graphics/filters/SVGFEDisplacementMap.cpp',
- 'svg/graphics/filters/SVGFEDisplacementMap.h',
- 'svg/graphics/filters/SVGFEFlood.cpp',
- 'svg/graphics/filters/SVGFEFlood.h',
'svg/graphics/filters/SVGFEImage.cpp',
'svg/graphics/filters/SVGFEImage.h',
- 'svg/graphics/filters/SVGFELighting.cpp',
- 'svg/graphics/filters/SVGFELighting.h',
- 'svg/graphics/filters/SVGFEMerge.cpp',
- 'svg/graphics/filters/SVGFEMerge.h',
- 'svg/graphics/filters/SVGFEMorphology.cpp',
- 'svg/graphics/filters/SVGFEMorphology.h',
- 'svg/graphics/filters/SVGFEOffset.cpp',
- 'svg/graphics/filters/SVGFEOffset.h',
- 'svg/graphics/filters/SVGFESpecularLighting.cpp',
- 'svg/graphics/filters/SVGFESpecularLighting.h',
- 'svg/graphics/filters/SVGFETile.cpp',
- 'svg/graphics/filters/SVGFETile.h',
- 'svg/graphics/filters/SVGFETurbulence.cpp',
- 'svg/graphics/filters/SVGFETurbulence.h',
'svg/graphics/filters/SVGFilter.cpp',
'svg/graphics/filters/SVGFilter.h',
'svg/graphics/filters/SVGFilterBuilder.cpp',
'svg/graphics/filters/SVGFilterBuilder.h',
- 'svg/graphics/filters/SVGLightSource.cpp',
- 'svg/graphics/filters/SVGLightSource.h',
- 'svg/graphics/filters/SVGPointLightSource.h',
- 'svg/graphics/filters/SVGSpotLightSource.h',
'svg/graphics/SVGImage.cpp',
'svg/graphics/SVGImage.h',
'svg/ColorDistance.cpp',
diff --git a/WebCore/WebCore.pro b/WebCore/WebCore.pro
index 9a9a3e5..848556b 100644
--- a/WebCore/WebCore.pro
+++ b/WebCore/WebCore.pro
@@ -1981,8 +1981,20 @@ HEADERS += \
platform/graphics/filters/FEColorMatrix.h \
platform/graphics/filters/FEComponentTransfer.h \
platform/graphics/filters/FEComposite.h \
+ platform/graphics/filters/FEConvolveMatrix.h \
+ platform/graphics/filters/FEDiffuseLighting.h \
+ platform/graphics/filters/FEDisplacementMap.h \
+ platform/graphics/filters/FEFlood.h \
platform/graphics/filters/FEGaussianBlur.h \
+ platform/graphics/filters/FELighting.h \
+ platform/graphics/filters/FEMerge.h \
+ platform/graphics/filters/FEMorphology.h \
+ platform/graphics/filters/FEOffset.h \
+ platform/graphics/filters/FESpecularLighting.h \
+ platform/graphics/filters/FETile.h \
+ platform/graphics/filters/FETurbulence.h \
platform/graphics/filters/FilterEffect.h \
+ platform/graphics/filters/LightSource.h \
platform/graphics/filters/SourceAlpha.h \
platform/graphics/filters/SourceGraphic.h \
platform/graphics/FloatPoint3D.h \
@@ -2274,21 +2286,9 @@ HEADERS += \
svg/animation/SMILTime.h \
svg/animation/SVGSMILElement.h \
svg/ColorDistance.h \
- svg/graphics/filters/SVGFEConvolveMatrix.h \
- svg/graphics/filters/SVGFEDiffuseLighting.h \
- svg/graphics/filters/SVGFEDisplacementMap.h \
- svg/graphics/filters/SVGFEFlood.h \
svg/graphics/filters/SVGFEImage.h \
- svg/graphics/filters/SVGFELighting.h \
- svg/graphics/filters/SVGFEMerge.h \
- svg/graphics/filters/SVGFEMorphology.h \
- svg/graphics/filters/SVGFEOffset.h \
- svg/graphics/filters/SVGFESpecularLighting.h \
- svg/graphics/filters/SVGFETile.h \
- svg/graphics/filters/SVGFETurbulence.h \
svg/graphics/filters/SVGFilterBuilder.h \
svg/graphics/filters/SVGFilter.h \
- svg/graphics/filters/SVGLightSource.h \
svg/graphics/SVGImage.h \
svg/SVGAElement.h \
svg/SVGAltGlyphElement.h \
@@ -3106,8 +3106,20 @@ contains(DEFINES, ENABLE_FILTERS=1) {
platform/graphics/filters/FEColorMatrix.cpp \
platform/graphics/filters/FEComponentTransfer.cpp \
platform/graphics/filters/FEComposite.cpp \
+ platform/graphics/filters/FEConvolveMatrix.cpp \
+ platform/graphics/filters/FEDiffuseLighting.cpp \
+ platform/graphics/filters/FEDisplacementMap.cpp \
+ platform/graphics/filters/FEFlood.cpp \
platform/graphics/filters/FEGaussianBlur.cpp \
+ platform/graphics/filters/FELighting.cpp \
+ platform/graphics/filters/FEMerge.cpp \
+ platform/graphics/filters/FEMorphology.cpp \
+ platform/graphics/filters/FEOffset.cpp \
+ platform/graphics/filters/FESpecularLighting.cpp \
+ platform/graphics/filters/FETile.cpp \
+ platform/graphics/filters/FETurbulence.cpp \
platform/graphics/filters/FilterEffect.cpp \
+ platform/graphics/filters/LightSource.cpp \
platform/graphics/filters/SourceAlpha.cpp \
platform/graphics/filters/SourceGraphic.cpp
}
@@ -3376,21 +3388,9 @@ contains(DEFINES, ENABLE_SVG=1) {
svg/animation/SMILTime.cpp \
svg/animation/SMILTimeContainer.cpp \
svg/animation/SVGSMILElement.cpp \
- svg/graphics/filters/SVGFEConvolveMatrix.cpp \
- svg/graphics/filters/SVGFEDiffuseLighting.cpp \
- svg/graphics/filters/SVGFEDisplacementMap.cpp \
- svg/graphics/filters/SVGFEFlood.cpp \
svg/graphics/filters/SVGFEImage.cpp \
- svg/graphics/filters/SVGFELighting.cpp \
- svg/graphics/filters/SVGFEMerge.cpp \
- svg/graphics/filters/SVGFEMorphology.cpp \
- svg/graphics/filters/SVGFEOffset.cpp \
- svg/graphics/filters/SVGFESpecularLighting.cpp \
- svg/graphics/filters/SVGFETile.cpp \
- svg/graphics/filters/SVGFETurbulence.cpp \
svg/graphics/filters/SVGFilter.cpp \
svg/graphics/filters/SVGFilterBuilder.cpp \
- svg/graphics/filters/SVGLightSource.cpp \
svg/graphics/SVGImage.cpp \
rendering/RenderForeignObject.cpp \
rendering/RenderPath.cpp \
diff --git a/WebCore/WebCore.vcproj/WebCore.vcproj b/WebCore/WebCore.vcproj/WebCore.vcproj
index 0421605..f86fdd9 100644
--- a/WebCore/WebCore.vcproj/WebCore.vcproj
+++ b/WebCore/WebCore.vcproj/WebCore.vcproj
@@ -26947,6 +26947,98 @@
>
</File>
<File
+ RelativePath="..\platform\graphics\filters\DistantLightSource.h"
+ >
+ </File>
+ <File
+ RelativePath="..\platform\graphics\filters\FEConvolveMatrix.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\platform\graphics\filters\FEConvolveMatrix.h"
+ >
+ </File>
+ <File
+ RelativePath="..\platform\graphics\filters\FEDiffuseLighting.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\platform\graphics\filters\FEDiffuseLighting.h"
+ >
+ </File>
+ <File
+ RelativePath="..\platform\graphics\filters\FEDisplacementMap.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\platform\graphics\filters\FEDisplacementMap.h"
+ >
+ </File>
+ <File
+ RelativePath="..\platform\graphics\filters\FEFlood.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\platform\graphics\filters\FEFlood.h"
+ >
+ </File>
+ <File
+ RelativePath="..\platform\graphics\filters\FELighting.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\platform\graphics\filters\FELighting.h"
+ >
+ </File>
+ <File
+ RelativePath="..\platform\graphics\filters\FEMerge.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\platform\graphics\filters\FEMerge.h"
+ >
+ </File>
+ <File
+ RelativePath="..\platform\graphics\filters\FEMorphology.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\platform\graphics\filters\FEMorphology.h"
+ >
+ </File>
+ <File
+ RelativePath="..\platform\graphics\filters\FEOffset.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\platform\graphics\filters\FEOffset.h"
+ >
+ </File>
+ <File
+ RelativePath="..\platform\graphics\filters\FESpecularLighting.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\platform\graphics\filters\FESpecularLighting.h"
+ >
+ </File>
+ <File
+ RelativePath="..\platform\graphics\filters\FETile.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\platform\graphics\filters\FETile.h"
+ >
+ </File>
+ <File
+ RelativePath="..\platform\graphics\filters\FETurbulence.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\platform\graphics\filters\FETurbulence.h"
+ >
+ </File>
+ <File
RelativePath="..\platform\graphics\filters\Filter.h"
>
</File>
@@ -26967,6 +27059,18 @@
>
</File>
<File
+ RelativePath="..\platform\graphics\filters\LightSource.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\platform\graphics\filters\LightSource.h"
+ >
+ </File>
+ <File
+ RelativePath="..\platform\graphics\filters\PointLightSource.h"
+ >
+ </File>
+ <File
RelativePath="..\platform\graphics\filters\SourceAlpha.cpp"
>
</File>
@@ -26982,6 +27086,10 @@
RelativePath="..\platform\graphics\filters\SourceGraphic.h"
>
</File>
+ <File
+ RelativePath="..\platform\graphics\filters\SpotLightSource.h"
+ >
+ </File>
</Filter>
</Filter>
<Filter
@@ -51143,42 +51251,6 @@
Name="filters"
>
<File
- RelativePath="..\svg\graphics\filters\SVGDistantLightSource.h"
- >
- </File>
- <File
- RelativePath="..\svg\graphics\filters\SVGFEConvolveMatrix.cpp"
- >
- </File>
- <File
- RelativePath="..\svg\graphics\filters\SVGFEConvolveMatrix.h"
- >
- </File>
- <File
- RelativePath="..\svg\graphics\filters\SVGFEDiffuseLighting.cpp"
- >
- </File>
- <File
- RelativePath="..\svg\graphics\filters\SVGFEDiffuseLighting.h"
- >
- </File>
- <File
- RelativePath="..\svg\graphics\filters\SVGFEDisplacementMap.cpp"
- >
- </File>
- <File
- RelativePath="..\svg\graphics\filters\SVGFEDisplacementMap.h"
- >
- </File>
- <File
- RelativePath="..\svg\graphics\filters\SVGFEFlood.cpp"
- >
- </File>
- <File
- RelativePath="..\svg\graphics\filters\SVGFEFlood.h"
- >
- </File>
- <File
RelativePath="..\svg\graphics\filters\SVGFEImage.cpp"
>
</File>
@@ -51187,62 +51259,6 @@
>
</File>
<File
- RelativePath="..\svg\graphics\filters\SVGFELighting.cpp"
- >
- </File>
- <File
- RelativePath="..\svg\graphics\filters\SVGFELighting.h"
- >
- </File>
- <File
- RelativePath="..\svg\graphics\filters\SVGFEMerge.cpp"
- >
- </File>
- <File
- RelativePath="..\svg\graphics\filters\SVGFEMerge.h"
- >
- </File>
- <File
- RelativePath="..\svg\graphics\filters\SVGFEMorphology.cpp"
- >
- </File>
- <File
- RelativePath="..\svg\graphics\filters\SVGFEMorphology.h"
- >
- </File>
- <File
- RelativePath="..\svg\graphics\filters\SVGFEOffset.cpp"
- >
- </File>
- <File
- RelativePath="..\svg\graphics\filters\SVGFEOffset.h"
- >
- </File>
- <File
- RelativePath="..\svg\graphics\filters\SVGFESpecularLighting.cpp"
- >
- </File>
- <File
- RelativePath="..\svg\graphics\filters\SVGFESpecularLighting.h"
- >
- </File>
- <File
- RelativePath="..\svg\graphics\filters\SVGFETile.cpp"
- >
- </File>
- <File
- RelativePath="..\svg\graphics\filters\SVGFETile.h"
- >
- </File>
- <File
- RelativePath="..\svg\graphics\filters\SVGFETurbulence.cpp"
- >
- </File>
- <File
- RelativePath="..\svg\graphics\filters\SVGFETurbulence.h"
- >
- </File>
- <File
RelativePath="..\svg\graphics\filters\SVGFilter.cpp"
>
</File>
@@ -51258,22 +51274,6 @@
RelativePath="..\svg\graphics\filters\SVGFilterBuilder.h"
>
</File>
- <File
- RelativePath="..\svg\graphics\filters\SVGLightSource.cpp"
- >
- </File>
- <File
- RelativePath="..\svg\graphics\filters\SVGLightSource.h"
- >
- </File>
- <File
- RelativePath="..\svg\graphics\filters\SVGPointLightSource.h"
- >
- </File>
- <File
- RelativePath="..\svg\graphics\filters\SVGSpotLightSource.h"
- >
- </File>
</Filter>
</Filter>
</Filter>
diff --git a/WebCore/WebCore.xcodeproj/project.pbxproj b/WebCore/WebCore.xcodeproj/project.pbxproj
index 735e9d5..adbb434 100644
--- a/WebCore/WebCore.xcodeproj/project.pbxproj
+++ b/WebCore/WebCore.xcodeproj/project.pbxproj
@@ -1479,6 +1479,33 @@
845E72F80FD261EE00A87D79 /* Filter.h in Headers */ = {isa = PBXBuildFile; fileRef = 845E72F70FD261EE00A87D79 /* Filter.h */; };
845E72FB0FD2623900A87D79 /* SVGFilter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 845E72F90FD2623900A87D79 /* SVGFilter.cpp */; };
845E72FC0FD2623900A87D79 /* SVGFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = 845E72FA0FD2623900A87D79 /* SVGFilter.h */; };
+ 84730D771248F0B300D3A9C9 /* DistantLightSource.h in Headers */ = {isa = PBXBuildFile; fileRef = 84730D5A1248F0B300D3A9C9 /* DistantLightSource.h */; };
+ 84730D781248F0B300D3A9C9 /* FEConvolveMatrix.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84730D5B1248F0B300D3A9C9 /* FEConvolveMatrix.cpp */; };
+ 84730D791248F0B300D3A9C9 /* FEConvolveMatrix.h in Headers */ = {isa = PBXBuildFile; fileRef = 84730D5C1248F0B300D3A9C9 /* FEConvolveMatrix.h */; };
+ 84730D7A1248F0B300D3A9C9 /* FEDiffuseLighting.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84730D5D1248F0B300D3A9C9 /* FEDiffuseLighting.cpp */; };
+ 84730D7B1248F0B300D3A9C9 /* FEDiffuseLighting.h in Headers */ = {isa = PBXBuildFile; fileRef = 84730D5E1248F0B300D3A9C9 /* FEDiffuseLighting.h */; };
+ 84730D7C1248F0B300D3A9C9 /* FEDisplacementMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84730D5F1248F0B300D3A9C9 /* FEDisplacementMap.cpp */; };
+ 84730D7D1248F0B300D3A9C9 /* FEDisplacementMap.h in Headers */ = {isa = PBXBuildFile; fileRef = 84730D601248F0B300D3A9C9 /* FEDisplacementMap.h */; };
+ 84730D7E1248F0B300D3A9C9 /* FEFlood.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84730D611248F0B300D3A9C9 /* FEFlood.cpp */; };
+ 84730D7F1248F0B300D3A9C9 /* FEFlood.h in Headers */ = {isa = PBXBuildFile; fileRef = 84730D621248F0B300D3A9C9 /* FEFlood.h */; };
+ 84730D801248F0B300D3A9C9 /* FELighting.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84730D631248F0B300D3A9C9 /* FELighting.cpp */; };
+ 84730D811248F0B300D3A9C9 /* FELighting.h in Headers */ = {isa = PBXBuildFile; fileRef = 84730D641248F0B300D3A9C9 /* FELighting.h */; };
+ 84730D821248F0B300D3A9C9 /* FEMerge.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84730D651248F0B300D3A9C9 /* FEMerge.cpp */; };
+ 84730D831248F0B300D3A9C9 /* FEMerge.h in Headers */ = {isa = PBXBuildFile; fileRef = 84730D661248F0B300D3A9C9 /* FEMerge.h */; };
+ 84730D841248F0B300D3A9C9 /* FEMorphology.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84730D671248F0B300D3A9C9 /* FEMorphology.cpp */; };
+ 84730D851248F0B300D3A9C9 /* FEMorphology.h in Headers */ = {isa = PBXBuildFile; fileRef = 84730D681248F0B300D3A9C9 /* FEMorphology.h */; };
+ 84730D861248F0B300D3A9C9 /* FEOffset.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84730D691248F0B300D3A9C9 /* FEOffset.cpp */; };
+ 84730D871248F0B300D3A9C9 /* FEOffset.h in Headers */ = {isa = PBXBuildFile; fileRef = 84730D6A1248F0B300D3A9C9 /* FEOffset.h */; };
+ 84730D881248F0B300D3A9C9 /* FESpecularLighting.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84730D6B1248F0B300D3A9C9 /* FESpecularLighting.cpp */; };
+ 84730D891248F0B300D3A9C9 /* FESpecularLighting.h in Headers */ = {isa = PBXBuildFile; fileRef = 84730D6C1248F0B300D3A9C9 /* FESpecularLighting.h */; };
+ 84730D8A1248F0B300D3A9C9 /* FETile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84730D6D1248F0B300D3A9C9 /* FETile.cpp */; };
+ 84730D8B1248F0B300D3A9C9 /* FETile.h in Headers */ = {isa = PBXBuildFile; fileRef = 84730D6E1248F0B300D3A9C9 /* FETile.h */; };
+ 84730D8C1248F0B300D3A9C9 /* FETurbulence.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84730D6F1248F0B300D3A9C9 /* FETurbulence.cpp */; };
+ 84730D8D1248F0B300D3A9C9 /* FETurbulence.h in Headers */ = {isa = PBXBuildFile; fileRef = 84730D701248F0B300D3A9C9 /* FETurbulence.h */; };
+ 84730D901248F0B300D3A9C9 /* LightSource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84730D731248F0B300D3A9C9 /* LightSource.cpp */; };
+ 84730D911248F0B300D3A9C9 /* LightSource.h in Headers */ = {isa = PBXBuildFile; fileRef = 84730D741248F0B300D3A9C9 /* LightSource.h */; };
+ 84730D921248F0B300D3A9C9 /* PointLightSource.h in Headers */ = {isa = PBXBuildFile; fileRef = 84730D751248F0B300D3A9C9 /* PointLightSource.h */; };
+ 84730D931248F0B300D3A9C9 /* SpotLightSource.h in Headers */ = {isa = PBXBuildFile; fileRef = 84730D761248F0B300D3A9C9 /* SpotLightSource.h */; };
8476C9E511DF6A0B00555B02 /* SVGPathSegListBuilder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8476C9E311DF6A0B00555B02 /* SVGPathSegListBuilder.cpp */; };
8476C9E611DF6A0B00555B02 /* SVGPathSegListBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = 8476C9E411DF6A0B00555B02 /* SVGPathSegListBuilder.h */; };
8476C9EA11DF6A2900555B02 /* SVGPathBuilder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8476C9E711DF6A2900555B02 /* SVGPathBuilder.cpp */; };
@@ -2908,7 +2935,6 @@
A7D20F62107F406900A80392 /* JSWebGLActiveInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7D20F60107F406900A80392 /* JSWebGLActiveInfo.cpp */; };
A7D20F63107F406900A80392 /* JSWebGLActiveInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D20F61107F406900A80392 /* JSWebGLActiveInfo.h */; };
A7D20F6D107F438B00A80392 /* WebGLActiveInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D20F6B107F438B00A80392 /* WebGLActiveInfo.h */; };
- A7D27FC40E0A599F0079AD2B /* SVGFETile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7D27FC30E0A599F0079AD2B /* SVGFETile.cpp */; };
A7D3C5240B576B4B002CA450 /* PasteboardHelper.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D3C5230B576B4B002CA450 /* PasteboardHelper.h */; settings = {ATTRIBUTES = (Private, ); }; };
A7D6B3490F61104500B79FD1 /* WorkerScriptLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D6B3470F61104500B79FD1 /* WorkerScriptLoader.h */; };
A7D6B34A0F61104500B79FD1 /* WorkerScriptLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7D6B3480F61104500B79FD1 /* WorkerScriptLoader.cpp */; };
@@ -4048,32 +4074,8 @@
B237C8A80D344D110013F707 /* SVGFontData.h in Headers */ = {isa = PBXBuildFile; fileRef = B237C8A60D344D110013F707 /* SVGFontData.h */; };
B24055650B5BE640002A28C0 /* DOMSVGElementInstanceInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = B24055630B5BE640002A28C0 /* DOMSVGElementInstanceInternal.h */; };
B24055660B5BE640002A28C0 /* DOMSVGElementInstanceListInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = B24055640B5BE640002A28C0 /* DOMSVGElementInstanceListInternal.h */; };
- B25599710D00D8BA00BB825C /* SVGDistantLightSource.h in Headers */ = {isa = PBXBuildFile; fileRef = B25598D70D00D8B900BB825C /* SVGDistantLightSource.h */; };
- B255997A0D00D8BA00BB825C /* SVGFEConvolveMatrix.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B25598E00D00D8B900BB825C /* SVGFEConvolveMatrix.cpp */; };
- B255997B0D00D8BA00BB825C /* SVGFEConvolveMatrix.h in Headers */ = {isa = PBXBuildFile; fileRef = B25598E10D00D8B900BB825C /* SVGFEConvolveMatrix.h */; };
- B255997C0D00D8BA00BB825C /* SVGFEDiffuseLighting.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B25598E20D00D8B900BB825C /* SVGFEDiffuseLighting.cpp */; };
- B255997D0D00D8BA00BB825C /* SVGFEDiffuseLighting.h in Headers */ = {isa = PBXBuildFile; fileRef = B25598E30D00D8B900BB825C /* SVGFEDiffuseLighting.h */; };
- B255997E0D00D8BA00BB825C /* SVGFEDisplacementMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B25598E40D00D8B900BB825C /* SVGFEDisplacementMap.cpp */; };
- B255997F0D00D8BA00BB825C /* SVGFEDisplacementMap.h in Headers */ = {isa = PBXBuildFile; fileRef = B25598E50D00D8B900BB825C /* SVGFEDisplacementMap.h */; };
- B25599800D00D8BA00BB825C /* SVGFEFlood.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B25598E60D00D8B900BB825C /* SVGFEFlood.cpp */; };
- B25599810D00D8BA00BB825C /* SVGFEFlood.h in Headers */ = {isa = PBXBuildFile; fileRef = B25598E70D00D8B900BB825C /* SVGFEFlood.h */; };
B25599840D00D8BA00BB825C /* SVGFEImage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B25598EA0D00D8B900BB825C /* SVGFEImage.cpp */; };
B25599850D00D8BA00BB825C /* SVGFEImage.h in Headers */ = {isa = PBXBuildFile; fileRef = B25598EB0D00D8B900BB825C /* SVGFEImage.h */; };
- B25599860D00D8BA00BB825C /* SVGFEMerge.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B25598EC0D00D8B900BB825C /* SVGFEMerge.cpp */; };
- B25599870D00D8BA00BB825C /* SVGFEMerge.h in Headers */ = {isa = PBXBuildFile; fileRef = B25598ED0D00D8B900BB825C /* SVGFEMerge.h */; };
- B25599880D00D8BA00BB825C /* SVGFEMorphology.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B25598EE0D00D8B900BB825C /* SVGFEMorphology.cpp */; };
- B25599890D00D8BA00BB825C /* SVGFEMorphology.h in Headers */ = {isa = PBXBuildFile; fileRef = B25598EF0D00D8B900BB825C /* SVGFEMorphology.h */; };
- B255998A0D00D8BA00BB825C /* SVGFEOffset.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B25598F00D00D8B900BB825C /* SVGFEOffset.cpp */; };
- B255998B0D00D8BA00BB825C /* SVGFEOffset.h in Headers */ = {isa = PBXBuildFile; fileRef = B25598F10D00D8B900BB825C /* SVGFEOffset.h */; };
- B255998C0D00D8BA00BB825C /* SVGFESpecularLighting.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B25598F20D00D8B900BB825C /* SVGFESpecularLighting.cpp */; };
- B255998D0D00D8BA00BB825C /* SVGFESpecularLighting.h in Headers */ = {isa = PBXBuildFile; fileRef = B25598F30D00D8B900BB825C /* SVGFESpecularLighting.h */; };
- B255998E0D00D8BA00BB825C /* SVGFETile.h in Headers */ = {isa = PBXBuildFile; fileRef = B25598F40D00D8B900BB825C /* SVGFETile.h */; };
- B255998F0D00D8BA00BB825C /* SVGFETurbulence.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B25598F50D00D8B900BB825C /* SVGFETurbulence.cpp */; };
- B25599900D00D8BA00BB825C /* SVGFETurbulence.h in Headers */ = {isa = PBXBuildFile; fileRef = B25598F60D00D8B900BB825C /* SVGFETurbulence.h */; };
- B25599930D00D8BA00BB825C /* SVGLightSource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B25598F90D00D8B900BB825C /* SVGLightSource.cpp */; };
- B25599940D00D8BA00BB825C /* SVGLightSource.h in Headers */ = {isa = PBXBuildFile; fileRef = B25598FA0D00D8B900BB825C /* SVGLightSource.h */; };
- B25599950D00D8BA00BB825C /* SVGPointLightSource.h in Headers */ = {isa = PBXBuildFile; fileRef = B25598FB0D00D8B900BB825C /* SVGPointLightSource.h */; };
- B25599960D00D8BA00BB825C /* SVGSpotLightSource.h in Headers */ = {isa = PBXBuildFile; fileRef = B25598FC0D00D8B900BB825C /* SVGSpotLightSource.h */; };
B25599A30D00D8BA00BB825C /* SVGImage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B255990B0D00D8B900BB825C /* SVGImage.cpp */; };
B25599A40D00D8BA00BB825C /* SVGImage.h in Headers */ = {isa = PBXBuildFile; fileRef = B255990C0D00D8B900BB825C /* SVGImage.h */; };
B25599A50D00D8BA00BB825C /* EmptyClients.h in Headers */ = {isa = PBXBuildFile; fileRef = B255990D0D00D8B900BB825C /* EmptyClients.h */; };
@@ -5291,8 +5293,6 @@
E1FF57A60F01256B00891EBB /* ThreadGlobalData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1FF57A50F01256B00891EBB /* ThreadGlobalData.cpp */; };
E415F1690D9A165D0033CE97 /* DOMElementTimeControl.h in Headers */ = {isa = PBXBuildFile; fileRef = E415F1680D9A165D0033CE97 /* DOMElementTimeControl.h */; };
E415F1840D9A1A830033CE97 /* ElementTimeControl.h in Headers */ = {isa = PBXBuildFile; fileRef = E415F1830D9A1A830033CE97 /* ElementTimeControl.h */; };
- E440A2D51191A50B000820B0 /* SVGFELighting.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E440A2D41191A50B000820B0 /* SVGFELighting.cpp */; };
- E440A2D71191A523000820B0 /* SVGFELighting.h in Headers */ = {isa = PBXBuildFile; fileRef = E440A2D61191A523000820B0 /* SVGFELighting.h */; };
E44613A10CD6331000FADA75 /* HTMLAudioElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E446138F0CD6331000FADA75 /* HTMLAudioElement.cpp */; };
E44613A20CD6331000FADA75 /* HTMLAudioElement.h in Headers */ = {isa = PBXBuildFile; fileRef = E44613900CD6331000FADA75 /* HTMLAudioElement.h */; };
E44613A40CD6331000FADA75 /* HTMLMediaElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E44613920CD6331000FADA75 /* HTMLMediaElement.cpp */; };
@@ -7442,6 +7442,33 @@
845E72F70FD261EE00A87D79 /* Filter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Filter.h; path = filters/Filter.h; sourceTree = "<group>"; };
845E72F90FD2623900A87D79 /* SVGFilter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGFilter.cpp; sourceTree = "<group>"; };
845E72FA0FD2623900A87D79 /* SVGFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGFilter.h; sourceTree = "<group>"; };
+ 84730D5A1248F0B300D3A9C9 /* DistantLightSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DistantLightSource.h; path = filters/DistantLightSource.h; sourceTree = "<group>"; };
+ 84730D5B1248F0B300D3A9C9 /* FEConvolveMatrix.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FEConvolveMatrix.cpp; path = filters/FEConvolveMatrix.cpp; sourceTree = "<group>"; };
+ 84730D5C1248F0B300D3A9C9 /* FEConvolveMatrix.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FEConvolveMatrix.h; path = filters/FEConvolveMatrix.h; sourceTree = "<group>"; };
+ 84730D5D1248F0B300D3A9C9 /* FEDiffuseLighting.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FEDiffuseLighting.cpp; path = filters/FEDiffuseLighting.cpp; sourceTree = "<group>"; };
+ 84730D5E1248F0B300D3A9C9 /* FEDiffuseLighting.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FEDiffuseLighting.h; path = filters/FEDiffuseLighting.h; sourceTree = "<group>"; };
+ 84730D5F1248F0B300D3A9C9 /* FEDisplacementMap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FEDisplacementMap.cpp; path = filters/FEDisplacementMap.cpp; sourceTree = "<group>"; };
+ 84730D601248F0B300D3A9C9 /* FEDisplacementMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FEDisplacementMap.h; path = filters/FEDisplacementMap.h; sourceTree = "<group>"; };
+ 84730D611248F0B300D3A9C9 /* FEFlood.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FEFlood.cpp; path = filters/FEFlood.cpp; sourceTree = "<group>"; };
+ 84730D621248F0B300D3A9C9 /* FEFlood.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FEFlood.h; path = filters/FEFlood.h; sourceTree = "<group>"; };
+ 84730D631248F0B300D3A9C9 /* FELighting.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FELighting.cpp; path = filters/FELighting.cpp; sourceTree = "<group>"; };
+ 84730D641248F0B300D3A9C9 /* FELighting.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FELighting.h; path = filters/FELighting.h; sourceTree = "<group>"; };
+ 84730D651248F0B300D3A9C9 /* FEMerge.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FEMerge.cpp; path = filters/FEMerge.cpp; sourceTree = "<group>"; };
+ 84730D661248F0B300D3A9C9 /* FEMerge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FEMerge.h; path = filters/FEMerge.h; sourceTree = "<group>"; };
+ 84730D671248F0B300D3A9C9 /* FEMorphology.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FEMorphology.cpp; path = filters/FEMorphology.cpp; sourceTree = "<group>"; };
+ 84730D681248F0B300D3A9C9 /* FEMorphology.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FEMorphology.h; path = filters/FEMorphology.h; sourceTree = "<group>"; };
+ 84730D691248F0B300D3A9C9 /* FEOffset.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FEOffset.cpp; path = filters/FEOffset.cpp; sourceTree = "<group>"; };
+ 84730D6A1248F0B300D3A9C9 /* FEOffset.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FEOffset.h; path = filters/FEOffset.h; sourceTree = "<group>"; };
+ 84730D6B1248F0B300D3A9C9 /* FESpecularLighting.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FESpecularLighting.cpp; path = filters/FESpecularLighting.cpp; sourceTree = "<group>"; };
+ 84730D6C1248F0B300D3A9C9 /* FESpecularLighting.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FESpecularLighting.h; path = filters/FESpecularLighting.h; sourceTree = "<group>"; };
+ 84730D6D1248F0B300D3A9C9 /* FETile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FETile.cpp; path = filters/FETile.cpp; sourceTree = "<group>"; };
+ 84730D6E1248F0B300D3A9C9 /* FETile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FETile.h; path = filters/FETile.h; sourceTree = "<group>"; };
+ 84730D6F1248F0B300D3A9C9 /* FETurbulence.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FETurbulence.cpp; path = filters/FETurbulence.cpp; sourceTree = "<group>"; };
+ 84730D701248F0B300D3A9C9 /* FETurbulence.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FETurbulence.h; path = filters/FETurbulence.h; sourceTree = "<group>"; };
+ 84730D731248F0B300D3A9C9 /* LightSource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LightSource.cpp; path = filters/LightSource.cpp; sourceTree = "<group>"; };
+ 84730D741248F0B300D3A9C9 /* LightSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LightSource.h; path = filters/LightSource.h; sourceTree = "<group>"; };
+ 84730D751248F0B300D3A9C9 /* PointLightSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PointLightSource.h; path = filters/PointLightSource.h; sourceTree = "<group>"; };
+ 84730D761248F0B300D3A9C9 /* SpotLightSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SpotLightSource.h; path = filters/SpotLightSource.h; sourceTree = "<group>"; };
8476C9E311DF6A0B00555B02 /* SVGPathSegListBuilder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGPathSegListBuilder.cpp; sourceTree = "<group>"; };
8476C9E411DF6A0B00555B02 /* SVGPathSegListBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGPathSegListBuilder.h; sourceTree = "<group>"; };
8476C9E711DF6A2900555B02 /* SVGPathBuilder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGPathBuilder.cpp; sourceTree = "<group>"; };
@@ -8817,7 +8844,6 @@
A7D20F60107F406900A80392 /* JSWebGLActiveInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWebGLActiveInfo.cpp; sourceTree = "<group>"; };
A7D20F61107F406900A80392 /* JSWebGLActiveInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWebGLActiveInfo.h; sourceTree = "<group>"; };
A7D20F6B107F438B00A80392 /* WebGLActiveInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebGLActiveInfo.h; path = canvas/WebGLActiveInfo.h; sourceTree = "<group>"; };
- A7D27FC30E0A599F0079AD2B /* SVGFETile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGFETile.cpp; sourceTree = "<group>"; };
A7D3C5230B576B4B002CA450 /* PasteboardHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PasteboardHelper.h; sourceTree = "<group>"; };
A7D6B3470F61104500B79FD1 /* WorkerScriptLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WorkerScriptLoader.h; path = workers/WorkerScriptLoader.h; sourceTree = "<group>"; };
A7D6B3480F61104500B79FD1 /* WorkerScriptLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WorkerScriptLoader.cpp; path = workers/WorkerScriptLoader.cpp; sourceTree = "<group>"; };
@@ -9844,32 +9870,8 @@
B237C8A60D344D110013F707 /* SVGFontData.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SVGFontData.h; sourceTree = "<group>"; };
B24055630B5BE640002A28C0 /* DOMSVGElementInstanceInternal.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DOMSVGElementInstanceInternal.h; sourceTree = "<group>"; };
B24055640B5BE640002A28C0 /* DOMSVGElementInstanceListInternal.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DOMSVGElementInstanceListInternal.h; sourceTree = "<group>"; };
- B25598D70D00D8B900BB825C /* SVGDistantLightSource.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SVGDistantLightSource.h; sourceTree = "<group>"; };
- B25598E00D00D8B900BB825C /* SVGFEConvolveMatrix.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = SVGFEConvolveMatrix.cpp; sourceTree = "<group>"; };
- B25598E10D00D8B900BB825C /* SVGFEConvolveMatrix.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SVGFEConvolveMatrix.h; sourceTree = "<group>"; };
- B25598E20D00D8B900BB825C /* SVGFEDiffuseLighting.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = SVGFEDiffuseLighting.cpp; sourceTree = "<group>"; };
- B25598E30D00D8B900BB825C /* SVGFEDiffuseLighting.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SVGFEDiffuseLighting.h; sourceTree = "<group>"; };
- B25598E40D00D8B900BB825C /* SVGFEDisplacementMap.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = SVGFEDisplacementMap.cpp; sourceTree = "<group>"; };
- B25598E50D00D8B900BB825C /* SVGFEDisplacementMap.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SVGFEDisplacementMap.h; sourceTree = "<group>"; };
- B25598E60D00D8B900BB825C /* SVGFEFlood.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = SVGFEFlood.cpp; sourceTree = "<group>"; };
- B25598E70D00D8B900BB825C /* SVGFEFlood.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SVGFEFlood.h; sourceTree = "<group>"; };
B25598EA0D00D8B900BB825C /* SVGFEImage.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = SVGFEImage.cpp; sourceTree = "<group>"; };
B25598EB0D00D8B900BB825C /* SVGFEImage.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SVGFEImage.h; sourceTree = "<group>"; };
- B25598EC0D00D8B900BB825C /* SVGFEMerge.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = SVGFEMerge.cpp; sourceTree = "<group>"; };
- B25598ED0D00D8B900BB825C /* SVGFEMerge.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SVGFEMerge.h; sourceTree = "<group>"; };
- B25598EE0D00D8B900BB825C /* SVGFEMorphology.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = SVGFEMorphology.cpp; sourceTree = "<group>"; };
- B25598EF0D00D8B900BB825C /* SVGFEMorphology.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SVGFEMorphology.h; sourceTree = "<group>"; };
- B25598F00D00D8B900BB825C /* SVGFEOffset.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = SVGFEOffset.cpp; sourceTree = "<group>"; };
- B25598F10D00D8B900BB825C /* SVGFEOffset.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SVGFEOffset.h; sourceTree = "<group>"; };
- B25598F20D00D8B900BB825C /* SVGFESpecularLighting.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = SVGFESpecularLighting.cpp; sourceTree = "<group>"; };
- B25598F30D00D8B900BB825C /* SVGFESpecularLighting.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SVGFESpecularLighting.h; sourceTree = "<group>"; };
- B25598F40D00D8B900BB825C /* SVGFETile.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SVGFETile.h; sourceTree = "<group>"; };
- B25598F50D00D8B900BB825C /* SVGFETurbulence.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = SVGFETurbulence.cpp; sourceTree = "<group>"; };
- B25598F60D00D8B900BB825C /* SVGFETurbulence.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SVGFETurbulence.h; sourceTree = "<group>"; };
- B25598F90D00D8B900BB825C /* SVGLightSource.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = SVGLightSource.cpp; sourceTree = "<group>"; };
- B25598FA0D00D8B900BB825C /* SVGLightSource.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SVGLightSource.h; sourceTree = "<group>"; };
- B25598FB0D00D8B900BB825C /* SVGPointLightSource.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SVGPointLightSource.h; sourceTree = "<group>"; };
- B25598FC0D00D8B900BB825C /* SVGSpotLightSource.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SVGSpotLightSource.h; sourceTree = "<group>"; };
B255990B0D00D8B900BB825C /* SVGImage.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = SVGImage.cpp; sourceTree = "<group>"; };
B255990C0D00D8B900BB825C /* SVGImage.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SVGImage.h; sourceTree = "<group>"; };
B255990D0D00D8B900BB825C /* EmptyClients.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = EmptyClients.h; sourceTree = "<group>"; };
@@ -11159,8 +11161,6 @@
E415F1830D9A1A830033CE97 /* ElementTimeControl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ElementTimeControl.h; sourceTree = "<group>"; };
E41EA038119836DB00710BC5 /* CSSPropertyNames.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSPropertyNames.cpp; sourceTree = "<group>"; };
E41EA0391198374900710BC5 /* CSSValueKeywords.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSValueKeywords.cpp; sourceTree = "<group>"; };
- E440A2D41191A50B000820B0 /* SVGFELighting.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGFELighting.cpp; sourceTree = "<group>"; };
- E440A2D61191A523000820B0 /* SVGFELighting.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGFELighting.h; sourceTree = "<group>"; };
E446138F0CD6331000FADA75 /* HTMLAudioElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLAudioElement.cpp; sourceTree = "<group>"; };
E44613900CD6331000FADA75 /* HTMLAudioElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTMLAudioElement.h; sourceTree = "<group>"; };
E44613910CD6331000FADA75 /* HTMLAudioElement.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = HTMLAudioElement.idl; sourceTree = "<group>"; };
@@ -14565,6 +14565,33 @@
A75E8B7F0E1DE2B0007F2481 /* filters */ = {
isa = PBXGroup;
children = (
+ 84730D5A1248F0B300D3A9C9 /* DistantLightSource.h */,
+ 84730D5B1248F0B300D3A9C9 /* FEConvolveMatrix.cpp */,
+ 84730D5C1248F0B300D3A9C9 /* FEConvolveMatrix.h */,
+ 84730D5D1248F0B300D3A9C9 /* FEDiffuseLighting.cpp */,
+ 84730D5E1248F0B300D3A9C9 /* FEDiffuseLighting.h */,
+ 84730D5F1248F0B300D3A9C9 /* FEDisplacementMap.cpp */,
+ 84730D601248F0B300D3A9C9 /* FEDisplacementMap.h */,
+ 84730D611248F0B300D3A9C9 /* FEFlood.cpp */,
+ 84730D621248F0B300D3A9C9 /* FEFlood.h */,
+ 84730D631248F0B300D3A9C9 /* FELighting.cpp */,
+ 84730D641248F0B300D3A9C9 /* FELighting.h */,
+ 84730D651248F0B300D3A9C9 /* FEMerge.cpp */,
+ 84730D661248F0B300D3A9C9 /* FEMerge.h */,
+ 84730D671248F0B300D3A9C9 /* FEMorphology.cpp */,
+ 84730D681248F0B300D3A9C9 /* FEMorphology.h */,
+ 84730D691248F0B300D3A9C9 /* FEOffset.cpp */,
+ 84730D6A1248F0B300D3A9C9 /* FEOffset.h */,
+ 84730D6B1248F0B300D3A9C9 /* FESpecularLighting.cpp */,
+ 84730D6C1248F0B300D3A9C9 /* FESpecularLighting.h */,
+ 84730D6D1248F0B300D3A9C9 /* FETile.cpp */,
+ 84730D6E1248F0B300D3A9C9 /* FETile.h */,
+ 84730D6F1248F0B300D3A9C9 /* FETurbulence.cpp */,
+ 84730D701248F0B300D3A9C9 /* FETurbulence.h */,
+ 84730D731248F0B300D3A9C9 /* LightSource.cpp */,
+ 84730D741248F0B300D3A9C9 /* LightSource.h */,
+ 84730D751248F0B300D3A9C9 /* PointLightSource.h */,
+ 84730D761248F0B300D3A9C9 /* SpotLightSource.h */,
A75E8B800E1DE2D6007F2481 /* FEBlend.cpp */,
A75E8B810E1DE2D6007F2481 /* FEBlend.h */,
A75E8B820E1DE2D6007F2481 /* FEColorMatrix.cpp */,
@@ -15857,39 +15884,12 @@
B255989C0D00D8B800BB825C /* filters */ = {
isa = PBXGroup;
children = (
- B25598D70D00D8B900BB825C /* SVGDistantLightSource.h */,
- B25598E00D00D8B900BB825C /* SVGFEConvolveMatrix.cpp */,
- B25598E10D00D8B900BB825C /* SVGFEConvolveMatrix.h */,
- B25598E20D00D8B900BB825C /* SVGFEDiffuseLighting.cpp */,
- B25598E30D00D8B900BB825C /* SVGFEDiffuseLighting.h */,
- B25598E40D00D8B900BB825C /* SVGFEDisplacementMap.cpp */,
- B25598E50D00D8B900BB825C /* SVGFEDisplacementMap.h */,
- B25598E60D00D8B900BB825C /* SVGFEFlood.cpp */,
- B25598E70D00D8B900BB825C /* SVGFEFlood.h */,
B25598EA0D00D8B900BB825C /* SVGFEImage.cpp */,
B25598EB0D00D8B900BB825C /* SVGFEImage.h */,
- E440A2D41191A50B000820B0 /* SVGFELighting.cpp */,
- E440A2D61191A523000820B0 /* SVGFELighting.h */,
- B25598EC0D00D8B900BB825C /* SVGFEMerge.cpp */,
- B25598ED0D00D8B900BB825C /* SVGFEMerge.h */,
- B25598EE0D00D8B900BB825C /* SVGFEMorphology.cpp */,
- B25598EF0D00D8B900BB825C /* SVGFEMorphology.h */,
- B25598F00D00D8B900BB825C /* SVGFEOffset.cpp */,
- B25598F10D00D8B900BB825C /* SVGFEOffset.h */,
- B25598F20D00D8B900BB825C /* SVGFESpecularLighting.cpp */,
- B25598F30D00D8B900BB825C /* SVGFESpecularLighting.h */,
- A7D27FC30E0A599F0079AD2B /* SVGFETile.cpp */,
- B25598F40D00D8B900BB825C /* SVGFETile.h */,
- B25598F50D00D8B900BB825C /* SVGFETurbulence.cpp */,
- B25598F60D00D8B900BB825C /* SVGFETurbulence.h */,
845E72F90FD2623900A87D79 /* SVGFilter.cpp */,
845E72FA0FD2623900A87D79 /* SVGFilter.h */,
081EBF380FD34F4100DA7559 /* SVGFilterBuilder.cpp */,
081EBF390FD34F4100DA7559 /* SVGFilterBuilder.h */,
- B25598F90D00D8B900BB825C /* SVGLightSource.cpp */,
- B25598FA0D00D8B900BB825C /* SVGLightSource.h */,
- B25598FB0D00D8B900BB825C /* SVGPointLightSource.h */,
- B25598FC0D00D8B900BB825C /* SVGSpotLightSource.h */,
);
path = filters;
sourceTree = "<group>";
@@ -20184,7 +20184,6 @@
B22279A80D00BF220071B782 /* SVGCursorElement.h in Headers */,
B22279AE0D00BF220071B782 /* SVGDefsElement.h in Headers */,
B22279B10D00BF220071B782 /* SVGDescElement.h in Headers */,
- B25599710D00D8BA00BB825C /* SVGDistantLightSource.h in Headers */,
B22279B40D00BF220071B782 /* SVGDocument.h in Headers */,
B28C6A280D00C44800334AA4 /* SVGDocumentExtensions.h in Headers */,
B22279B70D00BF220071B782 /* SVGElement.h in Headers */,
@@ -20199,14 +20198,10 @@
B22279CB0D00BF220071B782 /* SVGFEColorMatrixElement.h in Headers */,
B22279CE0D00BF220071B782 /* SVGFEComponentTransferElement.h in Headers */,
B22279D10D00BF220071B782 /* SVGFECompositeElement.h in Headers */,
- B255997B0D00D8BA00BB825C /* SVGFEConvolveMatrix.h in Headers */,
1921327511C0E6BB00456238 /* SVGFEConvolveMatrixElement.h in Headers */,
- B255997D0D00D8BA00BB825C /* SVGFEDiffuseLighting.h in Headers */,
B22279D40D00BF220071B782 /* SVGFEDiffuseLightingElement.h in Headers */,
- B255997F0D00D8BA00BB825C /* SVGFEDisplacementMap.h in Headers */,
B22279D70D00BF220071B782 /* SVGFEDisplacementMapElement.h in Headers */,
B22279DA0D00BF220071B782 /* SVGFEDistantLightElement.h in Headers */,
- B25599810D00D8BA00BB825C /* SVGFEFlood.h in Headers */,
B22279DD0D00BF220071B782 /* SVGFEFloodElement.h in Headers */,
B22279E00D00BF220071B782 /* SVGFEFuncAElement.h in Headers */,
B22279E30D00BF220071B782 /* SVGFEFuncBElement.h in Headers */,
@@ -20216,21 +20211,14 @@
B25599850D00D8BA00BB825C /* SVGFEImage.h in Headers */,
B22279EF0D00BF220071B782 /* SVGFEImageElement.h in Headers */,
B22279F20D00BF220071B782 /* SVGFELightElement.h in Headers */,
- E440A2D71191A523000820B0 /* SVGFELighting.h in Headers */,
- B25599870D00D8BA00BB825C /* SVGFEMerge.h in Headers */,
B22279F40D00BF220071B782 /* SVGFEMergeElement.h in Headers */,
B22279F70D00BF220071B782 /* SVGFEMergeNodeElement.h in Headers */,
- B25599890D00D8BA00BB825C /* SVGFEMorphology.h in Headers */,
84224194107E78A700766A87 /* SVGFEMorphologyElement.h in Headers */,
- B255998B0D00D8BA00BB825C /* SVGFEOffset.h in Headers */,
B22279FA0D00BF220071B782 /* SVGFEOffsetElement.h in Headers */,
B22279FD0D00BF220071B782 /* SVGFEPointLightElement.h in Headers */,
- B255998D0D00D8BA00BB825C /* SVGFESpecularLighting.h in Headers */,
B2227A000D00BF220071B782 /* SVGFESpecularLightingElement.h in Headers */,
B2227A030D00BF220071B782 /* SVGFESpotLightElement.h in Headers */,
- B255998E0D00D8BA00BB825C /* SVGFETile.h in Headers */,
B2227A060D00BF220071B782 /* SVGFETileElement.h in Headers */,
- B25599900D00D8BA00BB825C /* SVGFETurbulence.h in Headers */,
B2227A090D00BF220071B782 /* SVGFETurbulenceElement.h in Headers */,
845E72FC0FD2623900A87D79 /* SVGFilter.h in Headers */,
081EBF3B0FD34F4100DA7559 /* SVGFilterBuilder.h in Headers */,
@@ -20259,7 +20247,6 @@
B2227A300D00BF220071B782 /* SVGLangSpace.h in Headers */,
B2227A330D00BF220071B782 /* SVGLength.h in Headers */,
B2227A360D00BF220071B782 /* SVGLengthList.h in Headers */,
- B25599940D00D8BA00BB825C /* SVGLightSource.h in Headers */,
B2227A390D00BF220071B782 /* SVGLinearGradientElement.h in Headers */,
B2227A3C0D00BF220071B782 /* SVGLineElement.h in Headers */,
B2227A3E0D00BF220071B782 /* SVGList.h in Headers */,
@@ -20303,7 +20290,6 @@
84300BD6120C9AAC0021954A /* SVGPathStringSource.h in Headers */,
84C5B2FB1216DC810088B53A /* SVGPathTraversalStateBuilder.h in Headers */,
B2227A880D00BF220071B782 /* SVGPatternElement.h in Headers */,
- B25599950D00D8BA00BB825C /* SVGPointLightSource.h in Headers */,
B2227A8C0D00BF220071B782 /* SVGPointList.h in Headers */,
B2227A8F0D00BF220071B782 /* SVGPolyElement.h in Headers */,
B2227A910D00BF220071B782 /* SVGPolygonElement.h in Headers */,
@@ -20324,7 +20310,6 @@
B2227AA60D00BF220071B782 /* SVGSetElement.h in Headers */,
08DAB9C31103D9C1003E7ABA /* SVGShadowTreeElements.h in Headers */,
E4AFD0100DAF335500F5F55C /* SVGSMILElement.h in Headers */,
- B25599960D00D8BA00BB825C /* SVGSpotLightSource.h in Headers */,
B2227AA90D00BF220071B782 /* SVGStopElement.h in Headers */,
B2227AAC0D00BF220071B782 /* SVGStringList.h in Headers */,
B2227AAF0D00BF220071B782 /* SVGStylable.h in Headers */,
@@ -20582,6 +20567,21 @@
93F199ED08245E59001E9ABC /* XSLTProcessor.h in Headers */,
E1BE512E0CF6C512002EA959 /* XSLTUnicodeSort.h in Headers */,
97DD4D870FDF4D6E00ECF9A4 /* XSSAuditor.h in Headers */,
+ 84730D771248F0B300D3A9C9 /* DistantLightSource.h in Headers */,
+ 84730D791248F0B300D3A9C9 /* FEConvolveMatrix.h in Headers */,
+ 84730D7B1248F0B300D3A9C9 /* FEDiffuseLighting.h in Headers */,
+ 84730D7D1248F0B300D3A9C9 /* FEDisplacementMap.h in Headers */,
+ 84730D7F1248F0B300D3A9C9 /* FEFlood.h in Headers */,
+ 84730D811248F0B300D3A9C9 /* FELighting.h in Headers */,
+ 84730D831248F0B300D3A9C9 /* FEMerge.h in Headers */,
+ 84730D851248F0B300D3A9C9 /* FEMorphology.h in Headers */,
+ 84730D871248F0B300D3A9C9 /* FEOffset.h in Headers */,
+ 84730D891248F0B300D3A9C9 /* FESpecularLighting.h in Headers */,
+ 84730D8B1248F0B300D3A9C9 /* FETile.h in Headers */,
+ 84730D8D1248F0B300D3A9C9 /* FETurbulence.h in Headers */,
+ 84730D911248F0B300D3A9C9 /* LightSource.h in Headers */,
+ 84730D921248F0B300D3A9C9 /* PointLightSource.h in Headers */,
+ 84730D931248F0B300D3A9C9 /* SpotLightSource.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -22724,14 +22724,10 @@
B22279CA0D00BF220071B782 /* SVGFEColorMatrixElement.cpp in Sources */,
B22279CD0D00BF220071B782 /* SVGFEComponentTransferElement.cpp in Sources */,
B22279D00D00BF220071B782 /* SVGFECompositeElement.cpp in Sources */,
- B255997A0D00D8BA00BB825C /* SVGFEConvolveMatrix.cpp in Sources */,
1921327411C0E6BB00456238 /* SVGFEConvolveMatrixElement.cpp in Sources */,
- B255997C0D00D8BA00BB825C /* SVGFEDiffuseLighting.cpp in Sources */,
B22279D30D00BF220071B782 /* SVGFEDiffuseLightingElement.cpp in Sources */,
- B255997E0D00D8BA00BB825C /* SVGFEDisplacementMap.cpp in Sources */,
B22279D60D00BF220071B782 /* SVGFEDisplacementMapElement.cpp in Sources */,
B22279D90D00BF220071B782 /* SVGFEDistantLightElement.cpp in Sources */,
- B25599800D00D8BA00BB825C /* SVGFEFlood.cpp in Sources */,
B22279DC0D00BF220071B782 /* SVGFEFloodElement.cpp in Sources */,
B22279DF0D00BF220071B782 /* SVGFEFuncAElement.cpp in Sources */,
B22279E20D00BF220071B782 /* SVGFEFuncBElement.cpp in Sources */,
@@ -22741,21 +22737,14 @@
B25599840D00D8BA00BB825C /* SVGFEImage.cpp in Sources */,
B22279EE0D00BF220071B782 /* SVGFEImageElement.cpp in Sources */,
B22279F10D00BF220071B782 /* SVGFELightElement.cpp in Sources */,
- E440A2D51191A50B000820B0 /* SVGFELighting.cpp in Sources */,
- B25599860D00D8BA00BB825C /* SVGFEMerge.cpp in Sources */,
B22279F30D00BF220071B782 /* SVGFEMergeElement.cpp in Sources */,
B22279F60D00BF220071B782 /* SVGFEMergeNodeElement.cpp in Sources */,
- B25599880D00D8BA00BB825C /* SVGFEMorphology.cpp in Sources */,
84224193107E78A700766A87 /* SVGFEMorphologyElement.cpp in Sources */,
- B255998A0D00D8BA00BB825C /* SVGFEOffset.cpp in Sources */,
B22279F90D00BF220071B782 /* SVGFEOffsetElement.cpp in Sources */,
B22279FC0D00BF220071B782 /* SVGFEPointLightElement.cpp in Sources */,
- B255998C0D00D8BA00BB825C /* SVGFESpecularLighting.cpp in Sources */,
B22279FF0D00BF220071B782 /* SVGFESpecularLightingElement.cpp in Sources */,
B2227A020D00BF220071B782 /* SVGFESpotLightElement.cpp in Sources */,
- A7D27FC40E0A599F0079AD2B /* SVGFETile.cpp in Sources */,
B2227A050D00BF220071B782 /* SVGFETileElement.cpp in Sources */,
- B255998F0D00D8BA00BB825C /* SVGFETurbulence.cpp in Sources */,
B2227A080D00BF220071B782 /* SVGFETurbulenceElement.cpp in Sources */,
845E72FB0FD2623900A87D79 /* SVGFilter.cpp in Sources */,
081EBF3A0FD34F4100DA7559 /* SVGFilterBuilder.cpp in Sources */,
@@ -22784,7 +22773,6 @@
B2227A2F0D00BF220071B782 /* SVGLangSpace.cpp in Sources */,
B2227A320D00BF220071B782 /* SVGLength.cpp in Sources */,
B2227A350D00BF220071B782 /* SVGLengthList.cpp in Sources */,
- B25599930D00D8BA00BB825C /* SVGLightSource.cpp in Sources */,
B2227A380D00BF220071B782 /* SVGLinearGradientElement.cpp in Sources */,
B2227A3B0D00BF220071B782 /* SVGLineElement.cpp in Sources */,
B2227A400D00BF220071B782 /* SVGLocatable.cpp in Sources */,
@@ -23061,6 +23049,18 @@
93F19B0508245E59001E9ABC /* XSLTProcessorLibxslt.cpp in Sources */,
E1BE512D0CF6C512002EA959 /* XSLTUnicodeSort.cpp in Sources */,
97DD4D860FDF4D6E00ECF9A4 /* XSSAuditor.cpp in Sources */,
+ 84730D781248F0B300D3A9C9 /* FEConvolveMatrix.cpp in Sources */,
+ 84730D7A1248F0B300D3A9C9 /* FEDiffuseLighting.cpp in Sources */,
+ 84730D7C1248F0B300D3A9C9 /* FEDisplacementMap.cpp in Sources */,
+ 84730D7E1248F0B300D3A9C9 /* FEFlood.cpp in Sources */,
+ 84730D801248F0B300D3A9C9 /* FELighting.cpp in Sources */,
+ 84730D821248F0B300D3A9C9 /* FEMerge.cpp in Sources */,
+ 84730D841248F0B300D3A9C9 /* FEMorphology.cpp in Sources */,
+ 84730D861248F0B300D3A9C9 /* FEOffset.cpp in Sources */,
+ 84730D881248F0B300D3A9C9 /* FESpecularLighting.cpp in Sources */,
+ 84730D8A1248F0B300D3A9C9 /* FETile.cpp in Sources */,
+ 84730D8C1248F0B300D3A9C9 /* FETurbulence.cpp in Sources */,
+ 84730D901248F0B300D3A9C9 /* LightSource.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
diff --git a/WebCore/platform/graphics/filters/DistantLightSource.h b/WebCore/platform/graphics/filters/DistantLightSource.h
new file mode 100644
index 0000000..d5d474f
--- /dev/null
+++ b/WebCore/platform/graphics/filters/DistantLightSource.h
@@ -0,0 +1,62 @@
+/*
+ * Copyright (C) 2008 Alex Mathews <possessedpenguinbob at gmail.com>
+ * 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 DistantLightSource_h
+#define DistantLightSource_h
+
+#if ENABLE(FILTERS)
+#include "LightSource.h"
+
+namespace WebCore {
+
+class DistantLightSource : public LightSource {
+public:
+ static PassRefPtr<DistantLightSource> create(float azimuth, float elevation)
+ {
+ return adoptRef(new DistantLightSource(azimuth, elevation));
+ }
+
+ float azimuth() const { return m_azimuth; }
+ float elevation() const { return m_elevation; }
+
+ virtual void initPaintingData(PaintingData&);
+ virtual void updatePaintingData(PaintingData&, int x, int y, float z);
+
+ virtual TextStream& externalRepresentation(TextStream&) const;
+
+private:
+ DistantLightSource(float azimuth, float elevation)
+ : LightSource(LS_DISTANT)
+ , m_azimuth(azimuth)
+ , m_elevation(elevation)
+ {
+ }
+
+ float m_azimuth;
+ float m_elevation;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(FILTERS)
+
+#endif // DistantLightSource_h
diff --git a/WebCore/platform/graphics/filters/FEConvolveMatrix.cpp b/WebCore/platform/graphics/filters/FEConvolveMatrix.cpp
new file mode 100644
index 0000000..dd66c6a
--- /dev/null
+++ b/WebCore/platform/graphics/filters/FEConvolveMatrix.cpp
@@ -0,0 +1,471 @@
+/*
+ * 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 Zoltan Herczeg <zherczeg 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"
+
+#if ENABLE(FILTERS)
+#include "FEConvolveMatrix.h"
+
+#include "CanvasPixelArray.h"
+#include "Filter.h"
+#include "ImageData.h"
+
+namespace WebCore {
+
+FEConvolveMatrix::FEConvolveMatrix(const IntSize& kernelSize,
+ float divisor, float bias, const IntPoint& targetOffset, EdgeModeType edgeMode,
+ const FloatPoint& kernelUnitLength, bool preserveAlpha, const Vector<float>& kernelMatrix)
+ : FilterEffect()
+ , m_kernelSize(kernelSize)
+ , m_divisor(divisor)
+ , m_bias(bias)
+ , m_targetOffset(targetOffset)
+ , m_edgeMode(edgeMode)
+ , m_kernelUnitLength(kernelUnitLength)
+ , m_preserveAlpha(preserveAlpha)
+ , m_kernelMatrix(kernelMatrix)
+{
+}
+
+PassRefPtr<FEConvolveMatrix> FEConvolveMatrix::create(const IntSize& kernelSize,
+ float divisor, float bias, const IntPoint& targetOffset, EdgeModeType edgeMode,
+ const FloatPoint& kernelUnitLength, bool preserveAlpha, const Vector<float>& kernelMatrix)
+{
+ return adoptRef(new FEConvolveMatrix(kernelSize, divisor, bias, targetOffset, edgeMode, kernelUnitLength,
+ preserveAlpha, kernelMatrix));
+}
+
+
+IntSize FEConvolveMatrix::kernelSize() const
+{
+ return m_kernelSize;
+}
+
+void FEConvolveMatrix::setKernelSize(IntSize kernelSize)
+{
+ m_kernelSize = kernelSize;
+}
+
+const Vector<float>& FEConvolveMatrix::kernel() const
+{
+ return m_kernelMatrix;
+}
+
+void FEConvolveMatrix::setKernel(const Vector<float>& kernel)
+{
+ m_kernelMatrix = kernel;
+}
+
+float FEConvolveMatrix::divisor() const
+{
+ return m_divisor;
+}
+
+void FEConvolveMatrix::setDivisor(float divisor)
+{
+ m_divisor = divisor;
+}
+
+float FEConvolveMatrix::bias() const
+{
+ return m_bias;
+}
+
+void FEConvolveMatrix::setBias(float bias)
+{
+ m_bias = bias;
+}
+
+IntPoint FEConvolveMatrix::targetOffset() const
+{
+ return m_targetOffset;
+}
+
+void FEConvolveMatrix::setTargetOffset(IntPoint targetOffset)
+{
+ m_targetOffset = targetOffset;
+}
+
+EdgeModeType FEConvolveMatrix::edgeMode() const
+{
+ return m_edgeMode;
+}
+
+void FEConvolveMatrix::setEdgeMode(EdgeModeType edgeMode)
+{
+ m_edgeMode = edgeMode;
+}
+
+FloatPoint FEConvolveMatrix::kernelUnitLength() const
+{
+ return m_kernelUnitLength;
+}
+
+void FEConvolveMatrix::setKernelUnitLength(FloatPoint kernelUnitLength)
+{
+ m_kernelUnitLength = kernelUnitLength;
+}
+
+bool FEConvolveMatrix::preserveAlpha() const
+{
+ return m_preserveAlpha;
+}
+
+void FEConvolveMatrix::setPreserveAlpha(bool preserveAlpha)
+{
+ m_preserveAlpha = preserveAlpha;
+}
+
+/*
+ -----------------------------------
+ ConvolveMatrix implementation
+ -----------------------------------
+
+ The image rectangle is split in the following way:
+
+ +---------------------+
+ | A |
+ +---------------------+
+ | | | |
+ | B | C | D |
+ | | | |
+ +---------------------+
+ | E |
+ +---------------------+
+
+ Where region C contains those pixels, whose values
+ can be calculated without crossing the edge of the rectangle.
+
+ Example:
+ Image size: width: 10, height: 10
+
+ Order (kernel matrix size): width: 3, height 4
+ Target: x:1, y:3
+
+ The following figure shows the target inside the kernel matrix:
+
+ ...
+ ...
+ ...
+ .X.
+
+ The regions in this case are the following:
+ Note: (x1, y1) top-left and (x2, y2) is the bottom-right corner
+ Note: row x2 and column y2 is not part of the region
+ only those (x, y) pixels, where x1 <= x < x2 and y1 <= y < y2
+
+ Region A: x1: 0, y1: 0, x2: 10, y2: 3
+ Region B: x1: 0, y1: 3, x2: 1, y2: 10
+ Region C: x1: 1, y1: 3, x2: 9, y2: 10
+ Region D: x1: 9, y1: 3, x2: 10, y2: 10
+ Region E: x1: 0, y1: 10, x2: 10, y2: 10 (empty region)
+
+ Since region C (often) contains most of the pixels, we implemented
+ a fast algoritm to calculate these values, called fastSetInteriorPixels.
+ For other regions, fastSetOuterPixels is used, which calls getPixelValue,
+ to handle pixels outside of the image. In a rare situations, when
+ kernel matrix is bigger than the image, all pixels are calculated by this
+ function.
+
+ Although these two functions have lot in common, I decided not to make
+ common a template for them, since there are key differences as well,
+ and would make it really hard to understand.
+*/
+
+static ALWAYS_INLINE unsigned char clampRGBAValue(float channel, unsigned char max = 255)
+{
+ if (channel <= 0)
+ return 0;
+ if (channel >= max)
+ return max;
+ return channel;
+}
+
+template<bool preserveAlphaValues>
+ALWAYS_INLINE void setDestinationPixels(CanvasPixelArray* image, int& pixel, float* totals, float divisor, float bias, CanvasPixelArray* src)
+{
+ unsigned char maxAlpha = preserveAlphaValues ? 255 : clampRGBAValue(totals[3] / divisor + bias);
+ for (int i = 0; i < 3; ++i)
+ image->set(pixel++, clampRGBAValue(totals[i] / divisor + bias, maxAlpha));
+
+ if (preserveAlphaValues) {
+ image->set(pixel, src->get(pixel));
+ ++pixel;
+ } else
+ image->set(pixel++, maxAlpha);
+}
+
+// Only for region C
+template<bool preserveAlphaValues>
+ALWAYS_INLINE void FEConvolveMatrix::fastSetInteriorPixels(PaintingData& paintingData, int clipRight, int clipBottom)
+{
+ // edge mode does not affect these pixels
+ int pixel = (m_targetOffset.y() * paintingData.width + m_targetOffset.x()) * 4;
+ int startKernelPixel = 0;
+ int kernelIncrease = clipRight * 4;
+ int xIncrease = (m_kernelSize.width() - 1) * 4;
+ // Contains the sum of rgb(a) components
+ float totals[3 + (preserveAlphaValues ? 0 : 1)];
+
+ // m_divisor cannot be 0, SVGFEConvolveMatrixElement ensures this
+ ASSERT(m_divisor);
+
+ for (int y = clipBottom + 1; y > 0; --y) {
+ for (int x = clipRight + 1; x > 0; --x) {
+ int kernelValue = m_kernelMatrix.size() - 1;
+ int kernelPixel = startKernelPixel;
+ int width = m_kernelSize.width();
+
+ totals[0] = 0;
+ totals[1] = 0;
+ totals[2] = 0;
+ if (!preserveAlphaValues)
+ totals[3] = 0;
+
+ while (kernelValue >= 0) {
+ totals[0] += m_kernelMatrix[kernelValue] * static_cast<float>(paintingData.srcPixelArray->get(kernelPixel++));
+ totals[1] += m_kernelMatrix[kernelValue] * static_cast<float>(paintingData.srcPixelArray->get(kernelPixel++));
+ totals[2] += m_kernelMatrix[kernelValue] * static_cast<float>(paintingData.srcPixelArray->get(kernelPixel++));
+ if (!preserveAlphaValues)
+ totals[3] += m_kernelMatrix[kernelValue] * static_cast<float>(paintingData.srcPixelArray->get(kernelPixel));
+ ++kernelPixel;
+ --kernelValue;
+ if (!--width) {
+ kernelPixel += kernelIncrease;
+ width = m_kernelSize.width();
+ }
+ }
+
+ setDestinationPixels<preserveAlphaValues>(paintingData.dstPixelArray, pixel, totals, m_divisor, paintingData.bias, paintingData.srcPixelArray);
+ startKernelPixel += 4;
+ }
+ pixel += xIncrease;
+ startKernelPixel += xIncrease;
+ }
+}
+
+ALWAYS_INLINE int FEConvolveMatrix::getPixelValue(PaintingData& paintingData, int x, int y)
+{
+ if (x >= 0 && x < paintingData.width && x >= 0 && y < paintingData.height)
+ return (y * paintingData.width + x) << 2;
+
+ switch (m_edgeMode) {
+ default: // EDGEMODE_NONE
+ return -1;
+ case EDGEMODE_DUPLICATE:
+ if (x < 0)
+ x = 0;
+ else if (x >= paintingData.width)
+ x = paintingData.width - 1;
+ if (y < 0)
+ y = 0;
+ else if (y >= paintingData.height)
+ y = paintingData.height - 1;
+ return (y * paintingData.width + x) << 2;
+ case EDGEMODE_WRAP:
+ while (x < 0)
+ x += paintingData.width;
+ x %= paintingData.width;
+ while (y < 0)
+ y += paintingData.height;
+ y %= paintingData.height;
+ return (y * paintingData.width + x) << 2;
+ }
+}
+
+// For other regions than C
+template<bool preserveAlphaValues>
+void FEConvolveMatrix::fastSetOuterPixels(PaintingData& paintingData, int x1, int y1, int x2, int y2)
+{
+ int pixel = (y1 * paintingData.width + x1) * 4;
+ int height = y2 - y1;
+ int width = x2 - x1;
+ int beginKernelPixelX = x1 - m_targetOffset.x();
+ int startKernelPixelX = beginKernelPixelX;
+ int startKernelPixelY = y1 - m_targetOffset.y();
+ int xIncrease = (paintingData.width - width) * 4;
+ // Contains the sum of rgb(a) components
+ float totals[3 + (preserveAlphaValues ? 0 : 1)];
+
+ // m_divisor cannot be 0, SVGFEConvolveMatrixElement ensures this
+ ASSERT(m_divisor);
+
+ for (int y = height; y > 0; --y) {
+ for (int x = width; x > 0; --x) {
+ int kernelValue = m_kernelMatrix.size() - 1;
+ int kernelPixelX = startKernelPixelX;
+ int kernelPixelY = startKernelPixelY;
+ int width = m_kernelSize.width();
+
+ totals[0] = 0;
+ totals[1] = 0;
+ totals[2] = 0;
+ if (!preserveAlphaValues)
+ totals[3] = 0;
+
+ while (kernelValue >= 0) {
+ int pixelIndex = getPixelValue(paintingData, kernelPixelX, kernelPixelY);
+ if (pixelIndex >= 0) {
+ totals[0] += m_kernelMatrix[kernelValue] * static_cast<float>(paintingData.srcPixelArray->get(pixelIndex));
+ totals[1] += m_kernelMatrix[kernelValue] * static_cast<float>(paintingData.srcPixelArray->get(pixelIndex + 1));
+ totals[2] += m_kernelMatrix[kernelValue] * static_cast<float>(paintingData.srcPixelArray->get(pixelIndex + 2));
+ }
+ if (!preserveAlphaValues && pixelIndex >= 0)
+ totals[3] += m_kernelMatrix[kernelValue] * static_cast<float>(paintingData.srcPixelArray->get(pixelIndex + 3));
+ ++kernelPixelX;
+ --kernelValue;
+ if (!--width) {
+ kernelPixelX = startKernelPixelX;
+ ++kernelPixelY;
+ width = m_kernelSize.width();
+ }
+ }
+
+ setDestinationPixels<preserveAlphaValues>(paintingData.dstPixelArray, pixel, totals, m_divisor, paintingData.bias, paintingData.srcPixelArray);
+ ++startKernelPixelX;
+ }
+ pixel += xIncrease;
+ startKernelPixelX = beginKernelPixelX;
+ ++startKernelPixelY;
+ }
+}
+
+ALWAYS_INLINE void FEConvolveMatrix::setInteriorPixels(PaintingData& paintingData, int clipRight, int clipBottom)
+{
+ // Must be implemented here, since it refers another ALWAYS_INLINE
+ // function, which defined in this C++ source file as well
+ if (m_preserveAlpha)
+ fastSetInteriorPixels<true>(paintingData, clipRight, clipBottom);
+ else
+ fastSetInteriorPixels<false>(paintingData, clipRight, clipBottom);
+}
+
+ALWAYS_INLINE void FEConvolveMatrix::setOuterPixels(PaintingData& paintingData, int x1, int y1, int x2, int y2)
+{
+ // Although this function can be moved to the header, it is implemented here
+ // because setInteriorPixels is also implemented here
+ if (m_preserveAlpha)
+ fastSetOuterPixels<true>(paintingData, x1, y1, x2, y2);
+ else
+ fastSetOuterPixels<false>(paintingData, x1, y1, x2, y2);
+}
+
+void FEConvolveMatrix::apply(Filter* filter)
+{
+ FilterEffect* in = inputEffect(0);
+ in->apply(filter);
+ if (!in->resultImage())
+ return;
+
+ if (!effectContext())
+ return;
+
+ IntRect imageRect(IntPoint(), resultImage()->size());
+ IntRect effectDrawingRect = requestedRegionOfInputImageData(in->filterPrimitiveSubregion());
+
+ RefPtr<CanvasPixelArray> srcPixelArray;
+ if (m_preserveAlpha)
+ srcPixelArray = in->resultImage()->getUnmultipliedImageData(effectDrawingRect)->data();
+ else
+ srcPixelArray = in->resultImage()->getPremultipliedImageData(effectDrawingRect)->data();
+
+ RefPtr<ImageData> imageData = ImageData::create(imageRect.width(), imageRect.height());
+
+ PaintingData paintingData;
+ paintingData.srcPixelArray = srcPixelArray.get();
+ paintingData.dstPixelArray = imageData->data();
+ paintingData.width = imageRect.width();
+ paintingData.height = imageRect.height();
+ paintingData.bias = m_bias * 255;
+
+ // Drawing fully covered pixels
+ int clipRight = imageRect.width() - m_kernelSize.width();
+ int clipBottom = imageRect.height() - m_kernelSize.height();
+
+ if (clipRight >= 0 && clipBottom >= 0) {
+ setInteriorPixels(paintingData, clipRight, clipBottom);
+
+ clipRight += m_targetOffset.x() + 1;
+ clipBottom += m_targetOffset.y() + 1;
+ if (m_targetOffset.y() > 0)
+ setOuterPixels(paintingData, 0, 0, imageRect.width(), m_targetOffset.y());
+ if (clipBottom < imageRect.height())
+ setOuterPixels(paintingData, 0, clipBottom, imageRect.width(), imageRect.height());
+ if (m_targetOffset.x() > 0)
+ setOuterPixels(paintingData, 0, m_targetOffset.y(), m_targetOffset.x(), clipBottom);
+ if (clipRight < imageRect.width())
+ setOuterPixels(paintingData, clipRight, m_targetOffset.y(), imageRect.width(), clipBottom);
+ } else {
+ // Rare situation, not optimizied for speed
+ setOuterPixels(paintingData, 0, 0, imageRect.width(), imageRect.height());
+ }
+
+ if (m_preserveAlpha)
+ resultImage()->putUnmultipliedImageData(imageData.get(), imageRect, IntPoint());
+ else
+ resultImage()->putPremultipliedImageData(imageData.get(), imageRect, IntPoint());
+}
+
+void FEConvolveMatrix::dump()
+{
+}
+
+static TextStream& operator<<(TextStream& ts, const EdgeModeType& type)
+{
+ switch (type) {
+ case EDGEMODE_UNKNOWN:
+ ts << "UNKNOWN";
+ break;
+ case EDGEMODE_DUPLICATE:
+ ts << "DUPLICATE";
+ break;
+ case EDGEMODE_WRAP:
+ ts << "WRAP";
+ break;
+ case EDGEMODE_NONE:
+ ts << "NONE";
+ break;
+ }
+ return ts;
+}
+
+TextStream& FEConvolveMatrix::externalRepresentation(TextStream& ts, int indent) const
+{
+ writeIndent(ts, indent);
+ ts << "[feConvolveMatrix";
+ FilterEffect::externalRepresentation(ts);
+ ts << " order=\"" << m_kernelSize << "\" "
+ << "kernelMatrix=\"" << m_kernelMatrix << "\" "
+ << "divisor=\"" << m_divisor << "\" "
+ << "bias=\"" << m_bias << "\" "
+ << "target=\"" << m_targetOffset << "\" "
+ << "edgeMode=\"" << m_edgeMode << "\" "
+ << "kernelUnitLength=\"" << m_kernelUnitLength << "\" "
+ << "preserveAlpha=\"" << m_preserveAlpha << "\"]\n";
+ inputEffect(0)->externalRepresentation(ts, indent + 1);
+ return ts;
+}
+
+}; // namespace WebCore
+
+#endif // ENABLE(FILTERS)
diff --git a/WebCore/platform/graphics/filters/FEConvolveMatrix.h b/WebCore/platform/graphics/filters/FEConvolveMatrix.h
new file mode 100644
index 0000000..2fe634f
--- /dev/null
+++ b/WebCore/platform/graphics/filters/FEConvolveMatrix.h
@@ -0,0 +1,118 @@
+/*
+ * 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) 2010 Zoltan Herczeg <zherczeg 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 FEConvolveMatrix_h
+#define FEConvolveMatrix_h
+
+#if ENABLE(FILTERS)
+#include "FilterEffect.h"
+#include "FloatPoint.h"
+#include "FloatSize.h"
+#include "Filter.h"
+#include <wtf/AlwaysInline.h>
+#include <wtf/Vector.h>
+
+namespace WebCore {
+
+enum EdgeModeType {
+ EDGEMODE_UNKNOWN = 0,
+ EDGEMODE_DUPLICATE = 1,
+ EDGEMODE_WRAP = 2,
+ EDGEMODE_NONE = 3
+};
+
+class CanvasPixelArray;
+
+class FEConvolveMatrix : public FilterEffect {
+public:
+ static PassRefPtr<FEConvolveMatrix> create(const IntSize&,
+ float, float, const IntPoint&, EdgeModeType, const FloatPoint&,
+ bool, const Vector<float>&);
+
+ IntSize kernelSize() const;
+ void setKernelSize(IntSize);
+
+ const Vector<float>& kernel() const;
+ void setKernel(const Vector<float>&);
+
+ float divisor() const;
+ void setDivisor(float);
+
+ float bias() const;
+ void setBias(float);
+
+ IntPoint targetOffset() const;
+ void setTargetOffset(IntPoint);
+
+ EdgeModeType edgeMode() const;
+ void setEdgeMode(EdgeModeType);
+
+ FloatPoint kernelUnitLength() const;
+ void setKernelUnitLength(FloatPoint);
+
+ bool preserveAlpha() const;
+ void setPreserveAlpha(bool);
+
+ virtual void apply(Filter*);
+ virtual void dump();
+
+ virtual TextStream& externalRepresentation(TextStream&, int indention) const;
+
+private:
+ FEConvolveMatrix(const IntSize&, float, float,
+ const IntPoint&, EdgeModeType, const FloatPoint&, bool, const Vector<float>&);
+
+ struct PaintingData {
+ CanvasPixelArray* srcPixelArray;
+ CanvasPixelArray* dstPixelArray;
+ int width;
+ int height;
+ float bias;
+ };
+
+ template<bool preserveAlphaValues>
+ ALWAYS_INLINE void fastSetInteriorPixels(PaintingData&, int clipRight, int clipBottom);
+
+ ALWAYS_INLINE int getPixelValue(PaintingData&, int x, int y);
+
+ template<bool preserveAlphaValues>
+ void fastSetOuterPixels(PaintingData&, int x1, int y1, int x2, int y2);
+
+ // Wrapper functions
+ ALWAYS_INLINE void setInteriorPixels(PaintingData& paintingData, int clipRight, int clipBottom);
+ ALWAYS_INLINE void setOuterPixels(PaintingData& paintingData, int x1, int y1, int x2, int y2);
+
+ IntSize m_kernelSize;
+ float m_divisor;
+ float m_bias;
+ IntPoint m_targetOffset;
+ EdgeModeType m_edgeMode;
+ FloatPoint m_kernelUnitLength;
+ bool m_preserveAlpha;
+ Vector<float> m_kernelMatrix;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(FILTERS)
+
+#endif // FEConvolveMatrix_h
diff --git a/WebCore/platform/graphics/filters/FEDiffuseLighting.cpp b/WebCore/platform/graphics/filters/FEDiffuseLighting.cpp
new file mode 100644
index 0000000..98b5adf
--- /dev/null
+++ b/WebCore/platform/graphics/filters/FEDiffuseLighting.cpp
@@ -0,0 +1,126 @@
+/*
+ * 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.
+ */
+
+#include "config.h"
+
+#if ENABLE(FILTERS)
+#include "FEDiffuseLighting.h"
+
+#include "LightSource.h"
+
+namespace WebCore {
+
+FEDiffuseLighting::FEDiffuseLighting(const Color& lightingColor, float surfaceScale,
+ float diffuseConstant, float kernelUnitLengthX, float kernelUnitLengthY, PassRefPtr<LightSource> lightSource)
+ : FELighting(DiffuseLighting, lightingColor, surfaceScale, diffuseConstant, 0, 0, kernelUnitLengthX, kernelUnitLengthY, lightSource)
+{
+}
+
+PassRefPtr<FEDiffuseLighting> FEDiffuseLighting::create(const Color& lightingColor,
+ float surfaceScale, float diffuseConstant, float kernelUnitLengthX,
+ float kernelUnitLengthY, PassRefPtr<LightSource> lightSource)
+{
+ return adoptRef(new FEDiffuseLighting(lightingColor, surfaceScale, diffuseConstant, kernelUnitLengthX, kernelUnitLengthY, lightSource));
+}
+
+FEDiffuseLighting::~FEDiffuseLighting()
+{
+}
+
+Color FEDiffuseLighting::lightingColor() const
+{
+ return m_lightingColor;
+}
+
+void FEDiffuseLighting::setLightingColor(const Color& lightingColor)
+{
+ m_lightingColor = lightingColor;
+}
+
+float FEDiffuseLighting::surfaceScale() const
+{
+ return m_surfaceScale;
+}
+
+void FEDiffuseLighting::setSurfaceScale(float surfaceScale)
+{
+ m_surfaceScale = surfaceScale;
+}
+
+float FEDiffuseLighting::diffuseConstant() const
+{
+ return m_diffuseConstant;
+}
+
+void FEDiffuseLighting::setDiffuseConstant(float diffuseConstant)
+{
+ m_diffuseConstant = diffuseConstant;
+}
+
+float FEDiffuseLighting::kernelUnitLengthX() const
+{
+ return m_kernelUnitLengthX;
+}
+
+void FEDiffuseLighting::setKernelUnitLengthX(float kernelUnitLengthX)
+{
+ m_kernelUnitLengthX = kernelUnitLengthX;
+}
+
+float FEDiffuseLighting::kernelUnitLengthY() const
+{
+ return m_kernelUnitLengthY;
+}
+
+void FEDiffuseLighting::setKernelUnitLengthY(float kernelUnitLengthY)
+{
+ m_kernelUnitLengthY = kernelUnitLengthY;
+}
+
+const LightSource* FEDiffuseLighting::lightSource() const
+{
+ return m_lightSource.get();
+}
+
+void FEDiffuseLighting::setLightSource(PassRefPtr<LightSource> lightSource)
+{
+ m_lightSource = lightSource;
+}
+
+void FEDiffuseLighting::dump()
+{
+}
+
+TextStream& FEDiffuseLighting::externalRepresentation(TextStream& ts, int indent) const
+{
+ writeIndent(ts, indent);
+ ts << "[feDiffuseLighting";
+ FilterEffect::externalRepresentation(ts);
+ ts << " surfaceScale=\"" << m_surfaceScale << "\" "
+ << "diffuseConstant=\"" << m_diffuseConstant << "\" "
+ << "kernelUnitLength=\"" << m_kernelUnitLengthX << ", " << m_kernelUnitLengthY << "\"]\n";
+ inputEffect(0)->externalRepresentation(ts, indent + 1);
+ return ts;
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(FILTERS)
diff --git a/WebCore/platform/graphics/filters/FEDiffuseLighting.h b/WebCore/platform/graphics/filters/FEDiffuseLighting.h
new file mode 100644
index 0000000..5273144
--- /dev/null
+++ b/WebCore/platform/graphics/filters/FEDiffuseLighting.h
@@ -0,0 +1,68 @@
+/*
+ * 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 FEDiffuseLighting_h
+#define FEDiffuseLighting_h
+
+#if ENABLE(FILTERS)
+#include "FELighting.h"
+
+namespace WebCore {
+
+class LightSource;
+
+class FEDiffuseLighting : public FELighting {
+public:
+ static PassRefPtr<FEDiffuseLighting> create(const Color&, float, float,
+ float, float, PassRefPtr<LightSource>);
+ virtual ~FEDiffuseLighting();
+
+ Color lightingColor() const;
+ void setLightingColor(const Color&);
+
+ float surfaceScale() const;
+ void setSurfaceScale(float);
+
+ float diffuseConstant() const;
+ void setDiffuseConstant(float);
+
+ float kernelUnitLengthX() const;
+ void setKernelUnitLengthX(float);
+
+ float kernelUnitLengthY() const;
+ void setKernelUnitLengthY(float);
+
+ const LightSource* lightSource() const;
+ void setLightSource(PassRefPtr<LightSource>);
+
+ virtual void dump();
+
+ virtual TextStream& externalRepresentation(TextStream&, int indention) const;
+
+private:
+ FEDiffuseLighting(const Color&, float, float, float, float, PassRefPtr<LightSource>);
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(FILTERS)
+
+#endif // FEDiffuseLighting_h
diff --git a/WebCore/platform/graphics/filters/FEDisplacementMap.cpp b/WebCore/platform/graphics/filters/FEDisplacementMap.cpp
new file mode 100644
index 0000000..6b5dbaa
--- /dev/null
+++ b/WebCore/platform/graphics/filters/FEDisplacementMap.cpp
@@ -0,0 +1,171 @@
+/*
+ * 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"
+
+#if ENABLE(FILTERS)
+#include "FEDisplacementMap.h"
+
+#include "CanvasPixelArray.h"
+#include "Filter.h"
+#include "GraphicsContext.h"
+#include "ImageData.h"
+
+namespace WebCore {
+
+FEDisplacementMap::FEDisplacementMap(ChannelSelectorType xChannelSelector, ChannelSelectorType yChannelSelector, float scale)
+ : FilterEffect()
+ , m_xChannelSelector(xChannelSelector)
+ , m_yChannelSelector(yChannelSelector)
+ , m_scale(scale)
+{
+}
+
+PassRefPtr<FEDisplacementMap> FEDisplacementMap::create(ChannelSelectorType xChannelSelector,
+ ChannelSelectorType yChannelSelector, float scale)
+{
+ return adoptRef(new FEDisplacementMap(xChannelSelector, yChannelSelector, scale));
+}
+
+ChannelSelectorType FEDisplacementMap::xChannelSelector() const
+{
+ return m_xChannelSelector;
+}
+
+void FEDisplacementMap::setXChannelSelector(const ChannelSelectorType xChannelSelector)
+{
+ m_xChannelSelector = xChannelSelector;
+}
+
+ChannelSelectorType FEDisplacementMap::yChannelSelector() const
+{
+ return m_yChannelSelector;
+}
+
+void FEDisplacementMap::setYChannelSelector(const ChannelSelectorType yChannelSelector)
+{
+ m_yChannelSelector = yChannelSelector;
+}
+
+float FEDisplacementMap::scale() const
+{
+ return m_scale;
+}
+
+void FEDisplacementMap::setScale(float scale)
+{
+ m_scale = scale;
+}
+
+void FEDisplacementMap::apply(Filter* filter)
+{
+ FilterEffect* in = inputEffect(0);
+ FilterEffect* in2 = inputEffect(1);
+ in->apply(filter);
+ in2->apply(filter);
+ if (!in->resultImage() || !in2->resultImage())
+ return;
+
+ if (m_xChannelSelector == CHANNEL_UNKNOWN || m_yChannelSelector == CHANNEL_UNKNOWN)
+ return;
+
+ if (!effectContext())
+ return;
+
+ IntRect effectADrawingRect = requestedRegionOfInputImageData(in->repaintRectInLocalCoordinates());
+ RefPtr<CanvasPixelArray> srcPixelArrayA(in->resultImage()->getPremultipliedImageData(effectADrawingRect)->data());
+
+ IntRect effectBDrawingRect = requestedRegionOfInputImageData(in2->repaintRectInLocalCoordinates());
+ RefPtr<CanvasPixelArray> srcPixelArrayB(in2->resultImage()->getUnmultipliedImageData(effectBDrawingRect)->data());
+
+ IntRect imageRect(IntPoint(), resultImage()->size());
+ RefPtr<ImageData> imageData = ImageData::create(imageRect.width(), imageRect.height());
+
+ ASSERT(srcPixelArrayA->length() == srcPixelArrayB->length());
+
+ float scaleX = m_scale / 255.f * filter->filterResolution().width();
+ float scaleY = m_scale / 255.f * filter->filterResolution().height();
+ float scaleAdjustmentX = (0.5f - 0.5f * m_scale) * filter->filterResolution().width();
+ float scaleAdjustmentY = (0.5f - 0.5f * m_scale) * filter->filterResolution().height();
+ int stride = imageRect.width() * 4;
+ for (int y = 0; y < imageRect.height(); ++y) {
+ int line = y * stride;
+ for (int x = 0; x < imageRect.width(); ++x) {
+ int dstIndex = line + x * 4;
+ int srcX = x + static_cast<int>(scaleX * srcPixelArrayB->get(dstIndex + m_xChannelSelector - 1) + scaleAdjustmentX);
+ int srcY = y + static_cast<int>(scaleY * srcPixelArrayB->get(dstIndex + m_yChannelSelector - 1) + scaleAdjustmentY);
+ for (unsigned channel = 0; channel < 4; ++channel) {
+ if (srcX < 0 || srcX >= imageRect.width() || srcY < 0 || srcY >= imageRect.height())
+ imageData->data()->set(dstIndex + channel, static_cast<unsigned char>(0));
+ else {
+ unsigned char pixelValue = srcPixelArrayA->get(srcY * stride + srcX * 4 + channel);
+ imageData->data()->set(dstIndex + channel, pixelValue);
+ }
+ }
+
+ }
+ }
+ resultImage()->putPremultipliedImageData(imageData.get(), imageRect, IntPoint());
+}
+
+void FEDisplacementMap::dump()
+{
+}
+
+static TextStream& operator<<(TextStream& ts, const ChannelSelectorType& type)
+{
+ switch (type) {
+ case CHANNEL_UNKNOWN:
+ ts << "UNKNOWN";
+ break;
+ case CHANNEL_R:
+ ts << "RED";
+ break;
+ case CHANNEL_G:
+ ts << "GREEN";
+ break;
+ case CHANNEL_B:
+ ts << "BLUE";
+ break;
+ case CHANNEL_A:
+ ts << "ALPHA";
+ break;
+ }
+ return ts;
+}
+
+TextStream& FEDisplacementMap::externalRepresentation(TextStream& ts, int indent) const
+{
+ writeIndent(ts, indent);
+ ts << "[feDisplacementMap";
+ FilterEffect::externalRepresentation(ts);
+ ts << " scale=\"" << m_scale << "\" "
+ << "xChannelSelector=\"" << m_xChannelSelector << "\" "
+ << "yChannelSelector=\"" << m_yChannelSelector << "\"]\n";
+ inputEffect(0)->externalRepresentation(ts, indent + 1);
+ inputEffect(1)->externalRepresentation(ts, indent + 1);
+ return ts;
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(FILTERS)
diff --git a/WebCore/platform/graphics/filters/FEDisplacementMap.h b/WebCore/platform/graphics/filters/FEDisplacementMap.h
new file mode 100644
index 0000000..dc87b90
--- /dev/null
+++ b/WebCore/platform/graphics/filters/FEDisplacementMap.h
@@ -0,0 +1,70 @@
+/*
+ * 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 FEDisplacementMap_h
+#define FEDisplacementMap_h
+
+#if ENABLE(FILTERS)
+#include "PlatformString.h"
+#include "FilterEffect.h"
+#include "Filter.h"
+
+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 xChannelSelector, ChannelSelectorType yChannelSelector, float);
+
+ ChannelSelectorType xChannelSelector() const;
+ void setXChannelSelector(const ChannelSelectorType);
+
+ ChannelSelectorType yChannelSelector() const;
+ void setYChannelSelector(const ChannelSelectorType);
+
+ float scale() const;
+ void setScale(float scale);
+
+ virtual void apply(Filter*);
+ virtual void dump();
+
+ 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
+
+#endif // ENABLE(FILTERS)
+
+#endif // FEDisplacementMap_h
diff --git a/WebCore/platform/graphics/filters/FEFlood.cpp b/WebCore/platform/graphics/filters/FEFlood.cpp
new file mode 100644
index 0000000..7804d89
--- /dev/null
+++ b/WebCore/platform/graphics/filters/FEFlood.cpp
@@ -0,0 +1,91 @@
+/*
+ * 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"
+
+#if ENABLE(FILTERS)
+#include "FEFlood.h"
+
+#include "Filter.h"
+#include "GraphicsContext.h"
+
+namespace WebCore {
+
+FEFlood::FEFlood(const Color& floodColor, float floodOpacity)
+ : FilterEffect()
+ , m_floodColor(floodColor)
+ , m_floodOpacity(floodOpacity)
+{
+}
+
+PassRefPtr<FEFlood> FEFlood::create(const Color& floodColor, float floodOpacity)
+{
+ return adoptRef(new FEFlood(floodColor, floodOpacity));
+}
+
+Color FEFlood::floodColor() const
+{
+ return m_floodColor;
+}
+
+void FEFlood::setFloodColor(const Color& color)
+{
+ m_floodColor = color;
+}
+
+float FEFlood::floodOpacity() const
+{
+ return m_floodOpacity;
+}
+
+void FEFlood::setFloodOpacity(float floodOpacity)
+{
+ m_floodOpacity = floodOpacity;
+}
+
+void FEFlood::apply(Filter*)
+{
+ GraphicsContext* filterContext = effectContext();
+ if (!filterContext)
+ return;
+
+ Color color = colorWithOverrideAlpha(floodColor().rgb(), floodOpacity());
+ filterContext->fillRect(FloatRect(FloatPoint(), repaintRectInLocalCoordinates().size()), color, DeviceColorSpace);
+}
+
+void FEFlood::dump()
+{
+}
+
+TextStream& FEFlood::externalRepresentation(TextStream& ts, int indent) const
+{
+ writeIndent(ts, indent);
+ ts << "[feFlood";
+ FilterEffect::externalRepresentation(ts);
+ ts << " flood-color=\"" << floodColor().name() << "\" "
+ << "flood-opacity=\"" << floodOpacity() << "\"]\n";
+ return ts;
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(FILTERS)
diff --git a/WebCore/platform/graphics/filters/FEFlood.h b/WebCore/platform/graphics/filters/FEFlood.h
new file mode 100644
index 0000000..b615531
--- /dev/null
+++ b/WebCore/platform/graphics/filters/FEFlood.h
@@ -0,0 +1,58 @@
+/*
+ * 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 FEFlood_h
+#define FEFlood_h
+
+#if ENABLE(FILTERS)
+#include "Color.h"
+#include "Filter.h"
+#include "FilterEffect.h"
+
+namespace WebCore {
+
+class FEFlood : public FilterEffect {
+public:
+ static PassRefPtr<FEFlood> create(const Color&, float);
+
+ Color floodColor() const;
+ void setFloodColor(const Color &);
+
+ float floodOpacity() const;
+ void setFloodOpacity(float);
+
+ virtual void apply(Filter*);
+ virtual void dump();
+
+ virtual TextStream& externalRepresentation(TextStream&, int indention) const;
+
+private:
+ FEFlood(const Color&, float);
+
+ Color m_floodColor;
+ float m_floodOpacity;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(FILTERS)
+
+#endif // FEFlood_h
diff --git a/WebCore/platform/graphics/filters/FELighting.cpp b/WebCore/platform/graphics/filters/FELighting.cpp
new file mode 100644
index 0000000..f49b67d
--- /dev/null
+++ b/WebCore/platform/graphics/filters/FELighting.cpp
@@ -0,0 +1,270 @@
+/*
+ * Copyright (C) 2010 University of Szeged
+ * Copyright (C) 2010 Zoltan Herczeg
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY UNIVERSITY OF SZEGED ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL UNIVERSITY OF SZEGED OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#if ENABLE(FILTERS)
+#include "FELighting.h"
+
+#include "CanvasPixelArray.h"
+#include "ImageData.h"
+#include "LightSource.h"
+
+namespace WebCore {
+
+FELighting::FELighting(LightingType lightingType, const Color& lightingColor, float surfaceScale,
+ float diffuseConstant, float specularConstant, float specularExponent,
+ float kernelUnitLengthX, float kernelUnitLengthY, PassRefPtr<LightSource> lightSource)
+ : FilterEffect()
+ , m_lightingType(lightingType)
+ , m_lightSource(lightSource)
+ , m_lightingColor(lightingColor)
+ , m_surfaceScale(surfaceScale)
+ , m_diffuseConstant(diffuseConstant)
+ , m_specularConstant(specularConstant)
+ , m_specularExponent(specularExponent)
+ , m_kernelUnitLengthX(kernelUnitLengthX)
+ , m_kernelUnitLengthY(kernelUnitLengthY)
+{
+}
+
+const static int cPixelSize = 4;
+const static int cAlphaChannelOffset = 3;
+const static unsigned char cOpaqueAlpha = static_cast<unsigned char>(0xff);
+
+ALWAYS_INLINE int FELighting::LightingData::upLeftPixelValue()
+{
+ return static_cast<int>(pixels->get(offset - widthMultipliedByPixelSize - cPixelSize + cAlphaChannelOffset));
+}
+
+ALWAYS_INLINE int FELighting::LightingData::upPixelValue()
+{
+ return static_cast<int>(pixels->get(offset - widthMultipliedByPixelSize + cAlphaChannelOffset));
+}
+
+ALWAYS_INLINE int FELighting::LightingData::upRightPixelValue()
+{
+ return static_cast<int>(pixels->get(offset - widthMultipliedByPixelSize + cPixelSize + cAlphaChannelOffset));
+}
+
+ALWAYS_INLINE int FELighting::LightingData::leftPixelValue()
+{
+ return static_cast<int>(pixels->get(offset - cPixelSize + cAlphaChannelOffset));
+}
+
+ALWAYS_INLINE int FELighting::LightingData::centerPixelValue()
+{
+ return static_cast<int>(pixels->get(offset + cAlphaChannelOffset));
+}
+
+ALWAYS_INLINE int FELighting::LightingData::rightPixelValue()
+{
+ return static_cast<int>(pixels->get(offset + cPixelSize + cAlphaChannelOffset));
+}
+
+ALWAYS_INLINE int FELighting::LightingData::downLeftPixelValue()
+{
+ return static_cast<int>(pixels->get(offset + widthMultipliedByPixelSize - cPixelSize + cAlphaChannelOffset));
+}
+
+ALWAYS_INLINE int FELighting::LightingData::downPixelValue()
+{
+ return static_cast<int>(pixels->get(offset + widthMultipliedByPixelSize + cAlphaChannelOffset));
+}
+
+ALWAYS_INLINE int FELighting::LightingData::downRightPixelValue()
+{
+ return static_cast<int>(pixels->get(offset + widthMultipliedByPixelSize + cPixelSize + cAlphaChannelOffset));
+}
+
+ALWAYS_INLINE void FELighting::setPixel(LightingData& data, LightSource::PaintingData& paintingData,
+ int lightX, int lightY, float factorX, int normalX, float factorY, int normalY)
+{
+ m_lightSource->updatePaintingData(paintingData, lightX, lightY, static_cast<float>(data.pixels->get(data.offset + 3)) * data.surfaceScale);
+
+ data.normalVector.setX(factorX * static_cast<float>(normalX) * data.surfaceScale);
+ data.normalVector.setY(factorY * static_cast<float>(normalY) * data.surfaceScale);
+ data.normalVector.setZ(1.0f);
+ data.normalVector.normalize();
+
+ if (m_lightingType == FELighting::DiffuseLighting)
+ data.lightStrength = m_diffuseConstant * (data.normalVector * paintingData.lightVector);
+ else {
+ FloatPoint3D halfwayVector = paintingData.lightVector;
+ halfwayVector.setZ(halfwayVector.z() + 1.0f);
+ halfwayVector.normalize();
+ if (m_specularExponent == 1.0f)
+ data.lightStrength = m_specularConstant * (data.normalVector * halfwayVector);
+ else
+ data.lightStrength = m_specularConstant * powf(data.normalVector * halfwayVector, m_specularExponent);
+ }
+
+ if (data.lightStrength > 1.0f)
+ data.lightStrength = 1.0f;
+ if (data.lightStrength < 0.0f)
+ data.lightStrength = 0.0f;
+
+ data.pixels->set(data.offset, static_cast<unsigned char>(data.lightStrength * paintingData.colorVector.x()));
+ data.pixels->set(data.offset + 1, static_cast<unsigned char>(data.lightStrength * paintingData.colorVector.y()));
+ data.pixels->set(data.offset + 2, static_cast<unsigned char>(data.lightStrength * paintingData.colorVector.z()));
+}
+
+bool FELighting::drawLighting(CanvasPixelArray* pixels, int width, int height)
+{
+ LightSource::PaintingData paintingData;
+ LightingData data;
+
+ if (!m_lightSource)
+ return false;
+
+ // FIXME: do something if width or height (or both) is 1 pixel.
+ // The W3 spec does not define this case. Now the filter just returns.
+ if (width <= 2 || height <= 2)
+ return false;
+
+ data.pixels = pixels;
+ data.surfaceScale = m_surfaceScale / 255.0f;
+ data.widthMultipliedByPixelSize = width * cPixelSize;
+ data.widthDecreasedByOne = width - 1;
+ data.heightDecreasedByOne = height - 1;
+ paintingData.colorVector = FloatPoint3D(m_lightingColor.red(), m_lightingColor.green(), m_lightingColor.blue());
+ m_lightSource->initPaintingData(paintingData);
+
+ // Top/Left corner
+ data.offset = 0;
+ setPixel(data, paintingData, 0, 0,
+ -2.0f / 3.0f, -2 * data.centerPixelValue() + 2 * data.rightPixelValue() - data.downPixelValue() + data.downRightPixelValue(),
+ -2.0f / 3.0f, -2 * data.centerPixelValue() - data.rightPixelValue() + 2 * data.downPixelValue() + data.downRightPixelValue());
+
+ // Top/Right pixel
+ data.offset = data.widthMultipliedByPixelSize - cPixelSize;
+ setPixel(data, paintingData, data.widthDecreasedByOne, 0,
+ -2.0f / 3.0f, -2 * data.leftPixelValue() + 2 * data.centerPixelValue() - data.downLeftPixelValue() + data.downPixelValue(),
+ -2.0f / 3.0f, -data.leftPixelValue() - 2 * data.centerPixelValue() + data.downLeftPixelValue() + 2 * data.downPixelValue());
+
+ // Bottom/Left pixel
+ data.offset = data.heightDecreasedByOne * data.widthMultipliedByPixelSize;
+ setPixel(data, paintingData, 0, data.heightDecreasedByOne,
+ -2.0f / 3.0f, -data.upPixelValue() + data.upRightPixelValue() - 2 * data.centerPixelValue() + 2 * data.rightPixelValue(),
+ -2.0f / 3.0f, -2 * data.upPixelValue() - data.upRightPixelValue() + 2 * data.centerPixelValue() + data.rightPixelValue());
+
+ // Bottom/Right pixel
+ data.offset = height * data.widthMultipliedByPixelSize - cPixelSize;
+ setPixel(data, paintingData, data.widthDecreasedByOne, data.heightDecreasedByOne,
+ -2.0f / 3.0f, -data.upLeftPixelValue() + data.upPixelValue() - 2 * data.leftPixelValue() + 2 * data.centerPixelValue(),
+ -2.0f / 3.0f, -data.upLeftPixelValue() - 2 * data.upPixelValue() + data.leftPixelValue() + 2 * data.centerPixelValue());
+
+ if (width >= 3) {
+ // Top line
+ data.offset = cPixelSize;
+ for (int x = 1; x < data.widthDecreasedByOne; ++x, data.offset += cPixelSize) {
+ setPixel(data, paintingData, x, 0,
+ -1.0f / 3.0f, -2 * data.leftPixelValue() + 2 * data.rightPixelValue() - data.downLeftPixelValue() + data.downRightPixelValue(),
+ -1.0f / 2.0f, -data.leftPixelValue() - 2 * data.centerPixelValue() - data.rightPixelValue() + data.downLeftPixelValue() + 2 * data.downPixelValue() + data.downRightPixelValue());
+ }
+ // Bottom line
+ data.offset = data.heightDecreasedByOne * data.widthMultipliedByPixelSize + cPixelSize;
+ for (int x = 1; x < data.widthDecreasedByOne; ++x, data.offset += cPixelSize) {
+ setPixel(data, paintingData, x, data.heightDecreasedByOne,
+ -1.0f / 3.0f, -data.upLeftPixelValue() + data.upRightPixelValue() - 2 * data.leftPixelValue() + 2 * data.rightPixelValue(),
+ -1.0f / 2.0f, -data.upLeftPixelValue() - 2 * data.upPixelValue() - data.upRightPixelValue() + data.leftPixelValue() + 2 * data.centerPixelValue() + data.rightPixelValue());
+ }
+ }
+
+ if (height >= 3) {
+ // Left line
+ data.offset = data.widthMultipliedByPixelSize;
+ for (int y = 1; y < data.heightDecreasedByOne; ++y, data.offset += data.widthMultipliedByPixelSize) {
+ setPixel(data, paintingData, 0, y,
+ -1.0f / 2.0f, -data.upPixelValue() + data.upRightPixelValue() - 2 * data.centerPixelValue() + 2 * data.rightPixelValue() - data.downPixelValue() + data.downRightPixelValue(),
+ -1.0f / 3.0f, -2 * data.upPixelValue() - data.upRightPixelValue() + 2 * data.downPixelValue() + data.downRightPixelValue());
+ }
+ // Right line
+ data.offset = data.widthMultipliedByPixelSize + data.widthMultipliedByPixelSize - cPixelSize;
+ for (int y = 1; y < data.heightDecreasedByOne; ++y, data.offset += data.widthMultipliedByPixelSize) {
+ setPixel(data, paintingData, data.widthDecreasedByOne, y,
+ -1.0f / 2.0f, -data.upLeftPixelValue() + data.upPixelValue() -2 * data.leftPixelValue() + 2 * data.centerPixelValue() - data.downLeftPixelValue() + data.downPixelValue(),
+ -1.0f / 3.0f, -data.upLeftPixelValue() - 2 * data.upPixelValue() + data.downLeftPixelValue() + 2 * data.downPixelValue());
+ }
+ }
+
+ if (width >= 3 && height >= 3) {
+ // Interior pixels
+ for (int y = 1; y < data.heightDecreasedByOne; ++y) {
+ data.offset = y * data.widthMultipliedByPixelSize + cPixelSize;
+ for (int x = 1; x < data.widthDecreasedByOne; ++x, data.offset += cPixelSize) {
+ setPixel(data, paintingData, x, y,
+ -1.0f / 4.0f, -data.upLeftPixelValue() + data.upRightPixelValue() - 2 * data.leftPixelValue() + 2 * data.rightPixelValue() - data.downLeftPixelValue() + data.downRightPixelValue(),
+ -1.0f / 4.0f, -data.upLeftPixelValue() - 2 * data.upPixelValue() - data.upRightPixelValue() + data.downLeftPixelValue() + 2 * data.downPixelValue() + data.downRightPixelValue());
+ }
+ }
+ }
+
+ int totalSize = data.widthMultipliedByPixelSize * height;
+ if (m_lightingType == DiffuseLighting) {
+ for (int i = 3; i < totalSize; i += 4)
+ data.pixels->set(i, cOpaqueAlpha);
+ } else {
+ for (int i = 0; i < totalSize; i += 4) {
+ unsigned char a1 = data.pixels->get(i);
+ unsigned char a2 = data.pixels->get(i + 1);
+ unsigned char a3 = data.pixels->get(i + 2);
+ // alpha set to set to max(a1, a2, a3)
+ data.pixels->set(i + 3, a1 >= a2 ? (a1 >= a3 ? a1 : a3) : (a2 >= a3 ? a2 : a3));
+ }
+ }
+
+ return true;
+}
+
+void FELighting::apply(Filter* filter)
+{
+ FilterEffect* in = inputEffect(0);
+ in->apply(filter);
+ if (!in->resultImage())
+ return;
+
+ if (!effectContext())
+ return;
+
+ setIsAlphaImage(false);
+
+ IntRect effectDrawingRect = requestedRegionOfInputImageData(in->repaintRectInLocalCoordinates());
+ RefPtr<ImageData> srcImageData(in->resultImage()->getUnmultipliedImageData(effectDrawingRect));
+ CanvasPixelArray* srcPixelArray(srcImageData->data());
+
+ // FIXME: support kernelUnitLengths other than (1,1). The issue here is that the W3
+ // standard has no test case for them, and other browsers (like Firefox) has strange
+ // output for various kernelUnitLengths, and I am not sure they are reliable.
+ // Anyway, feConvolveMatrix should also use the implementation
+
+ if (drawLighting(srcPixelArray, effectDrawingRect.width(), effectDrawingRect.height()))
+ resultImage()->putUnmultipliedImageData(srcImageData.get(), IntRect(IntPoint(), resultImage()->size()), IntPoint());
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(FILTERS)
diff --git a/WebCore/platform/graphics/filters/FELighting.h b/WebCore/platform/graphics/filters/FELighting.h
new file mode 100644
index 0000000..28c00c4
--- /dev/null
+++ b/WebCore/platform/graphics/filters/FELighting.h
@@ -0,0 +1,96 @@
+/*
+ * Copyright (C) 2010 University of Szeged
+ * Copyright (C) 2010 Zoltan Herczeg
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY UNIVERSITY OF SZEGED ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL UNIVERSITY OF SZEGED OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef FELighting_h
+#define FELighting_h
+
+#if ENABLE(FILTERS)
+#include "Color.h"
+#include "Filter.h"
+#include "FilterEffect.h"
+#include "LightSource.h"
+#include <wtf/AlwaysInline.h>
+
+// Common base class for FEDiffuseLighting and FESpecularLighting
+
+namespace WebCore {
+
+class CanvasPixelArray;
+
+class FELighting : public FilterEffect {
+public:
+ virtual void apply(Filter*);
+
+protected:
+ enum LightingType {
+ DiffuseLighting,
+ SpecularLighting
+ };
+
+ struct LightingData {
+ FloatPoint3D normalVector;
+ CanvasPixelArray* pixels;
+ float lightStrength;
+ float surfaceScale;
+ int offset;
+ int widthMultipliedByPixelSize;
+ int widthDecreasedByOne;
+ int heightDecreasedByOne;
+
+ ALWAYS_INLINE int upLeftPixelValue();
+ ALWAYS_INLINE int upPixelValue();
+ ALWAYS_INLINE int upRightPixelValue();
+ ALWAYS_INLINE int leftPixelValue();
+ ALWAYS_INLINE int centerPixelValue();
+ ALWAYS_INLINE int rightPixelValue();
+ ALWAYS_INLINE int downLeftPixelValue();
+ ALWAYS_INLINE int downPixelValue();
+ ALWAYS_INLINE int downRightPixelValue();
+ };
+
+ FELighting(LightingType, const Color&, float, float, float, float, float, float, PassRefPtr<LightSource>);
+
+ bool drawLighting(CanvasPixelArray*, int, int);
+ ALWAYS_INLINE void setPixel(LightingData&, LightSource::PaintingData&,
+ int lightX, int lightY, float factorX, int normalX, float factorY, int normalY);
+
+ LightingType m_lightingType;
+ RefPtr<LightSource> m_lightSource;
+
+ Color m_lightingColor;
+ float m_surfaceScale;
+ float m_diffuseConstant;
+ float m_specularConstant;
+ float m_specularExponent;
+ float m_kernelUnitLengthX;
+ float m_kernelUnitLengthY;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(FILTERS)
+
+#endif // FELighting_h
diff --git a/WebCore/platform/graphics/filters/FEMerge.cpp b/WebCore/platform/graphics/filters/FEMerge.cpp
new file mode 100644
index 0000000..19c832a
--- /dev/null
+++ b/WebCore/platform/graphics/filters/FEMerge.cpp
@@ -0,0 +1,82 @@
+/*
+ * 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.
+ */
+
+#include "config.h"
+
+#if ENABLE(FILTERS)
+#include "FEMerge.h"
+
+#include "Filter.h"
+#include "GraphicsContext.h"
+
+namespace WebCore {
+
+FEMerge::FEMerge()
+ : FilterEffect()
+{
+}
+
+PassRefPtr<FEMerge> FEMerge::create()
+{
+ return adoptRef(new FEMerge);
+}
+
+void FEMerge::apply(Filter* filter)
+{
+ unsigned size = numberOfEffectInputs();
+ ASSERT(size > 0);
+ for (unsigned i = 0; i < size; ++i) {
+ FilterEffect* in = inputEffect(i);
+ in->apply(filter);
+ if (!in->resultImage())
+ return;
+ }
+
+ GraphicsContext* filterContext = effectContext();
+ if (!filterContext)
+ return;
+
+ for (unsigned i = 0; i < size; ++i) {
+ FilterEffect* in = inputEffect(i);
+ filterContext->drawImageBuffer(in->resultImage(), DeviceColorSpace, drawingRegionOfInputImage(in->repaintRectInLocalCoordinates()));
+ }
+}
+
+void FEMerge::dump()
+{
+}
+
+TextStream& FEMerge::externalRepresentation(TextStream& ts, int indent) const
+{
+ writeIndent(ts, indent);
+ ts << "[feMerge";
+ FilterEffect::externalRepresentation(ts);
+ unsigned size = numberOfEffectInputs();
+ ASSERT(size > 0);
+ ts << " mergeNodes=\"" << size << "\"]\n";
+ for (unsigned i = 0; i < size; ++i)
+ inputEffect(i)->externalRepresentation(ts, indent + 1);
+ return ts;
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(FILTERS)
diff --git a/WebCore/platform/graphics/filters/FEMerge.h b/WebCore/platform/graphics/filters/FEMerge.h
new file mode 100644
index 0000000..46b882f
--- /dev/null
+++ b/WebCore/platform/graphics/filters/FEMerge.h
@@ -0,0 +1,49 @@
+/*
+ * 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 FEMerge_h
+#define EMerge_h
+
+#if ENABLE(FILTERS)
+#include "FilterEffect.h"
+#include "Filter.h"
+#include <wtf/Vector.h>
+
+namespace WebCore {
+
+class FEMerge : public FilterEffect {
+public:
+ static PassRefPtr<FEMerge> create();
+
+ virtual void apply(Filter*);
+ virtual void dump();
+
+ virtual TextStream& externalRepresentation(TextStream&, int indention) const;
+
+private:
+ FEMerge();
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(FILTERS)
+
+#endif // FEMerge_h
diff --git a/WebCore/platform/graphics/filters/FEMorphology.cpp b/WebCore/platform/graphics/filters/FEMorphology.cpp
new file mode 100644
index 0000000..7329e1e
--- /dev/null
+++ b/WebCore/platform/graphics/filters/FEMorphology.cpp
@@ -0,0 +1,188 @@
+/*
+ * 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"
+
+#if ENABLE(FILTERS)
+#include "FEMorphology.h"
+
+#include "CanvasPixelArray.h"
+#include "Filter.h"
+#include "ImageData.h"
+
+#include <wtf/Vector.h>
+
+using std::min;
+using std::max;
+
+namespace WebCore {
+
+FEMorphology::FEMorphology(MorphologyOperatorType type, float radiusX, float radiusY)
+ : FilterEffect()
+ , m_type(type)
+ , m_radiusX(radiusX)
+ , m_radiusY(radiusY)
+{
+}
+
+PassRefPtr<FEMorphology> FEMorphology::create(MorphologyOperatorType type, float radiusX, float radiusY)
+{
+ return adoptRef(new FEMorphology(type, radiusX, radiusY));
+}
+
+MorphologyOperatorType FEMorphology::morphologyOperator() const
+{
+ return m_type;
+}
+
+void FEMorphology::setMorphologyOperator(MorphologyOperatorType type)
+{
+ m_type = type;
+}
+
+float FEMorphology::radiusX() const
+{
+ return m_radiusX;
+}
+
+void FEMorphology::setRadiusX(float radiusX)
+{
+ m_radiusX = radiusX;
+}
+
+float FEMorphology::radiusY() const
+{
+ return m_radiusY;
+}
+
+void FEMorphology::setRadiusY(float radiusY)
+{
+ m_radiusY = radiusY;
+}
+
+void FEMorphology::apply(Filter* filter)
+{
+ FilterEffect* in = inputEffect(0);
+ in->apply(filter);
+ if (!in->resultImage())
+ return;
+
+ if (!effectContext())
+ return;
+
+ setIsAlphaImage(in->isAlphaImage());
+
+ int radiusX = static_cast<int>(m_radiusX * filter->filterResolution().width());
+ int radiusY = static_cast<int>(m_radiusY * filter->filterResolution().height());
+ if (radiusX <= 0 || radiusY <= 0)
+ return;
+
+ IntRect imageRect(IntPoint(), resultImage()->size());
+ IntRect effectDrawingRect = requestedRegionOfInputImageData(in->repaintRectInLocalCoordinates());
+ RefPtr<CanvasPixelArray> srcPixelArray(in->resultImage()->getPremultipliedImageData(effectDrawingRect)->data());
+ RefPtr<ImageData> imageData = ImageData::create(imageRect.width(), imageRect.height());
+
+ int effectWidth = effectDrawingRect.width() * 4;
+
+ // Limit the radius size to effect dimensions
+ radiusX = min(effectDrawingRect.width() - 1, radiusX);
+ radiusY = min(effectDrawingRect.height() - 1, radiusY);
+
+ Vector<unsigned char> extrema;
+ for (int y = 0; y < effectDrawingRect.height(); ++y) {
+ int startY = max(0, y - radiusY);
+ int endY = min(effectDrawingRect.height() - 1, y + radiusY);
+ for (unsigned channel = 0; channel < 4; ++channel) {
+ // Fill the kernel
+ extrema.clear();
+ for (int j = 0; j <= radiusX; ++j) {
+ unsigned char columnExtrema = srcPixelArray->get(startY * effectWidth + 4 * j + channel);
+ for (int i = startY; i <= endY; ++i) {
+ unsigned char pixel = srcPixelArray->get(i * effectWidth + 4 * j + channel);
+ if ((m_type == FEMORPHOLOGY_OPERATOR_ERODE && pixel <= columnExtrema) ||
+ (m_type == FEMORPHOLOGY_OPERATOR_DILATE && pixel >= columnExtrema))
+ columnExtrema = pixel;
+ }
+ extrema.append(columnExtrema);
+ }
+
+ // Kernel is filled, get extrema of next column
+ for (int x = 0; x < effectDrawingRect.width(); ++x) {
+ unsigned endX = min(x + radiusX, effectDrawingRect.width() - 1);
+ unsigned char columnExtrema = srcPixelArray->get(startY * effectWidth + endX * 4 + channel);
+ for (int i = startY; i <= endY; ++i) {
+ unsigned char pixel = srcPixelArray->get(i * effectWidth + endX * 4 + channel);
+ if ((m_type == FEMORPHOLOGY_OPERATOR_ERODE && pixel <= columnExtrema) ||
+ (m_type == FEMORPHOLOGY_OPERATOR_DILATE && pixel >= columnExtrema))
+ columnExtrema = pixel;
+ }
+ if (x - radiusX >= 0)
+ extrema.remove(0);
+ if (x + radiusX <= effectDrawingRect.width())
+ extrema.append(columnExtrema);
+ unsigned char entireExtrema = extrema[0];
+ for (unsigned kernelIndex = 0; kernelIndex < extrema.size(); ++kernelIndex) {
+ if ((m_type == FEMORPHOLOGY_OPERATOR_ERODE && extrema[kernelIndex] <= entireExtrema) ||
+ (m_type == FEMORPHOLOGY_OPERATOR_DILATE && extrema[kernelIndex] >= entireExtrema))
+ entireExtrema = extrema[kernelIndex];
+ }
+ imageData->data()->set(y * effectWidth + 4 * x + channel, entireExtrema);
+ }
+ }
+ }
+ resultImage()->putPremultipliedImageData(imageData.get(), imageRect, IntPoint());
+}
+
+void FEMorphology::dump()
+{
+}
+
+static TextStream& operator<<(TextStream& ts, const MorphologyOperatorType& type)
+{
+ switch (type) {
+ case FEMORPHOLOGY_OPERATOR_UNKNOWN:
+ ts << "UNKNOWN";
+ break;
+ case FEMORPHOLOGY_OPERATOR_ERODE:
+ ts << "ERODE";
+ break;
+ case FEMORPHOLOGY_OPERATOR_DILATE:
+ ts << "DILATE";
+ break;
+ }
+ return ts;
+}
+
+TextStream& FEMorphology::externalRepresentation(TextStream& ts, int indent) const
+{
+ writeIndent(ts, indent);
+ ts << "[feMorphology";
+ FilterEffect::externalRepresentation(ts);
+ ts << " operator=\"" << morphologyOperator() << "\" "
+ << "radius=\"" << radiusX() << ", " << radiusY() << "\"]\n";
+ inputEffect(0)->externalRepresentation(ts, indent + 1);
+ return ts;
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(FILTERS)
diff --git a/WebCore/platform/graphics/filters/FEMorphology.h b/WebCore/platform/graphics/filters/FEMorphology.h
new file mode 100644
index 0000000..c8ce058
--- /dev/null
+++ b/WebCore/platform/graphics/filters/FEMorphology.h
@@ -0,0 +1,66 @@
+/*
+ * 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 FEMorphology_h
+#define FEMorphology_h
+
+#if ENABLE(FILTERS)
+#include "FilterEffect.h"
+#include "Filter.h"
+
+namespace WebCore {
+
+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);
+
+ float radiusX() const;
+ void setRadiusX(float);
+
+ float radiusY() const;
+ void setRadiusY(float);
+
+ virtual void apply(Filter*);
+ virtual void dump();
+
+ 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
+
+#endif // ENABLE(FILTERS)
+
+#endif // FEMorphology_h
diff --git a/WebCore/platform/graphics/filters/FEOffset.cpp b/WebCore/platform/graphics/filters/FEOffset.cpp
new file mode 100644
index 0000000..ea84cf0
--- /dev/null
+++ b/WebCore/platform/graphics/filters/FEOffset.cpp
@@ -0,0 +1,112 @@
+/*
+ * 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"
+
+#if ENABLE(FILTERS)
+#include "FEOffset.h"
+
+#include "Filter.h"
+#include "GraphicsContext.h"
+
+namespace WebCore {
+
+FEOffset::FEOffset(float dx, float dy)
+ : FilterEffect()
+ , m_dx(dx)
+ , m_dy(dy)
+{
+}
+
+PassRefPtr<FEOffset> FEOffset::create(float dx, float dy)
+{
+ return adoptRef(new FEOffset(dx, dy));
+}
+
+float FEOffset::dx() const
+{
+ return m_dx;
+}
+
+void FEOffset::setDx(float dx)
+{
+ m_dx = dx;
+}
+
+float FEOffset::dy() const
+{
+ return m_dy;
+}
+
+void FEOffset::setDy(float dy)
+{
+ m_dy = dy;
+}
+
+void FEOffset::apply(Filter* filter)
+{
+ FilterEffect* in = inputEffect(0);
+ in->apply(filter);
+ if (!in->resultImage())
+ return;
+
+ GraphicsContext* filterContext = effectContext();
+ if (!filterContext)
+ return;
+
+ setIsAlphaImage(in->isAlphaImage());
+
+ FloatRect sourceImageRect = filter->sourceImageRect();
+ sourceImageRect.scale(filter->filterResolution().width(), filter->filterResolution().height());
+
+ if (filter->effectBoundingBoxMode()) {
+ m_dx *= sourceImageRect.width();
+ m_dy *= sourceImageRect.height();
+ }
+ m_dx *= filter->filterResolution().width();
+ m_dy *= filter->filterResolution().height();
+
+ FloatRect dstRect = FloatRect(m_dx + in->repaintRectInLocalCoordinates().x() - repaintRectInLocalCoordinates().x(),
+ m_dy + in->repaintRectInLocalCoordinates().y() - repaintRectInLocalCoordinates().y(),
+ in->repaintRectInLocalCoordinates().width(),
+ in->repaintRectInLocalCoordinates().height());
+
+ filterContext->drawImageBuffer(in->resultImage(), DeviceColorSpace, dstRect);
+}
+
+void FEOffset::dump()
+{
+}
+
+TextStream& FEOffset::externalRepresentation(TextStream& ts, int indent) const
+{
+ writeIndent(ts, indent);
+ ts << "[feOffset";
+ FilterEffect::externalRepresentation(ts);
+ ts << " dx=\"" << dx() << "\" dy=\"" << dy() << "\"]\n";
+ inputEffect(0)->externalRepresentation(ts, indent + 1);
+ return ts;
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(FILTERS)
diff --git a/WebCore/platform/graphics/filters/FEOffset.h b/WebCore/platform/graphics/filters/FEOffset.h
new file mode 100644
index 0000000..052ba74
--- /dev/null
+++ b/WebCore/platform/graphics/filters/FEOffset.h
@@ -0,0 +1,57 @@
+/*
+ * 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 FEOffset_h
+#define FEOffset_h
+
+#if ENABLE(FILTERS)
+#include "FilterEffect.h"
+#include "Filter.h"
+
+namespace WebCore {
+
+class FEOffset : public FilterEffect {
+public:
+ static PassRefPtr<FEOffset> create(float dx, float dy);
+
+ float dx() const;
+ void setDx(float);
+
+ float dy() const;
+ void setDy(float);
+
+ virtual void apply(Filter*);
+ virtual void dump();
+
+ virtual TextStream& externalRepresentation(TextStream&, int indention) const;
+
+private:
+ FEOffset(float dx, float dy);
+
+ float m_dx;
+ float m_dy;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(FILTERS)
+
+#endif // FEOffset_h
diff --git a/WebCore/platform/graphics/filters/FESpecularLighting.cpp b/WebCore/platform/graphics/filters/FESpecularLighting.cpp
new file mode 100644
index 0000000..2606600
--- /dev/null
+++ b/WebCore/platform/graphics/filters/FESpecularLighting.cpp
@@ -0,0 +1,138 @@
+/*
+ * 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.
+ */
+
+#include "config.h"
+
+#if ENABLE(FILTERS)
+#include "FESpecularLighting.h"
+
+#include "LightSource.h"
+
+namespace WebCore {
+
+FESpecularLighting::FESpecularLighting(const Color& lightingColor, float surfaceScale,
+ float specularConstant, float specularExponent, float kernelUnitLengthX,
+ float kernelUnitLengthY, PassRefPtr<LightSource> lightSource)
+ : FELighting(SpecularLighting, lightingColor, surfaceScale, 0, specularConstant, specularExponent, kernelUnitLengthX, kernelUnitLengthY, lightSource)
+{
+}
+
+PassRefPtr<FESpecularLighting> FESpecularLighting::create(const Color& lightingColor,
+ float surfaceScale, float specularConstant, float specularExponent,
+ float kernelUnitLengthX, float kernelUnitLengthY, PassRefPtr<LightSource> lightSource)
+{
+ return adoptRef(new FESpecularLighting(lightingColor, surfaceScale, specularConstant, specularExponent,
+ kernelUnitLengthX, kernelUnitLengthY, lightSource));
+}
+
+FESpecularLighting::~FESpecularLighting()
+{
+}
+
+Color FESpecularLighting::lightingColor() const
+{
+ return m_lightingColor;
+}
+
+void FESpecularLighting::setLightingColor(const Color& lightingColor)
+{
+ m_lightingColor = lightingColor;
+}
+
+float FESpecularLighting::surfaceScale() const
+{
+ return m_surfaceScale;
+}
+
+void FESpecularLighting::setSurfaceScale(float surfaceScale)
+{
+ m_surfaceScale = surfaceScale;
+}
+
+float FESpecularLighting::specularConstant() const
+{
+ return m_specularConstant;
+}
+
+void FESpecularLighting::setSpecularConstant(float specularConstant)
+{
+ m_specularConstant = specularConstant;
+}
+
+float FESpecularLighting::specularExponent() const
+{
+ return m_specularExponent;
+}
+
+void FESpecularLighting::setSpecularExponent(float specularExponent)
+{
+ m_specularExponent = specularExponent;
+}
+
+float FESpecularLighting::kernelUnitLengthX() const
+{
+ return m_kernelUnitLengthX;
+}
+
+void FESpecularLighting::setKernelUnitLengthX(float kernelUnitLengthX)
+{
+ m_kernelUnitLengthX = kernelUnitLengthX;
+}
+
+float FESpecularLighting::kernelUnitLengthY() const
+{
+ return m_kernelUnitLengthY;
+}
+
+void FESpecularLighting::setKernelUnitLengthY(float kernelUnitLengthY)
+{
+ m_kernelUnitLengthY = kernelUnitLengthY;
+}
+
+const LightSource* FESpecularLighting::lightSource() const
+{
+ return m_lightSource.get();
+}
+
+void FESpecularLighting::setLightSource(PassRefPtr<LightSource> lightSource)
+{
+ m_lightSource = lightSource;
+}
+
+void FESpecularLighting::dump()
+{
+}
+
+TextStream& FESpecularLighting::externalRepresentation(TextStream& ts, int indent) const
+{
+ writeIndent(ts, indent);
+ ts << "[feSpecularLighting";
+ FilterEffect::externalRepresentation(ts);
+ ts << " surfaceScale=\"" << m_surfaceScale << "\" "
+ << "specualConstant=\"" << m_specularConstant << "\" "
+ << "specularExponent=\"" << m_specularExponent << "\"]\n";
+ inputEffect(0)->externalRepresentation(ts, indent + 1);
+ return ts;
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(FILTERS)
diff --git a/WebCore/platform/graphics/filters/FESpecularLighting.h b/WebCore/platform/graphics/filters/FESpecularLighting.h
new file mode 100644
index 0000000..f6e7b66
--- /dev/null
+++ b/WebCore/platform/graphics/filters/FESpecularLighting.h
@@ -0,0 +1,69 @@
+/*
+ * 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 FESpecularLighting_h
+#define FESpecularLighting_h
+
+#if ENABLE(FILTERS)
+#include "FELighting.h"
+
+namespace WebCore {
+
+class FESpecularLighting : public FELighting {
+public:
+ static PassRefPtr<FESpecularLighting> create(const Color&, float, float,
+ float, float, float, PassRefPtr<LightSource>);
+ virtual ~FESpecularLighting();
+
+ Color lightingColor() const;
+ void setLightingColor(const Color&);
+
+ float surfaceScale() const;
+ void setSurfaceScale(float);
+
+ float specularConstant() const;
+ void setSpecularConstant(float);
+
+ float specularExponent() const;
+ void setSpecularExponent(float);
+
+ float kernelUnitLengthX() const;
+ void setKernelUnitLengthX(float);
+
+ float kernelUnitLengthY() const;
+ void setKernelUnitLengthY(float);
+
+ const LightSource* lightSource() const;
+ void setLightSource(PassRefPtr<LightSource>);
+
+ virtual void dump();
+
+ virtual TextStream& externalRepresentation(TextStream&, int indention) const;
+
+private:
+ FESpecularLighting(const Color&, float, float, float, float, float, PassRefPtr<LightSource>);
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(FILTERS)
+
+#endif // FESpecularLighting_h
diff --git a/WebCore/platform/graphics/filters/FETile.cpp b/WebCore/platform/graphics/filters/FETile.cpp
new file mode 100644
index 0000000..41abd34
--- /dev/null
+++ b/WebCore/platform/graphics/filters/FETile.cpp
@@ -0,0 +1,106 @@
+/*
+ * 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.
+ */
+
+#include "config.h"
+
+#if ENABLE(FILTERS)
+#include "FETile.h"
+
+#include "AffineTransform.h"
+#include "Filter.h"
+#include "GraphicsContext.h"
+#include "Pattern.h"
+
+namespace WebCore {
+
+FETile::FETile()
+ : FilterEffect()
+{
+}
+
+PassRefPtr<FETile> FETile::create()
+{
+ return adoptRef(new FETile);
+}
+
+FloatRect FETile::determineFilterPrimitiveSubregion(Filter* filter)
+{
+ inputEffect(0)->determineFilterPrimitiveSubregion(filter);
+
+ filter->determineFilterPrimitiveSubregion(this, filter->filterRegion());
+ return filterPrimitiveSubregion();
+}
+
+void FETile::apply(Filter* filter)
+{
+ FilterEffect* in = inputEffect(0);
+ in->apply(filter);
+ if (!in->resultImage())
+ return;
+
+ GraphicsContext* filterContext = effectContext();
+ if (!filterContext)
+ return;
+
+ setIsAlphaImage(in->isAlphaImage());
+
+ IntRect tileRect = enclosingIntRect(in->repaintRectInLocalCoordinates());
+
+ // Source input needs more attention. It has the size of the filterRegion but gives the
+ // size of the cutted sourceImage back. This is part of the specification and optimization.
+ if (in->isSourceInput()) {
+ FloatRect filterRegion = filter->filterRegion();
+ filterRegion.scale(filter->filterResolution().width(), filter->filterResolution().height());
+ tileRect = enclosingIntRect(filterRegion);
+ }
+
+ OwnPtr<ImageBuffer> tileImage = ImageBuffer::create(tileRect.size());
+ GraphicsContext* tileImageContext = tileImage->context();
+ tileImageContext->drawImageBuffer(in->resultImage(), DeviceColorSpace, IntPoint());
+ RefPtr<Pattern> pattern = Pattern::create(tileImage->copyImage(), true, true);
+
+ AffineTransform matrix;
+ matrix.translate(in->repaintRectInLocalCoordinates().x() - repaintRectInLocalCoordinates().x(),
+ in->repaintRectInLocalCoordinates().y() - repaintRectInLocalCoordinates().y());
+ pattern.get()->setPatternSpaceTransform(matrix);
+
+ filterContext->setFillPattern(pattern);
+ filterContext->fillRect(FloatRect(FloatPoint(), repaintRectInLocalCoordinates().size()));
+}
+
+void FETile::dump()
+{
+}
+
+TextStream& FETile::externalRepresentation(TextStream& ts, int indent) const
+{
+ writeIndent(ts, indent);
+ ts << "[feTile";
+ FilterEffect::externalRepresentation(ts);
+ ts << "]\n";
+ inputEffect(0)->externalRepresentation(ts, indent + 1);
+
+ return ts;
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(FILTERS)
+
diff --git a/WebCore/platform/graphics/filters/FETile.h b/WebCore/platform/graphics/filters/FETile.h
new file mode 100644
index 0000000..20efbcd
--- /dev/null
+++ b/WebCore/platform/graphics/filters/FETile.h
@@ -0,0 +1,50 @@
+/*
+ * 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 FETile_h
+#define FETile_h
+
+#if ENABLE(FILTERS)
+#include "FilterEffect.h"
+#include "Filter.h"
+
+namespace WebCore {
+
+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
+
+#endif // ENABLE(FILTERS)
+
+#endif // FETile_h
diff --git a/WebCore/platform/graphics/filters/FETurbulence.cpp b/WebCore/platform/graphics/filters/FETurbulence.cpp
new file mode 100644
index 0000000..bb24362
--- /dev/null
+++ b/WebCore/platform/graphics/filters/FETurbulence.cpp
@@ -0,0 +1,386 @@
+/*
+ * 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 Renata Hodovan <reni at inf.u-szeged.hu>
+ *
+ * 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"
+
+#if ENABLE(FILTERS)
+#include "FETurbulence.h"
+
+#include "CanvasPixelArray.h"
+#include "Filter.h"
+#include "ImageData.h"
+
+#include <wtf/MathExtras.h>
+
+namespace WebCore {
+
+/*
+ Produces results in the range [1, 2**31 - 2]. Algorithm is:
+ r = (a * r) mod m where a = randAmplitude = 16807 and
+ m = randMaximum = 2**31 - 1 = 2147483647, r = seed.
+ See [Park & Miller], CACM vol. 31 no. 10 p. 1195, Oct. 1988
+ To test: the algorithm should produce the result 1043618065
+ as the 10,000th generated number if the original seed is 1.
+*/
+static const int s_perlinNoise = 4096;
+static const long s_randMaximum = 2147483647; // 2**31 - 1
+static const int s_randAmplitude = 16807; // 7**5; primitive root of m
+static const int s_randQ = 127773; // m / a
+static const int s_randR = 2836; // m % a
+
+FETurbulence::FETurbulence(TurbulanceType type, float baseFrequencyX, float baseFrequencyY, int numOctaves, float seed, bool stitchTiles)
+ : FilterEffect()
+ , m_type(type)
+ , m_baseFrequencyX(baseFrequencyX)
+ , m_baseFrequencyY(baseFrequencyY)
+ , m_numOctaves(numOctaves)
+ , m_seed(seed)
+ , m_stitchTiles(stitchTiles)
+{
+}
+
+PassRefPtr<FETurbulence> FETurbulence::create(TurbulanceType type, float baseFrequencyX, float baseFrequencyY, int numOctaves, float seed, bool stitchTiles)
+{
+ return adoptRef(new FETurbulence(type, baseFrequencyX, baseFrequencyY, numOctaves, seed, stitchTiles));
+}
+
+TurbulanceType FETurbulence::type() const
+{
+ return m_type;
+}
+
+void FETurbulence::setType(TurbulanceType type)
+{
+ m_type = type;
+}
+
+float FETurbulence::baseFrequencyY() const
+{
+ return m_baseFrequencyY;
+}
+
+void FETurbulence::setBaseFrequencyY(float baseFrequencyY)
+{
+ m_baseFrequencyY = baseFrequencyY;
+}
+
+float FETurbulence::baseFrequencyX() const
+{
+ return m_baseFrequencyX;
+}
+
+void FETurbulence::setBaseFrequencyX(float baseFrequencyX)
+{
+ m_baseFrequencyX = baseFrequencyX;
+}
+
+float FETurbulence::seed() const
+{
+ return m_seed;
+}
+
+void FETurbulence::setSeed(float seed)
+{
+ m_seed = seed;
+}
+
+int FETurbulence::numOctaves() const
+{
+ return m_numOctaves;
+}
+
+void FETurbulence::setNumOctaves(bool numOctaves)
+{
+ m_numOctaves = numOctaves;
+}
+
+bool FETurbulence::stitchTiles() const
+{
+ return m_stitchTiles;
+}
+
+void FETurbulence::setStitchTiles(bool stitch)
+{
+ m_stitchTiles = stitch;
+}
+
+// The turbulence calculation code is an adapted version of what appears in the SVG 1.1 specification:
+// http://www.w3.org/TR/SVG11/filters.html#feTurbulence
+
+FETurbulence::PaintingData::PaintingData(long paintingSeed, const IntSize& paintingSize)
+ : seed(paintingSeed)
+ , width(0)
+ , height(0)
+ , wrapX(0)
+ , wrapY(0)
+ , channel(0)
+ , filterSize(paintingSize)
+{
+}
+
+// Compute pseudo random number.
+inline long FETurbulence::PaintingData::random()
+{
+ long result = s_randAmplitude * (seed % s_randQ) - s_randR * (seed / s_randQ);
+ if (result <= 0)
+ result += s_randMaximum;
+ seed = result;
+ return result;
+}
+
+inline float smoothCurve(float t)
+{
+ return t * t * (3 - 2 * t);
+}
+
+inline float linearInterpolation(float t, float a, float b)
+{
+ return a + t * (b - a);
+}
+
+inline void FETurbulence::initPaint(PaintingData& paintingData)
+{
+ float normalizationFactor;
+
+ // The seed value clamp to the range [1, s_randMaximum - 1].
+ if (paintingData.seed <= 0)
+ paintingData.seed = -(paintingData.seed % (s_randMaximum - 1)) + 1;
+ if (paintingData.seed > s_randMaximum - 1)
+ paintingData.seed = s_randMaximum - 1;
+
+ float* gradient;
+ for (int channel = 0; channel < 4; ++channel) {
+ for (int i = 0; i < s_blockSize; ++i) {
+ paintingData.latticeSelector[i] = i;
+ gradient = paintingData.gradient[channel][i];
+ gradient[0] = static_cast<float>((paintingData.random() % (2 * s_blockSize)) - s_blockSize) / s_blockSize;
+ gradient[1] = static_cast<float>((paintingData.random() % (2 * s_blockSize)) - s_blockSize) / s_blockSize;
+ normalizationFactor = sqrtf(gradient[0] * gradient[0] + gradient[1] * gradient[1]);
+ gradient[0] /= normalizationFactor;
+ gradient[1] /= normalizationFactor;
+ }
+ }
+ for (int i = s_blockSize - 1; i > 0; --i) {
+ int k = paintingData.latticeSelector[i];
+ int j = paintingData.random() % s_blockSize;
+ ASSERT(j >= 0);
+ ASSERT(j < 2 * s_blockSize + 2);
+ paintingData.latticeSelector[i] = paintingData.latticeSelector[j];
+ paintingData.latticeSelector[j] = k;
+ }
+ for (int i = 0; i < s_blockSize + 2; ++i) {
+ paintingData.latticeSelector[s_blockSize + i] = paintingData.latticeSelector[i];
+ for (int channel = 0; channel < 4; ++channel) {
+ paintingData.gradient[channel][s_blockSize + i][0] = paintingData.gradient[channel][i][0];
+ paintingData.gradient[channel][s_blockSize + i][1] = paintingData.gradient[channel][i][1];
+ }
+ }
+}
+
+inline void checkNoise(int& noiseValue, int limitValue, int newValue)
+{
+ if (noiseValue >= limitValue)
+ noiseValue -= newValue;
+ if (noiseValue >= limitValue - 1)
+ noiseValue -= newValue - 1;
+}
+
+float FETurbulence::noise2D(PaintingData& paintingData, const FloatPoint& noiseVector)
+{
+ struct Noise {
+ int noisePositionIntegerValue;
+ float noisePositionFractionValue;
+
+ Noise(float component)
+ {
+ float position = component + s_perlinNoise;
+ noisePositionIntegerValue = static_cast<int>(position);
+ noisePositionFractionValue = position - noisePositionIntegerValue;
+ }
+ };
+
+ Noise noiseX(noiseVector.x());
+ Noise noiseY(noiseVector.y());
+ float* q;
+ float sx, sy, a, b, u, v;
+
+ // If stitching, adjust lattice points accordingly.
+ if (m_stitchTiles) {
+ checkNoise(noiseX.noisePositionIntegerValue, paintingData.wrapX, paintingData.width);
+ checkNoise(noiseY.noisePositionIntegerValue, paintingData.wrapY, paintingData.height);
+ }
+
+ noiseX.noisePositionIntegerValue &= s_blockMask;
+ noiseY.noisePositionIntegerValue &= s_blockMask;
+ int latticeIndex = paintingData.latticeSelector[noiseX.noisePositionIntegerValue];
+ int nextLatticeIndex = paintingData.latticeSelector[(noiseX.noisePositionIntegerValue + 1) & s_blockMask];
+
+ sx = smoothCurve(noiseX.noisePositionFractionValue);
+ sy = smoothCurve(noiseY.noisePositionFractionValue);
+
+ // This is taken 1:1 from SVG spec: http://www.w3.org/TR/SVG11/filters.html#feTurbulenceElement.
+ int temp = paintingData.latticeSelector[latticeIndex + noiseY.noisePositionIntegerValue];
+ q = paintingData.gradient[paintingData.channel][temp];
+ u = noiseX.noisePositionFractionValue * q[0] + noiseY.noisePositionFractionValue * q[1];
+ temp = paintingData.latticeSelector[nextLatticeIndex + noiseY.noisePositionIntegerValue];
+ q = paintingData.gradient[paintingData.channel][temp];
+ v = (noiseX.noisePositionFractionValue - 1) * q[0] + noiseY.noisePositionFractionValue * q[1];
+ a = linearInterpolation(sx, u, v);
+ temp = paintingData.latticeSelector[latticeIndex + noiseY.noisePositionIntegerValue + 1];
+ q = paintingData.gradient[paintingData.channel][temp];
+ u = noiseX.noisePositionFractionValue * q[0] + (noiseY.noisePositionFractionValue - 1) * q[1];
+ temp = paintingData.latticeSelector[nextLatticeIndex + noiseY.noisePositionIntegerValue + 1];
+ q = paintingData.gradient[paintingData.channel][temp];
+ v = (noiseX.noisePositionFractionValue - 1) * q[0] + (noiseY.noisePositionFractionValue - 1) * q[1];
+ b = linearInterpolation(sx, u, v);
+ return linearInterpolation(sy, a, b);
+}
+
+unsigned char FETurbulence::calculateTurbulenceValueForPoint(PaintingData& paintingData, const FloatPoint& point)
+{
+ float tileWidth = paintingData.filterSize.width();
+ ASSERT(tileWidth > 0);
+ float tileHeight = paintingData.filterSize.height();
+ ASSERT(tileHeight > 0);
+ // Adjust the base frequencies if necessary for stitching.
+ if (m_stitchTiles) {
+ // When stitching tiled turbulence, the frequencies must be adjusted
+ // so that the tile borders will be continuous.
+ if (m_baseFrequencyX) {
+ float lowFrequency = floorf(tileWidth * m_baseFrequencyX) / tileWidth;
+ float highFrequency = ceilf(tileWidth * m_baseFrequencyX) / tileWidth;
+ // BaseFrequency should be non-negative according to the standard.
+ if (m_baseFrequencyX / lowFrequency < highFrequency / m_baseFrequencyX)
+ m_baseFrequencyX = lowFrequency;
+ else
+ m_baseFrequencyX = highFrequency;
+ }
+ if (m_baseFrequencyY) {
+ float lowFrequency = floorf(tileHeight * m_baseFrequencyY) / tileHeight;
+ float highFrequency = ceilf(tileHeight * m_baseFrequencyY) / tileHeight;
+ if (m_baseFrequencyY / lowFrequency < highFrequency / m_baseFrequencyY)
+ m_baseFrequencyY = lowFrequency;
+ else
+ m_baseFrequencyY = highFrequency;
+ }
+ // Set up TurbulenceInitial stitch values.
+ paintingData.width = roundf(tileWidth * m_baseFrequencyX);
+ paintingData.wrapX = s_perlinNoise + paintingData.width;
+ paintingData.height = roundf(tileHeight * m_baseFrequencyY);
+ paintingData.wrapY = s_perlinNoise + paintingData.height;
+ }
+ float turbulenceFunctionResult = 0;
+ FloatPoint noiseVector(point.x() * m_baseFrequencyX, point.y() * m_baseFrequencyY);
+ float ratio = 1;
+ for (int octave = 0; octave < m_numOctaves; ++octave) {
+ if (m_type == FETURBULENCE_TYPE_FRACTALNOISE)
+ turbulenceFunctionResult += noise2D(paintingData, noiseVector) / ratio;
+ else
+ turbulenceFunctionResult += fabsf(noise2D(paintingData, noiseVector)) / ratio;
+ noiseVector.setX(noiseVector.x() * 2);
+ noiseVector.setY(noiseVector.y() * 2);
+ ratio *= 2;
+ if (m_stitchTiles) {
+ // Update stitch values. Subtracting s_perlinNoiseoise before the multiplication and
+ // adding it afterward simplifies to subtracting it once.
+ paintingData.width *= 2;
+ paintingData.wrapX = 2 * paintingData.wrapX - s_perlinNoise;
+ paintingData.height *= 2;
+ paintingData.wrapY = 2 * paintingData.wrapY - s_perlinNoise;
+ }
+ }
+
+ // The value of turbulenceFunctionResult comes from ((turbulenceFunctionResult * 255) + 255) / 2 by fractalNoise
+ // and (turbulenceFunctionResult * 255) by turbulence.
+ if (m_type == FETURBULENCE_TYPE_FRACTALNOISE)
+ turbulenceFunctionResult = turbulenceFunctionResult * 0.5f + 0.5f;
+ // Clamp result
+ turbulenceFunctionResult = std::max(std::min(turbulenceFunctionResult, 1.f), 0.f);
+ return static_cast<unsigned char>(turbulenceFunctionResult * 255);
+}
+
+void FETurbulence::apply(Filter* filter)
+{
+ if (!effectContext())
+ return;
+
+ IntRect imageRect(IntPoint(), resultImage()->size());
+ if (!imageRect.size().width() || !imageRect.size().height())
+ return;
+
+ RefPtr<ImageData> imageData = ImageData::create(imageRect.width(), imageRect.height());
+ PaintingData paintingData(m_seed, imageRect.size());
+ initPaint(paintingData);
+
+ FloatRect filterRegion = filter->filterRegion();
+ FloatPoint point;
+ point.setY(filterRegion.y());
+ int indexOfPixelChannel = 0;
+ for (int y = 0; y < imageRect.height(); ++y) {
+ point.setY(point.y() + 1);
+ point.setX(filterRegion.x());
+ for (int x = 0; x < imageRect.width(); ++x) {
+ point.setX(point.x() + 1);
+ for (paintingData.channel = 0; paintingData.channel < 4; ++paintingData.channel, ++indexOfPixelChannel)
+ imageData->data()->set(indexOfPixelChannel, calculateTurbulenceValueForPoint(paintingData, point));
+ }
+ }
+ resultImage()->putUnmultipliedImageData(imageData.get(), imageRect, IntPoint());
+}
+
+void FETurbulence::dump()
+{
+}
+
+static TextStream& operator<<(TextStream& ts, const TurbulanceType& type)
+{
+ switch (type) {
+ case FETURBULENCE_TYPE_UNKNOWN:
+ ts << "UNKNOWN";
+ break;
+ case FETURBULENCE_TYPE_TURBULENCE:
+ ts << "TURBULANCE";
+ break;
+ case FETURBULENCE_TYPE_FRACTALNOISE:
+ ts << "NOISE";
+ break;
+ }
+ return ts;
+}
+
+TextStream& FETurbulence::externalRepresentation(TextStream& ts, int indent) const
+{
+ writeIndent(ts, indent);
+ ts << "[feTurbulence";
+ FilterEffect::externalRepresentation(ts);
+ ts << " type=\"" << type() << "\" "
+ << "baseFrequency=\"" << baseFrequencyX() << ", " << baseFrequencyY() << "\" "
+ << "seed=\"" << seed() << "\" "
+ << "numOctaves=\"" << numOctaves() << "\" "
+ << "stitchTiles=\"" << stitchTiles() << "\"]\n";
+ return ts;
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(FILTERS)
diff --git a/WebCore/platform/graphics/filters/FETurbulence.h b/WebCore/platform/graphics/filters/FETurbulence.h
new file mode 100644
index 0000000..1a5a28a
--- /dev/null
+++ b/WebCore/platform/graphics/filters/FETurbulence.h
@@ -0,0 +1,103 @@
+/*
+ * 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 Renata Hodovan <reni at inf.u-szeged.hu>
+ *
+ * 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 FETurbulence_h
+#define FETurbulence_h
+
+#if ENABLE(FILTERS)
+#include "FilterEffect.h"
+#include "Filter.h"
+
+namespace WebCore {
+
+enum TurbulanceType {
+ FETURBULENCE_TYPE_UNKNOWN = 0,
+ FETURBULENCE_TYPE_FRACTALNOISE = 1,
+ FETURBULENCE_TYPE_TURBULENCE = 2
+};
+
+class FETurbulence : public FilterEffect {
+public:
+ static PassRefPtr<FETurbulence> create(TurbulanceType, float, float, int, float, bool);
+
+ TurbulanceType type() const;
+ void setType(TurbulanceType);
+
+ float baseFrequencyY() const;
+ void setBaseFrequencyY(float);
+
+ float baseFrequencyX() const;
+ void setBaseFrequencyX(float);
+
+ float seed() const;
+ void setSeed(float);
+
+ int numOctaves() const;
+ void setNumOctaves(bool);
+
+ bool stitchTiles() const;
+ void setStitchTiles(bool);
+
+ virtual void apply(Filter*);
+ virtual void dump();
+
+ virtual TextStream& externalRepresentation(TextStream&, int indention) const;
+
+private:
+ static const int s_blockSize = 256;
+ static const int s_blockMask = s_blockSize - 1;
+
+ struct PaintingData {
+ long seed;
+ int latticeSelector[2 * s_blockSize + 2];
+ float gradient[4][2 * s_blockSize + 2][2];
+ int width; // How much to subtract to wrap for stitching.
+ int height;
+ int wrapX; // Minimum value to wrap.
+ int wrapY;
+ int channel;
+ IntSize filterSize;
+
+ PaintingData(long paintingSeed, const IntSize& paintingSize);
+ inline long random();
+ };
+
+ FETurbulence(TurbulanceType, float, float, int, float, bool);
+
+ inline void initPaint(PaintingData&);
+ float noise2D(PaintingData&, const FloatPoint&);
+ unsigned char calculateTurbulenceValueForPoint(PaintingData&, const FloatPoint&);
+
+ TurbulanceType m_type;
+ float m_baseFrequencyX;
+ float m_baseFrequencyY;
+ int m_numOctaves;
+ float m_seed;
+ bool m_stitchTiles;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(FILTERS)
+
+#endif // FETurbulence_h
diff --git a/WebCore/platform/graphics/filters/LightSource.cpp b/WebCore/platform/graphics/filters/LightSource.cpp
new file mode 100644
index 0000000..a80b14b
--- /dev/null
+++ b/WebCore/platform/graphics/filters/LightSource.cpp
@@ -0,0 +1,169 @@
+/*
+ * 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) 2010 Zoltan Herczeg <zherczeg 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"
+
+#if ENABLE(FILTERS)
+#include "LightSource.h"
+
+#include "DistantLightSource.h"
+#include "PointLightSource.h"
+#include "RenderTreeAsText.h"
+#include "SpotLightSource.h"
+#include <wtf/MathExtras.h>
+
+namespace WebCore {
+
+void PointLightSource::initPaintingData(PaintingData&)
+{
+}
+
+void PointLightSource::updatePaintingData(PaintingData& paintingData, int x, int y, float z)
+{
+ paintingData.lightVector.setX(m_position.x() - x);
+ paintingData.lightVector.setY(m_position.y() - y);
+ paintingData.lightVector.setZ(m_position.z() - z);
+ paintingData.lightVector.normalize();
+}
+
+// spot-light edge darkening depends on an absolute treshold
+// according to the SVG 1.1 SE light regression tests
+static const float antiAliasTreshold = 0.016f;
+
+void SpotLightSource::initPaintingData(PaintingData& paintingData)
+{
+ paintingData.privateColorVector = paintingData.colorVector;
+ paintingData.directionVector.setX(m_direction.x() - m_position.x());
+ paintingData.directionVector.setY(m_direction.y() - m_position.y());
+ paintingData.directionVector.setZ(m_direction.z() - m_position.z());
+ paintingData.directionVector.normalize();
+
+ if (!m_limitingConeAngle) {
+ paintingData.coneCutOffLimit = 0.0f;
+ paintingData.coneFullLight = -antiAliasTreshold;
+ } else {
+ float limitingConeAngle = m_limitingConeAngle;
+ if (limitingConeAngle < 0.0f)
+ limitingConeAngle = -limitingConeAngle;
+ if (limitingConeAngle > 90.0f)
+ limitingConeAngle = 90.0f;
+ paintingData.coneCutOffLimit = cosf(deg2rad(180.0f - limitingConeAngle));
+ paintingData.coneFullLight = paintingData.coneCutOffLimit - antiAliasTreshold;
+ }
+
+ // Optimization for common specularExponent values
+ if (!m_specularExponent)
+ paintingData.specularExponent = 0;
+ else if (m_specularExponent == 1.0f)
+ paintingData.specularExponent = 1;
+ else // It is neither 0.0f nor 1.0f
+ paintingData.specularExponent = 2;
+}
+
+void SpotLightSource::updatePaintingData(PaintingData& paintingData, int x, int y, float z)
+{
+ paintingData.lightVector.setX(m_position.x() - x);
+ paintingData.lightVector.setY(m_position.y() - y);
+ paintingData.lightVector.setZ(m_position.z() - z);
+ paintingData.lightVector.normalize();
+
+ float cosineOfAngle = paintingData.lightVector * paintingData.directionVector;
+ if (cosineOfAngle > paintingData.coneCutOffLimit) {
+ // No light is produced, scanlines are not updated
+ paintingData.colorVector.setX(0.0f);
+ paintingData.colorVector.setY(0.0f);
+ paintingData.colorVector.setZ(0.0f);
+ return;
+ }
+
+ // Set the color of the pixel
+ float lightStrength;
+ switch (paintingData.specularExponent) {
+ case 0:
+ lightStrength = 1.0f; // -cosineOfAngle ^ 0 == 1
+ break;
+ case 1:
+ lightStrength = -cosineOfAngle; // -cosineOfAngle ^ 1 == -cosineOfAngle
+ break;
+ default:
+ lightStrength = powf(-cosineOfAngle, m_specularExponent);
+ break;
+ }
+
+ if (cosineOfAngle > paintingData.coneFullLight)
+ lightStrength *= (paintingData.coneCutOffLimit - cosineOfAngle) / (paintingData.coneCutOffLimit - paintingData.coneFullLight);
+
+ if (lightStrength > 1.0f)
+ lightStrength = 1.0f;
+
+ paintingData.colorVector.setX(paintingData.privateColorVector.x() * lightStrength);
+ paintingData.colorVector.setY(paintingData.privateColorVector.y() * lightStrength);
+ paintingData.colorVector.setZ(paintingData.privateColorVector.z() * lightStrength);
+}
+
+void DistantLightSource::initPaintingData(PaintingData& paintingData)
+{
+ float azimuth = deg2rad(m_azimuth);
+ float elevation = deg2rad(m_elevation);
+ paintingData.lightVector.setX(cosf(azimuth) * cosf(elevation));
+ paintingData.lightVector.setY(sinf(azimuth) * cosf(elevation));
+ paintingData.lightVector.setZ(sinf(elevation));
+}
+
+void DistantLightSource::updatePaintingData(PaintingData&, int, int, float)
+{
+}
+
+static TextStream& operator<<(TextStream& ts, const FloatPoint3D& p)
+{
+ ts << "x=" << p.x() << " y=" << p.y() << " z=" << p.z();
+ return ts;
+}
+
+TextStream& PointLightSource::externalRepresentation(TextStream& ts) const
+{
+ ts << "[type=POINT-LIGHT] ";
+ ts << "[position=\"" << position() << "\"]";
+ return ts;
+}
+
+TextStream& SpotLightSource::externalRepresentation(TextStream& ts) const
+{
+ ts << "[type=SPOT-LIGHT] ";
+ ts << "[position=\"" << position() << "\"]";
+ ts << "[direction=\"" << direction() << "\"]";
+ ts << "[specularExponent=\"" << specularExponent() << "\"]";
+ ts << "[limitingConeAngle=\"" << limitingConeAngle() << "\"]";
+ return ts;
+}
+
+TextStream& DistantLightSource::externalRepresentation(TextStream& ts) const
+{
+ ts << "[type=DISTANT-LIGHT] ";
+ ts << "[azimuth=\"" << azimuth() << "\"]";
+ ts << "[elevation=\"" << elevation() << "\"]";
+ return ts;
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(FILTERS)
diff --git a/WebCore/platform/graphics/filters/LightSource.h b/WebCore/platform/graphics/filters/LightSource.h
new file mode 100644
index 0000000..2e4c579
--- /dev/null
+++ b/WebCore/platform/graphics/filters/LightSource.h
@@ -0,0 +1,84 @@
+/*
+ * Copyright (C) 2008 Alex Mathews <possessedpenguinbob at gmail.com>
+ * 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) 2010 Zoltan Herczeg <zherczeg 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 LightSource_h
+#define LightSource_h
+
+#if ENABLE(FILTERS)
+#include "FloatPoint3D.h"
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefCounted.h>
+
+namespace WebCore {
+
+enum LightType {
+ LS_DISTANT,
+ LS_POINT,
+ LS_SPOT
+};
+
+class TextStream;
+
+class LightSource : public RefCounted<LightSource> {
+public:
+
+ // Light vectors must be calculated for every pixel during
+ // painting. It is expensive to pass all these arguments to
+ // a frequently called function, especially because not all
+ // light sources require all of them. Instead, we just pass
+ // a reference to the following structure
+ struct PaintingData {
+ // SVGFELighting also use them
+ FloatPoint3D lightVector;
+ FloatPoint3D colorVector;
+ // Private members
+ FloatPoint3D directionVector;
+ FloatPoint3D privateColorVector;
+ float coneCutOffLimit;
+ float coneFullLight;
+ int specularExponent;
+ };
+
+ LightSource(LightType type)
+ : m_type(type)
+ { }
+
+ virtual ~LightSource() { }
+
+ LightType type() const { return m_type; }
+ virtual TextStream& externalRepresentation(TextStream&) const = 0;
+
+ virtual void initPaintingData(PaintingData&) = 0;
+ // z is a float number, since it is the alpha value scaled by a user
+ // specified "surfaceScale" constant, which type is <number> in the SVG standard
+ virtual void updatePaintingData(PaintingData&, int x, int y, float z) = 0;
+
+private:
+ LightType m_type;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(FILTERS)
+
+#endif // LightSource_h
diff --git a/WebCore/platform/graphics/filters/PointLightSource.h b/WebCore/platform/graphics/filters/PointLightSource.h
new file mode 100644
index 0000000..163c829
--- /dev/null
+++ b/WebCore/platform/graphics/filters/PointLightSource.h
@@ -0,0 +1,59 @@
+/*
+ * Copyright (C) 2008 Alex Mathews <possessedpenguinbob at gmail.com>
+ * 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 PointLightSource_h
+#define PointLightSource_h
+
+#if ENABLE(FILTERS)
+#include "LightSource.h"
+
+namespace WebCore {
+
+class PointLightSource : public LightSource {
+public:
+ static PassRefPtr<PointLightSource> create(const FloatPoint3D& position)
+ {
+ return adoptRef(new PointLightSource(position));
+ }
+
+ const FloatPoint3D& position() const { return m_position; }
+
+ virtual void initPaintingData(PaintingData&);
+ virtual void updatePaintingData(PaintingData&, int x, int y, float z);
+
+ virtual TextStream& externalRepresentation(TextStream&) const;
+
+private:
+ PointLightSource(const FloatPoint3D& position)
+ : LightSource(LS_POINT)
+ , m_position(position)
+ {
+ }
+
+ FloatPoint3D m_position;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(FILTERS)
+
+#endif // PointLightSource_h
diff --git a/WebCore/platform/graphics/filters/SpotLightSource.h b/WebCore/platform/graphics/filters/SpotLightSource.h
new file mode 100644
index 0000000..cd6a614
--- /dev/null
+++ b/WebCore/platform/graphics/filters/SpotLightSource.h
@@ -0,0 +1,72 @@
+/*
+ * Copyright (C) 2008 Alex Mathews <possessedpenguinbob at gmail.com>
+ * 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 SpotLightSource_h
+#define SpotLightSource_h
+
+#if ENABLE(FILTERS)
+#include "LightSource.h"
+
+namespace WebCore {
+
+class SpotLightSource : public LightSource {
+public:
+ static PassRefPtr<SpotLightSource> create(const FloatPoint3D& position,
+ const FloatPoint3D& direction, float specularExponent, float limitingConeAngle)
+ {
+ return adoptRef(new SpotLightSource(position, direction, specularExponent, limitingConeAngle));
+ }
+
+ const FloatPoint3D& position() const { return m_position; }
+ const FloatPoint3D& direction() const { return m_direction; }
+
+ float specularExponent() const { return m_specularExponent; }
+ float limitingConeAngle() const { return m_limitingConeAngle; }
+
+ virtual void initPaintingData(PaintingData&);
+ virtual void updatePaintingData(PaintingData&, int x, int y, float z);
+
+ virtual TextStream& externalRepresentation(TextStream&) const;
+
+private:
+ SpotLightSource(const FloatPoint3D& position, const FloatPoint3D& direction,
+ float specularExponent, float limitingConeAngle)
+ : LightSource(LS_SPOT)
+ , m_position(position)
+ , m_direction(direction)
+ , m_specularExponent(specularExponent)
+ , m_limitingConeAngle(limitingConeAngle)
+ {
+ }
+
+ FloatPoint3D m_position;
+ FloatPoint3D m_direction;
+
+ float m_specularExponent;
+ float m_limitingConeAngle;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(FILTERS)
+
+#endif // SpotLightSource_h
diff --git a/WebCore/svg/SVGFEConvolveMatrixElement.h b/WebCore/svg/SVGFEConvolveMatrixElement.h
index e70b768..b1fe7e2 100644
--- a/WebCore/svg/SVGFEConvolveMatrixElement.h
+++ b/WebCore/svg/SVGFEConvolveMatrixElement.h
@@ -21,7 +21,7 @@
#define SVGFEConvolveMatrixElement_h
#if ENABLE(SVG) && ENABLE(FILTERS)
-#include "SVGFEConvolveMatrix.h"
+#include "FEConvolveMatrix.h"
#include "SVGFilterPrimitiveStandardAttributes.h"
#include "SVGNumberList.h"
diff --git a/WebCore/svg/SVGFEDiffuseLightingElement.cpp b/WebCore/svg/SVGFEDiffuseLightingElement.cpp
index 4bc1bdb..d2e15f8 100644
--- a/WebCore/svg/SVGFEDiffuseLightingElement.cpp
+++ b/WebCore/svg/SVGFEDiffuseLightingElement.cpp
@@ -23,8 +23,8 @@
#include "SVGFEDiffuseLightingElement.h"
#include "Attr.h"
+#include "FEDiffuseLighting.h"
#include "SVGColor.h"
-#include "SVGFEDiffuseLighting.h"
#include "SVGFELightElement.h"
#include "SVGNames.h"
#include "SVGParserUtilities.h"
diff --git a/WebCore/svg/SVGFEDisplacementMapElement.h b/WebCore/svg/SVGFEDisplacementMapElement.h
index 239c2c7..21fd83f 100644
--- a/WebCore/svg/SVGFEDisplacementMapElement.h
+++ b/WebCore/svg/SVGFEDisplacementMapElement.h
@@ -21,7 +21,7 @@
#define SVGFEDisplacementMapElement_h
#if ENABLE(SVG) && ENABLE(FILTERS)
-#include "SVGFEDisplacementMap.h"
+#include "FEDisplacementMap.h"
#include "SVGFilterPrimitiveStandardAttributes.h"
namespace WebCore {
diff --git a/WebCore/svg/SVGFEDistantLightElement.cpp b/WebCore/svg/SVGFEDistantLightElement.cpp
index 59394d8..43a2868 100644
--- a/WebCore/svg/SVGFEDistantLightElement.cpp
+++ b/WebCore/svg/SVGFEDistantLightElement.cpp
@@ -21,7 +21,8 @@
#if ENABLE(SVG) && ENABLE(FILTERS)
#include "SVGFEDistantLightElement.h"
-#include "SVGDistantLightSource.h"
+
+#include "DistantLightSource.h"
namespace WebCore {
diff --git a/WebCore/svg/SVGFEFloodElement.h b/WebCore/svg/SVGFEFloodElement.h
index 2f7d94d..10a418f 100644
--- a/WebCore/svg/SVGFEFloodElement.h
+++ b/WebCore/svg/SVGFEFloodElement.h
@@ -22,7 +22,7 @@
#define SVGFEFloodElement_h
#if ENABLE(SVG) && ENABLE(FILTERS)
-#include "SVGFEFlood.h"
+#include "FEFlood.h"
#include "SVGFilterPrimitiveStandardAttributes.h"
namespace WebCore {
diff --git a/WebCore/svg/SVGFELightElement.h b/WebCore/svg/SVGFELightElement.h
index b86204d..d594475 100644
--- a/WebCore/svg/SVGFELightElement.h
+++ b/WebCore/svg/SVGFELightElement.h
@@ -23,8 +23,8 @@
#define SVGFELightElement_h
#if ENABLE(SVG) && ENABLE(FILTERS)
+#include "LightSource.h"
#include "SVGElement.h"
-#include "SVGLightSource.h"
#include "SVGNames.h"
namespace WebCore {
diff --git a/WebCore/svg/SVGFEMergeElement.h b/WebCore/svg/SVGFEMergeElement.h
index c07be4c..da94ac7 100644
--- a/WebCore/svg/SVGFEMergeElement.h
+++ b/WebCore/svg/SVGFEMergeElement.h
@@ -22,7 +22,7 @@
#define SVGFEMergeElement_h
#if ENABLE(SVG) && ENABLE(FILTERS)
-#include "SVGFEMerge.h"
+#include "FEMerge.h"
#include "SVGFilterPrimitiveStandardAttributes.h"
namespace WebCore {
diff --git a/WebCore/svg/SVGFEMorphologyElement.h b/WebCore/svg/SVGFEMorphologyElement.h
index 9bf26ee..c2be757 100644
--- a/WebCore/svg/SVGFEMorphologyElement.h
+++ b/WebCore/svg/SVGFEMorphologyElement.h
@@ -21,7 +21,7 @@
#define SVGFEMorphologyElement_h
#if ENABLE(SVG) && ENABLE(FILTERS)
-#include "SVGFEMorphology.h"
+#include "FEMorphology.h"
#include "SVGFilterPrimitiveStandardAttributes.h"
namespace WebCore {
diff --git a/WebCore/svg/SVGFEOffsetElement.h b/WebCore/svg/SVGFEOffsetElement.h
index e522ce2..2d522a2 100644
--- a/WebCore/svg/SVGFEOffsetElement.h
+++ b/WebCore/svg/SVGFEOffsetElement.h
@@ -22,8 +22,8 @@
#define SVGFEOffsetElement_h
#if ENABLE(SVG) && ENABLE(FILTERS)
+#include "FEOffset.h"
#include "SVGFilterPrimitiveStandardAttributes.h"
-#include "SVGFEOffset.h"
namespace WebCore {
diff --git a/WebCore/svg/SVGFEPointLightElement.cpp b/WebCore/svg/SVGFEPointLightElement.cpp
index 4436ab9..666b744 100644
--- a/WebCore/svg/SVGFEPointLightElement.cpp
+++ b/WebCore/svg/SVGFEPointLightElement.cpp
@@ -21,7 +21,8 @@
#if ENABLE(SVG) && ENABLE(FILTERS)
#include "SVGFEPointLightElement.h"
-#include "SVGPointLightSource.h"
+
+#include "PointLightSource.h"
namespace WebCore {
diff --git a/WebCore/svg/SVGFESpecularLightingElement.h b/WebCore/svg/SVGFESpecularLightingElement.h
index 1fed36f..378bc49 100644
--- a/WebCore/svg/SVGFESpecularLightingElement.h
+++ b/WebCore/svg/SVGFESpecularLightingElement.h
@@ -23,7 +23,7 @@
#define SVGFESpecularLightingElement_h
#if ENABLE(SVG) && ENABLE(FILTERS)
-#include "SVGFESpecularLighting.h"
+#include "FESpecularLighting.h"
#include "SVGFilterPrimitiveStandardAttributes.h"
namespace WebCore {
diff --git a/WebCore/svg/SVGFESpotLightElement.cpp b/WebCore/svg/SVGFESpotLightElement.cpp
index 04731f0..528cb5c 100644
--- a/WebCore/svg/SVGFESpotLightElement.cpp
+++ b/WebCore/svg/SVGFESpotLightElement.cpp
@@ -21,7 +21,8 @@
#if ENABLE(SVG) && ENABLE(FILTERS)
#include "SVGFESpotLightElement.h"
-#include "SVGSpotLightSource.h"
+
+#include "SpotLightSource.h"
namespace WebCore {
diff --git a/WebCore/svg/SVGFETileElement.h b/WebCore/svg/SVGFETileElement.h
index 03dc08d..b943c55 100644
--- a/WebCore/svg/SVGFETileElement.h
+++ b/WebCore/svg/SVGFETileElement.h
@@ -22,8 +22,8 @@
#define SVGFETileElement_h
#if ENABLE(SVG) && ENABLE(FILTERS)
+#include "FETile.h"
#include "SVGFilterPrimitiveStandardAttributes.h"
-#include "SVGFETile.h"
namespace WebCore {
diff --git a/WebCore/svg/SVGFETurbulenceElement.h b/WebCore/svg/SVGFETurbulenceElement.h
index 887aacf..20e9ed6 100644
--- a/WebCore/svg/SVGFETurbulenceElement.h
+++ b/WebCore/svg/SVGFETurbulenceElement.h
@@ -22,7 +22,7 @@
#define SVGFETurbulenceElement_h
#if ENABLE(SVG) && ENABLE(FILTERS)
-#include "SVGFETurbulence.h"
+#include "FETurbulence.h"
#include "SVGFilterPrimitiveStandardAttributes.h"
namespace WebCore {
diff --git a/WebCore/svg/graphics/filters/SVGDistantLightSource.h b/WebCore/svg/graphics/filters/SVGDistantLightSource.h
deleted file mode 100644
index 93c5f2a..0000000
--- a/WebCore/svg/graphics/filters/SVGDistantLightSource.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Copyright (C) 2008 Alex Mathews <possessedpenguinbob at gmail.com>
- * 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 SVGDistantLightSource_h
-#define SVGDistantLightSource_h
-
-#if ENABLE(SVG) && ENABLE(FILTERS)
-#include "SVGLightSource.h"
-
-namespace WebCore {
-
-class DistantLightSource : public LightSource {
-public:
- static PassRefPtr<DistantLightSource> create(float azimuth, float elevation)
- {
- return adoptRef(new DistantLightSource(azimuth, elevation));
- }
-
- float azimuth() const { return m_azimuth; }
- float elevation() const { return m_elevation; }
-
- virtual void initPaintingData(PaintingData&);
- virtual void updatePaintingData(PaintingData&, int x, int y, float z);
-
- virtual TextStream& externalRepresentation(TextStream&) const;
-
-private:
- DistantLightSource(float azimuth, float elevation)
- : LightSource(LS_DISTANT)
- , m_azimuth(azimuth)
- , m_elevation(elevation)
- {
- }
-
- float m_azimuth;
- float m_elevation;
-};
-
-} // namespace WebCore
-
-#endif // ENABLE(SVG) && ENABLE(FILTERS)
-
-#endif // SVGDistantLightSource_h
diff --git a/WebCore/svg/graphics/filters/SVGFEConvolveMatrix.cpp b/WebCore/svg/graphics/filters/SVGFEConvolveMatrix.cpp
deleted file mode 100644
index 5c0c175..0000000
--- a/WebCore/svg/graphics/filters/SVGFEConvolveMatrix.cpp
+++ /dev/null
@@ -1,471 +0,0 @@
-/*
- * 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 Zoltan Herczeg <zherczeg 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"
-
-#if ENABLE(SVG) && ENABLE(FILTERS)
-#include "SVGFEConvolveMatrix.h"
-
-#include "CanvasPixelArray.h"
-#include "Filter.h"
-#include "ImageData.h"
-
-namespace WebCore {
-
-FEConvolveMatrix::FEConvolveMatrix(const IntSize& kernelSize,
- float divisor, float bias, const IntPoint& targetOffset, EdgeModeType edgeMode,
- const FloatPoint& kernelUnitLength, bool preserveAlpha, const Vector<float>& kernelMatrix)
- : FilterEffect()
- , m_kernelSize(kernelSize)
- , m_divisor(divisor)
- , m_bias(bias)
- , m_targetOffset(targetOffset)
- , m_edgeMode(edgeMode)
- , m_kernelUnitLength(kernelUnitLength)
- , m_preserveAlpha(preserveAlpha)
- , m_kernelMatrix(kernelMatrix)
-{
-}
-
-PassRefPtr<FEConvolveMatrix> FEConvolveMatrix::create(const IntSize& kernelSize,
- float divisor, float bias, const IntPoint& targetOffset, EdgeModeType edgeMode,
- const FloatPoint& kernelUnitLength, bool preserveAlpha, const Vector<float>& kernelMatrix)
-{
- return adoptRef(new FEConvolveMatrix(kernelSize, divisor, bias, targetOffset, edgeMode, kernelUnitLength,
- preserveAlpha, kernelMatrix));
-}
-
-
-IntSize FEConvolveMatrix::kernelSize() const
-{
- return m_kernelSize;
-}
-
-void FEConvolveMatrix::setKernelSize(IntSize kernelSize)
-{
- m_kernelSize = kernelSize;
-}
-
-const Vector<float>& FEConvolveMatrix::kernel() const
-{
- return m_kernelMatrix;
-}
-
-void FEConvolveMatrix::setKernel(const Vector<float>& kernel)
-{
- m_kernelMatrix = kernel;
-}
-
-float FEConvolveMatrix::divisor() const
-{
- return m_divisor;
-}
-
-void FEConvolveMatrix::setDivisor(float divisor)
-{
- m_divisor = divisor;
-}
-
-float FEConvolveMatrix::bias() const
-{
- return m_bias;
-}
-
-void FEConvolveMatrix::setBias(float bias)
-{
- m_bias = bias;
-}
-
-IntPoint FEConvolveMatrix::targetOffset() const
-{
- return m_targetOffset;
-}
-
-void FEConvolveMatrix::setTargetOffset(IntPoint targetOffset)
-{
- m_targetOffset = targetOffset;
-}
-
-EdgeModeType FEConvolveMatrix::edgeMode() const
-{
- return m_edgeMode;
-}
-
-void FEConvolveMatrix::setEdgeMode(EdgeModeType edgeMode)
-{
- m_edgeMode = edgeMode;
-}
-
-FloatPoint FEConvolveMatrix::kernelUnitLength() const
-{
- return m_kernelUnitLength;
-}
-
-void FEConvolveMatrix::setKernelUnitLength(FloatPoint kernelUnitLength)
-{
- m_kernelUnitLength = kernelUnitLength;
-}
-
-bool FEConvolveMatrix::preserveAlpha() const
-{
- return m_preserveAlpha;
-}
-
-void FEConvolveMatrix::setPreserveAlpha(bool preserveAlpha)
-{
- m_preserveAlpha = preserveAlpha;
-}
-
-/*
- -----------------------------------
- ConvolveMatrix implementation
- -----------------------------------
-
- The image rectangle is split in the following way:
-
- +---------------------+
- | A |
- +---------------------+
- | | | |
- | B | C | D |
- | | | |
- +---------------------+
- | E |
- +---------------------+
-
- Where region C contains those pixels, whose values
- can be calculated without crossing the edge of the rectangle.
-
- Example:
- Image size: width: 10, height: 10
-
- Order (kernel matrix size): width: 3, height 4
- Target: x:1, y:3
-
- The following figure shows the target inside the kernel matrix:
-
- ...
- ...
- ...
- .X.
-
- The regions in this case are the following:
- Note: (x1, y1) top-left and (x2, y2) is the bottom-right corner
- Note: row x2 and column y2 is not part of the region
- only those (x, y) pixels, where x1 <= x < x2 and y1 <= y < y2
-
- Region A: x1: 0, y1: 0, x2: 10, y2: 3
- Region B: x1: 0, y1: 3, x2: 1, y2: 10
- Region C: x1: 1, y1: 3, x2: 9, y2: 10
- Region D: x1: 9, y1: 3, x2: 10, y2: 10
- Region E: x1: 0, y1: 10, x2: 10, y2: 10 (empty region)
-
- Since region C (often) contains most of the pixels, we implemented
- a fast algoritm to calculate these values, called fastSetInteriorPixels.
- For other regions, fastSetOuterPixels is used, which calls getPixelValue,
- to handle pixels outside of the image. In a rare situations, when
- kernel matrix is bigger than the image, all pixels are calculated by this
- function.
-
- Although these two functions have lot in common, I decided not to make
- common a template for them, since there are key differences as well,
- and would make it really hard to understand.
-*/
-
-static ALWAYS_INLINE unsigned char clampRGBAValue(float channel, unsigned char max = 255)
-{
- if (channel <= 0)
- return 0;
- if (channel >= max)
- return max;
- return channel;
-}
-
-template<bool preserveAlphaValues>
-ALWAYS_INLINE void setDestinationPixels(CanvasPixelArray* image, int& pixel, float* totals, float divisor, float bias, CanvasPixelArray* src)
-{
- unsigned char maxAlpha = preserveAlphaValues ? 255 : clampRGBAValue(totals[3] / divisor + bias);
- for (int i = 0; i < 3; ++i)
- image->set(pixel++, clampRGBAValue(totals[i] / divisor + bias, maxAlpha));
-
- if (preserveAlphaValues) {
- image->set(pixel, src->get(pixel));
- ++pixel;
- } else
- image->set(pixel++, maxAlpha);
-}
-
-// Only for region C
-template<bool preserveAlphaValues>
-ALWAYS_INLINE void FEConvolveMatrix::fastSetInteriorPixels(PaintingData& paintingData, int clipRight, int clipBottom)
-{
- // edge mode does not affect these pixels
- int pixel = (m_targetOffset.y() * paintingData.width + m_targetOffset.x()) * 4;
- int startKernelPixel = 0;
- int kernelIncrease = clipRight * 4;
- int xIncrease = (m_kernelSize.width() - 1) * 4;
- // Contains the sum of rgb(a) components
- float totals[3 + (preserveAlphaValues ? 0 : 1)];
-
- // m_divisor cannot be 0, SVGFEConvolveMatrixElement ensures this
- ASSERT(m_divisor);
-
- for (int y = clipBottom + 1; y > 0; --y) {
- for (int x = clipRight + 1; x > 0; --x) {
- int kernelValue = m_kernelMatrix.size() - 1;
- int kernelPixel = startKernelPixel;
- int width = m_kernelSize.width();
-
- totals[0] = 0;
- totals[1] = 0;
- totals[2] = 0;
- if (!preserveAlphaValues)
- totals[3] = 0;
-
- while (kernelValue >= 0) {
- totals[0] += m_kernelMatrix[kernelValue] * static_cast<float>(paintingData.srcPixelArray->get(kernelPixel++));
- totals[1] += m_kernelMatrix[kernelValue] * static_cast<float>(paintingData.srcPixelArray->get(kernelPixel++));
- totals[2] += m_kernelMatrix[kernelValue] * static_cast<float>(paintingData.srcPixelArray->get(kernelPixel++));
- if (!preserveAlphaValues)
- totals[3] += m_kernelMatrix[kernelValue] * static_cast<float>(paintingData.srcPixelArray->get(kernelPixel));
- ++kernelPixel;
- --kernelValue;
- if (!--width) {
- kernelPixel += kernelIncrease;
- width = m_kernelSize.width();
- }
- }
-
- setDestinationPixels<preserveAlphaValues>(paintingData.dstPixelArray, pixel, totals, m_divisor, paintingData.bias, paintingData.srcPixelArray);
- startKernelPixel += 4;
- }
- pixel += xIncrease;
- startKernelPixel += xIncrease;
- }
-}
-
-ALWAYS_INLINE int FEConvolveMatrix::getPixelValue(PaintingData& paintingData, int x, int y)
-{
- if (x >= 0 && x < paintingData.width && x >= 0 && y < paintingData.height)
- return (y * paintingData.width + x) << 2;
-
- switch (m_edgeMode) {
- default: // EDGEMODE_NONE
- return -1;
- case EDGEMODE_DUPLICATE:
- if (x < 0)
- x = 0;
- else if (x >= paintingData.width)
- x = paintingData.width - 1;
- if (y < 0)
- y = 0;
- else if (y >= paintingData.height)
- y = paintingData.height - 1;
- return (y * paintingData.width + x) << 2;
- case EDGEMODE_WRAP:
- while (x < 0)
- x += paintingData.width;
- x %= paintingData.width;
- while (y < 0)
- y += paintingData.height;
- y %= paintingData.height;
- return (y * paintingData.width + x) << 2;
- }
-}
-
-// For other regions than C
-template<bool preserveAlphaValues>
-void FEConvolveMatrix::fastSetOuterPixels(PaintingData& paintingData, int x1, int y1, int x2, int y2)
-{
- int pixel = (y1 * paintingData.width + x1) * 4;
- int height = y2 - y1;
- int width = x2 - x1;
- int beginKernelPixelX = x1 - m_targetOffset.x();
- int startKernelPixelX = beginKernelPixelX;
- int startKernelPixelY = y1 - m_targetOffset.y();
- int xIncrease = (paintingData.width - width) * 4;
- // Contains the sum of rgb(a) components
- float totals[3 + (preserveAlphaValues ? 0 : 1)];
-
- // m_divisor cannot be 0, SVGFEConvolveMatrixElement ensures this
- ASSERT(m_divisor);
-
- for (int y = height; y > 0; --y) {
- for (int x = width; x > 0; --x) {
- int kernelValue = m_kernelMatrix.size() - 1;
- int kernelPixelX = startKernelPixelX;
- int kernelPixelY = startKernelPixelY;
- int width = m_kernelSize.width();
-
- totals[0] = 0;
- totals[1] = 0;
- totals[2] = 0;
- if (!preserveAlphaValues)
- totals[3] = 0;
-
- while (kernelValue >= 0) {
- int pixelIndex = getPixelValue(paintingData, kernelPixelX, kernelPixelY);
- if (pixelIndex >= 0) {
- totals[0] += m_kernelMatrix[kernelValue] * static_cast<float>(paintingData.srcPixelArray->get(pixelIndex));
- totals[1] += m_kernelMatrix[kernelValue] * static_cast<float>(paintingData.srcPixelArray->get(pixelIndex + 1));
- totals[2] += m_kernelMatrix[kernelValue] * static_cast<float>(paintingData.srcPixelArray->get(pixelIndex + 2));
- }
- if (!preserveAlphaValues && pixelIndex >= 0)
- totals[3] += m_kernelMatrix[kernelValue] * static_cast<float>(paintingData.srcPixelArray->get(pixelIndex + 3));
- ++kernelPixelX;
- --kernelValue;
- if (!--width) {
- kernelPixelX = startKernelPixelX;
- ++kernelPixelY;
- width = m_kernelSize.width();
- }
- }
-
- setDestinationPixels<preserveAlphaValues>(paintingData.dstPixelArray, pixel, totals, m_divisor, paintingData.bias, paintingData.srcPixelArray);
- ++startKernelPixelX;
- }
- pixel += xIncrease;
- startKernelPixelX = beginKernelPixelX;
- ++startKernelPixelY;
- }
-}
-
-ALWAYS_INLINE void FEConvolveMatrix::setInteriorPixels(PaintingData& paintingData, int clipRight, int clipBottom)
-{
- // Must be implemented here, since it refers another ALWAYS_INLINE
- // function, which defined in this C++ source file as well
- if (m_preserveAlpha)
- fastSetInteriorPixels<true>(paintingData, clipRight, clipBottom);
- else
- fastSetInteriorPixels<false>(paintingData, clipRight, clipBottom);
-}
-
-ALWAYS_INLINE void FEConvolveMatrix::setOuterPixels(PaintingData& paintingData, int x1, int y1, int x2, int y2)
-{
- // Although this function can be moved to the header, it is implemented here
- // because setInteriorPixels is also implemented here
- if (m_preserveAlpha)
- fastSetOuterPixels<true>(paintingData, x1, y1, x2, y2);
- else
- fastSetOuterPixels<false>(paintingData, x1, y1, x2, y2);
-}
-
-void FEConvolveMatrix::apply(Filter* filter)
-{
- FilterEffect* in = inputEffect(0);
- in->apply(filter);
- if (!in->resultImage())
- return;
-
- if (!effectContext())
- return;
-
- IntRect imageRect(IntPoint(), resultImage()->size());
- IntRect effectDrawingRect = requestedRegionOfInputImageData(in->filterPrimitiveSubregion());
-
- RefPtr<CanvasPixelArray> srcPixelArray;
- if (m_preserveAlpha)
- srcPixelArray = in->resultImage()->getUnmultipliedImageData(effectDrawingRect)->data();
- else
- srcPixelArray = in->resultImage()->getPremultipliedImageData(effectDrawingRect)->data();
-
- RefPtr<ImageData> imageData = ImageData::create(imageRect.width(), imageRect.height());
-
- PaintingData paintingData;
- paintingData.srcPixelArray = srcPixelArray.get();
- paintingData.dstPixelArray = imageData->data();
- paintingData.width = imageRect.width();
- paintingData.height = imageRect.height();
- paintingData.bias = m_bias * 255;
-
- // Drawing fully covered pixels
- int clipRight = imageRect.width() - m_kernelSize.width();
- int clipBottom = imageRect.height() - m_kernelSize.height();
-
- if (clipRight >= 0 && clipBottom >= 0) {
- setInteriorPixels(paintingData, clipRight, clipBottom);
-
- clipRight += m_targetOffset.x() + 1;
- clipBottom += m_targetOffset.y() + 1;
- if (m_targetOffset.y() > 0)
- setOuterPixels(paintingData, 0, 0, imageRect.width(), m_targetOffset.y());
- if (clipBottom < imageRect.height())
- setOuterPixels(paintingData, 0, clipBottom, imageRect.width(), imageRect.height());
- if (m_targetOffset.x() > 0)
- setOuterPixels(paintingData, 0, m_targetOffset.y(), m_targetOffset.x(), clipBottom);
- if (clipRight < imageRect.width())
- setOuterPixels(paintingData, clipRight, m_targetOffset.y(), imageRect.width(), clipBottom);
- } else {
- // Rare situation, not optimizied for speed
- setOuterPixels(paintingData, 0, 0, imageRect.width(), imageRect.height());
- }
-
- if (m_preserveAlpha)
- resultImage()->putUnmultipliedImageData(imageData.get(), imageRect, IntPoint());
- else
- resultImage()->putPremultipliedImageData(imageData.get(), imageRect, IntPoint());
-}
-
-void FEConvolveMatrix::dump()
-{
-}
-
-static TextStream& operator<<(TextStream& ts, const EdgeModeType& type)
-{
- switch (type) {
- case EDGEMODE_UNKNOWN:
- ts << "UNKNOWN";
- break;
- case EDGEMODE_DUPLICATE:
- ts << "DUPLICATE";
- break;
- case EDGEMODE_WRAP:
- ts << "WRAP";
- break;
- case EDGEMODE_NONE:
- ts << "NONE";
- break;
- }
- return ts;
-}
-
-TextStream& FEConvolveMatrix::externalRepresentation(TextStream& ts, int indent) const
-{
- writeIndent(ts, indent);
- ts << "[feConvolveMatrix";
- FilterEffect::externalRepresentation(ts);
- ts << " order=\"" << m_kernelSize << "\" "
- << "kernelMatrix=\"" << m_kernelMatrix << "\" "
- << "divisor=\"" << m_divisor << "\" "
- << "bias=\"" << m_bias << "\" "
- << "target=\"" << m_targetOffset << "\" "
- << "edgeMode=\"" << m_edgeMode << "\" "
- << "kernelUnitLength=\"" << m_kernelUnitLength << "\" "
- << "preserveAlpha=\"" << m_preserveAlpha << "\"]\n";
- inputEffect(0)->externalRepresentation(ts, indent + 1);
- return ts;
-}
-
-}; // namespace WebCore
-
-#endif // ENABLE(SVG) && ENABLE(FILTERS)
diff --git a/WebCore/svg/graphics/filters/SVGFEConvolveMatrix.h b/WebCore/svg/graphics/filters/SVGFEConvolveMatrix.h
deleted file mode 100644
index 04dd59c..0000000
--- a/WebCore/svg/graphics/filters/SVGFEConvolveMatrix.h
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * 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) 2010 Zoltan Herczeg <zherczeg 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 SVGFEConvolveMatrix_h
-#define SVGFEConvolveMatrix_h
-
-#if ENABLE(SVG) && ENABLE(FILTERS)
-#include "FilterEffect.h"
-#include "FloatPoint.h"
-#include "FloatSize.h"
-#include "Filter.h"
-#include <wtf/AlwaysInline.h>
-#include <wtf/Vector.h>
-
-namespace WebCore {
-
-enum EdgeModeType {
- EDGEMODE_UNKNOWN = 0,
- EDGEMODE_DUPLICATE = 1,
- EDGEMODE_WRAP = 2,
- EDGEMODE_NONE = 3
-};
-
-class CanvasPixelArray;
-
-class FEConvolveMatrix : public FilterEffect {
-public:
- static PassRefPtr<FEConvolveMatrix> create(const IntSize&,
- float, float, const IntPoint&, EdgeModeType, const FloatPoint&,
- bool, const Vector<float>&);
-
- IntSize kernelSize() const;
- void setKernelSize(IntSize);
-
- const Vector<float>& kernel() const;
- void setKernel(const Vector<float>&);
-
- float divisor() const;
- void setDivisor(float);
-
- float bias() const;
- void setBias(float);
-
- IntPoint targetOffset() const;
- void setTargetOffset(IntPoint);
-
- EdgeModeType edgeMode() const;
- void setEdgeMode(EdgeModeType);
-
- FloatPoint kernelUnitLength() const;
- void setKernelUnitLength(FloatPoint);
-
- bool preserveAlpha() const;
- void setPreserveAlpha(bool);
-
- virtual void apply(Filter*);
- virtual void dump();
-
- virtual TextStream& externalRepresentation(TextStream&, int indention) const;
-
-private:
- FEConvolveMatrix(const IntSize&, float, float,
- const IntPoint&, EdgeModeType, const FloatPoint&, bool, const Vector<float>&);
-
- struct PaintingData {
- CanvasPixelArray* srcPixelArray;
- CanvasPixelArray* dstPixelArray;
- int width;
- int height;
- float bias;
- };
-
- template<bool preserveAlphaValues>
- ALWAYS_INLINE void fastSetInteriorPixels(PaintingData&, int clipRight, int clipBottom);
-
- ALWAYS_INLINE int getPixelValue(PaintingData&, int x, int y);
-
- template<bool preserveAlphaValues>
- void fastSetOuterPixels(PaintingData&, int x1, int y1, int x2, int y2);
-
- // Wrapper functions
- ALWAYS_INLINE void setInteriorPixels(PaintingData& paintingData, int clipRight, int clipBottom);
- ALWAYS_INLINE void setOuterPixels(PaintingData& paintingData, int x1, int y1, int x2, int y2);
-
- IntSize m_kernelSize;
- float m_divisor;
- float m_bias;
- IntPoint m_targetOffset;
- EdgeModeType m_edgeMode;
- FloatPoint m_kernelUnitLength;
- bool m_preserveAlpha;
- Vector<float> m_kernelMatrix;
-};
-
-} // namespace WebCore
-
-#endif // ENABLE(SVG) && ENABLE(FILTERS)
-
-#endif // SVGFEConvolveMatrix_h
diff --git a/WebCore/svg/graphics/filters/SVGFEDiffuseLighting.cpp b/WebCore/svg/graphics/filters/SVGFEDiffuseLighting.cpp
deleted file mode 100644
index 0d6f04f..0000000
--- a/WebCore/svg/graphics/filters/SVGFEDiffuseLighting.cpp
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- * 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.
- */
-
-#include "config.h"
-
-#if ENABLE(SVG) && ENABLE(FILTERS)
-#include "SVGFEDiffuseLighting.h"
-
-#include "SVGLightSource.h"
-
-namespace WebCore {
-
-FEDiffuseLighting::FEDiffuseLighting(const Color& lightingColor, float surfaceScale,
- float diffuseConstant, float kernelUnitLengthX, float kernelUnitLengthY, PassRefPtr<LightSource> lightSource)
- : FELighting(DiffuseLighting, lightingColor, surfaceScale, diffuseConstant, 0, 0, kernelUnitLengthX, kernelUnitLengthY, lightSource)
-{
-}
-
-PassRefPtr<FEDiffuseLighting> FEDiffuseLighting::create(const Color& lightingColor,
- float surfaceScale, float diffuseConstant, float kernelUnitLengthX,
- float kernelUnitLengthY, PassRefPtr<LightSource> lightSource)
-{
- return adoptRef(new FEDiffuseLighting(lightingColor, surfaceScale, diffuseConstant, kernelUnitLengthX, kernelUnitLengthY, lightSource));
-}
-
-FEDiffuseLighting::~FEDiffuseLighting()
-{
-}
-
-Color FEDiffuseLighting::lightingColor() const
-{
- return m_lightingColor;
-}
-
-void FEDiffuseLighting::setLightingColor(const Color& lightingColor)
-{
- m_lightingColor = lightingColor;
-}
-
-float FEDiffuseLighting::surfaceScale() const
-{
- return m_surfaceScale;
-}
-
-void FEDiffuseLighting::setSurfaceScale(float surfaceScale)
-{
- m_surfaceScale = surfaceScale;
-}
-
-float FEDiffuseLighting::diffuseConstant() const
-{
- return m_diffuseConstant;
-}
-
-void FEDiffuseLighting::setDiffuseConstant(float diffuseConstant)
-{
- m_diffuseConstant = diffuseConstant;
-}
-
-float FEDiffuseLighting::kernelUnitLengthX() const
-{
- return m_kernelUnitLengthX;
-}
-
-void FEDiffuseLighting::setKernelUnitLengthX(float kernelUnitLengthX)
-{
- m_kernelUnitLengthX = kernelUnitLengthX;
-}
-
-float FEDiffuseLighting::kernelUnitLengthY() const
-{
- return m_kernelUnitLengthY;
-}
-
-void FEDiffuseLighting::setKernelUnitLengthY(float kernelUnitLengthY)
-{
- m_kernelUnitLengthY = kernelUnitLengthY;
-}
-
-const LightSource* FEDiffuseLighting::lightSource() const
-{
- return m_lightSource.get();
-}
-
-void FEDiffuseLighting::setLightSource(PassRefPtr<LightSource> lightSource)
-{
- m_lightSource = lightSource;
-}
-
-void FEDiffuseLighting::dump()
-{
-}
-
-TextStream& FEDiffuseLighting::externalRepresentation(TextStream& ts, int indent) const
-{
- writeIndent(ts, indent);
- ts << "[feDiffuseLighting";
- FilterEffect::externalRepresentation(ts);
- ts << " surfaceScale=\"" << m_surfaceScale << "\" "
- << "diffuseConstant=\"" << m_diffuseConstant << "\" "
- << "kernelUnitLength=\"" << m_kernelUnitLengthX << ", " << m_kernelUnitLengthY << "\"]\n";
- inputEffect(0)->externalRepresentation(ts, indent + 1);
- return ts;
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(SVG) && ENABLE(FILTERS)
diff --git a/WebCore/svg/graphics/filters/SVGFEDiffuseLighting.h b/WebCore/svg/graphics/filters/SVGFEDiffuseLighting.h
deleted file mode 100644
index 90db35d..0000000
--- a/WebCore/svg/graphics/filters/SVGFEDiffuseLighting.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * 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 SVGFEDiffuseLighting_h
-#define SVGFEDiffuseLighting_h
-
-#if ENABLE(SVG) && ENABLE(FILTERS)
-#include "SVGFELighting.h"
-
-namespace WebCore {
-
-class LightSource;
-
-class FEDiffuseLighting : public FELighting {
-public:
- static PassRefPtr<FEDiffuseLighting> create(const Color&, float, float,
- float, float, PassRefPtr<LightSource>);
- virtual ~FEDiffuseLighting();
-
- Color lightingColor() const;
- void setLightingColor(const Color&);
-
- float surfaceScale() const;
- void setSurfaceScale(float);
-
- float diffuseConstant() const;
- void setDiffuseConstant(float);
-
- float kernelUnitLengthX() const;
- void setKernelUnitLengthX(float);
-
- float kernelUnitLengthY() const;
- void setKernelUnitLengthY(float);
-
- const LightSource* lightSource() const;
- void setLightSource(PassRefPtr<LightSource>);
-
- virtual void dump();
-
- virtual TextStream& externalRepresentation(TextStream&, int indention) const;
-
-private:
- FEDiffuseLighting(const Color&, float, float, float, float, PassRefPtr<LightSource>);
-};
-
-} // namespace WebCore
-
-#endif // ENABLE(SVG) && ENABLE(FILTERS)
-
-#endif // SVGFEDiffuseLighting_h
diff --git a/WebCore/svg/graphics/filters/SVGFEDisplacementMap.cpp b/WebCore/svg/graphics/filters/SVGFEDisplacementMap.cpp
deleted file mode 100644
index 202e37f..0000000
--- a/WebCore/svg/graphics/filters/SVGFEDisplacementMap.cpp
+++ /dev/null
@@ -1,171 +0,0 @@
-/*
- * 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"
-
-#if ENABLE(SVG) && ENABLE(FILTERS)
-#include "SVGFEDisplacementMap.h"
-
-#include "CanvasPixelArray.h"
-#include "Filter.h"
-#include "GraphicsContext.h"
-#include "ImageData.h"
-
-namespace WebCore {
-
-FEDisplacementMap::FEDisplacementMap(ChannelSelectorType xChannelSelector, ChannelSelectorType yChannelSelector, float scale)
- : FilterEffect()
- , m_xChannelSelector(xChannelSelector)
- , m_yChannelSelector(yChannelSelector)
- , m_scale(scale)
-{
-}
-
-PassRefPtr<FEDisplacementMap> FEDisplacementMap::create(ChannelSelectorType xChannelSelector,
- ChannelSelectorType yChannelSelector, float scale)
-{
- return adoptRef(new FEDisplacementMap(xChannelSelector, yChannelSelector, scale));
-}
-
-ChannelSelectorType FEDisplacementMap::xChannelSelector() const
-{
- return m_xChannelSelector;
-}
-
-void FEDisplacementMap::setXChannelSelector(const ChannelSelectorType xChannelSelector)
-{
- m_xChannelSelector = xChannelSelector;
-}
-
-ChannelSelectorType FEDisplacementMap::yChannelSelector() const
-{
- return m_yChannelSelector;
-}
-
-void FEDisplacementMap::setYChannelSelector(const ChannelSelectorType yChannelSelector)
-{
- m_yChannelSelector = yChannelSelector;
-}
-
-float FEDisplacementMap::scale() const
-{
- return m_scale;
-}
-
-void FEDisplacementMap::setScale(float scale)
-{
- m_scale = scale;
-}
-
-void FEDisplacementMap::apply(Filter* filter)
-{
- FilterEffect* in = inputEffect(0);
- FilterEffect* in2 = inputEffect(1);
- in->apply(filter);
- in2->apply(filter);
- if (!in->resultImage() || !in2->resultImage())
- return;
-
- if (m_xChannelSelector == CHANNEL_UNKNOWN || m_yChannelSelector == CHANNEL_UNKNOWN)
- return;
-
- if (!effectContext())
- return;
-
- IntRect effectADrawingRect = requestedRegionOfInputImageData(in->repaintRectInLocalCoordinates());
- RefPtr<CanvasPixelArray> srcPixelArrayA(in->resultImage()->getPremultipliedImageData(effectADrawingRect)->data());
-
- IntRect effectBDrawingRect = requestedRegionOfInputImageData(in2->repaintRectInLocalCoordinates());
- RefPtr<CanvasPixelArray> srcPixelArrayB(in2->resultImage()->getUnmultipliedImageData(effectBDrawingRect)->data());
-
- IntRect imageRect(IntPoint(), resultImage()->size());
- RefPtr<ImageData> imageData = ImageData::create(imageRect.width(), imageRect.height());
-
- ASSERT(srcPixelArrayA->length() == srcPixelArrayB->length());
-
- float scaleX = m_scale / 255.f * filter->filterResolution().width();
- float scaleY = m_scale / 255.f * filter->filterResolution().height();
- float scaleAdjustmentX = (0.5f - 0.5f * m_scale) * filter->filterResolution().width();
- float scaleAdjustmentY = (0.5f - 0.5f * m_scale) * filter->filterResolution().height();
- int stride = imageRect.width() * 4;
- for (int y = 0; y < imageRect.height(); ++y) {
- int line = y * stride;
- for (int x = 0; x < imageRect.width(); ++x) {
- int dstIndex = line + x * 4;
- int srcX = x + static_cast<int>(scaleX * srcPixelArrayB->get(dstIndex + m_xChannelSelector - 1) + scaleAdjustmentX);
- int srcY = y + static_cast<int>(scaleY * srcPixelArrayB->get(dstIndex + m_yChannelSelector - 1) + scaleAdjustmentY);
- for (unsigned channel = 0; channel < 4; ++channel) {
- if (srcX < 0 || srcX >= imageRect.width() || srcY < 0 || srcY >= imageRect.height())
- imageData->data()->set(dstIndex + channel, static_cast<unsigned char>(0));
- else {
- unsigned char pixelValue = srcPixelArrayA->get(srcY * stride + srcX * 4 + channel);
- imageData->data()->set(dstIndex + channel, pixelValue);
- }
- }
-
- }
- }
- resultImage()->putPremultipliedImageData(imageData.get(), imageRect, IntPoint());
-}
-
-void FEDisplacementMap::dump()
-{
-}
-
-static TextStream& operator<<(TextStream& ts, const ChannelSelectorType& type)
-{
- switch (type) {
- case CHANNEL_UNKNOWN:
- ts << "UNKNOWN";
- break;
- case CHANNEL_R:
- ts << "RED";
- break;
- case CHANNEL_G:
- ts << "GREEN";
- break;
- case CHANNEL_B:
- ts << "BLUE";
- break;
- case CHANNEL_A:
- ts << "ALPHA";
- break;
- }
- return ts;
-}
-
-TextStream& FEDisplacementMap::externalRepresentation(TextStream& ts, int indent) const
-{
- writeIndent(ts, indent);
- ts << "[feDisplacementMap";
- FilterEffect::externalRepresentation(ts);
- ts << " scale=\"" << m_scale << "\" "
- << "xChannelSelector=\"" << m_xChannelSelector << "\" "
- << "yChannelSelector=\"" << m_yChannelSelector << "\"]\n";
- inputEffect(0)->externalRepresentation(ts, indent + 1);
- inputEffect(1)->externalRepresentation(ts, indent + 1);
- return ts;
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(SVG) && ENABLE(FILTERS)
diff --git a/WebCore/svg/graphics/filters/SVGFEDisplacementMap.h b/WebCore/svg/graphics/filters/SVGFEDisplacementMap.h
deleted file mode 100644
index d99677f..0000000
--- a/WebCore/svg/graphics/filters/SVGFEDisplacementMap.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * 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 SVGFEDisplacementMap_h
-#define SVGFEDisplacementMap_h
-
-#if ENABLE(SVG) && ENABLE(FILTERS)
-#include "PlatformString.h"
-#include "FilterEffect.h"
-#include "Filter.h"
-
-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 xChannelSelector, ChannelSelectorType yChannelSelector, float);
-
- ChannelSelectorType xChannelSelector() const;
- void setXChannelSelector(const ChannelSelectorType);
-
- ChannelSelectorType yChannelSelector() const;
- void setYChannelSelector(const ChannelSelectorType);
-
- float scale() const;
- void setScale(float scale);
-
- virtual void apply(Filter*);
- virtual void dump();
-
- 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
-
-#endif // ENABLE(SVG) && ENABLE(FILTERS)
-
-#endif // SVGFEDisplacementMap_h
diff --git a/WebCore/svg/graphics/filters/SVGFEFlood.cpp b/WebCore/svg/graphics/filters/SVGFEFlood.cpp
deleted file mode 100644
index e538304..0000000
--- a/WebCore/svg/graphics/filters/SVGFEFlood.cpp
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * 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"
-
-#if ENABLE(SVG) && ENABLE(FILTERS)
-#include "SVGFEFlood.h"
-
-#include "Filter.h"
-#include "GraphicsContext.h"
-
-namespace WebCore {
-
-FEFlood::FEFlood(const Color& floodColor, float floodOpacity)
- : FilterEffect()
- , m_floodColor(floodColor)
- , m_floodOpacity(floodOpacity)
-{
-}
-
-PassRefPtr<FEFlood> FEFlood::create(const Color& floodColor, float floodOpacity)
-{
- return adoptRef(new FEFlood(floodColor, floodOpacity));
-}
-
-Color FEFlood::floodColor() const
-{
- return m_floodColor;
-}
-
-void FEFlood::setFloodColor(const Color& color)
-{
- m_floodColor = color;
-}
-
-float FEFlood::floodOpacity() const
-{
- return m_floodOpacity;
-}
-
-void FEFlood::setFloodOpacity(float floodOpacity)
-{
- m_floodOpacity = floodOpacity;
-}
-
-void FEFlood::apply(Filter*)
-{
- GraphicsContext* filterContext = effectContext();
- if (!filterContext)
- return;
-
- Color color = colorWithOverrideAlpha(floodColor().rgb(), floodOpacity());
- filterContext->fillRect(FloatRect(FloatPoint(), repaintRectInLocalCoordinates().size()), color, DeviceColorSpace);
-}
-
-void FEFlood::dump()
-{
-}
-
-TextStream& FEFlood::externalRepresentation(TextStream& ts, int indent) const
-{
- writeIndent(ts, indent);
- ts << "[feFlood";
- FilterEffect::externalRepresentation(ts);
- ts << " flood-color=\"" << floodColor().name() << "\" "
- << "flood-opacity=\"" << floodOpacity() << "\"]\n";
- return ts;
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(SVG) && ENABLE(FILTERS)
diff --git a/WebCore/svg/graphics/filters/SVGFEFlood.h b/WebCore/svg/graphics/filters/SVGFEFlood.h
deleted file mode 100644
index e81506d..0000000
--- a/WebCore/svg/graphics/filters/SVGFEFlood.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * 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 SVGFEFlood_h
-#define SVGFEFlood_h
-
-#if ENABLE(SVG) && ENABLE(FILTERS)
-#include "Color.h"
-#include "Filter.h"
-#include "FilterEffect.h"
-
-namespace WebCore {
-
-class FEFlood : public FilterEffect {
-public:
- static PassRefPtr<FEFlood> create(const Color&, float);
-
- Color floodColor() const;
- void setFloodColor(const Color &);
-
- float floodOpacity() const;
- void setFloodOpacity(float);
-
- virtual void apply(Filter*);
- virtual void dump();
-
- virtual TextStream& externalRepresentation(TextStream&, int indention) const;
-
-private:
- FEFlood(const Color&, float);
-
- Color m_floodColor;
- float m_floodOpacity;
-};
-
-} // namespace WebCore
-
-#endif // ENABLE(SVG) && ENABLE(FILTERS)
-
-#endif // SVGFEFlood_h
diff --git a/WebCore/svg/graphics/filters/SVGFELighting.cpp b/WebCore/svg/graphics/filters/SVGFELighting.cpp
deleted file mode 100644
index 369889f..0000000
--- a/WebCore/svg/graphics/filters/SVGFELighting.cpp
+++ /dev/null
@@ -1,270 +0,0 @@
-/*
- * Copyright (C) 2010 University of Szeged
- * Copyright (C) 2010 Zoltan Herczeg
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY UNIVERSITY OF SZEGED ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL UNIVERSITY OF SZEGED OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-
-#if ENABLE(SVG) && ENABLE(FILTERS)
-#include "SVGFELighting.h"
-
-#include "CanvasPixelArray.h"
-#include "ImageData.h"
-#include "SVGLightSource.h"
-
-namespace WebCore {
-
-FELighting::FELighting(LightingType lightingType, const Color& lightingColor, float surfaceScale,
- float diffuseConstant, float specularConstant, float specularExponent,
- float kernelUnitLengthX, float kernelUnitLengthY, PassRefPtr<LightSource> lightSource)
- : FilterEffect()
- , m_lightingType(lightingType)
- , m_lightSource(lightSource)
- , m_lightingColor(lightingColor)
- , m_surfaceScale(surfaceScale)
- , m_diffuseConstant(diffuseConstant)
- , m_specularConstant(specularConstant)
- , m_specularExponent(specularExponent)
- , m_kernelUnitLengthX(kernelUnitLengthX)
- , m_kernelUnitLengthY(kernelUnitLengthY)
-{
-}
-
-const static int cPixelSize = 4;
-const static int cAlphaChannelOffset = 3;
-const static unsigned char cOpaqueAlpha = static_cast<unsigned char>(0xff);
-
-ALWAYS_INLINE int FELighting::LightingData::upLeftPixelValue()
-{
- return static_cast<int>(pixels->get(offset - widthMultipliedByPixelSize - cPixelSize + cAlphaChannelOffset));
-}
-
-ALWAYS_INLINE int FELighting::LightingData::upPixelValue()
-{
- return static_cast<int>(pixels->get(offset - widthMultipliedByPixelSize + cAlphaChannelOffset));
-}
-
-ALWAYS_INLINE int FELighting::LightingData::upRightPixelValue()
-{
- return static_cast<int>(pixels->get(offset - widthMultipliedByPixelSize + cPixelSize + cAlphaChannelOffset));
-}
-
-ALWAYS_INLINE int FELighting::LightingData::leftPixelValue()
-{
- return static_cast<int>(pixels->get(offset - cPixelSize + cAlphaChannelOffset));
-}
-
-ALWAYS_INLINE int FELighting::LightingData::centerPixelValue()
-{
- return static_cast<int>(pixels->get(offset + cAlphaChannelOffset));
-}
-
-ALWAYS_INLINE int FELighting::LightingData::rightPixelValue()
-{
- return static_cast<int>(pixels->get(offset + cPixelSize + cAlphaChannelOffset));
-}
-
-ALWAYS_INLINE int FELighting::LightingData::downLeftPixelValue()
-{
- return static_cast<int>(pixels->get(offset + widthMultipliedByPixelSize - cPixelSize + cAlphaChannelOffset));
-}
-
-ALWAYS_INLINE int FELighting::LightingData::downPixelValue()
-{
- return static_cast<int>(pixels->get(offset + widthMultipliedByPixelSize + cAlphaChannelOffset));
-}
-
-ALWAYS_INLINE int FELighting::LightingData::downRightPixelValue()
-{
- return static_cast<int>(pixels->get(offset + widthMultipliedByPixelSize + cPixelSize + cAlphaChannelOffset));
-}
-
-ALWAYS_INLINE void FELighting::setPixel(LightingData& data, LightSource::PaintingData& paintingData,
- int lightX, int lightY, float factorX, int normalX, float factorY, int normalY)
-{
- m_lightSource->updatePaintingData(paintingData, lightX, lightY, static_cast<float>(data.pixels->get(data.offset + 3)) * data.surfaceScale);
-
- data.normalVector.setX(factorX * static_cast<float>(normalX) * data.surfaceScale);
- data.normalVector.setY(factorY * static_cast<float>(normalY) * data.surfaceScale);
- data.normalVector.setZ(1.0f);
- data.normalVector.normalize();
-
- if (m_lightingType == FELighting::DiffuseLighting)
- data.lightStrength = m_diffuseConstant * (data.normalVector * paintingData.lightVector);
- else {
- FloatPoint3D halfwayVector = paintingData.lightVector;
- halfwayVector.setZ(halfwayVector.z() + 1.0f);
- halfwayVector.normalize();
- if (m_specularExponent == 1.0f)
- data.lightStrength = m_specularConstant * (data.normalVector * halfwayVector);
- else
- data.lightStrength = m_specularConstant * powf(data.normalVector * halfwayVector, m_specularExponent);
- }
-
- if (data.lightStrength > 1.0f)
- data.lightStrength = 1.0f;
- if (data.lightStrength < 0.0f)
- data.lightStrength = 0.0f;
-
- data.pixels->set(data.offset, static_cast<unsigned char>(data.lightStrength * paintingData.colorVector.x()));
- data.pixels->set(data.offset + 1, static_cast<unsigned char>(data.lightStrength * paintingData.colorVector.y()));
- data.pixels->set(data.offset + 2, static_cast<unsigned char>(data.lightStrength * paintingData.colorVector.z()));
-}
-
-bool FELighting::drawLighting(CanvasPixelArray* pixels, int width, int height)
-{
- LightSource::PaintingData paintingData;
- LightingData data;
-
- if (!m_lightSource)
- return false;
-
- // FIXME: do something if width or height (or both) is 1 pixel.
- // The W3 spec does not define this case. Now the filter just returns.
- if (width <= 2 || height <= 2)
- return false;
-
- data.pixels = pixels;
- data.surfaceScale = m_surfaceScale / 255.0f;
- data.widthMultipliedByPixelSize = width * cPixelSize;
- data.widthDecreasedByOne = width - 1;
- data.heightDecreasedByOne = height - 1;
- paintingData.colorVector = FloatPoint3D(m_lightingColor.red(), m_lightingColor.green(), m_lightingColor.blue());
- m_lightSource->initPaintingData(paintingData);
-
- // Top/Left corner
- data.offset = 0;
- setPixel(data, paintingData, 0, 0,
- -2.0f / 3.0f, -2 * data.centerPixelValue() + 2 * data.rightPixelValue() - data.downPixelValue() + data.downRightPixelValue(),
- -2.0f / 3.0f, -2 * data.centerPixelValue() - data.rightPixelValue() + 2 * data.downPixelValue() + data.downRightPixelValue());
-
- // Top/Right pixel
- data.offset = data.widthMultipliedByPixelSize - cPixelSize;
- setPixel(data, paintingData, data.widthDecreasedByOne, 0,
- -2.0f / 3.0f, -2 * data.leftPixelValue() + 2 * data.centerPixelValue() - data.downLeftPixelValue() + data.downPixelValue(),
- -2.0f / 3.0f, -data.leftPixelValue() - 2 * data.centerPixelValue() + data.downLeftPixelValue() + 2 * data.downPixelValue());
-
- // Bottom/Left pixel
- data.offset = data.heightDecreasedByOne * data.widthMultipliedByPixelSize;
- setPixel(data, paintingData, 0, data.heightDecreasedByOne,
- -2.0f / 3.0f, -data.upPixelValue() + data.upRightPixelValue() - 2 * data.centerPixelValue() + 2 * data.rightPixelValue(),
- -2.0f / 3.0f, -2 * data.upPixelValue() - data.upRightPixelValue() + 2 * data.centerPixelValue() + data.rightPixelValue());
-
- // Bottom/Right pixel
- data.offset = height * data.widthMultipliedByPixelSize - cPixelSize;
- setPixel(data, paintingData, data.widthDecreasedByOne, data.heightDecreasedByOne,
- -2.0f / 3.0f, -data.upLeftPixelValue() + data.upPixelValue() - 2 * data.leftPixelValue() + 2 * data.centerPixelValue(),
- -2.0f / 3.0f, -data.upLeftPixelValue() - 2 * data.upPixelValue() + data.leftPixelValue() + 2 * data.centerPixelValue());
-
- if (width >= 3) {
- // Top line
- data.offset = cPixelSize;
- for (int x = 1; x < data.widthDecreasedByOne; ++x, data.offset += cPixelSize) {
- setPixel(data, paintingData, x, 0,
- -1.0f / 3.0f, -2 * data.leftPixelValue() + 2 * data.rightPixelValue() - data.downLeftPixelValue() + data.downRightPixelValue(),
- -1.0f / 2.0f, -data.leftPixelValue() - 2 * data.centerPixelValue() - data.rightPixelValue() + data.downLeftPixelValue() + 2 * data.downPixelValue() + data.downRightPixelValue());
- }
- // Bottom line
- data.offset = data.heightDecreasedByOne * data.widthMultipliedByPixelSize + cPixelSize;
- for (int x = 1; x < data.widthDecreasedByOne; ++x, data.offset += cPixelSize) {
- setPixel(data, paintingData, x, data.heightDecreasedByOne,
- -1.0f / 3.0f, -data.upLeftPixelValue() + data.upRightPixelValue() - 2 * data.leftPixelValue() + 2 * data.rightPixelValue(),
- -1.0f / 2.0f, -data.upLeftPixelValue() - 2 * data.upPixelValue() - data.upRightPixelValue() + data.leftPixelValue() + 2 * data.centerPixelValue() + data.rightPixelValue());
- }
- }
-
- if (height >= 3) {
- // Left line
- data.offset = data.widthMultipliedByPixelSize;
- for (int y = 1; y < data.heightDecreasedByOne; ++y, data.offset += data.widthMultipliedByPixelSize) {
- setPixel(data, paintingData, 0, y,
- -1.0f / 2.0f, -data.upPixelValue() + data.upRightPixelValue() - 2 * data.centerPixelValue() + 2 * data.rightPixelValue() - data.downPixelValue() + data.downRightPixelValue(),
- -1.0f / 3.0f, -2 * data.upPixelValue() - data.upRightPixelValue() + 2 * data.downPixelValue() + data.downRightPixelValue());
- }
- // Right line
- data.offset = data.widthMultipliedByPixelSize + data.widthMultipliedByPixelSize - cPixelSize;
- for (int y = 1; y < data.heightDecreasedByOne; ++y, data.offset += data.widthMultipliedByPixelSize) {
- setPixel(data, paintingData, data.widthDecreasedByOne, y,
- -1.0f / 2.0f, -data.upLeftPixelValue() + data.upPixelValue() -2 * data.leftPixelValue() + 2 * data.centerPixelValue() - data.downLeftPixelValue() + data.downPixelValue(),
- -1.0f / 3.0f, -data.upLeftPixelValue() - 2 * data.upPixelValue() + data.downLeftPixelValue() + 2 * data.downPixelValue());
- }
- }
-
- if (width >= 3 && height >= 3) {
- // Interior pixels
- for (int y = 1; y < data.heightDecreasedByOne; ++y) {
- data.offset = y * data.widthMultipliedByPixelSize + cPixelSize;
- for (int x = 1; x < data.widthDecreasedByOne; ++x, data.offset += cPixelSize) {
- setPixel(data, paintingData, x, y,
- -1.0f / 4.0f, -data.upLeftPixelValue() + data.upRightPixelValue() - 2 * data.leftPixelValue() + 2 * data.rightPixelValue() - data.downLeftPixelValue() + data.downRightPixelValue(),
- -1.0f / 4.0f, -data.upLeftPixelValue() - 2 * data.upPixelValue() - data.upRightPixelValue() + data.downLeftPixelValue() + 2 * data.downPixelValue() + data.downRightPixelValue());
- }
- }
- }
-
- int totalSize = data.widthMultipliedByPixelSize * height;
- if (m_lightingType == DiffuseLighting) {
- for (int i = 3; i < totalSize; i += 4)
- data.pixels->set(i, cOpaqueAlpha);
- } else {
- for (int i = 0; i < totalSize; i += 4) {
- unsigned char a1 = data.pixels->get(i);
- unsigned char a2 = data.pixels->get(i + 1);
- unsigned char a3 = data.pixels->get(i + 2);
- // alpha set to set to max(a1, a2, a3)
- data.pixels->set(i + 3, a1 >= a2 ? (a1 >= a3 ? a1 : a3) : (a2 >= a3 ? a2 : a3));
- }
- }
-
- return true;
-}
-
-void FELighting::apply(Filter* filter)
-{
- FilterEffect* in = inputEffect(0);
- in->apply(filter);
- if (!in->resultImage())
- return;
-
- if (!effectContext())
- return;
-
- setIsAlphaImage(false);
-
- IntRect effectDrawingRect = requestedRegionOfInputImageData(in->repaintRectInLocalCoordinates());
- RefPtr<ImageData> srcImageData(in->resultImage()->getUnmultipliedImageData(effectDrawingRect));
- CanvasPixelArray* srcPixelArray(srcImageData->data());
-
- // FIXME: support kernelUnitLengths other than (1,1). The issue here is that the W3
- // standard has no test case for them, and other browsers (like Firefox) has strange
- // output for various kernelUnitLengths, and I am not sure they are reliable.
- // Anyway, feConvolveMatrix should also use the implementation
-
- if (drawLighting(srcPixelArray, effectDrawingRect.width(), effectDrawingRect.height()))
- resultImage()->putUnmultipliedImageData(srcImageData.get(), IntRect(IntPoint(), resultImage()->size()), IntPoint());
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(SVG) && ENABLE(FILTERS)
diff --git a/WebCore/svg/graphics/filters/SVGFELighting.h b/WebCore/svg/graphics/filters/SVGFELighting.h
deleted file mode 100644
index c99f3c5..0000000
--- a/WebCore/svg/graphics/filters/SVGFELighting.h
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * Copyright (C) 2010 University of Szeged
- * Copyright (C) 2010 Zoltan Herczeg
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY UNIVERSITY OF SZEGED ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL UNIVERSITY OF SZEGED OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SVGFELighting_h
-#define SVGFELighting_h
-
-#if ENABLE(SVG) && ENABLE(FILTERS)
-#include "Color.h"
-#include "Filter.h"
-#include "FilterEffect.h"
-#include "SVGLightSource.h"
-#include <wtf/AlwaysInline.h>
-
-// Common base class for FEDiffuseLighting and FESpecularLighting
-
-namespace WebCore {
-
-class CanvasPixelArray;
-
-class FELighting : public FilterEffect {
-public:
- virtual void apply(Filter*);
-
-protected:
- enum LightingType {
- DiffuseLighting,
- SpecularLighting
- };
-
- struct LightingData {
- FloatPoint3D normalVector;
- CanvasPixelArray* pixels;
- float lightStrength;
- float surfaceScale;
- int offset;
- int widthMultipliedByPixelSize;
- int widthDecreasedByOne;
- int heightDecreasedByOne;
-
- ALWAYS_INLINE int upLeftPixelValue();
- ALWAYS_INLINE int upPixelValue();
- ALWAYS_INLINE int upRightPixelValue();
- ALWAYS_INLINE int leftPixelValue();
- ALWAYS_INLINE int centerPixelValue();
- ALWAYS_INLINE int rightPixelValue();
- ALWAYS_INLINE int downLeftPixelValue();
- ALWAYS_INLINE int downPixelValue();
- ALWAYS_INLINE int downRightPixelValue();
- };
-
- FELighting(LightingType, const Color&, float, float, float, float, float, float, PassRefPtr<LightSource>);
-
- bool drawLighting(CanvasPixelArray*, int, int);
- ALWAYS_INLINE void setPixel(LightingData&, LightSource::PaintingData&,
- int lightX, int lightY, float factorX, int normalX, float factorY, int normalY);
-
- LightingType m_lightingType;
- RefPtr<LightSource> m_lightSource;
-
- Color m_lightingColor;
- float m_surfaceScale;
- float m_diffuseConstant;
- float m_specularConstant;
- float m_specularExponent;
- float m_kernelUnitLengthX;
- float m_kernelUnitLengthY;
-};
-
-} // namespace WebCore
-
-#endif // ENABLE(SVG) && ENABLE(FILTERS)
-
-#endif // SVGFELighting_h
diff --git a/WebCore/svg/graphics/filters/SVGFEMerge.cpp b/WebCore/svg/graphics/filters/SVGFEMerge.cpp
deleted file mode 100644
index 42d2b10..0000000
--- a/WebCore/svg/graphics/filters/SVGFEMerge.cpp
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * 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.
- */
-
-#include "config.h"
-
-#if ENABLE(SVG) && ENABLE(FILTERS)
-#include "SVGFEMerge.h"
-
-#include "Filter.h"
-#include "GraphicsContext.h"
-
-namespace WebCore {
-
-FEMerge::FEMerge()
- : FilterEffect()
-{
-}
-
-PassRefPtr<FEMerge> FEMerge::create()
-{
- return adoptRef(new FEMerge);
-}
-
-void FEMerge::apply(Filter* filter)
-{
- unsigned size = numberOfEffectInputs();
- ASSERT(size > 0);
- for (unsigned i = 0; i < size; ++i) {
- FilterEffect* in = inputEffect(i);
- in->apply(filter);
- if (!in->resultImage())
- return;
- }
-
- GraphicsContext* filterContext = effectContext();
- if (!filterContext)
- return;
-
- for (unsigned i = 0; i < size; ++i) {
- FilterEffect* in = inputEffect(i);
- filterContext->drawImageBuffer(in->resultImage(), DeviceColorSpace, drawingRegionOfInputImage(in->repaintRectInLocalCoordinates()));
- }
-}
-
-void FEMerge::dump()
-{
-}
-
-TextStream& FEMerge::externalRepresentation(TextStream& ts, int indent) const
-{
- writeIndent(ts, indent);
- ts << "[feMerge";
- FilterEffect::externalRepresentation(ts);
- unsigned size = numberOfEffectInputs();
- ASSERT(size > 0);
- ts << " mergeNodes=\"" << size << "\"]\n";
- for (unsigned i = 0; i < size; ++i)
- inputEffect(i)->externalRepresentation(ts, indent + 1);
- return ts;
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(SVG) && ENABLE(FILTERS)
diff --git a/WebCore/svg/graphics/filters/SVGFEMerge.h b/WebCore/svg/graphics/filters/SVGFEMerge.h
deleted file mode 100644
index 7b83113..0000000
--- a/WebCore/svg/graphics/filters/SVGFEMerge.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * 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 SVGFEMerge_h
-#define SVGFEMerge_h
-
-#if ENABLE(SVG) && ENABLE(FILTERS)
-#include "FilterEffect.h"
-#include "Filter.h"
-#include <wtf/Vector.h>
-
-namespace WebCore {
-
-class FEMerge : public FilterEffect {
-public:
- static PassRefPtr<FEMerge> create();
-
- virtual void apply(Filter*);
- virtual void dump();
-
- virtual TextStream& externalRepresentation(TextStream&, int indention) const;
-
-private:
- FEMerge();
-};
-
-} // namespace WebCore
-
-#endif // ENABLE(SVG) && ENABLE(FILTERS)
-
-#endif // SVGFEMerge_h
diff --git a/WebCore/svg/graphics/filters/SVGFEMorphology.cpp b/WebCore/svg/graphics/filters/SVGFEMorphology.cpp
deleted file mode 100644
index 7e031d4..0000000
--- a/WebCore/svg/graphics/filters/SVGFEMorphology.cpp
+++ /dev/null
@@ -1,188 +0,0 @@
-/*
- * 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"
-
-#if ENABLE(SVG) && ENABLE(FILTERS)
-#include "SVGFEMorphology.h"
-
-#include "CanvasPixelArray.h"
-#include "Filter.h"
-#include "ImageData.h"
-
-#include <wtf/Vector.h>
-
-using std::min;
-using std::max;
-
-namespace WebCore {
-
-FEMorphology::FEMorphology(MorphologyOperatorType type, float radiusX, float radiusY)
- : FilterEffect()
- , m_type(type)
- , m_radiusX(radiusX)
- , m_radiusY(radiusY)
-{
-}
-
-PassRefPtr<FEMorphology> FEMorphology::create(MorphologyOperatorType type, float radiusX, float radiusY)
-{
- return adoptRef(new FEMorphology(type, radiusX, radiusY));
-}
-
-MorphologyOperatorType FEMorphology::morphologyOperator() const
-{
- return m_type;
-}
-
-void FEMorphology::setMorphologyOperator(MorphologyOperatorType type)
-{
- m_type = type;
-}
-
-float FEMorphology::radiusX() const
-{
- return m_radiusX;
-}
-
-void FEMorphology::setRadiusX(float radiusX)
-{
- m_radiusX = radiusX;
-}
-
-float FEMorphology::radiusY() const
-{
- return m_radiusY;
-}
-
-void FEMorphology::setRadiusY(float radiusY)
-{
- m_radiusY = radiusY;
-}
-
-void FEMorphology::apply(Filter* filter)
-{
- FilterEffect* in = inputEffect(0);
- in->apply(filter);
- if (!in->resultImage())
- return;
-
- if (!effectContext())
- return;
-
- setIsAlphaImage(in->isAlphaImage());
-
- int radiusX = static_cast<int>(m_radiusX * filter->filterResolution().width());
- int radiusY = static_cast<int>(m_radiusY * filter->filterResolution().height());
- if (radiusX <= 0 || radiusY <= 0)
- return;
-
- IntRect imageRect(IntPoint(), resultImage()->size());
- IntRect effectDrawingRect = requestedRegionOfInputImageData(in->repaintRectInLocalCoordinates());
- RefPtr<CanvasPixelArray> srcPixelArray(in->resultImage()->getPremultipliedImageData(effectDrawingRect)->data());
- RefPtr<ImageData> imageData = ImageData::create(imageRect.width(), imageRect.height());
-
- int effectWidth = effectDrawingRect.width() * 4;
-
- // Limit the radius size to effect dimensions
- radiusX = min(effectDrawingRect.width() - 1, radiusX);
- radiusY = min(effectDrawingRect.height() - 1, radiusY);
-
- Vector<unsigned char> extrema;
- for (int y = 0; y < effectDrawingRect.height(); ++y) {
- int startY = max(0, y - radiusY);
- int endY = min(effectDrawingRect.height() - 1, y + radiusY);
- for (unsigned channel = 0; channel < 4; ++channel) {
- // Fill the kernel
- extrema.clear();
- for (int j = 0; j <= radiusX; ++j) {
- unsigned char columnExtrema = srcPixelArray->get(startY * effectWidth + 4 * j + channel);
- for (int i = startY; i <= endY; ++i) {
- unsigned char pixel = srcPixelArray->get(i * effectWidth + 4 * j + channel);
- if ((m_type == FEMORPHOLOGY_OPERATOR_ERODE && pixel <= columnExtrema) ||
- (m_type == FEMORPHOLOGY_OPERATOR_DILATE && pixel >= columnExtrema))
- columnExtrema = pixel;
- }
- extrema.append(columnExtrema);
- }
-
- // Kernel is filled, get extrema of next column
- for (int x = 0; x < effectDrawingRect.width(); ++x) {
- unsigned endX = min(x + radiusX, effectDrawingRect.width() - 1);
- unsigned char columnExtrema = srcPixelArray->get(startY * effectWidth + endX * 4 + channel);
- for (int i = startY; i <= endY; ++i) {
- unsigned char pixel = srcPixelArray->get(i * effectWidth + endX * 4 + channel);
- if ((m_type == FEMORPHOLOGY_OPERATOR_ERODE && pixel <= columnExtrema) ||
- (m_type == FEMORPHOLOGY_OPERATOR_DILATE && pixel >= columnExtrema))
- columnExtrema = pixel;
- }
- if (x - radiusX >= 0)
- extrema.remove(0);
- if (x + radiusX <= effectDrawingRect.width())
- extrema.append(columnExtrema);
- unsigned char entireExtrema = extrema[0];
- for (unsigned kernelIndex = 0; kernelIndex < extrema.size(); ++kernelIndex) {
- if ((m_type == FEMORPHOLOGY_OPERATOR_ERODE && extrema[kernelIndex] <= entireExtrema) ||
- (m_type == FEMORPHOLOGY_OPERATOR_DILATE && extrema[kernelIndex] >= entireExtrema))
- entireExtrema = extrema[kernelIndex];
- }
- imageData->data()->set(y * effectWidth + 4 * x + channel, entireExtrema);
- }
- }
- }
- resultImage()->putPremultipliedImageData(imageData.get(), imageRect, IntPoint());
-}
-
-void FEMorphology::dump()
-{
-}
-
-static TextStream& operator<<(TextStream& ts, const MorphologyOperatorType& type)
-{
- switch (type) {
- case FEMORPHOLOGY_OPERATOR_UNKNOWN:
- ts << "UNKNOWN";
- break;
- case FEMORPHOLOGY_OPERATOR_ERODE:
- ts << "ERODE";
- break;
- case FEMORPHOLOGY_OPERATOR_DILATE:
- ts << "DILATE";
- break;
- }
- return ts;
-}
-
-TextStream& FEMorphology::externalRepresentation(TextStream& ts, int indent) const
-{
- writeIndent(ts, indent);
- ts << "[feMorphology";
- FilterEffect::externalRepresentation(ts);
- ts << " operator=\"" << morphologyOperator() << "\" "
- << "radius=\"" << radiusX() << ", " << radiusY() << "\"]\n";
- inputEffect(0)->externalRepresentation(ts, indent + 1);
- return ts;
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(SVG) && ENABLE(FILTERS)
diff --git a/WebCore/svg/graphics/filters/SVGFEMorphology.h b/WebCore/svg/graphics/filters/SVGFEMorphology.h
deleted file mode 100644
index 56fdd3d..0000000
--- a/WebCore/svg/graphics/filters/SVGFEMorphology.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * 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 SVGFEMorphology_h
-#define SVGFEMorphology_h
-
-#if ENABLE(SVG) && ENABLE(FILTERS)
-#include "FilterEffect.h"
-#include "Filter.h"
-
-namespace WebCore {
-
-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);
-
- float radiusX() const;
- void setRadiusX(float);
-
- float radiusY() const;
- void setRadiusY(float);
-
- virtual void apply(Filter*);
- virtual void dump();
-
- 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
-
-#endif // ENABLE(SVG) && ENABLE(FILTERS)
-
-#endif // SVGFEMorphology_h
diff --git a/WebCore/svg/graphics/filters/SVGFEOffset.cpp b/WebCore/svg/graphics/filters/SVGFEOffset.cpp
deleted file mode 100644
index 037602a..0000000
--- a/WebCore/svg/graphics/filters/SVGFEOffset.cpp
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * 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"
-
-#if ENABLE(SVG) && ENABLE(FILTERS)
-#include "SVGFEOffset.h"
-
-#include "Filter.h"
-#include "GraphicsContext.h"
-
-namespace WebCore {
-
-FEOffset::FEOffset(float dx, float dy)
- : FilterEffect()
- , m_dx(dx)
- , m_dy(dy)
-{
-}
-
-PassRefPtr<FEOffset> FEOffset::create(float dx, float dy)
-{
- return adoptRef(new FEOffset(dx, dy));
-}
-
-float FEOffset::dx() const
-{
- return m_dx;
-}
-
-void FEOffset::setDx(float dx)
-{
- m_dx = dx;
-}
-
-float FEOffset::dy() const
-{
- return m_dy;
-}
-
-void FEOffset::setDy(float dy)
-{
- m_dy = dy;
-}
-
-void FEOffset::apply(Filter* filter)
-{
- FilterEffect* in = inputEffect(0);
- in->apply(filter);
- if (!in->resultImage())
- return;
-
- GraphicsContext* filterContext = effectContext();
- if (!filterContext)
- return;
-
- setIsAlphaImage(in->isAlphaImage());
-
- FloatRect sourceImageRect = filter->sourceImageRect();
- sourceImageRect.scale(filter->filterResolution().width(), filter->filterResolution().height());
-
- if (filter->effectBoundingBoxMode()) {
- m_dx *= sourceImageRect.width();
- m_dy *= sourceImageRect.height();
- }
- m_dx *= filter->filterResolution().width();
- m_dy *= filter->filterResolution().height();
-
- FloatRect dstRect = FloatRect(m_dx + in->repaintRectInLocalCoordinates().x() - repaintRectInLocalCoordinates().x(),
- m_dy + in->repaintRectInLocalCoordinates().y() - repaintRectInLocalCoordinates().y(),
- in->repaintRectInLocalCoordinates().width(),
- in->repaintRectInLocalCoordinates().height());
-
- filterContext->drawImageBuffer(in->resultImage(), DeviceColorSpace, dstRect);
-}
-
-void FEOffset::dump()
-{
-}
-
-TextStream& FEOffset::externalRepresentation(TextStream& ts, int indent) const
-{
- writeIndent(ts, indent);
- ts << "[feOffset";
- FilterEffect::externalRepresentation(ts);
- ts << " dx=\"" << dx() << "\" dy=\"" << dy() << "\"]\n";
- inputEffect(0)->externalRepresentation(ts, indent + 1);
- return ts;
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(SVG) && ENABLE(FILTERS)
diff --git a/WebCore/svg/graphics/filters/SVGFEOffset.h b/WebCore/svg/graphics/filters/SVGFEOffset.h
deleted file mode 100644
index 6857e14..0000000
--- a/WebCore/svg/graphics/filters/SVGFEOffset.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * 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 SVGFEOffset_h
-#define SVGFEOffset_h
-
-#if ENABLE(SVG) && ENABLE(FILTERS)
-#include "FilterEffect.h"
-#include "Filter.h"
-
-namespace WebCore {
-
-class FEOffset : public FilterEffect {
-public:
- static PassRefPtr<FEOffset> create(float dx, float dy);
-
- float dx() const;
- void setDx(float);
-
- float dy() const;
- void setDy(float);
-
- virtual void apply(Filter*);
- virtual void dump();
-
- virtual TextStream& externalRepresentation(TextStream&, int indention) const;
-
-private:
- FEOffset(float dx, float dy);
-
- float m_dx;
- float m_dy;
-};
-
-} // namespace WebCore
-
-#endif // ENABLE(SVG) && ENABLE(FILTERS)
-
-#endif // SVGFEOffset_h
diff --git a/WebCore/svg/graphics/filters/SVGFESpecularLighting.cpp b/WebCore/svg/graphics/filters/SVGFESpecularLighting.cpp
deleted file mode 100644
index 113ae14..0000000
--- a/WebCore/svg/graphics/filters/SVGFESpecularLighting.cpp
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * 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.
- */
-
-#include "config.h"
-
-#if ENABLE(SVG) && ENABLE(FILTERS)
-#include "SVGFESpecularLighting.h"
-
-#include "SVGLightSource.h"
-
-namespace WebCore {
-
-FESpecularLighting::FESpecularLighting(const Color& lightingColor, float surfaceScale,
- float specularConstant, float specularExponent, float kernelUnitLengthX,
- float kernelUnitLengthY, PassRefPtr<LightSource> lightSource)
- : FELighting(SpecularLighting, lightingColor, surfaceScale, 0, specularConstant, specularExponent, kernelUnitLengthX, kernelUnitLengthY, lightSource)
-{
-}
-
-PassRefPtr<FESpecularLighting> FESpecularLighting::create(const Color& lightingColor,
- float surfaceScale, float specularConstant, float specularExponent,
- float kernelUnitLengthX, float kernelUnitLengthY, PassRefPtr<LightSource> lightSource)
-{
- return adoptRef(new FESpecularLighting(lightingColor, surfaceScale, specularConstant, specularExponent,
- kernelUnitLengthX, kernelUnitLengthY, lightSource));
-}
-
-FESpecularLighting::~FESpecularLighting()
-{
-}
-
-Color FESpecularLighting::lightingColor() const
-{
- return m_lightingColor;
-}
-
-void FESpecularLighting::setLightingColor(const Color& lightingColor)
-{
- m_lightingColor = lightingColor;
-}
-
-float FESpecularLighting::surfaceScale() const
-{
- return m_surfaceScale;
-}
-
-void FESpecularLighting::setSurfaceScale(float surfaceScale)
-{
- m_surfaceScale = surfaceScale;
-}
-
-float FESpecularLighting::specularConstant() const
-{
- return m_specularConstant;
-}
-
-void FESpecularLighting::setSpecularConstant(float specularConstant)
-{
- m_specularConstant = specularConstant;
-}
-
-float FESpecularLighting::specularExponent() const
-{
- return m_specularExponent;
-}
-
-void FESpecularLighting::setSpecularExponent(float specularExponent)
-{
- m_specularExponent = specularExponent;
-}
-
-float FESpecularLighting::kernelUnitLengthX() const
-{
- return m_kernelUnitLengthX;
-}
-
-void FESpecularLighting::setKernelUnitLengthX(float kernelUnitLengthX)
-{
- m_kernelUnitLengthX = kernelUnitLengthX;
-}
-
-float FESpecularLighting::kernelUnitLengthY() const
-{
- return m_kernelUnitLengthY;
-}
-
-void FESpecularLighting::setKernelUnitLengthY(float kernelUnitLengthY)
-{
- m_kernelUnitLengthY = kernelUnitLengthY;
-}
-
-const LightSource* FESpecularLighting::lightSource() const
-{
- return m_lightSource.get();
-}
-
-void FESpecularLighting::setLightSource(PassRefPtr<LightSource> lightSource)
-{
- m_lightSource = lightSource;
-}
-
-void FESpecularLighting::dump()
-{
-}
-
-TextStream& FESpecularLighting::externalRepresentation(TextStream& ts, int indent) const
-{
- writeIndent(ts, indent);
- ts << "[feSpecularLighting";
- FilterEffect::externalRepresentation(ts);
- ts << " surfaceScale=\"" << m_surfaceScale << "\" "
- << "specualConstant=\"" << m_specularConstant << "\" "
- << "specularExponent=\"" << m_specularExponent << "\"]\n";
- inputEffect(0)->externalRepresentation(ts, indent + 1);
- return ts;
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(SVG) && ENABLE(FILTERS)
diff --git a/WebCore/svg/graphics/filters/SVGFESpecularLighting.h b/WebCore/svg/graphics/filters/SVGFESpecularLighting.h
deleted file mode 100644
index 00a5f8a..0000000
--- a/WebCore/svg/graphics/filters/SVGFESpecularLighting.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * 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 SVGFESpecularLighting_h
-#define SVGFESpecularLighting_h
-
-#if ENABLE(SVG) && ENABLE(FILTERS)
-#include "SVGFELighting.h"
-
-namespace WebCore {
-
-class FESpecularLighting : public FELighting {
-public:
- static PassRefPtr<FESpecularLighting> create(const Color&, float, float,
- float, float, float, PassRefPtr<LightSource>);
- virtual ~FESpecularLighting();
-
- Color lightingColor() const;
- void setLightingColor(const Color&);
-
- float surfaceScale() const;
- void setSurfaceScale(float);
-
- float specularConstant() const;
- void setSpecularConstant(float);
-
- float specularExponent() const;
- void setSpecularExponent(float);
-
- float kernelUnitLengthX() const;
- void setKernelUnitLengthX(float);
-
- float kernelUnitLengthY() const;
- void setKernelUnitLengthY(float);
-
- const LightSource* lightSource() const;
- void setLightSource(PassRefPtr<LightSource>);
-
- virtual void dump();
-
- virtual TextStream& externalRepresentation(TextStream&, int indention) const;
-
-private:
- FESpecularLighting(const Color&, float, float, float, float, float, PassRefPtr<LightSource>);
-};
-
-} // namespace WebCore
-
-#endif // ENABLE(SVG) && ENABLE(FILTERS)
-
-#endif // SVGFESpecularLighting_h
diff --git a/WebCore/svg/graphics/filters/SVGFETile.cpp b/WebCore/svg/graphics/filters/SVGFETile.cpp
deleted file mode 100644
index f8f0adc..0000000
--- a/WebCore/svg/graphics/filters/SVGFETile.cpp
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * 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.
- */
-
-#include "config.h"
-
-#if ENABLE(SVG) && ENABLE(FILTERS)
-#include "SVGFETile.h"
-
-#include "AffineTransform.h"
-#include "Filter.h"
-#include "GraphicsContext.h"
-#include "Pattern.h"
-
-namespace WebCore {
-
-FETile::FETile()
- : FilterEffect()
-{
-}
-
-PassRefPtr<FETile> FETile::create()
-{
- return adoptRef(new FETile);
-}
-
-FloatRect FETile::determineFilterPrimitiveSubregion(Filter* filter)
-{
- inputEffect(0)->determineFilterPrimitiveSubregion(filter);
-
- filter->determineFilterPrimitiveSubregion(this, filter->filterRegion());
- return filterPrimitiveSubregion();
-}
-
-void FETile::apply(Filter* filter)
-{
- FilterEffect* in = inputEffect(0);
- in->apply(filter);
- if (!in->resultImage())
- return;
-
- GraphicsContext* filterContext = effectContext();
- if (!filterContext)
- return;
-
- setIsAlphaImage(in->isAlphaImage());
-
- IntRect tileRect = enclosingIntRect(in->repaintRectInLocalCoordinates());
-
- // Source input needs more attention. It has the size of the filterRegion but gives the
- // size of the cutted sourceImage back. This is part of the specification and optimization.
- if (in->isSourceInput()) {
- FloatRect filterRegion = filter->filterRegion();
- filterRegion.scale(filter->filterResolution().width(), filter->filterResolution().height());
- tileRect = enclosingIntRect(filterRegion);
- }
-
- OwnPtr<ImageBuffer> tileImage = ImageBuffer::create(tileRect.size());
- GraphicsContext* tileImageContext = tileImage->context();
- tileImageContext->drawImageBuffer(in->resultImage(), DeviceColorSpace, IntPoint());
- RefPtr<Pattern> pattern = Pattern::create(tileImage->copyImage(), true, true);
-
- AffineTransform matrix;
- matrix.translate(in->repaintRectInLocalCoordinates().x() - repaintRectInLocalCoordinates().x(),
- in->repaintRectInLocalCoordinates().y() - repaintRectInLocalCoordinates().y());
- pattern.get()->setPatternSpaceTransform(matrix);
-
- filterContext->setFillPattern(pattern);
- filterContext->fillRect(FloatRect(FloatPoint(), repaintRectInLocalCoordinates().size()));
-}
-
-void FETile::dump()
-{
-}
-
-TextStream& FETile::externalRepresentation(TextStream& ts, int indent) const
-{
- writeIndent(ts, indent);
- ts << "[feTile";
- FilterEffect::externalRepresentation(ts);
- ts << "]\n";
- inputEffect(0)->externalRepresentation(ts, indent + 1);
-
- return ts;
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(SVG) && ENABLE(FILTERS)
-
diff --git a/WebCore/svg/graphics/filters/SVGFETile.h b/WebCore/svg/graphics/filters/SVGFETile.h
deleted file mode 100644
index e587683..0000000
--- a/WebCore/svg/graphics/filters/SVGFETile.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * 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 SVGFETile_h
-#define SVGFETile_h
-
-#if ENABLE(SVG) && ENABLE(FILTERS)
-#include "FilterEffect.h"
-#include "Filter.h"
-
-namespace WebCore {
-
-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
-
-#endif // ENABLE(SVG) && ENABLE(FILTERS)
-
-#endif // SVGFETile_h
diff --git a/WebCore/svg/graphics/filters/SVGFETurbulence.cpp b/WebCore/svg/graphics/filters/SVGFETurbulence.cpp
deleted file mode 100644
index 8e9a6f7..0000000
--- a/WebCore/svg/graphics/filters/SVGFETurbulence.cpp
+++ /dev/null
@@ -1,386 +0,0 @@
-/*
- * 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 Renata Hodovan <reni at inf.u-szeged.hu>
- *
- * 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"
-
-#if ENABLE(SVG) && ENABLE(FILTERS)
-#include "SVGFETurbulence.h"
-
-#include "CanvasPixelArray.h"
-#include "Filter.h"
-#include "ImageData.h"
-
-#include <wtf/MathExtras.h>
-
-namespace WebCore {
-
-/*
- Produces results in the range [1, 2**31 - 2]. Algorithm is:
- r = (a * r) mod m where a = randAmplitude = 16807 and
- m = randMaximum = 2**31 - 1 = 2147483647, r = seed.
- See [Park & Miller], CACM vol. 31 no. 10 p. 1195, Oct. 1988
- To test: the algorithm should produce the result 1043618065
- as the 10,000th generated number if the original seed is 1.
-*/
-static const int s_perlinNoise = 4096;
-static const long s_randMaximum = 2147483647; // 2**31 - 1
-static const int s_randAmplitude = 16807; // 7**5; primitive root of m
-static const int s_randQ = 127773; // m / a
-static const int s_randR = 2836; // m % a
-
-FETurbulence::FETurbulence(TurbulanceType type, float baseFrequencyX, float baseFrequencyY, int numOctaves, float seed, bool stitchTiles)
- : FilterEffect()
- , m_type(type)
- , m_baseFrequencyX(baseFrequencyX)
- , m_baseFrequencyY(baseFrequencyY)
- , m_numOctaves(numOctaves)
- , m_seed(seed)
- , m_stitchTiles(stitchTiles)
-{
-}
-
-PassRefPtr<FETurbulence> FETurbulence::create(TurbulanceType type, float baseFrequencyX, float baseFrequencyY, int numOctaves, float seed, bool stitchTiles)
-{
- return adoptRef(new FETurbulence(type, baseFrequencyX, baseFrequencyY, numOctaves, seed, stitchTiles));
-}
-
-TurbulanceType FETurbulence::type() const
-{
- return m_type;
-}
-
-void FETurbulence::setType(TurbulanceType type)
-{
- m_type = type;
-}
-
-float FETurbulence::baseFrequencyY() const
-{
- return m_baseFrequencyY;
-}
-
-void FETurbulence::setBaseFrequencyY(float baseFrequencyY)
-{
- m_baseFrequencyY = baseFrequencyY;
-}
-
-float FETurbulence::baseFrequencyX() const
-{
- return m_baseFrequencyX;
-}
-
-void FETurbulence::setBaseFrequencyX(float baseFrequencyX)
-{
- m_baseFrequencyX = baseFrequencyX;
-}
-
-float FETurbulence::seed() const
-{
- return m_seed;
-}
-
-void FETurbulence::setSeed(float seed)
-{
- m_seed = seed;
-}
-
-int FETurbulence::numOctaves() const
-{
- return m_numOctaves;
-}
-
-void FETurbulence::setNumOctaves(bool numOctaves)
-{
- m_numOctaves = numOctaves;
-}
-
-bool FETurbulence::stitchTiles() const
-{
- return m_stitchTiles;
-}
-
-void FETurbulence::setStitchTiles(bool stitch)
-{
- m_stitchTiles = stitch;
-}
-
-// The turbulence calculation code is an adapted version of what appears in the SVG 1.1 specification:
-// http://www.w3.org/TR/SVG11/filters.html#feTurbulence
-
-FETurbulence::PaintingData::PaintingData(long paintingSeed, const IntSize& paintingSize)
- : seed(paintingSeed)
- , width(0)
- , height(0)
- , wrapX(0)
- , wrapY(0)
- , channel(0)
- , filterSize(paintingSize)
-{
-}
-
-// Compute pseudo random number.
-inline long FETurbulence::PaintingData::random()
-{
- long result = s_randAmplitude * (seed % s_randQ) - s_randR * (seed / s_randQ);
- if (result <= 0)
- result += s_randMaximum;
- seed = result;
- return result;
-}
-
-inline float smoothCurve(float t)
-{
- return t * t * (3 - 2 * t);
-}
-
-inline float linearInterpolation(float t, float a, float b)
-{
- return a + t * (b - a);
-}
-
-inline void FETurbulence::initPaint(PaintingData& paintingData)
-{
- float normalizationFactor;
-
- // The seed value clamp to the range [1, s_randMaximum - 1].
- if (paintingData.seed <= 0)
- paintingData.seed = -(paintingData.seed % (s_randMaximum - 1)) + 1;
- if (paintingData.seed > s_randMaximum - 1)
- paintingData.seed = s_randMaximum - 1;
-
- float* gradient;
- for (int channel = 0; channel < 4; ++channel) {
- for (int i = 0; i < s_blockSize; ++i) {
- paintingData.latticeSelector[i] = i;
- gradient = paintingData.gradient[channel][i];
- gradient[0] = static_cast<float>((paintingData.random() % (2 * s_blockSize)) - s_blockSize) / s_blockSize;
- gradient[1] = static_cast<float>((paintingData.random() % (2 * s_blockSize)) - s_blockSize) / s_blockSize;
- normalizationFactor = sqrtf(gradient[0] * gradient[0] + gradient[1] * gradient[1]);
- gradient[0] /= normalizationFactor;
- gradient[1] /= normalizationFactor;
- }
- }
- for (int i = s_blockSize - 1; i > 0; --i) {
- int k = paintingData.latticeSelector[i];
- int j = paintingData.random() % s_blockSize;
- ASSERT(j >= 0);
- ASSERT(j < 2 * s_blockSize + 2);
- paintingData.latticeSelector[i] = paintingData.latticeSelector[j];
- paintingData.latticeSelector[j] = k;
- }
- for (int i = 0; i < s_blockSize + 2; ++i) {
- paintingData.latticeSelector[s_blockSize + i] = paintingData.latticeSelector[i];
- for (int channel = 0; channel < 4; ++channel) {
- paintingData.gradient[channel][s_blockSize + i][0] = paintingData.gradient[channel][i][0];
- paintingData.gradient[channel][s_blockSize + i][1] = paintingData.gradient[channel][i][1];
- }
- }
-}
-
-inline void checkNoise(int& noiseValue, int limitValue, int newValue)
-{
- if (noiseValue >= limitValue)
- noiseValue -= newValue;
- if (noiseValue >= limitValue - 1)
- noiseValue -= newValue - 1;
-}
-
-float FETurbulence::noise2D(PaintingData& paintingData, const FloatPoint& noiseVector)
-{
- struct Noise {
- int noisePositionIntegerValue;
- float noisePositionFractionValue;
-
- Noise(float component)
- {
- float position = component + s_perlinNoise;
- noisePositionIntegerValue = static_cast<int>(position);
- noisePositionFractionValue = position - noisePositionIntegerValue;
- }
- };
-
- Noise noiseX(noiseVector.x());
- Noise noiseY(noiseVector.y());
- float* q;
- float sx, sy, a, b, u, v;
-
- // If stitching, adjust lattice points accordingly.
- if (m_stitchTiles) {
- checkNoise(noiseX.noisePositionIntegerValue, paintingData.wrapX, paintingData.width);
- checkNoise(noiseY.noisePositionIntegerValue, paintingData.wrapY, paintingData.height);
- }
-
- noiseX.noisePositionIntegerValue &= s_blockMask;
- noiseY.noisePositionIntegerValue &= s_blockMask;
- int latticeIndex = paintingData.latticeSelector[noiseX.noisePositionIntegerValue];
- int nextLatticeIndex = paintingData.latticeSelector[(noiseX.noisePositionIntegerValue + 1) & s_blockMask];
-
- sx = smoothCurve(noiseX.noisePositionFractionValue);
- sy = smoothCurve(noiseY.noisePositionFractionValue);
-
- // This is taken 1:1 from SVG spec: http://www.w3.org/TR/SVG11/filters.html#feTurbulenceElement.
- int temp = paintingData.latticeSelector[latticeIndex + noiseY.noisePositionIntegerValue];
- q = paintingData.gradient[paintingData.channel][temp];
- u = noiseX.noisePositionFractionValue * q[0] + noiseY.noisePositionFractionValue * q[1];
- temp = paintingData.latticeSelector[nextLatticeIndex + noiseY.noisePositionIntegerValue];
- q = paintingData.gradient[paintingData.channel][temp];
- v = (noiseX.noisePositionFractionValue - 1) * q[0] + noiseY.noisePositionFractionValue * q[1];
- a = linearInterpolation(sx, u, v);
- temp = paintingData.latticeSelector[latticeIndex + noiseY.noisePositionIntegerValue + 1];
- q = paintingData.gradient[paintingData.channel][temp];
- u = noiseX.noisePositionFractionValue * q[0] + (noiseY.noisePositionFractionValue - 1) * q[1];
- temp = paintingData.latticeSelector[nextLatticeIndex + noiseY.noisePositionIntegerValue + 1];
- q = paintingData.gradient[paintingData.channel][temp];
- v = (noiseX.noisePositionFractionValue - 1) * q[0] + (noiseY.noisePositionFractionValue - 1) * q[1];
- b = linearInterpolation(sx, u, v);
- return linearInterpolation(sy, a, b);
-}
-
-unsigned char FETurbulence::calculateTurbulenceValueForPoint(PaintingData& paintingData, const FloatPoint& point)
-{
- float tileWidth = paintingData.filterSize.width();
- ASSERT(tileWidth > 0);
- float tileHeight = paintingData.filterSize.height();
- ASSERT(tileHeight > 0);
- // Adjust the base frequencies if necessary for stitching.
- if (m_stitchTiles) {
- // When stitching tiled turbulence, the frequencies must be adjusted
- // so that the tile borders will be continuous.
- if (m_baseFrequencyX) {
- float lowFrequency = floorf(tileWidth * m_baseFrequencyX) / tileWidth;
- float highFrequency = ceilf(tileWidth * m_baseFrequencyX) / tileWidth;
- // BaseFrequency should be non-negative according to the standard.
- if (m_baseFrequencyX / lowFrequency < highFrequency / m_baseFrequencyX)
- m_baseFrequencyX = lowFrequency;
- else
- m_baseFrequencyX = highFrequency;
- }
- if (m_baseFrequencyY) {
- float lowFrequency = floorf(tileHeight * m_baseFrequencyY) / tileHeight;
- float highFrequency = ceilf(tileHeight * m_baseFrequencyY) / tileHeight;
- if (m_baseFrequencyY / lowFrequency < highFrequency / m_baseFrequencyY)
- m_baseFrequencyY = lowFrequency;
- else
- m_baseFrequencyY = highFrequency;
- }
- // Set up TurbulenceInitial stitch values.
- paintingData.width = roundf(tileWidth * m_baseFrequencyX);
- paintingData.wrapX = s_perlinNoise + paintingData.width;
- paintingData.height = roundf(tileHeight * m_baseFrequencyY);
- paintingData.wrapY = s_perlinNoise + paintingData.height;
- }
- float turbulenceFunctionResult = 0;
- FloatPoint noiseVector(point.x() * m_baseFrequencyX, point.y() * m_baseFrequencyY);
- float ratio = 1;
- for (int octave = 0; octave < m_numOctaves; ++octave) {
- if (m_type == FETURBULENCE_TYPE_FRACTALNOISE)
- turbulenceFunctionResult += noise2D(paintingData, noiseVector) / ratio;
- else
- turbulenceFunctionResult += fabsf(noise2D(paintingData, noiseVector)) / ratio;
- noiseVector.setX(noiseVector.x() * 2);
- noiseVector.setY(noiseVector.y() * 2);
- ratio *= 2;
- if (m_stitchTiles) {
- // Update stitch values. Subtracting s_perlinNoiseoise before the multiplication and
- // adding it afterward simplifies to subtracting it once.
- paintingData.width *= 2;
- paintingData.wrapX = 2 * paintingData.wrapX - s_perlinNoise;
- paintingData.height *= 2;
- paintingData.wrapY = 2 * paintingData.wrapY - s_perlinNoise;
- }
- }
-
- // The value of turbulenceFunctionResult comes from ((turbulenceFunctionResult * 255) + 255) / 2 by fractalNoise
- // and (turbulenceFunctionResult * 255) by turbulence.
- if (m_type == FETURBULENCE_TYPE_FRACTALNOISE)
- turbulenceFunctionResult = turbulenceFunctionResult * 0.5f + 0.5f;
- // Clamp result
- turbulenceFunctionResult = std::max(std::min(turbulenceFunctionResult, 1.f), 0.f);
- return static_cast<unsigned char>(turbulenceFunctionResult * 255);
-}
-
-void FETurbulence::apply(Filter* filter)
-{
- if (!effectContext())
- return;
-
- IntRect imageRect(IntPoint(), resultImage()->size());
- if (!imageRect.size().width() || !imageRect.size().height())
- return;
-
- RefPtr<ImageData> imageData = ImageData::create(imageRect.width(), imageRect.height());
- PaintingData paintingData(m_seed, imageRect.size());
- initPaint(paintingData);
-
- FloatRect filterRegion = filter->filterRegion();
- FloatPoint point;
- point.setY(filterRegion.y());
- int indexOfPixelChannel = 0;
- for (int y = 0; y < imageRect.height(); ++y) {
- point.setY(point.y() + 1);
- point.setX(filterRegion.x());
- for (int x = 0; x < imageRect.width(); ++x) {
- point.setX(point.x() + 1);
- for (paintingData.channel = 0; paintingData.channel < 4; ++paintingData.channel, ++indexOfPixelChannel)
- imageData->data()->set(indexOfPixelChannel, calculateTurbulenceValueForPoint(paintingData, point));
- }
- }
- resultImage()->putUnmultipliedImageData(imageData.get(), imageRect, IntPoint());
-}
-
-void FETurbulence::dump()
-{
-}
-
-static TextStream& operator<<(TextStream& ts, const TurbulanceType& type)
-{
- switch (type) {
- case FETURBULENCE_TYPE_UNKNOWN:
- ts << "UNKNOWN";
- break;
- case FETURBULENCE_TYPE_TURBULENCE:
- ts << "TURBULANCE";
- break;
- case FETURBULENCE_TYPE_FRACTALNOISE:
- ts << "NOISE";
- break;
- }
- return ts;
-}
-
-TextStream& FETurbulence::externalRepresentation(TextStream& ts, int indent) const
-{
- writeIndent(ts, indent);
- ts << "[feTurbulence";
- FilterEffect::externalRepresentation(ts);
- ts << " type=\"" << type() << "\" "
- << "baseFrequency=\"" << baseFrequencyX() << ", " << baseFrequencyY() << "\" "
- << "seed=\"" << seed() << "\" "
- << "numOctaves=\"" << numOctaves() << "\" "
- << "stitchTiles=\"" << stitchTiles() << "\"]\n";
- return ts;
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(SVG) && ENABLE(FILTERS)
diff --git a/WebCore/svg/graphics/filters/SVGFETurbulence.h b/WebCore/svg/graphics/filters/SVGFETurbulence.h
deleted file mode 100644
index 68719ad..0000000
--- a/WebCore/svg/graphics/filters/SVGFETurbulence.h
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * 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 Renata Hodovan <reni at inf.u-szeged.hu>
- *
- * 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 SVGFETurbulence_h
-#define SVGFETurbulence_h
-
-#if ENABLE(SVG) && ENABLE(FILTERS)
-#include "FilterEffect.h"
-#include "Filter.h"
-
-namespace WebCore {
-
-enum TurbulanceType {
- FETURBULENCE_TYPE_UNKNOWN = 0,
- FETURBULENCE_TYPE_FRACTALNOISE = 1,
- FETURBULENCE_TYPE_TURBULENCE = 2
-};
-
-class FETurbulence : public FilterEffect {
-public:
- static PassRefPtr<FETurbulence> create(TurbulanceType, float, float, int, float, bool);
-
- TurbulanceType type() const;
- void setType(TurbulanceType);
-
- float baseFrequencyY() const;
- void setBaseFrequencyY(float);
-
- float baseFrequencyX() const;
- void setBaseFrequencyX(float);
-
- float seed() const;
- void setSeed(float);
-
- int numOctaves() const;
- void setNumOctaves(bool);
-
- bool stitchTiles() const;
- void setStitchTiles(bool);
-
- virtual void apply(Filter*);
- virtual void dump();
-
- virtual TextStream& externalRepresentation(TextStream&, int indention) const;
-
-private:
- static const int s_blockSize = 256;
- static const int s_blockMask = s_blockSize - 1;
-
- struct PaintingData {
- long seed;
- int latticeSelector[2 * s_blockSize + 2];
- float gradient[4][2 * s_blockSize + 2][2];
- int width; // How much to subtract to wrap for stitching.
- int height;
- int wrapX; // Minimum value to wrap.
- int wrapY;
- int channel;
- IntSize filterSize;
-
- PaintingData(long paintingSeed, const IntSize& paintingSize);
- inline long random();
- };
-
- FETurbulence(TurbulanceType, float, float, int, float, bool);
-
- inline void initPaint(PaintingData&);
- float noise2D(PaintingData&, const FloatPoint&);
- unsigned char calculateTurbulenceValueForPoint(PaintingData&, const FloatPoint&);
-
- TurbulanceType m_type;
- float m_baseFrequencyX;
- float m_baseFrequencyY;
- int m_numOctaves;
- float m_seed;
- bool m_stitchTiles;
-};
-
-} // namespace WebCore
-
-#endif // ENABLE(SVG) && ENABLE(FILTERS)
-
-#endif // SVGFETurbulence_h
diff --git a/WebCore/svg/graphics/filters/SVGLightSource.cpp b/WebCore/svg/graphics/filters/SVGLightSource.cpp
deleted file mode 100644
index 2981f25..0000000
--- a/WebCore/svg/graphics/filters/SVGLightSource.cpp
+++ /dev/null
@@ -1,169 +0,0 @@
-/*
- * 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) 2010 Zoltan Herczeg <zherczeg 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"
-
-#if ENABLE(SVG) && ENABLE(FILTERS)
-#include "SVGLightSource.h"
-
-#include "SVGDistantLightSource.h"
-#include "SVGPointLightSource.h"
-#include "SVGRenderTreeAsText.h"
-#include "SVGSpotLightSource.h"
-#include <wtf/MathExtras.h>
-
-namespace WebCore {
-
-void PointLightSource::initPaintingData(PaintingData&)
-{
-}
-
-void PointLightSource::updatePaintingData(PaintingData& paintingData, int x, int y, float z)
-{
- paintingData.lightVector.setX(m_position.x() - x);
- paintingData.lightVector.setY(m_position.y() - y);
- paintingData.lightVector.setZ(m_position.z() - z);
- paintingData.lightVector.normalize();
-}
-
-// spot-light edge darkening depends on an absolute treshold
-// according to the SVG 1.1 SE light regression tests
-static const float antiAliasTreshold = 0.016f;
-
-void SpotLightSource::initPaintingData(PaintingData& paintingData)
-{
- paintingData.privateColorVector = paintingData.colorVector;
- paintingData.directionVector.setX(m_direction.x() - m_position.x());
- paintingData.directionVector.setY(m_direction.y() - m_position.y());
- paintingData.directionVector.setZ(m_direction.z() - m_position.z());
- paintingData.directionVector.normalize();
-
- if (!m_limitingConeAngle) {
- paintingData.coneCutOffLimit = 0.0f;
- paintingData.coneFullLight = -antiAliasTreshold;
- } else {
- float limitingConeAngle = m_limitingConeAngle;
- if (limitingConeAngle < 0.0f)
- limitingConeAngle = -limitingConeAngle;
- if (limitingConeAngle > 90.0f)
- limitingConeAngle = 90.0f;
- paintingData.coneCutOffLimit = cosf(deg2rad(180.0f - limitingConeAngle));
- paintingData.coneFullLight = paintingData.coneCutOffLimit - antiAliasTreshold;
- }
-
- // Optimization for common specularExponent values
- if (!m_specularExponent)
- paintingData.specularExponent = 0;
- else if (m_specularExponent == 1.0f)
- paintingData.specularExponent = 1;
- else // It is neither 0.0f nor 1.0f
- paintingData.specularExponent = 2;
-}
-
-void SpotLightSource::updatePaintingData(PaintingData& paintingData, int x, int y, float z)
-{
- paintingData.lightVector.setX(m_position.x() - x);
- paintingData.lightVector.setY(m_position.y() - y);
- paintingData.lightVector.setZ(m_position.z() - z);
- paintingData.lightVector.normalize();
-
- float cosineOfAngle = paintingData.lightVector * paintingData.directionVector;
- if (cosineOfAngle > paintingData.coneCutOffLimit) {
- // No light is produced, scanlines are not updated
- paintingData.colorVector.setX(0.0f);
- paintingData.colorVector.setY(0.0f);
- paintingData.colorVector.setZ(0.0f);
- return;
- }
-
- // Set the color of the pixel
- float lightStrength;
- switch (paintingData.specularExponent) {
- case 0:
- lightStrength = 1.0f; // -cosineOfAngle ^ 0 == 1
- break;
- case 1:
- lightStrength = -cosineOfAngle; // -cosineOfAngle ^ 1 == -cosineOfAngle
- break;
- default:
- lightStrength = powf(-cosineOfAngle, m_specularExponent);
- break;
- }
-
- if (cosineOfAngle > paintingData.coneFullLight)
- lightStrength *= (paintingData.coneCutOffLimit - cosineOfAngle) / (paintingData.coneCutOffLimit - paintingData.coneFullLight);
-
- if (lightStrength > 1.0f)
- lightStrength = 1.0f;
-
- paintingData.colorVector.setX(paintingData.privateColorVector.x() * lightStrength);
- paintingData.colorVector.setY(paintingData.privateColorVector.y() * lightStrength);
- paintingData.colorVector.setZ(paintingData.privateColorVector.z() * lightStrength);
-}
-
-void DistantLightSource::initPaintingData(PaintingData& paintingData)
-{
- float azimuth = deg2rad(m_azimuth);
- float elevation = deg2rad(m_elevation);
- paintingData.lightVector.setX(cosf(azimuth) * cosf(elevation));
- paintingData.lightVector.setY(sinf(azimuth) * cosf(elevation));
- paintingData.lightVector.setZ(sinf(elevation));
-}
-
-void DistantLightSource::updatePaintingData(PaintingData&, int, int, float)
-{
-}
-
-static TextStream& operator<<(TextStream& ts, const FloatPoint3D& p)
-{
- ts << "x=" << p.x() << " y=" << p.y() << " z=" << p.z();
- return ts;
-}
-
-TextStream& PointLightSource::externalRepresentation(TextStream& ts) const
-{
- ts << "[type=POINT-LIGHT] ";
- ts << "[position=\"" << position() << "\"]";
- return ts;
-}
-
-TextStream& SpotLightSource::externalRepresentation(TextStream& ts) const
-{
- ts << "[type=SPOT-LIGHT] ";
- ts << "[position=\"" << position() << "\"]";
- ts << "[direction=\"" << direction() << "\"]";
- ts << "[specularExponent=\"" << specularExponent() << "\"]";
- ts << "[limitingConeAngle=\"" << limitingConeAngle() << "\"]";
- return ts;
-}
-
-TextStream& DistantLightSource::externalRepresentation(TextStream& ts) const
-{
- ts << "[type=DISTANT-LIGHT] ";
- ts << "[azimuth=\"" << azimuth() << "\"]";
- ts << "[elevation=\"" << elevation() << "\"]";
- return ts;
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(SVG) && ENABLE(FILTERS)
diff --git a/WebCore/svg/graphics/filters/SVGLightSource.h b/WebCore/svg/graphics/filters/SVGLightSource.h
deleted file mode 100644
index 6795107..0000000
--- a/WebCore/svg/graphics/filters/SVGLightSource.h
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Copyright (C) 2008 Alex Mathews <possessedpenguinbob at gmail.com>
- * 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) 2010 Zoltan Herczeg <zherczeg 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 SVGLightSource_h
-#define SVGLightSource_h
-
-#if ENABLE(SVG) && ENABLE(FILTERS)
-#include "FloatPoint3D.h"
-#include <wtf/PassRefPtr.h>
-#include <wtf/RefCounted.h>
-
-namespace WebCore {
-
-enum LightType {
- LS_DISTANT,
- LS_POINT,
- LS_SPOT
-};
-
-class TextStream;
-
-class LightSource : public RefCounted<LightSource> {
-public:
-
- // Light vectors must be calculated for every pixel during
- // painting. It is expensive to pass all these arguments to
- // a frequently called function, especially because not all
- // light sources require all of them. Instead, we just pass
- // a reference to the following structure
- struct PaintingData {
- // SVGFELighting also use them
- FloatPoint3D lightVector;
- FloatPoint3D colorVector;
- // Private members
- FloatPoint3D directionVector;
- FloatPoint3D privateColorVector;
- float coneCutOffLimit;
- float coneFullLight;
- int specularExponent;
- };
-
- LightSource(LightType type)
- : m_type(type)
- { }
-
- virtual ~LightSource() { }
-
- LightType type() const { return m_type; }
- virtual TextStream& externalRepresentation(TextStream&) const = 0;
-
- virtual void initPaintingData(PaintingData&) = 0;
- // z is a float number, since it is the alpha value scaled by a user
- // specified "surfaceScale" constant, which type is <number> in the SVG standard
- virtual void updatePaintingData(PaintingData&, int x, int y, float z) = 0;
-
-private:
- LightType m_type;
-};
-
-} // namespace WebCore
-
-#endif // ENABLE(SVG) && ENABLE(FILTERS)
-
-#endif // SVGLightSource_h
diff --git a/WebCore/svg/graphics/filters/SVGPointLightSource.h b/WebCore/svg/graphics/filters/SVGPointLightSource.h
deleted file mode 100644
index cd8f9b2..0000000
--- a/WebCore/svg/graphics/filters/SVGPointLightSource.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright (C) 2008 Alex Mathews <possessedpenguinbob at gmail.com>
- * 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 SVGPointLightSource_h
-#define SVGPointLightSource_h
-
-#if ENABLE(SVG) && ENABLE(FILTERS)
-#include "SVGLightSource.h"
-
-namespace WebCore {
-
-class PointLightSource : public LightSource {
-public:
- static PassRefPtr<PointLightSource> create(const FloatPoint3D& position)
- {
- return adoptRef(new PointLightSource(position));
- }
-
- const FloatPoint3D& position() const { return m_position; }
-
- virtual void initPaintingData(PaintingData&);
- virtual void updatePaintingData(PaintingData&, int x, int y, float z);
-
- virtual TextStream& externalRepresentation(TextStream&) const;
-
-private:
- PointLightSource(const FloatPoint3D& position)
- : LightSource(LS_POINT)
- , m_position(position)
- {
- }
-
- FloatPoint3D m_position;
-};
-
-} // namespace WebCore
-
-#endif // ENABLE(SVG) && ENABLE(FILTERS)
-
-#endif // SVGPointLightSource_h
diff --git a/WebCore/svg/graphics/filters/SVGSpotLightSource.h b/WebCore/svg/graphics/filters/SVGSpotLightSource.h
deleted file mode 100644
index 31c5674..0000000
--- a/WebCore/svg/graphics/filters/SVGSpotLightSource.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright (C) 2008 Alex Mathews <possessedpenguinbob at gmail.com>
- * 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 SVGSpotLightSource_h
-#define SVGSpotLightSource_h
-
-#if ENABLE(SVG) && ENABLE(FILTERS)
-#include "SVGLightSource.h"
-
-namespace WebCore {
-
-class SpotLightSource : public LightSource {
-public:
- static PassRefPtr<SpotLightSource> create(const FloatPoint3D& position,
- const FloatPoint3D& direction, float specularExponent, float limitingConeAngle)
- {
- return adoptRef(new SpotLightSource(position, direction, specularExponent, limitingConeAngle));
- }
-
- const FloatPoint3D& position() const { return m_position; }
- const FloatPoint3D& direction() const { return m_direction; }
-
- float specularExponent() const { return m_specularExponent; }
- float limitingConeAngle() const { return m_limitingConeAngle; }
-
- virtual void initPaintingData(PaintingData&);
- virtual void updatePaintingData(PaintingData&, int x, int y, float z);
-
- virtual TextStream& externalRepresentation(TextStream&) const;
-
-private:
- SpotLightSource(const FloatPoint3D& position, const FloatPoint3D& direction,
- float specularExponent, float limitingConeAngle)
- : LightSource(LS_SPOT)
- , m_position(position)
- , m_direction(direction)
- , m_specularExponent(specularExponent)
- , m_limitingConeAngle(limitingConeAngle)
- {
- }
-
- FloatPoint3D m_position;
- FloatPoint3D m_direction;
-
- float m_specularExponent;
- float m_limitingConeAngle;
-};
-
-} // namespace WebCore
-
-#endif // ENABLE(SVG) && ENABLE(FILTERS)
-
-#endif // SVGSpotLightSource_h
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list