2006-02-15 Oliver Hunt <ojh16@student.canterbury.ac.nz>
authoreseidel <eseidel@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 15 Feb 2006 10:30:52 +0000 (10:30 +0000)
committereseidel <eseidel@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 15 Feb 2006 10:30:52 +0000 (10:30 +0000)
        Reviewed by eseidel.  Landed by eseidel.

        Implemented feDisplacementMap.
        http://bugzilla.opendarwin.org/show_bug.cgi?id=5862

        Test: svg/custom/feDisplacementMap-01.svg

        * WebCore.xcodeproj/project.pbxproj: added files.
        * kcanvas/KCanvasFilters.cpp:
        (WebCore::KCanvasFEDisplacementMap::externalRepresentation):
        * kcanvas/KCanvasFilters.h:
        (WebCore::KCanvasFEDisplacementMap::KCanvasFEDisplacementMap):
        (WebCore::KCanvasFEDisplacementMap::xChannelSelector):
        (WebCore::KCanvasFEDisplacementMap::setXChannelSelector):
        (WebCore::KCanvasFEDisplacementMap::yChannelSelector):
        (WebCore::KCanvasFEDisplacementMap::setYChannelSelector):
        (WebCore::KCanvasFEDisplacementMap::scale):
        (WebCore::KCanvasFEDisplacementMap::setScale):
        * kcanvas/device/quartz/KCanvasFilterQuartz.h:
        * kcanvas/device/quartz/KCanvasFilterQuartz.mm:
        (WebCore::getVectorForChannel):
        (WebCore::KCanvasFEDisplacementMapQuartz::getCIFilter):
        * kcanvas/device/quartz/KRenderingDeviceQuartz.mm:
        (WebCore::KRenderingDeviceQuartz::createFilterEffect):
        * kcanvas/device/quartz/filters/WKDisplacementMapFilter.cikernel: Added.
        * kcanvas/device/quartz/filters/WKDisplacementMapFilter.h: Added.
        * kcanvas/device/quartz/filters/WKDisplacementMapFilter.m: Added.
        (+[WKDisplacementMapFilter initialize]):
        (+[WKDisplacementMapFilter filterWithName:]):
        (-[WKDisplacementMapFilter init]):
        (-[WKDisplacementMapFilter outputImage]):
        * ksvg2/svg/SVGFEDisplacementMapElementImpl.cpp: Added.
        (SVGFEDisplacementMapElementImpl::SVGFEDisplacementMapElementImpl):
        (SVGFEDisplacementMapElementImpl::~SVGFEDisplacementMapElementImpl):
        (SVGFEDisplacementMapElementImpl::in1):
        (SVGFEDisplacementMapElementImpl::in2):
        (SVGFEDisplacementMapElementImpl::xChannelSelector):
        (SVGFEDisplacementMapElementImpl::yChannelSelector):
        (SVGFEDisplacementMapElementImpl::scale):
        (SVGFEDisplacementMapElementImpl::stringToChannel):
        (SVGFEDisplacementMapElementImpl::parseMappedAttribute):
        (SVGFEDisplacementMapElementImpl::filterEffect):
        * ksvg2/svg/SVGFEDisplacementMapElementImpl.h: Added.
        * ksvg2/svg/svgtags.in:

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

20 files changed:
LayoutTests/ChangeLog
LayoutTests/svg/W3C-SVG-1.1/filters-displace-01-f-expected.checksum
LayoutTests/svg/W3C-SVG-1.1/filters-displace-01-f-expected.png
LayoutTests/svg/W3C-SVG-1.1/filters-displace-01-f-expected.txt
LayoutTests/svg/custom/feDisplacementMap-01.svg [new file with mode: 0644]
LayoutTests/svg/custom/resources/feDisplacementMap-01-displace.png [new file with mode: 0644]
LayoutTests/svg/custom/resources/feDisplacementMap-01-source.png [new file with mode: 0644]
WebCore/ChangeLog
WebCore/WebCore.xcodeproj/project.pbxproj
WebCore/kcanvas/KCanvasFilters.cpp
WebCore/kcanvas/KCanvasFilters.h
WebCore/kcanvas/device/quartz/KCanvasFilterQuartz.h
WebCore/kcanvas/device/quartz/KCanvasFilterQuartz.mm
WebCore/kcanvas/device/quartz/KRenderingDeviceQuartz.mm
WebCore/kcanvas/device/quartz/filters/WKDisplacementMapFilter.cikernel [new file with mode: 0644]
WebCore/kcanvas/device/quartz/filters/WKDisplacementMapFilter.h [new file with mode: 0644]
WebCore/kcanvas/device/quartz/filters/WKDisplacementMapFilter.m [new file with mode: 0644]
WebCore/ksvg2/svg/SVGFEDisplacementMapElementImpl.cpp [new file with mode: 0644]
WebCore/ksvg2/svg/SVGFEDisplacementMapElementImpl.h [new file with mode: 0644]
WebCore/ksvg2/svg/svgtags.in

