2009-01-21 Dirk Schulze <krit@webkit.org>
authorkrit@webkit.org <krit@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 21 Jan 2009 20:07:07 +0000 (20:07 +0000)
committerkrit@webkit.org <krit@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 21 Jan 2009 20:07:07 +0000 (20:07 +0000)
        Reviewed by Nikolas Zimmermann.

        Remove last relics of platform dependent PaintServer in SVG.
        We draw everything with the help of GraphicsContext.

        Remove SVGPaintServerPlatform's
        [https://bugs.webkit.org/show_bug.cgi?id=23439]

        * GNUmakefile.am:
        * WebCore.pro:
        * WebCore.vcproj/WebCore.vcproj:
        * WebCore.xcodeproj/project.pbxproj:
        * svg/graphics/SVGPaintServer.cpp:
        (WebCore::SVGPaintServer::draw):
        (WebCore::SVGPaintServer::renderPath):
        (WebCore::SVGPaintServer::teardown):
        * svg/graphics/SVGPaintServer.h:
        * svg/graphics/SVGPaintServerGradient.cpp:
        * svg/graphics/SVGPaintServerGradient.h:
        * svg/graphics/SVGPaintServerPattern.cpp:
        * svg/graphics/SVGPaintServerPattern.h:
        * svg/graphics/SVGPaintServerSolid.cpp:
        * svg/graphics/SVGPaintServerSolid.h:
        * svg/graphics/cairo/SVGPaintServerCairo.cpp: Removed.
        * svg/graphics/cg/SVGPaintServerCg.cpp: Removed.
        * svg/graphics/qt/SVGPaintServerQt.cpp: Removed.
        * svg/graphics/skia/SVGPaintServerSkia.cpp: Removed.

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

17 files changed:
WebCore/ChangeLog
WebCore/GNUmakefile.am
WebCore/WebCore.pro
WebCore/WebCore.vcproj/WebCore.vcproj
WebCore/WebCore.xcodeproj/project.pbxproj
WebCore/svg/graphics/SVGPaintServer.cpp
WebCore/svg/graphics/SVGPaintServer.h
WebCore/svg/graphics/SVGPaintServerGradient.cpp
WebCore/svg/graphics/SVGPaintServerGradient.h
WebCore/svg/graphics/SVGPaintServerPattern.cpp
WebCore/svg/graphics/SVGPaintServerPattern.h
WebCore/svg/graphics/SVGPaintServerSolid.cpp
WebCore/svg/graphics/SVGPaintServerSolid.h
WebCore/svg/graphics/cairo/SVGPaintServerCairo.cpp [deleted file]
WebCore/svg/graphics/cg/SVGPaintServerCg.cpp [deleted file]
WebCore/svg/graphics/qt/SVGPaintServerQt.cpp [deleted file]
WebCore/svg/graphics/skia/SVGPaintServerSkia.cpp [deleted file]

index 00744cd..9a90c5b 100644 (file)
@@ -1,3 +1,33 @@
+2009-01-21  Dirk Schulze  <krit@webkit.org>
+
+        Reviewed by Nikolas Zimmermann.
+
+        Remove last relics of platform dependent PaintServer in SVG.
+        We draw everything with the help of GraphicsContext.
+
+        Remove SVGPaintServerPlatform's
+        [https://bugs.webkit.org/show_bug.cgi?id=23439]
+
+        * GNUmakefile.am:
+        * WebCore.pro:
+        * WebCore.vcproj/WebCore.vcproj:
+        * WebCore.xcodeproj/project.pbxproj:
+        * svg/graphics/SVGPaintServer.cpp:
+        (WebCore::SVGPaintServer::draw):
+        (WebCore::SVGPaintServer::renderPath):
+        (WebCore::SVGPaintServer::teardown):
+        * svg/graphics/SVGPaintServer.h:
+        * svg/graphics/SVGPaintServerGradient.cpp:
+        * svg/graphics/SVGPaintServerGradient.h:
+        * svg/graphics/SVGPaintServerPattern.cpp:
+        * svg/graphics/SVGPaintServerPattern.h:
+        * svg/graphics/SVGPaintServerSolid.cpp:
+        * svg/graphics/SVGPaintServerSolid.h:
+        * svg/graphics/cairo/SVGPaintServerCairo.cpp: Removed.
+        * svg/graphics/cg/SVGPaintServerCg.cpp: Removed.
+        * svg/graphics/qt/SVGPaintServerQt.cpp: Removed.
+        * svg/graphics/skia/SVGPaintServerSkia.cpp: Removed.
+
 2009-01-21  Nikolas Zimmermann  <nikolas.zimmermann@torchmobile.com>
 
         Reviewed by Alexey Proskuryakov.
index 61dfadf..48acdff 100644 (file)
@@ -2843,7 +2843,6 @@ webcore_sources += \
        WebCore/svg/graphics/filters/SVGSpotLightSource.h
 
 webcoregtk_sources += \
-       WebCore/svg/graphics/cairo/SVGPaintServerCairo.cpp \
        WebCore/svg/graphics/cairo/SVGResourceFilterCairo.cpp \
        WebCore/svg/graphics/cairo/SVGResourceMaskerCairo.cpp
 
index f48afbc..b6e6476 100644 (file)
@@ -1801,7 +1801,6 @@ contains(DEFINES, ENABLE_SVG=1) {
         rendering/SVGRootInlineBox.cpp
 
 SOURCES += \
-        svg/graphics/qt/SVGPaintServerQt.cpp \
         svg/graphics/qt/SVGResourceFilterQt.cpp \
         svg/graphics/qt/SVGResourceMaskerQt.cpp
 
index 2187134..f7871e2 100644 (file)
                                        Name="cg"\r
                                        >\r
                                        <File\r
-                                               RelativePath="..\svg\graphics\cg\SVGPaintServerCg.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
                                        Name="cairo"\r
                                        >\r
                                        <File\r
-                                               RelativePath="..\svg\graphics\cairo\SVGPaintServerCairo.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 c7d14e6..9965f7d 100644 (file)
                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 */; };
-               B255992F0D00D8BA00BB825C /* SVGPaintServerCg.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B25598930D00D8B800BB825C /* SVGPaintServerCg.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 */; };
                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>"; };
-               B25598930D00D8B800BB825C /* SVGPaintServerCg.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = SVGPaintServerCg.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>"; };
                B255988F0D00D8B800BB825C /* cg */ = {
                        isa = PBXGroup;
                        children = (
-                               B25598930D00D8B800BB825C /* SVGPaintServerCg.cpp */,
                                B25598990D00D8B800BB825C /* SVGResourceFilterCg.mm */,
                                B255989B0D00D8B800BB825C /* SVGResourceMaskerCg.mm */,
                        );
                                B2227A500D00BF220071B782 /* SVGNumberList.cpp in Sources */,
                                B2227A530D00BF220071B782 /* SVGPaint.cpp in Sources */,
                                B25599A60D00D8BA00BB825C /* SVGPaintServer.cpp in Sources */,
-                               B255992F0D00D8BA00BB825C /* SVGPaintServerCg.cpp in Sources */,
                                B25599A80D00D8BA00BB825C /* SVGPaintServerGradient.cpp in Sources */,
                                B25599AA0D00D8BA00BB825C /* SVGPaintServerLinearGradient.cpp in Sources */,
                                B25599AC0D00D8BA00BB825C /* SVGPaintServerPattern.cpp in Sources */,
index 0240532..4e7a8cf 100644 (file)
@@ -1,6 +1,7 @@
 /*
  * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org>
  *               2007 Rob Buis <buis@kde.org>
+ *               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
@@ -158,6 +159,40 @@ void applyStrokeStyleToContext(GraphicsContext* context, RenderStyle* style, con
     context->setLineDash(dashes, dashOffset);
 }
 
+void SVGPaintServer::draw(GraphicsContext*& context, const RenderObject* path, SVGPaintTargetType type) const
+{
+    if (!setup(context, path, type))
+        return;
+
+    renderPath(context, path, type);
+    teardown(context, path, type);
+}
+
+void SVGPaintServer::renderPath(GraphicsContext*& context, const RenderObject* path, SVGPaintTargetType type) const
+{
+    const SVGRenderStyle* style = path ? path->style()->svgStyle() : 0;
+
+    if ((type & ApplyToFillTargetType) && (!style || style->hasFill()))
+        context->fillPath();
+
+    if ((type & ApplyToStrokeTargetType) && (!style || style->hasStroke()))
+        context->strokePath();
+}
+
+void SVGPaintServer::teardown(GraphicsContext*&, const RenderObject*, SVGPaintTargetType, bool) const
+{
+#if PLATFORM(SKIA)
+    // FIXME: Move this into the GraphicsContext
+    // WebKit implicitly expects us to reset the path.
+    // For example in fillAndStrokePath() of RenderPath.cpp the path is 
+    // added back to the context after filling. This is because internally it
+    // calls CGContextFillPath() which closes the path.
+    context->beginPath();
+    context->platformContext()->setGradient(0);
+    context->platformContext()->setPattern(0);
+#endif
+}
+
 DashArray dashArrayFromRenderingStyle(const RenderStyle* style)
 {
     DashArray array;
index 5722e8b..9174f66 100644 (file)
@@ -77,12 +77,6 @@ namespace WebCore {
         static SVGPaintServerSolid* sharedSolidPaintServer();
 
     protected:
-#if PLATFORM(CG)
-        void strokePath(CGContextRef, const RenderObject*) const;
-        void fillPath(CGContextRef, const RenderObject*) const;
-#endif
-
-    protected:
         SVGPaintServer();        
     };
 
index ba080ae..5a55b74 100644 (file)
@@ -257,17 +257,6 @@ bool SVGPaintServerGradient::setup(GraphicsContext*& context, const RenderObject
     return true;
 }
 
-void SVGPaintServerGradient::renderPath(GraphicsContext*& context, const RenderObject* path, SVGPaintTargetType type) const
-{
-    const SVGRenderStyle* style = path->style()->svgStyle();
-
-    if ((type & ApplyToFillTargetType) && style->hasFill())
-        context->fillPath();
-
-    if ((type & ApplyToStrokeTargetType) && style->hasStroke())
-        context->strokePath();
-}
-
 void SVGPaintServerGradient::teardown(GraphicsContext*& context, const RenderObject* object, SVGPaintTargetType, bool isPaintingText) const
 {
 #if PLATFORM(CG)
index 9f0b714..16dab0b 100644 (file)
@@ -71,7 +71,6 @@ namespace WebCore {
 
         virtual bool setup(GraphicsContext*&, const RenderObject*, SVGPaintTargetType, bool isPaintingText) const;
         virtual void teardown(GraphicsContext*&, const RenderObject*, SVGPaintTargetType, bool isPaintingText) const;
-        virtual void renderPath(GraphicsContext*&, const RenderObject*, SVGPaintTargetType) const;
 
     protected:
         SVGPaintServerGradient(const SVGGradientElement* owner);
index 6f58c52..5926aad 100644 (file)
@@ -173,17 +173,6 @@ bool SVGPaintServerPattern::setup(GraphicsContext*& context, const RenderObject*
     return true;
 }
 
-void SVGPaintServerPattern::renderPath(GraphicsContext*& context, const RenderObject* path, SVGPaintTargetType type) const
-{
-    const SVGRenderStyle* style = path->style()->svgStyle();
-
-    if ((type & ApplyToFillTargetType) && style->hasFill())
-        context->fillPath();
-
-    if ((type & ApplyToStrokeTargetType) && style->hasStroke())
-        context->strokePath();
-}
-
 void SVGPaintServerPattern::teardown(GraphicsContext*& context, const RenderObject*, SVGPaintTargetType, bool) const
 {
     m_pattern = 0;
index 2533255..48acd51 100644 (file)
@@ -64,7 +64,6 @@ 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;
         virtual void teardown(GraphicsContext*&, const RenderObject*, SVGPaintTargetType, bool isPaintingText) const;
 
     private:
index e862115..b333042 100644 (file)
@@ -88,17 +88,6 @@ bool SVGPaintServerSolid::setup(GraphicsContext*& context, const RenderObject* o
     return true;
 }
 
-void SVGPaintServerSolid::renderPath(GraphicsContext*& context, const RenderObject* path, SVGPaintTargetType type) const
-{
-    const SVGRenderStyle* svgStyle = path ? path->style()->svgStyle() : 0;
-
-    if ((type & ApplyToFillTargetType) && (!svgStyle || svgStyle->hasFill()))
-        context->fillPath();
-
-    if ((type & ApplyToStrokeTargetType) && (!svgStyle || svgStyle->hasStroke()))
-        context->strokePath();
-}
-
 } // namespace WebCore
 
 #endif
index 120752c..0166c87 100644 (file)
@@ -46,7 +46,6 @@ 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/SVGPaintServerCairo.cpp b/WebCore/svg/graphics/cairo/SVGPaintServerCairo.cpp
deleted file mode 100644 (file)
index 272b3cd..0000000
+++ /dev/null
@@ -1,63 +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 "SVGPaintServer.h"
-
-#include "GraphicsContext.h"
-#include "SVGPaintServer.h"
-#include "RenderPath.h"
-
-#include <cairo.h>
-
-namespace WebCore {
-
-void SVGPaintServer::draw(GraphicsContext*& context, const RenderObject* path, SVGPaintTargetType type) const
-{
-    if (!setup(context, path, type))
-        return;
-
-    renderPath(context, path, type);
-    teardown(context, path, type);
-}
-
-void SVGPaintServer::teardown(GraphicsContext*&, const RenderObject*, SVGPaintTargetType, bool isPaintingText) const
-{
-    // no-op
-}
-
-void SVGPaintServer::renderPath(GraphicsContext*& context, const RenderObject* path, SVGPaintTargetType type) const
-{
-    cairo_t* cr = context->platformContext();
-    const SVGRenderStyle* style = path ? path->style()->svgStyle(): 0;
-
-    if ((type & ApplyToFillTargetType) && (!style || style->hasFill()))
-        cairo_fill_preserve(cr);
-
-    if ((type & ApplyToStrokeTargetType) && (!style || style->hasStroke()))
-        cairo_stroke_preserve(cr);
-
-    cairo_new_path(cr);
-}
-
-} // namespace WebCore
-
-#endif
diff --git a/WebCore/svg/graphics/cg/SVGPaintServerCg.cpp b/WebCore/svg/graphics/cg/SVGPaintServerCg.cpp
deleted file mode 100644 (file)
index bb048a5..0000000
+++ /dev/null
@@ -1,75 +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 "SVGPaintServer.h"
-
-#include "GraphicsContext.h"
-#include "RenderObject.h"
-
-namespace WebCore {
-
-void SVGPaintServer::draw(GraphicsContext*& context, const RenderObject* path, SVGPaintTargetType type) const
-{
-    if (!setup(context, path, type))
-        return;
-
-    renderPath(context, path, type);
-    teardown(context, path, type);
-}
-
-void SVGPaintServer::teardown(GraphicsContext*&, const RenderObject*, SVGPaintTargetType, bool) const
-{
-    // no-op
-}
-
-void SVGPaintServer::renderPath(GraphicsContext*& context, const RenderObject* path, SVGPaintTargetType type) const
-{
-    RenderStyle* style = path ? path->style() : 0;
-    CGContextRef contextRef = context->platformContext();
-
-    if ((type & ApplyToFillTargetType) && (!style || style->svgStyle()->hasFill()))
-        fillPath(contextRef, path);
-
-    if ((type & ApplyToStrokeTargetType) && (!style || style->svgStyle()->hasStroke()))
-        strokePath(contextRef, path);
-}
-
-void SVGPaintServer::strokePath(CGContextRef context, const RenderObject*) const
-{
-    CGContextStrokePath(context);
-}
-
-void SVGPaintServer::fillPath(CGContextRef context, const RenderObject* path) const
-{
-    if (!path || path->style()->svgStyle()->fillRule() == RULE_EVENODD)
-        CGContextEOFillPath(context);
-    else
-        CGContextFillPath(context);
-}
-
-} // namespace WebCore
-
-#endif
-
-// vim:ts=4:noet
diff --git a/WebCore/svg/graphics/qt/SVGPaintServerQt.cpp b/WebCore/svg/graphics/qt/SVGPaintServerQt.cpp
deleted file mode 100644 (file)
index 801201b..0000000
+++ /dev/null
@@ -1,72 +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 "SVGPaintServer.h"
-
-#include "GraphicsContext.h"
-#include "SVGRenderStyle.h"
-#include "RenderObject.h"
-
-#include <QPainter>
-#include <QVector>
-
-namespace WebCore {
-
-void SVGPaintServer::draw(GraphicsContext*& context, const RenderObject* path, SVGPaintTargetType type) const
-{
-    if (!setup(context, path, type))
-        return;
-
-    renderPath(context, path, type);
-    teardown(context, path, type);
-}
-
-void SVGPaintServer::teardown(GraphicsContext*&, const RenderObject*, SVGPaintTargetType, bool isPaintingText) const
-{
-    // no-op
-}
-
-void SVGPaintServer::renderPath(GraphicsContext*& context, const RenderObject* path, SVGPaintTargetType type) const
-{
-    RenderStyle* renderStyle = path ? path->style(): 0;
-
-    QPainter* painter(context ? context->platformContext() : 0);
-    Q_ASSERT(painter);
-
-    QPainterPath* painterPath(context ? context->currentPath() : 0);
-    Q_ASSERT(painterPath);
-
-    if ((type & ApplyToFillTargetType) && (!renderStyle || renderStyle->svgStyle()->hasFill()))
-        painter->fillPath(*painterPath, painter->brush());
-
-    if ((type & ApplyToStrokeTargetType) && (!renderStyle || renderStyle->svgStyle()->hasStroke()))
-        painter->strokePath(*painterPath, painter->pen());
-}
-
-} // namespace WebCore
-
-#endif
-
-// vim:ts=4:noet
diff --git a/WebCore/svg/graphics/skia/SVGPaintServerSkia.cpp b/WebCore/svg/graphics/skia/SVGPaintServerSkia.cpp
deleted file mode 100644 (file)
index 0435b67..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright (c) 2008, Google Inc. All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- *     * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *     * 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.
- *     * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "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 COPYRIGHT
- * OWNER 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)
-#include "SVGPaintServer.h"
-
-#include "GraphicsContext.h"
-#include "RenderPath.h"
-#include "PlatformContextSkia.h"
-#include "SkiaUtils.h"
-
-namespace WebCore {
-
-void SVGPaintServer::draw(GraphicsContext*& context, const RenderObject* object, SVGPaintTargetType type) const
-{
-    if (!setup(context, object, type))
-        return;
-
-    renderPath(context, object, type);
-    teardown(context, object, type);
-}
-
-void SVGPaintServer::teardown(GraphicsContext*& context, const RenderObject*, SVGPaintTargetType, bool isPaintingText) const
-{
-    // WebKit implicitly expects us to reset the path.
-    // For example in fillAndStrokePath() of RenderPath.cpp the path is 
-    // added back to the context after filling. This is because internally it
-    // calls CGContextFillPath() which closes the path.
-    context->beginPath();
-    context->platformContext()->setGradient(0);
-    context->platformContext()->setPattern(0);
-}
-
-void SVGPaintServer::renderPath(GraphicsContext*& context, const RenderObject* object, SVGPaintTargetType type) const
-{
-    RenderStyle* renderStyle = object ? object->style() : 0;
-
-    if ((type & ApplyToFillTargetType) && (!renderStyle || renderStyle->svgStyle()->hasFill()))
-        context->fillPath();
-
-    if ((type & ApplyToStrokeTargetType) && (!renderStyle || renderStyle->svgStyle()->hasStroke()))
-        context->strokePath();
-}
-
-} // namespace WebCore
-
-#endif