2008-11-15 Dirk Schulze <vbs85@gmx.de>
authorkrit@webkit.org <krit@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 15 Nov 2008 20:48:41 +0000 (20:48 +0000)
committerkrit@webkit.org <krit@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 15 Nov 2008 20:48:41 +0000 (20:48 +0000)
        Reviewed by Darin Adler.

        Removed platform dependent code on SVGPaintServerSolid.

        * GNUmakefile.am:
        * WebCore.pro:
        * WebCore.vcproj/WebCore.vcproj:
        * WebCore.xcodeproj/project.pbxproj:
        * svg/graphics/SVGPaintServerSolid.cpp:
        (WebCore::SVGPaintServerSolid::setup):
        (WebCore::SVGPaintServerSolid::renderPath):
        * svg/graphics/SVGPaintServerSolid.h:
        * svg/graphics/cairo/SVGPaintServerSolidCairo.cpp: Removed.
        * svg/graphics/cg/SVGPaintServerSolidCg.cpp: Removed.
        * svg/graphics/qt/SVGPaintServerSolidQt.cpp: Removed.

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

WebCore/ChangeLog
WebCore/GNUmakefile.am
WebCore/WebCore.pro
WebCore/WebCore.vcproj/WebCore.vcproj
WebCore/WebCore.xcodeproj/project.pbxproj
WebCore/svg/graphics/SVGPaintServerSolid.cpp
WebCore/svg/graphics/SVGPaintServerSolid.h
WebCore/svg/graphics/cairo/SVGPaintServerSolidCairo.cpp [deleted file]
WebCore/svg/graphics/cg/SVGPaintServerSolidCg.cpp [deleted file]
WebCore/svg/graphics/qt/SVGPaintServerSolidQt.cpp [deleted file]

index 4ef93a6..632b236 100644 (file)
@@ -1,3 +1,21 @@
+2008-11-15  Dirk Schulze  <krit@webkit.org>
+
+        Reviewed by Darin Adler.
+
+        Removed platform dependent code on SVGPaintServerSolid.
+
+        * GNUmakefile.am:
+        * WebCore.pro:
+        * WebCore.vcproj/WebCore.vcproj:
+        * WebCore.xcodeproj/project.pbxproj:
+        * svg/graphics/SVGPaintServerSolid.cpp:
+        (WebCore::SVGPaintServerSolid::setup):
+        (WebCore::SVGPaintServerSolid::renderPath):
+        * svg/graphics/SVGPaintServerSolid.h:
+        * svg/graphics/cairo/SVGPaintServerSolidCairo.cpp: Removed.
+        * svg/graphics/cg/SVGPaintServerSolidCg.cpp: Removed.
+        * svg/graphics/qt/SVGPaintServerSolidQt.cpp: Removed.
+
 2008-11-15  Geoffrey Garen  <ggaren@apple.com>
 
         Reviewed by Sam Weinig.
index bed341a..819f042 100644 (file)
@@ -2703,7 +2703,6 @@ webcoregtk_sources += \
        WebCore/svg/graphics/cairo/SVGPaintServerCairo.cpp \
        WebCore/svg/graphics/cairo/SVGPaintServerGradientCairo.cpp \
        WebCore/svg/graphics/cairo/SVGPaintServerPatternCairo.cpp \
-       WebCore/svg/graphics/cairo/SVGPaintServerSolidCairo.cpp \
        WebCore/svg/graphics/cairo/SVGResourceFilterCairo.cpp \
        WebCore/svg/graphics/cairo/SVGResourceMaskerCairo.cpp
 
index 5d3f45f..77fe3e9 100644 (file)
@@ -1706,7 +1706,6 @@ SOURCES += \
         svg/graphics/qt/SVGPaintServerPatternQt.cpp \
         svg/graphics/qt/SVGPaintServerQt.cpp \
         svg/graphics/qt/SVGPaintServerRadialGradientQt.cpp \
-        svg/graphics/qt/SVGPaintServerSolidQt.cpp \
         svg/graphics/qt/SVGResourceFilterQt.cpp \
         svg/graphics/qt/SVGResourceMaskerQt.cpp
 
