[SVG] Remove explicit LightSource dispatchers
authorfmalita@chromium.org <fmalita@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 21 Mar 2013 20:02:40 +0000 (20:02 +0000)
committerfmalita@chromium.org <fmalita@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 21 Mar 2013 20:02:40 +0000 (20:02 +0000)
https://bugs.webkit.org/show_bug.cgi?id=112827

Reviewed by Stephen Chenney.

Convert LightSource setters to dynamic dispatch. This allows us to remove LightSource.cpp
altogether.

No new tests: refactoring only.

* CMakeLists.txt:
* GNUmakefile.list.am:
* Target.pri:
* WebCore.gypi:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/filters/DistantLightSource.h:
(DistantLightSource):
* platform/graphics/filters/LightSource.cpp: Removed.
* platform/graphics/filters/LightSource.h:
(WebCore::LightSource::setAzimuth):
(WebCore::LightSource::setElevation):
(WebCore::LightSource::setX):
(WebCore::LightSource::setY):
(WebCore::LightSource::setZ):
(WebCore::LightSource::setPointsAtX):
(WebCore::LightSource::setPointsAtY):
(WebCore::LightSource::setPointsAtZ):
(WebCore::LightSource::setSpecularExponent):
(WebCore::LightSource::setLimitingConeAngle):
* platform/graphics/filters/PointLightSource.h:
(PointLightSource):
* platform/graphics/filters/SpotLightSource.h:
(SpotLightSource):

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

14 files changed:
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/GNUmakefile.list.am
Source/WebCore/Target.pri
Source/WebCore/WebCore.gypi
Source/WebCore/WebCore.vcproj/WebCore.vcproj
Source/WebCore/WebCore.vcxproj/WebCore.vcxproj
Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/platform/graphics/filters/DistantLightSource.h
Source/WebCore/platform/graphics/filters/LightSource.cpp [deleted file]
Source/WebCore/platform/graphics/filters/LightSource.h
Source/WebCore/platform/graphics/filters/PointLightSource.h
Source/WebCore/platform/graphics/filters/SpotLightSource.h