index dfc2838c1d2800a4888bbb2b216ae2595ae39fd6..bb3f549e85adce59dc4d14c2324100c7084b8dde 100644 (file)
@@ -1,3 +1,20 @@
+2006-02-15  Oliver Hunt  <ojh16@student.canterbury.ac.nz>
+
+        Reviewed by eseidel.  Landed by eseidel.
+        
+        Implemented feDisplacementMap.
+        http://bugzilla.opendarwin.org/show_bug.cgi?id=5862
+        
+        * svg/W3C-SVG-1.1/filters-displace-01-f-expected.checksum:
+        * svg/W3C-SVG-1.1/filters-displace-01-f-expected.png:
+        * svg/W3C-SVG-1.1/filters-displace-01-f-expected.txt:
+        * svg/custom/feDisplacementMap-01.svg: Added.
+        * svg/custom/feDisplacementMap-01-expected.checksum: Added.
+        * svg/custom/feDisplacementMap-01-expected.png: Added.
+        * svg/custom/feDisplacementMap-01-expected.txt: Added.
+        * svg/custom/resources/feDisplacementMap-01-displace.png: Added.
+        * svg/custom/resources/feDisplacementMap-01-source.png: Added.
+
 2006-02-15  Eric Seidel  <eseidel@apple.com>
 
         Update missing result from last commit.
index 0905796fa68890c961da0cb3329c40d5480a166e..4f30bcda339ea1b38f8fd1da776ef80324a22588 100644 (file)
@@ -1 +1 @@
-8358f9bb800ec982bf0cad2861823a2a
\ No newline at end of file
+fc78a06aa0251b7b03ad6243e2017fb5
\ No newline at end of file
index 9f2b06afb1a4763c1a25b28e49a1782e84265e94..1ca263358007d98af64f60b7e5d5059e056e9884 100644 (file)
Binary files a/LayoutTests/svg/W3C-SVG-1.1/filters-displace-01-f-expected.png and b/LayoutTests/svg/W3C-SVG-1.1/filters-displace-01-f-expected.png differ
index f1963a050e2e306de029ba0e3db056c4ec02fb52..c11c1c3c98f1f394e5e326e3652b0f77ba59fa80 100644 (file)
@@ -1,8 +1,8 @@
 KCanvasResource {id="DispMapChecker" [type=FILTER]  [bounding box=at (0,0) size 1x1] [effect bounding box mode=0] [effects=[[type=IMAGE]  [subregion="at (0,0) size 480x360"]]]}
 KCanvasResource {id="RotateMap" [type=FILTER]  [bounding box=at (0,0) size 1x1] [effect bounding box mode=0] [effects=[[type=IMAGE]  [subregion="at (0,0) size 480x360"]]]}
 KCanvasResource {id="SphereMap" [type=FILTER]  [bounding box=at (0,0) size 1x1] [effect bounding box mode=0] [effects=[[type=IMAGE]  [subregion="at (0,0) size 480x360"]]]}
-KCanvasResource {id="RotateMapTest" [type=FILTER]  [bounding box=at (0,0) size 1x1] [effect bounding box mode=0] [effects=[[type=IMAGE]  [result="Map"] [subregion="at (0,0) size 480x360"], [type=IMAGE]  [result="Texture"] [subregion="at (0,0) size 480x360"]]]}
-KCanvasResource {id="SphereMapTest" [type=FILTER]  [bounding box=at (0,0) size 1x1] [effect bounding box mode=0] [effects=[[type=IMAGE]  [result="Map"] [subregion="at (0,0) size 480x360"], [type=IMAGE]  [result="Texture"] [subregion="at (0,0) size 480x360"]]]}
+KCanvasResource {id="RotateMapTest" [type=FILTER]  [bounding box=at (0,0) size 1x1] [effect bounding box mode=0] [effects=[[type=IMAGE]  [result="Map"] [subregion="at (0,0) size 480x360"], [type=IMAGE]  [result="Texture"] [subregion="at (0,0) size 480x360"], [type=DISPLACEMENT-MAP] [in="Texture"] [subregion="at (0,0) size 480x360"] [in2=Map] [scale=64.00] [x channel selector=RED] [y channel selector=GREEN]]]}
+KCanvasResource {id="SphereMapTest" [type=FILTER]  [bounding box=at (0,0) size 1x1] [effect bounding box mode=0] [effects=[[type=IMAGE]  [result="Map"] [subregion="at (0,0) size 480x360"], [type=IMAGE]  [result="Texture"] [subregion="at (0,0) size 480x360"], [type=DISPLACEMENT-MAP] [in="Texture"] [subregion="at (0,0) size 480x360"] [in2=Map] [scale=64.00] [x channel selector=RED] [y channel selector=GREEN]]]}
 layer at (0,0) size 480x360
   RenderCanvas at (0,0) size 480x360
     KCanvasContainer {svg} at (0.50,0.50) size 479x359