index 2503dec..4e9c91e 100644 (file)
                                                </FileConfiguration>\r
                                        </File>\r
                                        <File\r
-                                               RelativePath="..\svg\graphics\cg\SVGPaintServerSolidCg.cpp"\r
-                                               >\r
-                                               <FileConfiguration\r
-                                                       Name="Debug_Cairo|Win32"\r
-                                                       ExcludedFromBuild="true"\r
-                                                       >\r
-                                                       <Tool\r
-                                                               Name="VCCLCompilerTool"\r
-                                                       />\r
-                                               </FileConfiguration>\r
-                                               <FileConfiguration\r
-                                                       Name="Release_Cairo|Win32"\r
-                                                       ExcludedFromBuild="true"\r
-                                                       >\r
-                                                       <Tool\r
-                                                               Name="VCCLCompilerTool"\r
-                                                       />\r
-                                               </FileConfiguration>\r
-                                       </File>\r
-                                       <File\r
                                                RelativePath="..\svg\graphics\cg\SVGResourceFilterCg.cpp"\r
                                                >\r
                                                <FileConfiguration\r
                                                </FileConfiguration>\r
                                        </File>\r
                                        <File\r
-                                               RelativePath="..\svg\graphics\cairo\SVGPaintServerSolidCairo.cpp"\r
-                                               >\r
-                                               <FileConfiguration\r
-                                                       Name="Debug|Win32"\r
-                                                       ExcludedFromBuild="true"\r
-                                                       >\r
-                                                       <Tool\r
-                                                               Name="VCCLCompilerTool"\r
-                                                       />\r
-                                               </FileConfiguration>\r
-                                               <FileConfiguration\r
-                                                       Name="Release|Win32"\r
-                                                       ExcludedFromBuild="true"\r
-                                                       >\r
-                                                       <Tool\r
-                                                               Name="VCCLCompilerTool"\r
-                                                       />\r
-                                               </FileConfiguration>\r
-                                               <FileConfiguration\r
-                                                       Name="Debug_Internal|Win32"\r
-                                                       ExcludedFromBuild="true"\r
-                                                       >\r
-                                                       <Tool\r
-                                                               Name="VCCLCompilerTool"\r
-                                                       />\r
-                                               </FileConfiguration>\r
-                                               <FileConfiguration\r
-                                                       Name="Release_PGO|Win32"\r
-                                                       ExcludedFromBuild="true"\r
-                                                       >\r
-                                                       <Tool\r
-                                                               Name="VCCLCompilerTool"\r
-                                                       />\r
-                                               </FileConfiguration>\r
-                                       </File>\r
-                                       <File\r
                                                RelativePath="..\svg\graphics\cairo\SVGResourceFilterCairo.cpp"\r
                                                >\r
                                                <FileConfiguration\r
index b3fb8a7..cf1b63b 100644 (file)
                B255992F0D00D8BA00BB825C /* SVGPaintServerCg.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B25598930D00D8B800BB825C /* SVGPaintServerCg.cpp */; };
                B25599300D00D8BA00BB825C /* SVGPaintServerGradientCg.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B25598940D00D8B800BB825C /* SVGPaintServerGradientCg.cpp */; };
                B25599310D00D8BA00BB825C /* SVGPaintServerPatternCg.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B25598950D00D8B800BB825C /* SVGPaintServerPatternCg.cpp */; };