index 3fe8518..be31d24 100644 (file)
@@ -1995,7 +1995,6 @@ set(WebCore_SOURCES
     platform/graphics/filters/FilterEffect.cpp
     platform/graphics/filters/FilterOperation.cpp
     platform/graphics/filters/FilterOperations.cpp
-    platform/graphics/filters/LightSource.cpp
     platform/graphics/filters/PointLightSource.cpp
     platform/graphics/filters/SourceAlpha.cpp
     platform/graphics/filters/SourceGraphic.cpp
index fc63ecd..7d51f82 100644 (file)
@@ -1,3 +1,42 @@
+2013-03-21  Florin Malita  <fmalita@chromium.org>
+
+        [SVG] Remove explicit LightSource dispatchers
+        https://bugs.webkit.org/show_bug.cgi?id=112827
+
+        Reviewed by Stephen Chenney.
+
+        Convert LightSource setters to dynamic dispatch. This allows us to remove LightSource.cpp
+        altogether.
+
+        No new tests: refactoring only.
+
+        * CMakeLists.txt:
+        * GNUmakefile.list.am:
+        * Target.pri:
+        * WebCore.gypi:
+        * WebCore.vcproj/WebCore.vcproj:
+        * WebCore.vcxproj/WebCore.vcxproj:
+        * WebCore.vcxproj/WebCore.vcxproj.filters:
+        * WebCore.xcodeproj/project.pbxproj:
+        * platform/graphics/filters/DistantLightSource.h:
+        (DistantLightSource):
+        * platform/graphics/filters/LightSource.cpp: Removed.
+        * platform/graphics/filters/LightSource.h:
+        (WebCore::LightSource::setAzimuth):
+        (WebCore::LightSource::setElevation):
+        (WebCore::LightSource::setX):
+        (WebCore::LightSource::setY):
+        (WebCore::LightSource::setZ):
+        (WebCore::LightSource::setPointsAtX):
+        (WebCore::LightSource::setPointsAtY):
+        (WebCore::LightSource::setPointsAtZ):
+        (WebCore::LightSource::setSpecularExponent):
+        (WebCore::LightSource::setLimitingConeAngle):
+        * platform/graphics/filters/PointLightSource.h:
+        (PointLightSource):
+        * platform/graphics/filters/SpotLightSource.h:
+        (SpotLightSource):
+
 2013-03-21  Igor Oliveira  <igor.o@sisa.samsung.com>
 
         [Texmap] Implement support for OpenGLES EXT_unpack_subimage extension
index aa002ba..49b6e40 100644 (file)
@@ -5600,7 +5600,6 @@ webcore_platform_sources += \
        Source/WebCore/platform/graphics/filters/FilterOperation.cpp \
        Source/WebCore/platform/graphics/filters/FilterOperations.cpp \
        Source/WebCore/platform/graphics/filters/FilterOperations.h \
-       Source/WebCore/platform/graphics/filters/LightSource.cpp \
        Source/WebCore/platform/graphics/filters/LightSource.h \
        Source/WebCore/platform/graphics/filters/PointLightSource.cpp \
        Source/WebCore/platform/graphics/filters/PointLightSource.h \
index 3e39f56..e30ec05 100644 (file)
@@ -3685,7 +3685,6 @@ enable?(FILTERS) {
         platform/graphics/filters/FilterOperations.cpp \
         platform/graphics/filters/FilterOperation.cpp \
         platform/graphics/filters/FilterEffect.cpp \
-        platform/graphics/filters/LightSource.cpp \
         platform/graphics/filters/PointLightSource.cpp \
         platform/graphics/filters/SpotLightSource.cpp \
         platform/graphics/filters/SourceAlpha.cpp \
index 4216f3e..42262ef 100644 (file)
             'platform/graphics/filters/FilterOperation.h',
             'platform/graphics/filters/FilterOperations.cpp',
             'platform/graphics/filters/FilterOperations.h',
-            'platform/graphics/filters/LightSource.cpp',
             'platform/graphics/filters/LightSource.h',
             'platform/graphics/filters/PointLightSource.cpp',
             'platform/graphics/filters/PointLightSource.h',
index 31398c2..044037a 100755 (executable)
                                                >
                                        </File>
                                        <File
-                                               RelativePath="..\platform\graphics\filters\LightSource.cpp"
-                                               >
-                                       </File>
-                                       <File
                                                RelativePath="..\platform\graphics\filters\LightSource.h"
                                                >
                                        </File>
index 7280693..9fef4b2 100644 (file)
     <ClCompile Include="..\platform\graphics\filters\FilterEffect.cpp" />
     <ClCompile Include="..\platform\graphics\filters\FilterOperation.cpp" />
     <ClCompile Include="..\platform\graphics\filters\FilterOperations.cpp" />
-    <ClCompile Include="..\platform\graphics\filters\LightSource.cpp" />
     <ClCompile Include="..\platform\graphics\filters\PointLightSource.cpp" />
     <ClCompile Include="..\platform\graphics\filters\SourceAlpha.cpp" />
     <ClCompile Include="..\platform\graphics\filters\SourceGraphic.cpp" />
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <ImportGroup Label="ExtensionTargets">
   </ImportGroup>
-</Project>
\ No newline at end of file
+</Project>
index 80a655f..5acaf6f 100644 (file)
     <ClCompile Include="..\platform\graphics\filters\FilterOperations.cpp">
       <Filter>platform\graphics\filters</Filter>
     </ClCompile>
-    <ClCompile Include="..\platform\graphics\filters\LightSource.cpp">
-      <Filter>platform\graphics\filters</Filter>
-    </ClCompile>
     <ClCompile Include="..\platform\graphics\filters\PointLightSource.cpp">
       <Filter>platform\graphics\filters</Filter>
     </ClCompile>
index 5952008..40a9825 100644 (file)
                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 */; };
                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>"; };
                                49ECEB641499790D00CDD3A4 /* FilterOperation.h */,
                                49ECEB651499790D00CDD3A4 /* FilterOperations.cpp */,
                                49ECEB661499790D00CDD3A4 /* FilterOperations.h */,
-                               84730D731248F0B300D3A9C9 /* LightSource.cpp */,
                                84730D741248F0B300D3A9C9 /* LightSource.h */,
                                A1E1154513015C4E0054AC8C /* PointLightSource.cpp */,
                                84730D751248F0B300D3A9C9 /* PointLightSource.h */,
                                8CADF2AA135C7B36009EF43F /* LevelDBDatabase.cpp in Sources */,
                                8C0E334C138A92C7008DA94F /* LevelDBTransaction.cpp in Sources */,
                                8C0E334E138A92C7008DA94F /* LevelDBWriteBatch.cpp in Sources */,
-                               84730D901248F0B300D3A9C9 /* LightSource.cpp in Sources */,
                                89B5EAA111E8003D00F2367E /* LineEnding.cpp in Sources */,
                                A7AD2F870EC89D07008AB002 /* LinkHash.cpp in Sources */,
                                98CE4326129E00BD005821DC /* LinkLoader.cpp in Sources */,
index 1e19c62..b2ba937 100644 (file)
@@ -36,9 +36,10 @@ public:
     }
 
     float azimuth() const { return m_azimuth; }