diff --git a/LayoutTests/svg/custom/feDisplacementMap-01.svg b/LayoutTests/svg/custom/feDisplacementMap-01.svg
new file mode 100644 (file)
index 0000000..5e24285
--- /dev/null
@@ -0,0 +1,25 @@
+<svg version="1.1" baseProfile="full" id="svg-root" width="100%" height="100%"\r
+     xmlns="http://www.w3.org/2000/svg" \r
+     xmlns:xlink="http://www.w3.org/1999/xlink" >\r
+     <!-- This testcase provides a simple demonstration of the feDisplacementMap filter.\r
+          The output should be a 100x100 green rectangle, however due to the nature of the\r
+          test it may produce a ~1px red line around the right half of the image.  While not\r
+          ideal this is currently expected.\r
+          \r
+          If the square is not at (0,0) then there is some form of colour matching occuring\r
+          outside the domain of the filter.  In that case, provided there is still no \r
+          significant red visible the test is a pass.          \r
+       -->\r
+  <title id="test-title">Displacement mapping test case</title>\r
+  <g id="test-body-content">\r
+    <defs>\r
+      <filter id="ResultImage">\r
+        <feImage result="Map"     xlink:href="resources/feDisplacementMap-01-displace.png" width="100" height="100"/>\r
+        <feImage result="Texture" xlink:href="resources/feDisplacementMap-01-source.png" width="100" height="100"/>\r
+        <feDisplacementMap in="Texture" in2="Map" scale="100" xChannelSelector="R" yChannelSelector="G"/>\r
+      </filter>\r
+    </defs>\r
+    <rect x="0" y="0" width="100" height="100" filter="url(#ResultImage)" />\r
+    <rect fill="none" stroke="blue" x="0" y="0" width="100" height="100"/>\r
+  </g>\r
+</svg>\r
diff --git a/LayoutTests/svg/custom/resources/feDisplacementMap-01-displace.png b/LayoutTests/svg/custom/resources/feDisplacementMap-01-displace.png
new file mode 100644 (file)
index 0000000..3396e45
Binary files /dev/null and b/LayoutTests/svg/custom/resources/feDisplacementMap-01-displace.png differ
diff --git a/LayoutTests/svg/custom/resources/feDisplacementMap-01-source.png b/LayoutTests/svg/custom/resources/feDisplacementMap-01-source.png
new file mode 100644 (file)
index 0000000..4ed5136
Binary files /dev/null and b/LayoutTests/svg/custom/resources/feDisplacementMap-01-source.png differ
index d0bdbecea2386a01a56519c0d229b49ee34f869c..b000132c9390cfdf49915ba8732545e268fb8248 100644 (file)
@@ -1,3 +1,50 @@
+2006-02-15  Oliver Hunt  <ojh16@student.canterbury.ac.nz>
+
+        Reviewed by eseidel.  Landed by eseidel.
+        
+        Implemented feDisplacementMap.
+        http://bugzilla.opendarwin.org/show_bug.cgi?id=5862
+
+        Test: svg/custom/feDisplacementMap-01.svg
+
+        * WebCore.xcodeproj/project.pbxproj: added files.
+        * kcanvas/KCanvasFilters.cpp:
+        (WebCore::KCanvasFEDisplacementMap::externalRepresentation):
+        * kcanvas/KCanvasFilters.h:
+        (WebCore::KCanvasFEDisplacementMap::KCanvasFEDisplacementMap):
+        (WebCore::KCanvasFEDisplacementMap::xChannelSelector):
+        (WebCore::KCanvasFEDisplacementMap::setXChannelSelector):
+        (WebCore::KCanvasFEDisplacementMap::yChannelSelector):
+        (WebCore::KCanvasFEDisplacementMap::setYChannelSelector):
+        (WebCore::KCanvasFEDisplacementMap::scale):
+        (WebCore::KCanvasFEDisplacementMap::setScale):
+        * kcanvas/device/quartz/KCanvasFilterQuartz.h:
+        * kcanvas/device/quartz/KCanvasFilterQuartz.mm:
+        (WebCore::getVectorForChannel):
+        (WebCore::KCanvasFEDisplacementMapQuartz::getCIFilter):
+        * kcanvas/device/quartz/KRenderingDeviceQuartz.mm:
+        (WebCore::KRenderingDeviceQuartz::createFilterEffect):
+        * kcanvas/device/quartz/filters/WKDisplacementMapFilter.cikernel: Added.
+        * kcanvas/device/quartz/filters/WKDisplacementMapFilter.h: Added.
+        * kcanvas/device/quartz/filters/WKDisplacementMapFilter.m: Added.
+        (+[WKDisplacementMapFilter initialize]):
+        (+[WKDisplacementMapFilter filterWithName:]):
+        (-[WKDisplacementMapFilter init]):
+        (-[WKDisplacementMapFilter outputImage]):
+        * ksvg2/svg/SVGFEDisplacementMapElementImpl.cpp: Added.
+        (SVGFEDisplacementMapElementImpl::SVGFEDisplacementMapElementImpl):
+        (SVGFEDisplacementMapElementImpl::~SVGFEDisplacementMapElementImpl):
+        (SVGFEDisplacementMapElementImpl::in1):
+        (SVGFEDisplacementMapElementImpl::in2):
+        (SVGFEDisplacementMapElementImpl::xChannelSelector):
+        (SVGFEDisplacementMapElementImpl::yChannelSelector):
+        (SVGFEDisplacementMapElementImpl::scale):
+        (SVGFEDisplacementMapElementImpl::stringToChannel):
+        (SVGFEDisplacementMapElementImpl::parseMappedAttribute):
+        (SVGFEDisplacementMapElementImpl::filterEffect):
+        * ksvg2/svg/SVGFEDisplacementMapElementImpl.h: Added.
+        * ksvg2/svg/svgtags.in:
+
 2006-02-15  Eric Seidel  <eseidel@apple.com>
 
         Reviewed by darin.
index 42df3ea972fe0bbac4858ed9e18224dd10958a4a..2878d7bcba3c64439c2fae0273ab39a5ef233932 100644 (file)
                93F19B1608245E59001E9ABC /* JavaScriptCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F8216299029F4FB501000131 /* JavaScriptCore.framework */; };
                93F19B1708245E59001E9ABC /* libicucore.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 93F1D31A0558CC5C00821BC0 /* libicucore.dylib */; };
                93F19B1808245E59001E9ABC /* libxslt.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 840633070731A77200DB1FD1 /* libxslt.dylib */; };