-               B25599320D00D8BA00BB825C /* SVGPaintServerSolidCg.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B25598960D00D8B800BB825C /* SVGPaintServerSolidCg.cpp */; };
                B25599350D00D8BA00BB825C /* SVGResourceFilterCg.mm in Sources */ = {isa = PBXBuildFile; fileRef = B25598990D00D8B800BB825C /* SVGResourceFilterCg.mm */; };
                B25599370D00D8BA00BB825C /* SVGResourceMaskerCg.mm in Sources */ = {isa = PBXBuildFile; fileRef = B255989B0D00D8B800BB825C /* SVGResourceMaskerCg.mm */; };
                B25599400D00D8BA00BB825C /* SVGFEHelpersCg.h in Headers */ = {isa = PBXBuildFile; fileRef = B25598A60D00D8B800BB825C /* SVGFEHelpersCg.h */; };
                B25598930D00D8B800BB825C /* SVGPaintServerCg.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = SVGPaintServerCg.cpp; sourceTree = "<group>"; };
                B25598940D00D8B800BB825C /* SVGPaintServerGradientCg.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = SVGPaintServerGradientCg.cpp; sourceTree = "<group>"; };
                B25598950D00D8B800BB825C /* SVGPaintServerPatternCg.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = SVGPaintServerPatternCg.cpp; sourceTree = "<group>"; };
-               B25598960D00D8B800BB825C /* SVGPaintServerSolidCg.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = SVGPaintServerSolidCg.cpp; sourceTree = "<group>"; };
                B25598990D00D8B800BB825C /* SVGResourceFilterCg.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = SVGResourceFilterCg.mm; sourceTree = "<group>"; };
                B255989B0D00D8B800BB825C /* SVGResourceMaskerCg.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = SVGResourceMaskerCg.mm; sourceTree = "<group>"; };
                B25598A60D00D8B800BB825C /* SVGFEHelpersCg.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SVGFEHelpersCg.h; sourceTree = "<group>"; };
                                B25598930D00D8B800BB825C /* SVGPaintServerCg.cpp */,
                                B25598940D00D8B800BB825C /* SVGPaintServerGradientCg.cpp */,
                                B25598950D00D8B800BB825C /* SVGPaintServerPatternCg.cpp */,
-                               B25598960D00D8B800BB825C /* SVGPaintServerSolidCg.cpp */,
                                B25598990D00D8B800BB825C /* SVGResourceFilterCg.mm */,
                                B255989B0D00D8B800BB825C /* SVGResourceMaskerCg.mm */,
                        );
                                B25599310D00D8BA00BB825C /* SVGPaintServerPatternCg.cpp in Sources */,
                                B25599AE0D00D8BA00BB825C /* SVGPaintServerRadialGradient.cpp in Sources */,
                                B25599B00D00D8BA00BB825C /* SVGPaintServerSolid.cpp in Sources */,
-                               B25599320D00D8BA00BB825C /* SVGPaintServerSolidCg.cpp in Sources */,
                                B2227A560D00BF220071B782 /* SVGParserUtilities.cpp in Sources */,
                                B2227A580D00BF220071B782 /* SVGPathElement.cpp in Sources */,
                                B2227A5D0D00BF220071B782 /* SVGPathSegArc.cpp in Sources */,