-    bool setAzimuth(float);
     float elevation() const { return m_elevation; }
-    bool setElevation(float);
+
+    virtual bool setAzimuth(float) OVERRIDE;
+    virtual bool setElevation(float) OVERRIDE;
 
     virtual void initPaintingData(PaintingData&);
     virtual void updatePaintingData(PaintingData&, int x, int y, float z);
diff --git a/Source/WebCore/platform/graphics/filters/LightSource.cpp b/Source/WebCore/platform/graphics/filters/LightSource.cpp
deleted file mode 100644 (file)
index cf262e8..0000000
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
- * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
- * Copyright (C) 2005 Eric Seidel <eric@webkit.org>
- * Copyright (C) 2010 Zoltan Herczeg <zherczeg@webkit.org>
- * Copyright (C) 2011 Renata Hodovan <reni@webkit.org>, University of Szeged.
- *
- * 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 {
-
-bool LightSource::setAzimuth(float azimuth)
-{
-    if (m_type == LS_DISTANT)
-        return static_cast<DistantLightSource*>(this)->setAzimuth(azimuth);
-    return false;
-}
-
-bool LightSource::setElevation(float elevation)
-{
-    if (m_type == LS_DISTANT)
-        return static_cast<DistantLightSource*>(this)->setElevation(elevation);
-    return false;
-}
-
-bool LightSource::setX(float x)
-{
-    if (m_type == LS_SPOT)
-        return static_cast<SpotLightSource*>(this)->setX(x);
-    if (m_type == LS_POINT)
-        return static_cast<PointLightSource*>(this)->setX(x);
-    return false;
-}
-
-bool LightSource::setY(float y)
-{
-    if (m_type == LS_SPOT)
-        return static_cast<SpotLightSource*>(this)->setY(y);
-    if (m_type == LS_POINT)
-        return static_cast<PointLightSource*>(this)->setY(y);
-    return false;
-}
-
-bool LightSource::setZ(float z)
-{
-    if (m_type == LS_SPOT)
-        return static_cast<SpotLightSource*>(this)->setZ(z);
-    if (m_type == LS_POINT)
-        return static_cast<PointLightSource*>(this)->setZ(z);
-    return false;
-}
-
-bool LightSource::setPointsAtX(float pointsAtX)
-{
-    if (m_type == LS_SPOT)
-        return static_cast<SpotLightSource*>(this)->setPointsAtX(pointsAtX);
-    return false;
-}
-
-bool LightSource::setPointsAtY(float pointsAtY)
-{
-    if (m_type == LS_SPOT)
-        return static_cast<SpotLightSource*>(this)->setPointsAtY(pointsAtY);
-    return false;
-}
-
-bool LightSource::setPointsAtZ(float pointsAtZ)
-{
-    if (m_type == LS_SPOT)
-        return static_cast<SpotLightSource*>(this)->setPointsAtZ(pointsAtZ);
-    return false;
-}
-
-bool LightSource::setSpecularExponent(float specularExponent)
-{
-    if (m_type == LS_SPOT)
-        return static_cast<SpotLightSource*>(this)->setSpecularExponent(specularExponent);
-    return false;
-}
-
-bool LightSource::setLimitingConeAngle(float limitingConeAngle)
-{
-    if (m_type == LS_SPOT)
-        return static_cast<SpotLightSource*>(this)->setLimitingConeAngle(limitingConeAngle);
-    return false;
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(FILTERS)
index 24c319a..7aa270e 100644 (file)
@@ -74,16 +74,16 @@ public:
     // specified "surfaceScale" constant, which type is <number> in the SVG standard
     virtual void updatePaintingData(PaintingData&, int x, int y, float z) = 0;
 
-    bool setAzimuth(float);
-    bool setElevation(float);
-    bool setX(float);
-    bool setY(float);
-    bool setZ(float);
-    bool setPointsAtX(float);
-    bool setPointsAtY(float);
-    bool setPointsAtZ(float);
-    bool setSpecularExponent(float);
-    bool setLimitingConeAngle(float);
+    virtual bool setAzimuth(float) { return false; }
+    virtual bool setElevation(float) { return false; }
+    virtual bool setX(float) { return false; }
+    virtual bool setY(float) { return false; }
+    virtual bool setZ(float) { return false; }
+    virtual bool setPointsAtX(float) { return false; }
+    virtual bool setPointsAtY(float) { return false; }
+    virtual bool setPointsAtZ(float) { return false; }
+    virtual bool setSpecularExponent(float) { return false; }
+    virtual bool setLimitingConeAngle(float) { return false; }
 
 private:
     LightType m_type;
index a93bf2c..80eef10 100644 (file)
@@ -36,9 +36,9 @@ public:
     }
 
     const FloatPoint3D& position() const { return m_position; }
-    bool setX(float);
-    bool setY(float);
-    bool setZ(float);
+    virtual bool setX(float) OVERRIDE;
+    virtual bool setY(float) OVERRIDE;
+    virtual bool setZ(float) OVERRIDE;
 
     virtual void initPaintingData(PaintingData&);
     virtual void updatePaintingData(PaintingData&, int x, int y, float z);
index b4f1b61..a54ddc0 100644 (file)
@@ -37,18 +37,19 @@ public:
     }
 
     const FloatPoint3D& position() const { return m_position; }
-    bool setX(float);
-    bool setY(float);
-    bool setZ(float);
     const FloatPoint3D& direction() const { return m_direction; }
-    bool setPointsAtX(float);
-    bool setPointsAtY(float);
-    bool setPointsAtZ(float);
-
     float specularExponent() const { return m_specularExponent; }
-    bool setSpecularExponent(float);
     float limitingConeAngle() const { return m_limitingConeAngle; }
-    bool setLimitingConeAngle(float);
+
+    virtual bool setX(float) OVERRIDE;
+    virtual bool setY(float) OVERRIDE;
+    virtual bool setZ(float) OVERRIDE;
+    virtual bool setPointsAtX(float) OVERRIDE;
+    virtual bool setPointsAtY(float) OVERRIDE;
+    virtual bool setPointsAtZ(float) OVERRIDE;
+
+    virtual bool setSpecularExponent(float) OVERRIDE;
+    virtual bool setLimitingConeAngle(float) OVERRIDE;
 
     virtual void initPaintingData(PaintingData&);
     virtual void updatePaintingData(PaintingData&, int x, int y, float z);