+               A7638A8B09958EA50007E14F /* WKDisplacementMapFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = A7638A8909958EA50007E14F /* WKDisplacementMapFilter.h */; };
+               A7638A8C09958EA50007E14F /* WKDisplacementMapFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = A7638A8A09958EA50007E14F /* WKDisplacementMapFilter.m */; };
+               A7638A92099592C30007E14F /* WKDisplacementMapFilter.cikernel in Resources */ = {isa = PBXBuildFile; fileRef = A7638A91099592C30007E14F /* WKDisplacementMapFilter.cikernel */; };
+               A7638A970995965D0007E14F /* SVGFEDisplacementMapElementImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = A7638A950995965D0007E14F /* SVGFEDisplacementMapElementImpl.h */; };
+               A7638A980995965D0007E14F /* SVGFEDisplacementMapElementImpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7638A960995965D0007E14F /* SVGFEDisplacementMapElementImpl.cpp */; };
                A81369CA097374F600D74463 /* HTMLIsIndexElementImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = A81369AE097374F500D74463 /* HTMLIsIndexElementImpl.h */; };
                A81369CB097374F600D74463 /* HTMLIsIndexElementImpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A81369AF097374F500D74463 /* HTMLIsIndexElementImpl.cpp */; };
                A81369CC097374F600D74463 /* HTMLInputElementImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = A81369B0097374F500D74463 /* HTMLInputElementImpl.h */; };
                93F19B1908245E59001E9ABC /* Info.plist */ = {isa = PBXFileReference; indentWidth = 4; lastKnownFileType = text.xml; path = Info.plist; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                93F19B1A08245E5A001E9ABC /* WebCore.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = WebCore.framework; sourceTree = BUILT_PRODUCTS_DIR; };
                93F1D31A0558CC5C00821BC0 /* libicucore.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libicucore.dylib; path = /usr/lib/libicucore.dylib; sourceTree = "<absolute>"; };
+               A7638A8909958EA50007E14F /* WKDisplacementMapFilter.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = WKDisplacementMapFilter.h; sourceTree = "<group>"; };
+               A7638A8A09958EA50007E14F /* WKDisplacementMapFilter.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = WKDisplacementMapFilter.m; sourceTree = "<group>"; };
+               A7638A91099592C30007E14F /* WKDisplacementMapFilter.cikernel */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WKDisplacementMapFilter.cikernel; sourceTree = "<group>"; };
+               A7638A950995965D0007E14F /* SVGFEDisplacementMapElementImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGFEDisplacementMapElementImpl.h; sourceTree = "<group>"; };
+               A7638A960995965D0007E14F /* SVGFEDisplacementMapElementImpl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGFEDisplacementMapElementImpl.cpp; sourceTree = "<group>"; };
                A810E39308A4160F00333D98 /* KCanvasTreeDebug.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = KCanvasTreeDebug.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                A810E39408A4160F00333D98 /* KCanvasTreeDebug.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = KCanvasTreeDebug.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                A8122C7E08D564B000844FA3 /* GetSVGDocument.idl */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = text; path = GetSVGDocument.idl; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                                A8C0F842089701F300BA5114 /* SVGEllipseElementImpl.h */,
                                A8C0F845089701F300BA5114 /* SVGExternalResourcesRequiredImpl.cpp */,
                                A8C0F846089701F300BA5114 /* SVGExternalResourcesRequiredImpl.h */,