index cb58a3a..20eaada 100644 (file)
@@ -1,5 +1,6 @@
 /*
  * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org>
+ * Copyright (C) 2008 Dirk Schulze <krit@webkit.org>
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -27,6 +28,9 @@
 
 #if ENABLE(SVG)
 #include "SVGPaintServerSolid.h"
+
+#include "GraphicsContext.h"
+#include "RenderPath.h"
 #include "SVGRenderTreeAsText.h"
 
 namespace WebCore {
@@ -56,6 +60,53 @@ TextStream& SVGPaintServerSolid::externalRepresentation(TextStream& ts) const
     return ts;
 }
 
+bool SVGPaintServerSolid::setup(GraphicsContext*& context, const RenderObject* object, SVGPaintTargetType type, bool isPaintingText) const
+{
+    RenderStyle* style = object ? object->style() : 0;
+    const SVGRenderStyle* svgStyle = object ? object->style()->svgStyle() : 0;
+
+    if ((type & ApplyToFillTargetType) && (!style || svgStyle->hasFill())) {
+        RGBA32 rgba = color().rgb();
+        ASSERT(!color().hasAlpha());
+        if (style)
+            rgba = colorWithOverrideAlpha(rgba, svgStyle->fillOpacity());
+
+        context->setFillRule(svgStyle->fillRule());
+        context->setFillColor(rgba);
+
+        if (isPaintingText)
+            context->setTextDrawingMode(cTextFill);
+    }
+
+    if ((type & ApplyToStrokeTargetType) && (!style || svgStyle->hasStroke())) {
+        RGBA32 rgba = color().rgb();
+        ASSERT(!color().hasAlpha());
+        if (style)
+            rgba = colorWithOverrideAlpha(rgba, svgStyle->strokeOpacity());
+
+        context->setStrokeColor(rgba);
+
+        if (style)
+            applyStrokeStyleToContext(context, style, object);
+
+        if (isPaintingText)
+            context->setTextDrawingMode(cTextStroke);
+    }
+
+    return true;
+}
+
+void SVGPaintServerSolid::renderPath(GraphicsContext*& context, const RenderObject* path, SVGPaintTargetType type) const
+{
+    const SVGRenderStyle* svgStyle = path->style()->svgStyle();
+
+    if ((type & ApplyToFillTargetType) && svgStyle->hasFill())
+        context->fillPath();
+
+    if ((type & ApplyToStrokeTargetType) && svgStyle->hasStroke())
+        context->strokePath();
+}
+
 } // namespace WebCore
 
 #endif
index 0166c87..120752c 100644 (file)
@@ -46,6 +46,7 @@ namespace WebCore {
         virtual TextStream& externalRepresentation(TextStream&) const;
 
         virtual bool setup(GraphicsContext*&, const RenderObject*, SVGPaintTargetType, bool isPaintingText) const;
+        virtual void renderPath(GraphicsContext*&, const RenderObject*, SVGPaintTargetType) const;
 
     private:
         SVGPaintServerSolid();
diff --git a/WebCore/svg/graphics/cairo/SVGPaintServerSolidCairo.cpp b/WebCore/svg/graphics/cairo/SVGPaintServerSolidCairo.cpp
deleted file mode 100644 (file)
index 49e6f55..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright (C) 2007 Alp Toker <alp@atoker.com>
- *
- * 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)
-#include "SVGPaintServerSolid.h"
-
-#include "GraphicsContext.h"
-#include "SVGPaintServer.h"
-#include "RenderPath.h"
-
-namespace WebCore {
-
-bool SVGPaintServerSolid::setup(GraphicsContext*& context, const RenderObject* object, SVGPaintTargetType type, bool isPaintingText) const
-{
-    // TODO: share this code with other PaintServers
-    cairo_t* cr = context->platformContext();
-
-    const SVGRenderStyle* svgStyle = object->style()->svgStyle();
-    RenderStyle* style = object->style();
-
-    float red, green, blue, alpha;
-    color().getRGBA(red, green, blue, alpha);
-
-    if ((type & ApplyToFillTargetType) && svgStyle->hasFill()) {
-        alpha = svgStyle->fillOpacity();
-        context->setFillRule(svgStyle->fillRule());
-    }
-
-    if ((type & ApplyToStrokeTargetType) && svgStyle->hasStroke()) {
-        alpha = svgStyle->strokeOpacity();
-        applyStrokeStyleToContext(context, style, object);
-    }
-
-    cairo_set_source_rgba(cr, red, green, blue, alpha);
-
-    return true;
-}
-
-} // namespace WebCore
-
-#endif
diff --git a/WebCore/svg/graphics/cg/SVGPaintServerSolidCg.cpp b/WebCore/svg/graphics/cg/SVGPaintServerSolidCg.cpp
deleted file mode 100644 (file)
index bd2a56f..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
-    Copyright (C) 2006 Nikolas Zimmermann <wildfox@kde.org>
-
-    This file is part of the KDE project
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Library General Public
-    License as published by the Free Software Foundation; either
-    version 2 of the License, or (at your option) any later version.
-
-    This library is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-    Library General Public License for more details.
-
-    You should have received a copy of the GNU Library General Public License
-    aint with this library; see the file COPYING.LIB.  If not, write to
-    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-    Boston, MA 02110-1301, USA.
-*/
-
-#include "config.h"
-
-#if ENABLE(SVG)
-#include "SVGPaintServerSolid.h"
-
-#include "Color.h"
-#include "CgSupport.h"
-#include "GraphicsContext.h"
-#include "RenderObject.h"
-
-namespace WebCore {
-
-bool SVGPaintServerSolid::setup(GraphicsContext*& context, const RenderObject* object, SVGPaintTargetType type, bool isPaintingText) const
-{
-    // FIXME: This function does not use any CG-specific calls, however it's not yet
-    // cross platform, because CG handles fill rule different from other graphics
-    // platforms.  CG makes you use two separate fill calls, other platforms set
-    // the fill rule state on the context and then call a generic "fillPath"
-
-    RenderStyle* style = object ? object->style() : 0;
-
-    if ((type & ApplyToFillTargetType) && (!style || style->svgStyle()->hasFill())) {
-        RGBA32 rgba = color().rgb();
-        ASSERT(!color().hasAlpha());
-        if (style)
-            rgba = colorWithOverrideAlpha(rgba, style->svgStyle()->fillOpacity());
-
-        context->setFillColor(rgba);
-
-        if (isPaintingText)
-            context->setTextDrawingMode(cTextFill);
-    }
-
-    if ((type & ApplyToStrokeTargetType) && (!style || style->svgStyle()->hasStroke())) {
-        RGBA32 rgba = color().rgb();
-        ASSERT(!color().hasAlpha());
-        if (style)
-            rgba = colorWithOverrideAlpha(rgba, style->svgStyle()->strokeOpacity());
-
-        context->setStrokeColor(rgba);
-
-        if (style)
-            applyStrokeStyleToContext(context, style, object);
-
-        if (isPaintingText)
-            context->setTextDrawingMode(cTextStroke);
-    }
-
-    return true;
-}
-
-} // namespace WebCore
-
-#endif
-
-// vim:ts=4:noet
diff --git a/WebCore/svg/graphics/qt/SVGPaintServerSolidQt.cpp b/WebCore/svg/graphics/qt/SVGPaintServerSolidQt.cpp
deleted file mode 100644 (file)
index e088df2..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
-    Copyright (C) 2006 Nikolas Zimmermann <wildfox@kde.org>
-    Copyright (C) 2008 Holger Hans Peter Freyther
-
-    This file is part of the KDE project
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Library General Public
-    License as published by the Free Software Foundation; either
-    version 2 of the License, or (at your option) any later version.
-
-    This library is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-    Library General Public License for more details.
-
-    You should have received a copy of the GNU Library General Public License
-    aint with this library; see the file COPYING.LIB.  If not, write to
-    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-    Boston, MA 02110-1301, USA.
-*/
-
-#include "config.h"
-
-#if ENABLE(SVG)
-#include "SVGPaintServerSolid.h"
-
-#include "GraphicsContext.h"
-#include "RenderPath.h"
-
-#include <QPainter>
-
-namespace WebCore {
-
-bool SVGPaintServerSolid::setup(GraphicsContext*& context, const RenderObject* object, SVGPaintTargetType type, bool isPaintingText) const
-{
-    QPainter* painter(context ? context->platformContext() : 0);
-    Q_ASSERT(painter);
-
-    const SVGRenderStyle* svgStyle = object->style()->svgStyle();
-    RenderStyle* style = object ? object->style() : 0;
-    // TODO? painter->setOpacity(renderStyle->opacity());
-
-    QColor c = color();
-
-    if ((type & ApplyToFillTargetType) && (!style || svgStyle->hasFill())) {
-        if (style)
-            c.setAlphaF(svgStyle->fillOpacity());
-
-        QBrush brush(c);
-        painter->setBrush(brush);
-
-        if (style)
-            context->setFillRule(svgStyle->fillRule());
-
-        /* if(isPaintingText()) ... */
-    }
-
-    if ((type & ApplyToStrokeTargetType) && (!style || svgStyle->hasStroke())) {
-        if (style)
-            c.setAlphaF(svgStyle->strokeOpacity());
-
-        QPen pen(c);
-        painter->setPen(pen);
-        if (style)
-            applyStrokeStyleToContext(context, style, object);
-
-        /* if(isPaintingText()) ... */
-    }
-
-    return true;
-}
-
-} // namespace WebCore
-
-#endif
-
-// vim:ts=4:noet