+                               A7638A950995965D0007E14F /* SVGFEDisplacementMapElementImpl.h */,
+                               A7638A960995965D0007E14F /* SVGFEDisplacementMapElementImpl.cpp */,
                                A8C0F847089701F300BA5114 /* SVGFEBlendElementImpl.cpp */,
                                A8C0F848089701F300BA5114 /* SVGFEBlendElementImpl.h */,
                                A8C0F849089701F300BA5114 /* SVGFEColorMatrixElementImpl.cpp */,
                A8C3291F093BB732000B9CAC /* filters */ = {
                        isa = PBXGroup;
                        children = (
+                               A7638A8909958EA50007E14F /* WKDisplacementMapFilter.h */,
+                               A7638A8A09958EA50007E14F /* WKDisplacementMapFilter.m */,
+                               A7638A91099592C30007E14F /* WKDisplacementMapFilter.cikernel */,
                                A8C32920093BB732000B9CAC /* WKArithmeticFilter.cikernel */,
                                A8C32921093BB732000B9CAC /* WKArithmeticFilter.h */,
                                A8C32922093BB732000B9CAC /* WKArithmeticFilter.m */,
                                BC6B7ECF0998AC7F0052867B /* ImageSource.h in Headers */,
                                6582A14009999CD600BEEB6D /* QString.h in Headers */,
                                6582A16009999D6D00BEEB6D /* PDFDocumentImage.h in Headers */,
+                               A7638A8B09958EA50007E14F /* WKDisplacementMapFilter.h in Headers */,
+                               A7638A970995965D0007E14F /* SVGFEDisplacementMapElementImpl.h in Headers */,
                                93309DD7099E64920056E581 /* AppendNodeCommand.h in Headers */,
                                93309DD9099E64920056E581 /* ApplyStyleCommand.h in Headers */,
                                93309DDB099E64920056E581 /* BreakBlockquoteCommand.h in Headers */,
                                BCEA479C097CAAC80094C9E4 /* cssproperties.in in Resources */,
                                BCEA479F097CAAC80094C9E4 /* cssvalues.in in Resources */,
                                BCC8CFCD0986CD2400140BF2 /* ColorData.gperf in Resources */,
+                               A7638A92099592C30007E14F /* WKDisplacementMapFilter.cikernel in Resources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
                                6582A17809999EA000BEEB6D /* QStringMac.mm in Sources */,
                                1A2154EE099A11A800343DF8 /* JSDOMCore.cpp in Sources */,
                                1A2154EF099A11A800343DF8 /* JSDOMEvents.cpp in Sources */,
+                               A7638A8C09958EA50007E14F /* WKDisplacementMapFilter.m in Sources */,
+                               A7638A980995965D0007E14F /* SVGFEDisplacementMapElementImpl.cpp in Sources */,
                                93309DD6099E64920056E581 /* AppendNodeCommand.cpp in Sources */,
                                93309DD8099E64920056E581 /* ApplyStyleCommand.cpp in Sources */,
                                93309DDA099E64920056E581 /* BreakBlockquoteCommand.cpp in Sources */,
index f78e26310f0d680cff024070775fbd7df905ec95..f6f91f704cdf92fe78e751fc08a7f14352c7c57a 100644 (file)
@@ -345,8 +345,8 @@ QTextStream &KCanvasFEDisplacementMap::externalRepresentation(QTextStream &ts) c
     if (!in2().isEmpty())
         ts << " [in2=" << in2() << "]";        
     ts << " [scale=" << m_scale << "]"
-        << " [x channel selector=" << m_XChannelSelector << "]"
-        << " [y channel selector=" << m_XChannelSelector << "]";
+        << " [x channel selector=" << m_xChannelSelector << "]"
+        << " [y channel selector=" << m_yChannelSelector << "]";
    return ts;
 }
 
index faad868d54c6bf46afbbf4ad681722082bfb1c70..ac660dd3979b28478822dfaaaa6346a72bcc4488 100644 (file)
@@ -449,16 +449,27 @@ typedef enum {
 class KCanvasFEDisplacementMap : public KCanvasFilterEffect
 {
 public:
+    KCanvasFEDisplacementMap() : m_xChannelSelector(CS_RED), m_yChannelSelector(CS_RED), m_scale(0) {}
+    
     QString in2() const { return m_in2; }
     void setIn2(const QString &in2) { m_in2 = in2; }
+    
+    KCChannelSelectorType xChannelSelector() const { return m_xChannelSelector; }
+    void setXChannelSelector(const KCChannelSelectorType xChannelSelector) { m_xChannelSelector = xChannelSelector; }
+    
+    KCChannelSelectorType yChannelSelector() const { return m_yChannelSelector; }
+    void setYChannelSelector(const KCChannelSelectorType yChannelSelector) { m_yChannelSelector = yChannelSelector; }
 
+    float scale() const { return m_scale; }
+    void setScale(float scale) { m_scale = scale; }
+    
     QTextStream &externalRepresentation(QTextStream &) const;
     
 private:
-    float m_scale;
-    KCChannelSelectorType m_XChannelSelector;
-    KCChannelSelectorType m_YChannelSelector;
     QString m_in2;
+    KCChannelSelectorType m_xChannelSelector;
+    KCChannelSelectorType m_yChannelSelector;
+    float m_scale;
 };
 
 class KCanvasFEFlood : public KCanvasFilterEffect
index cf6925824db6b98301248a48a1922fea42fd9c9f..c8ecb37444c4d7aac072dc7c105e25270d2b2cce 100644 (file)
@@ -106,6 +106,11 @@ public:
     virtual CIFilter *getCIFilter(KCanvasFilterQuartz *quartzFilter) const;
 };
 
+class KCanvasFEDisplacementMapQuartz : public KCanvasFEDisplacementMap {
+public:
+    virtual CIFilter *getCIFilter(KCanvasFilterQuartz *quartzFilter) const;
+};
+
 class KCanvasFEMergeQuartz : public KCanvasFEMerge {
 public:
     virtual CIFilter *getCIFilter(KCanvasFilterQuartz *quartzFilter) const;
index 8195e1b9a0e6b0e2fde6aabdcff7a6fcac20c355..e62421868cd908b4361741eb1b8fc599f438a626 100644 (file)
@@ -32,6 +32,7 @@
 #import "KRenderingDeviceQuartz.h"
 #import "QuartzSupport.h"
 #import "KWQExceptions.h"
+#import "WKDisplacementMapFilter.h"
 #import "WKDiffuseLightingFilter.h"
 #import "WKSpecularLightingFilter.h"
 #import "WKSpotLightFilter.h"
@@ -393,6 +394,40 @@ CIFilter *KCanvasFECompositeQuartz::getCIFilter(KCanvasFilterQuartz *quartzFilte
     FE_QUARTZ_OUTPUT_RETURN;
 }
 
+static inline CIVector *getVectorForChannel(int idx){
+    switch(idx){
+    case 0:
+        return [CIVector vectorWithX:1.0 Y:0.0 Z:0.0 W:0.0];
+    case 1:
+        return [CIVector vectorWithX:0.0 Y:1.0 Z:0.0 W:0.0];            
+    case 2:
+        return [CIVector vectorWithX:0.0 Y:0.0 Z:1.0 W:0.0];
+    case 3:
+        return [CIVector vectorWithX:0.0 Y:0.0 Z:0.0 W:1.0];
+    default:
+        return [CIVector vectorWithX:0.0 Y:0.0 Z:0.0 W:0.0];
+    }
+}
+
+CIFilter *KCanvasFEDisplacementMapQuartz::getCIFilter(KCanvasFilterQuartz *quartzFilter) const
+{
+    CIFilter *filter = nil;
+    KWQ_BLOCK_EXCEPTIONS;
+    [WKDisplacementMapFilter class];
+    filter = [CIFilter filterWithName:@"WKDisplacementMapFilter"];    
+    [filter setDefaults];
+    CIImage *inputImage = quartzFilter->inputImage(this);
+    CIImage *displacementMap = quartzFilter->imageForName(in2());
+    FE_QUARTZ_CHECK_INPUT(inputImage);
+    FE_QUARTZ_CHECK_INPUT(displacementMap);
+    [filter setValue:inputImage forKey:@"inputImage"];
+    [filter setValue:displacementMap forKey:@"inputDisplacementMap"];
+    [filter setValue:getVectorForChannel(xChannelSelector()) forKey:@"inputXChannelSelector"];
+    [filter setValue:getVectorForChannel(yChannelSelector()) forKey:@"inputYChannelSelector"];
+    [filter setValue:[NSNumber numberWithFloat:scale()] forKey:@"inputScale"];
+    FE_QUARTZ_OUTPUT_RETURN;
+}
+
 static inline CIFilter *getPointLightVectors(CIFilter * normals, CIVector * lightPosition, float surfaceScale)
 {
     CIFilter *filter;
index b100aed773221343307375c8e0ea904cfb1d14f5..b655467e069dff0d2eac1588d77e73004d738f71 100644 (file)
@@ -257,7 +257,7 @@ KCanvasFilterEffect *KRenderingDeviceQuartz::createFilterEffect(const KCFilterEf
     case FE_COMPOSITE: return new KCanvasFECompositeQuartz();
 //  case FE_CONVOLVE_MATRIX: 
     case FE_DIFFUSE_LIGHTING: return new KCanvasFEDiffuseLightingQuartz();
-//  case FE_DISPLACEMENT_MAP: 
+    case FE_DISPLACEMENT_MAP: return new KCanvasFEDisplacementMapQuartz();
     case FE_FLOOD: return new KCanvasFEFloodQuartz();
     case FE_GAUSSIAN_BLUR: return new KCanvasFEGaussianBlurQuartz();
     case FE_IMAGE: return new KCanvasFEImageQuartz();
diff --git a/WebCore/kcanvas/device/quartz/filters/WKDisplacementMapFilter.cikernel b/WebCore/kcanvas/device/quartz/filters/WKDisplacementMapFilter.cikernel
new file mode 100644 (file)
index 0000000..ee48000
--- /dev/null
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2006 Oliver Hunt <ojh16@student.canterbury.ac.nz>.  All rights reserved.
+ *
+ * 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 THE AUTHOR ``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 THE AUTHOR 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. 
+ */
+/*
+ * Performs the transformation:
+ * P'(x,y) <- P( x + scale * (XC(x,y) - .5), y + scale * (YC(x,y) - .5))
+ *
+ * x/ychannel arguments are used to select the appropriate channel for x and
+ * y displacement.  Hence each vector should have only one non-zero element,
+ * which should have the value 1.0.
+ *
+ */
+
+kernel vec4 displacementMap(sampler image, sampler map, vec4 xchannel, vec4 ychannel, float scale)
+{
+    vec2 samplePos = samplerCoord(image);
+    vec4 XCYC = sample(map, samplerCoord(map));
+    float xc = dot(XCYC, xchannel);
+    float yc = dot(XCYC, ychannel);
+    samplePos.x += scale*(xc-0.5);
+    //flip the y-axis
+    samplePos.y -= scale*(yc-0.5);
+    return sample(image, samplePos);
+}
diff --git a/WebCore/kcanvas/device/quartz/filters/WKDisplacementMapFilter.h b/WebCore/kcanvas/device/quartz/filters/WKDisplacementMapFilter.h
new file mode 100644 (file)
index 0000000..450353a
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2006 Oliver Hunt <ojh16@student.canterbury.ac.nz>.  All rights reserved.
+ *
+ * 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 THE AUTHOR ``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 THE AUTHOR 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. 
+ */
+
+#import <QuartzCore/CoreImage.h>
+
+@interface WKDisplacementMapFilter : CIFilter {
+    CIImage  *inputImage;
+    CIImage  *inputDisplacementMap;
+    CIVector *inputXChannelSelector;
+    CIVector *inputYChannelSelector;
+    NSNumber *inputScale;
+}
+
+@end
diff --git a/WebCore/kcanvas/device/quartz/filters/WKDisplacementMapFilter.m b/WebCore/kcanvas/device/quartz/filters/WKDisplacementMapFilter.m
new file mode 100644 (file)
index 0000000..ac7b1cc
--- /dev/null
@@ -0,0 +1,76 @@
+/*
+ * Copyright (C) 2006 Oliver Hunt <ojh16@student.canterbury.ac.nz>.  All rights reserved.
+ *
+ * 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 THE AUTHOR ``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 THE AUTHOR 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. 
+ */
+
+#import "WKDisplacementMapFilter.h"
+
+static CIKernel *displacementMapFilter = nil;
+
+@implementation WKDisplacementMapFilter
+
++ (void)initialize
+{
+    [CIFilter registerFilterName:@"WKDisplacementMapFilter"  
+                     constructor:self
+                 classAttributes:[NSDictionary dictionaryWithObjectsAndKeys:
+                     @"WebKit Displacement Map Filter", kCIAttributeFilterDisplayName,
+                     [NSArray arrayWithObjects:kCICategoryStylize, kCICategoryVideo,
+                         kCICategoryStillImage, kCICategoryNonSquarePixels,nil], kCIAttributeFilterCategories,
+                     [NSDictionary dictionaryWithObjectsAndKeys:
+                         [CIVector vectorWithX:1.0 Y:0.0 Z:0.0 W:0.0],
+                         kCIAttributeDefault, nil], @"inputXChannelSelector",   
+                     [NSDictionary dictionaryWithObjectsAndKeys:
+                         [CIVector vectorWithX:0.0 Y:1.0 Z:0.0 W:0.0],
+                         kCIAttributeDefault, nil], @"inputYChannelSelector",                  
+                     [NSDictionary dictionaryWithObjectsAndKeys:
+                         [NSNumber numberWithDouble:0.0], kCIAttributeDefault,
+                         [NSNumber numberWithDouble:0.0], kCIAttributeIdentity,
+                         kCIAttributeTypeScalar, kCIAttributeType,
+                         nil], @"inputScale",
+                     nil]];
+}
+
++ (CIFilter *)filterWithName:(NSString *)name
+{
+    return [[[self alloc] init] autorelease];
+}
+
+- (id)init
+{
+    if (!displacementMapFilter) {
+        NSBundle *bundle = [NSBundle bundleForClass:[self class]];
+        NSString *kernelFile = [bundle pathForResource:@"WKDisplacementMapFilter" ofType:@"cikernel"];
+        NSString *code = [NSString stringWithContentsOfFile:kernelFile];
+        NSArray *kernels = [CIKernel kernelsWithString:code];
+        displacementMapFilter = [[kernels objectAtIndex:0] retain];
+    }
+    return [super init];
+}
+
+- (CIImage *)outputImage
+{
+    return [self apply:displacementMapFilter, inputImage, inputDisplacementMap, inputXChannelSelector, inputYChannelSelector, inputScale, nil];
+}
+
+@end
diff --git a/WebCore/ksvg2/svg/SVGFEDisplacementMapElementImpl.cpp b/WebCore/ksvg2/svg/SVGFEDisplacementMapElementImpl.cpp
new file mode 100644 (file)
index 0000000..542a5ca
--- /dev/null
@@ -0,0 +1,128 @@
+/*
+ Copyright (C) 2006 Oliver Hunt <ojh16@student.canterbury.ac.nz>
+ 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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+ */
+
+
+#include "config.h"
+#if SVG_SUPPORT
+#include <qstringlist.h>
+
+#include <kdom/core/AttrImpl.h>
+
+#include <kcanvas/KCanvas.h>
+#include <kcanvas/KCanvasFilters.h>
+#include <kcanvas/device/KRenderingDevice.h>
+
+#include "ksvg.h"
+#include "SVGHelper.h"
+#include "SVGRenderStyle.h"
+#include "SVGFEDisplacementMapElementImpl.h"
+#include "SVGAnimatedEnumerationImpl.h"
+#include "SVGAnimatedStringImpl.h"
+#include "SVGAnimatedNumberImpl.h"
+#include "SVGDOMImplementationImpl.h"
+
+using namespace KSVG;
+
+SVGFEDisplacementMapElementImpl::SVGFEDisplacementMapElementImpl(const KDOM::QualifiedName& tagName, KDOM::DocumentImpl* doc) : 
+SVGFilterPrimitiveStandardAttributesImpl(tagName, doc)
+{
+    m_filterEffect = 0;
+}
+
+SVGFEDisplacementMapElementImpl::~SVGFEDisplacementMapElementImpl()
+{
+    delete m_filterEffect;
+}
+
+SVGAnimatedStringImpl* SVGFEDisplacementMapElementImpl::in1() const
+{
+    SVGStyledElementImpl* dummy = 0;
+    return lazy_create<SVGAnimatedStringImpl>(m_in1, dummy);
+}
+
+SVGAnimatedStringImpl* SVGFEDisplacementMapElementImpl::in2() const
+{
+    SVGStyledElementImpl* dummy = 0;
+    return lazy_create<SVGAnimatedStringImpl>(m_in2, dummy);
+}
+
+SVGAnimatedEnumerationImpl* SVGFEDisplacementMapElementImpl::xChannelSelector() const
+{
+    SVGStyledElementImpl* dummy = 0;
+    return lazy_create<SVGAnimatedEnumerationImpl>(m_xChannelSelector, dummy);
+}
+
+SVGAnimatedEnumerationImpl* SVGFEDisplacementMapElementImpl::yChannelSelector() const
+{
+    SVGStyledElementImpl* dummy = 0;
+    return lazy_create<SVGAnimatedEnumerationImpl>(m_yChannelSelector, dummy);
+}
+
+SVGAnimatedNumberImpl* SVGFEDisplacementMapElementImpl::scale() const
+{
+    SVGStyledElementImpl* dummy = 0;
+    return lazy_create<SVGAnimatedNumberImpl>(m_scale, dummy);
+}
+
+KCChannelSelectorType SVGFEDisplacementMapElementImpl::stringToChannel(KDOM::DOMString& key)
+{
+    if(key == "R")
+        return CS_RED;
+    else if(key == "G")
+        return CS_GREEN;
+    else if(key == "B")
+        return CS_BLUE;
+    else if(key == "A")
+        return CS_ALPHA;
+    //error
+    return (KCChannelSelectorType)-1;
+}
+
+void SVGFEDisplacementMapElementImpl::parseMappedAttribute(KDOM::MappedAttributeImpl* attr)
+{
+    KDOM::DOMString value(attr->value());
+    if (attr->name() == SVGNames::xChannelSelectorAttr)
+        xChannelSelector()->setBaseVal(stringToChannel(value));
+    else if (attr->name() == SVGNames::yChannelSelectorAttr)
+        yChannelSelector()->setBaseVal(stringToChannel(value));
+    else if (attr->name() == SVGNames::inAttr)
+        in1()->setBaseVal(value.impl());
+    else if (attr->name() == SVGNames::in2Attr)
+        in2()->setBaseVal(value.impl());
+    else if (attr->name() == SVGNames::scaleAttr)
+        scale()->setBaseVal(value.qstring().toDouble());
+    else
+        SVGFilterPrimitiveStandardAttributesImpl::parseMappedAttribute(attr);
+}
+
+KCanvasFEDisplacementMap* SVGFEDisplacementMapElementImpl::filterEffect() const
+{
+    if (!m_filterEffect)
+        m_filterEffect = static_cast<KCanvasFEDisplacementMap *>(QPainter::renderingDevice()->createFilterEffect(FE_DISPLACEMENT_MAP));
+    if (!m_filterEffect)
+        return 0;
+    m_filterEffect->setXChannelSelector((KCChannelSelectorType)(xChannelSelector()->baseVal()));
+    m_filterEffect->setYChannelSelector((KCChannelSelectorType)(yChannelSelector()->baseVal()));
+    m_filterEffect->setIn(KDOM::DOMString(in1()->baseVal()).qstring());
+    m_filterEffect->setIn2(KDOM::DOMString(in2()->baseVal()).qstring());
+    m_filterEffect->setScale(scale()->baseVal());
+    setStandardAttributes(m_filterEffect);
+    return m_filterEffect;
+}
+#endif // SVG_SUPPORT
diff --git a/WebCore/ksvg2/svg/SVGFEDisplacementMapElementImpl.h b/WebCore/ksvg2/svg/SVGFEDisplacementMapElementImpl.h
new file mode 100644 (file)
index 0000000..1baa99d
--- /dev/null
@@ -0,0 +1,67 @@
+/*
+ Copyright (C) 2006 Oliver Hunt <ojh16@student.canterbury.ac.nz>
+ 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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+ */
+
+
+
+#ifndef KSVG_SVGFEDisplacementMapElementImpl_H
+#define KSVG_SVGFEDisplacementMapElementImpl_H
+#if SVG_SUPPORT
+
+#include "SVGFilterPrimitiveStandardAttributesImpl.h"
+#include "KCanvasFilters.h"
+
+namespace KSVG
+{
+    class SVGAnimatedNumberImpl;
+    class SVGAnimatedStringImpl;
+    class SVGAnimatedEnumerationImpl;
+    
+    class SVGFEDisplacementMapElementImpl : public SVGFilterPrimitiveStandardAttributesImpl
+    {
+public:
+        SVGFEDisplacementMapElementImpl(const KDOM::QualifiedName& tagName, KDOM::DocumentImpl *doc);
+        virtual ~SVGFEDisplacementMapElementImpl();
+        
+        // 'SVGFEDisplacementMapElement' functions
+        SVGAnimatedStringImpl* in1() const;
+        SVGAnimatedStringImpl* in2() const;
+        SVGAnimatedEnumerationImpl* xChannelSelector() const;
+        SVGAnimatedEnumerationImpl* yChannelSelector() const;
+        SVGAnimatedNumberImpl* scale() const;
+        
+        static KCChannelSelectorType stringToChannel(KDOM::DOMString &key);
+        
+        // Derived from: 'ElementImpl'
+        virtual void parseMappedAttribute(KDOM::MappedAttributeImpl *attr);
+        
+        virtual KCanvasFEDisplacementMap* filterEffect() const;
+        
+private:
+        mutable RefPtr<SVGAnimatedStringImpl> m_in1;
+        mutable RefPtr<SVGAnimatedStringImpl> m_in2;
+        mutable RefPtr<SVGAnimatedEnumerationImpl> m_xChannelSelector;
+        mutable RefPtr<SVGAnimatedEnumerationImpl> m_yChannelSelector;
+        mutable RefPtr<SVGAnimatedNumberImpl> m_scale;
+        mutable KCanvasFEDisplacementMap *m_filterEffect;
+    };
+};
+
+#endif // SVG_SUPPORT
+#endif // KSVG_SVGFEDisplacementMapElementImpl_H
+
index ad28406c5a59bbb9455f1181ea7cc1b0518bde81..b32a17dda99ec0c2a9e85b18150d342f8d612d3a 100644 (file)
@@ -20,7 +20,7 @@ feComponentTransfer
 feComposite
 #feConvolveMatrix
 feDiffuseLighting
-#feDisplacementMap
+feDisplacementMap
 feDistantLight
 feFlood
 feFuncA