Reviewed by Eric.
authormjs <mjs@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 9 Feb 2006 03:02:38 +0000 (03:02 +0000)
committermjs <mjs@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 9 Feb 2006 03:02:38 +0000 (03:02 +0000)
        RenderPath refactoring:

        - Rename the files to RenderPath
        - Push the portable code from KCanvasItemQuartz down to RenderPath
        - Move most of the unportable code from KCanvasItemQuartz to KCanvasPathQuartz

        The only thing left in KCanvasItemQuartz is marker support. That should be factored to separate
        iterating the path elements (KCanvasPathQuartz needs to provide that) and drawing the markers
        (which should be done in portable code).

        * ForwardingHeaders/kcanvas/RenderPath.h: Removed.
        * WebCore.xcodeproj/project.pbxproj:
        * kcanvas/KCanvasItem.cpp: Removed.
        * kcanvas/KCanvasItem.h: Removed.
        * kcanvas/KCanvasPath.h:
        * kcanvas/RenderPath.cpp: Added.
        (RenderPath::mapAbsolutePointToLocal):
        (RenderPath::fillContains):
        (RenderPath::strokeContains):
        (RenderPath::strokeBBox):
        (RenderPath::relativeBBox):
        (RenderPath::setPath):
        (RenderPath::layout):
        (RenderPath::getAbsoluteRepaintRect):
        (RenderPath::requiresLayer):
        (RenderPath::lineHeight):
        (RenderPath::baselinePosition):
        (RenderPath::paint):
        (RenderPath::nodeAtPoint):
        * kcanvas/RenderPath.h: Added.
        * kcanvas/device/quartz/KCanvasItemQuartz.h:
        * kcanvas/device/quartz/KCanvasItemQuartz.mm:
        * kcanvas/device/quartz/KCanvasPathQuartz.h:
        * kcanvas/device/quartz/KCanvasPathQuartz.mm:
        (KCanvasPathQuartz::boundingBox):
        (scratchContext):
        (KCanvasPathQuartz::strokeBoundingBox):
        (pathContainsPoint):
        (KCanvasPathQuartz::containsPoint):
        (KCanvasPathQuartz::strokeContainsPoint):
        * kcanvas/device/quartz/KRenderingDeviceQuartz.mm:
        (KRenderingDeviceQuartz::createItem):
        * kcanvas/device/quartz/QuartzSupport.h:
        * kcanvas/device/quartz/QuartzSupport.mm:
        (applyStrokeStyleToContext):
        * ksvg2/svg/SVGStyledElementImpl.cpp:
        (SVGStyledElementImpl::updateCanvasItem):
        (SVGStyledElementImpl::pushAttributeContext):
        * ksvg2/svg/SVGStyledLocatableElementImpl.cpp:
        * ksvg2/svg/SVGStyledTransformableElementImpl.cpp:
        * kwq/KWQRenderTreeDebug.cpp:

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

18 files changed:
WebCore/ChangeLog
WebCore/ForwardingHeaders/kcanvas/RenderPath.h [deleted file]
WebCore/WebCore.xcodeproj/project.pbxproj
WebCore/kcanvas/KCanvasItem.cpp [deleted file]
WebCore/kcanvas/KCanvasPath.h
WebCore/kcanvas/RenderPath.cpp [new file with mode: 0644]
WebCore/kcanvas/RenderPath.h [moved from WebCore/kcanvas/KCanvasItem.h with 77% similarity]
WebCore/kcanvas/device/quartz/KCanvasItemQuartz.h
WebCore/kcanvas/device/quartz/KCanvasItemQuartz.mm
WebCore/kcanvas/device/quartz/KCanvasPathQuartz.h
WebCore/kcanvas/device/quartz/KCanvasPathQuartz.mm
WebCore/kcanvas/device/quartz/KRenderingDeviceQuartz.mm
WebCore/kcanvas/device/quartz/QuartzSupport.h
WebCore/kcanvas/device/quartz/QuartzSupport.mm
WebCore/ksvg2/svg/SVGStyledElementImpl.cpp
WebCore/ksvg2/svg/SVGStyledLocatableElementImpl.cpp
WebCore/ksvg2/svg/SVGStyledTransformableElementImpl.cpp
WebCore/kwq/KWQRenderTreeDebug.cpp

index 73a51ef67cb1a405de660ad324a68034aaed5e2c..1c8a5e97b885d475ca8aa627dfebea73d31cdb10 100644 (file)
@@ -1,3 +1,59 @@
+2006-02-08  Maciej Stachowiak  <mjs@apple.com>
+
+        Reviewed by Eric.
+
+        RenderPath refactoring:
+        
+        - Rename the files to RenderPath
+        - Push the portable code from KCanvasItemQuartz down to RenderPath
+        - Move most of the unportable code from KCanvasItemQuartz to KCanvasPathQuartz
+        
+        The only thing left in KCanvasItemQuartz is marker support. That should be factored to separate
+        iterating the path elements (KCanvasPathQuartz needs to provide that) and drawing the markers
+        (which should be done in portable code).
+
+        * ForwardingHeaders/kcanvas/RenderPath.h: Removed.
+        * WebCore.xcodeproj/project.pbxproj:
+        * kcanvas/KCanvasItem.cpp: Removed.
+        * kcanvas/KCanvasItem.h: Removed.
+        * kcanvas/KCanvasPath.h:
+        * kcanvas/RenderPath.cpp: Added.
+        (RenderPath::mapAbsolutePointToLocal):
+        (RenderPath::fillContains):
+        (RenderPath::strokeContains):
+        (RenderPath::strokeBBox):
+        (RenderPath::relativeBBox):
+        (RenderPath::setPath):
+        (RenderPath::layout):
+        (RenderPath::getAbsoluteRepaintRect):
+        (RenderPath::requiresLayer):
+        (RenderPath::lineHeight):
+        (RenderPath::baselinePosition):
+        (RenderPath::paint):
+        (RenderPath::nodeAtPoint):
+        * kcanvas/RenderPath.h: Added.
+        * kcanvas/device/quartz/KCanvasItemQuartz.h:
+        * kcanvas/device/quartz/KCanvasItemQuartz.mm:
+        * kcanvas/device/quartz/KCanvasPathQuartz.h:
+        * kcanvas/device/quartz/KCanvasPathQuartz.mm:
+        (KCanvasPathQuartz::boundingBox):
+        (scratchContext):
+        (KCanvasPathQuartz::strokeBoundingBox):
+        (pathContainsPoint):
+        (KCanvasPathQuartz::containsPoint):
+        (KCanvasPathQuartz::strokeContainsPoint):
+        * kcanvas/device/quartz/KRenderingDeviceQuartz.mm:
+        (KRenderingDeviceQuartz::createItem):
+        * kcanvas/device/quartz/QuartzSupport.h:
+        * kcanvas/device/quartz/QuartzSupport.mm:
+        (applyStrokeStyleToContext):
+        * ksvg2/svg/SVGStyledElementImpl.cpp:
+        (SVGStyledElementImpl::updateCanvasItem):
+        (SVGStyledElementImpl::pushAttributeContext):
+        * ksvg2/svg/SVGStyledLocatableElementImpl.cpp:
+        * ksvg2/svg/SVGStyledTransformableElementImpl.cpp:
+        * kwq/KWQRenderTreeDebug.cpp:
+
 2006-02-08  Adele Peterson  <adele@apple.com>
 
         Fix broken layout tests.
diff --git a/WebCore/ForwardingHeaders/kcanvas/RenderPath.h b/WebCore/ForwardingHeaders/kcanvas/RenderPath.h
deleted file mode 100644 (file)
index 1336757..0000000
+++ /dev/null
@@ -1 +0,0 @@
-#include "KCanvasItem.h"
index 6d037f31456ab12415521eaa329f8319a240bcee..1828a01b29376d378e678a75b412be50ca4c6021 100644 (file)
                A88AD3BE0952486E001DD196 /* KCanvasFilters.h in Headers */ = {isa = PBXBuildFile; fileRef = A8C0FB7F089701F800BA5114 /* KCanvasFilters.h */; };
                A88AD3BF0952486E001DD196 /* KCanvasImage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8C0FB80089701F800BA5114 /* KCanvasImage.cpp */; };
                A88AD3C00952486E001DD196 /* KCanvasImage.h in Headers */ = {isa = PBXBuildFile; fileRef = A8C0FB81089701F800BA5114 /* KCanvasImage.h */; };
-               A88AD3C10952486E001DD196 /* KCanvasItem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8C0FB82089701F800BA5114 /* KCanvasItem.cpp */; };
-               A88AD3C20952486E001DD196 /* KCanvasItem.h in Headers */ = {isa = PBXBuildFile; fileRef = A8C0FB83089701F800BA5114 /* KCanvasItem.h */; };
+               A88AD3C10952486E001DD196 /* RenderPath.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8C0FB82089701F800BA5114 /* RenderPath.cpp */; };
+               A88AD3C20952486E001DD196 /* RenderPath.h in Headers */ = {isa = PBXBuildFile; fileRef = A8C0FB83089701F800BA5114 /* RenderPath.h */; };
                A88AD3C30952486E001DD196 /* KCanvasMatrix.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8C0FB84089701F800BA5114 /* KCanvasMatrix.cpp */; };
                A88AD3C40952486E001DD196 /* KCanvasMatrix.h in Headers */ = {isa = PBXBuildFile; fileRef = A8C0FB85089701F800BA5114 /* KCanvasMatrix.h */; };
                A88AD3C50952486E001DD196 /* KCanvasPath.h in Headers */ = {isa = PBXBuildFile; fileRef = A8C0FB86089701F800BA5114 /* KCanvasPath.h */; };
                A8C0FB7F089701F800BA5114 /* KCanvasFilters.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = KCanvasFilters.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                A8C0FB80089701F800BA5114 /* KCanvasImage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = KCanvasImage.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                A8C0FB81089701F800BA5114 /* KCanvasImage.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = KCanvasImage.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
-               A8C0FB82089701F800BA5114 /* KCanvasItem.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = KCanvasItem.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
-               A8C0FB83089701F800BA5114 /* KCanvasItem.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = KCanvasItem.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
+               A8C0FB82089701F800BA5114 /* RenderPath.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderPath.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
+               A8C0FB83089701F800BA5114 /* RenderPath.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = RenderPath.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                A8C0FB84089701F800BA5114 /* KCanvasMatrix.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = KCanvasMatrix.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                A8C0FB85089701F800BA5114 /* KCanvasMatrix.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = KCanvasMatrix.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                A8C0FB86089701F800BA5114 /* KCanvasPath.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = KCanvasPath.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                                A8C0FB7F089701F800BA5114 /* KCanvasFilters.h */,
                                A8C0FB80089701F800BA5114 /* KCanvasImage.cpp */,
                                A8C0FB81089701F800BA5114 /* KCanvasImage.h */,
-                               A8C0FB82089701F800BA5114 /* KCanvasItem.cpp */,
-                               A8C0FB83089701F800BA5114 /* KCanvasItem.h */,
+                               A8C0FB82089701F800BA5114 /* RenderPath.cpp */,
+                               A8C0FB83089701F800BA5114 /* RenderPath.h */,
                                A8C0FB84089701F800BA5114 /* KCanvasMatrix.cpp */,
                                A8C0FB85089701F800BA5114 /* KCanvasMatrix.h */,
                                A8C0FB86089701F800BA5114 /* KCanvasPath.h */,
                                A88AD3BC0952486E001DD196 /* KCanvasCreator.h in Headers */,
                                A88AD3BE0952486E001DD196 /* KCanvasFilters.h in Headers */,
                                A88AD3C00952486E001DD196 /* KCanvasImage.h in Headers */,
-                               A88AD3C20952486E001DD196 /* KCanvasItem.h in Headers */,
+                               A88AD3C20952486E001DD196 /* RenderPath.h in Headers */,
                                A88AD3C40952486E001DD196 /* KCanvasMatrix.h in Headers */,
                                A88AD3C50952486E001DD196 /* KCanvasPath.h in Headers */,
                                A88AD3C70952486E001DD196 /* KCanvasResourceListener.h in Headers */,
                                A88AD3BB0952486E001DD196 /* KCanvasCreator.cpp in Sources */,
                                A88AD3BD0952486E001DD196 /* KCanvasFilters.cpp in Sources */,
                                A88AD3BF0952486E001DD196 /* KCanvasImage.cpp in Sources */,
-                               A88AD3C10952486E001DD196 /* KCanvasItem.cpp in Sources */,
+                               A88AD3C10952486E001DD196 /* RenderPath.cpp in Sources */,
                                A88AD3C30952486E001DD196 /* KCanvasMatrix.cpp in Sources */,
                                A88AD3C60952486E001DD196 /* KCanvasPath.cpp in Sources */,
                                A88AD3C80952486E001DD196 /* KCanvasResources.cpp in Sources */,
diff --git a/WebCore/kcanvas/KCanvasItem.cpp b/WebCore/kcanvas/KCanvasItem.cpp
deleted file mode 100644 (file)
index 9591be2..0000000
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
-    Copyright (C) 2004, 2005 Nikolas Zimmermann <wildfox@kde.org>
-                  2004, 2005 Rob Buis <buis@kde.org>
-                  2005 Eric Seidel <eric.seidel@kdemail.net>
-
-    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., 59 Temple Place - Suite 330,
-    Boston, MA 02111-1307, USA.
-*/
-
-#include "config.h"
-#if SVG_SUPPORT
-#include "IntRect.h"
-#include <kdebug.h>
-#include <kxmlcore/Assertions.h>
-
-#include "kcanvas/KCanvas.h"
-#include "kcanvas/RenderPath.h"
-#include "KCanvasMatrix.h"
-#include "KRenderingDevice.h"
-#include "KCanvasContainer.h"
-#include "KRenderingFillPainter.h"
-#include "KRenderingStrokePainter.h"
-
-#include "KCanvasRenderingStyle.h"
-#include "SVGRenderStyle.h"
-
-class RenderPath::Private
-{
-public:
-    RefPtr<KCanvasPath> path;
-
-    FloatRect fillBBox, strokeBbox;
-    QMatrix matrix;
-};        
-
-// RenderPath
-RenderPath::RenderPath(khtml::RenderStyle *style, KSVG::SVGStyledElementImpl *node) : RenderObject((DOM::NodeImpl *)node), d(new Private())
-{
-    ASSERT(style != 0);
-}
-
-RenderPath::~RenderPath()
-{
-    delete d;
-}
-
-QMatrix RenderPath::localTransform() const
-{
-    return d->matrix;
-}
-
-void RenderPath::setLocalTransform(const QMatrix &matrix)
-{
-    d->matrix = matrix;
-}
-
-bool RenderPath::fillContains(const FloatPoint &p) const
-{
-    if(d->path)
-        return hitsPath(p, true);
-
-    return false;
-}
-
-bool RenderPath::strokeContains(const FloatPoint &p) const
-{
-    if(d->path)
-        return hitsPath(p, false);
-
-    return false;
-}
-
-FloatRect RenderPath::relativeBBox(bool includeStroke) const
-{
-    FloatRect result;
-    
-    if (!d->path)
-        return result;
-
-    if (includeStroke) {
-        if (d->strokeBbox.isEmpty())
-            d->strokeBbox = bboxForPath(true);
-        result = d->strokeBbox;
-    } else {
-        if (d->fillBBox.isEmpty())
-            d->fillBBox = bboxForPath(false);
-        result = d->fillBBox;
-    }
-    
-    return result;
-}
-
-void RenderPath::changePath(KCanvasPath* newPath)
-{
-    d->path = newPath;
-}
-
-KCanvasPath* RenderPath::path() const
-{
-    return d->path.get();
-}
-
-// vim:ts=4:noet
-#endif // SVG_SUPPORT
-
index afaa71f52c41448c6c63b701f26688f1804c39a9..f7f55e796cec0aa3ee3d21a387850293a21bbcb5 100644 (file)
 #include <kxmlcore/RefPtr.h>
 #include <kxmlcore/Assertions.h>
 #include "Shared.h"
+#include "FloatRect.h"
+
+class KRenderingStrokePainter;
+
+namespace WebCore {
+    class RenderStyle;
+}
 
 class QTextStream;
 
@@ -60,6 +67,11 @@ public:
     virtual void lineTo(float x, float y) = 0;
     virtual void curveTo(float x1, float y1, float x2, float y2, float x3, float y3) = 0;
     virtual void closeSubpath() = 0;
+
+    virtual FloatRect boundingBox() = 0;
+    virtual FloatRect strokeBoundingBox(const KRenderingStrokePainter&) = 0;
+    virtual bool strokeContainsPoint(const FloatPoint&) = 0;
+    virtual bool containsPoint(const FloatPoint&, KCWindRule) = 0;
 };
 
 // Clipping paths
diff --git a/WebCore/kcanvas/RenderPath.cpp b/WebCore/kcanvas/RenderPath.cpp
new file mode 100644 (file)
index 0000000..5da3366
--- /dev/null
@@ -0,0 +1,263 @@
+/*
+    Copyright (C) 2004, 2005 Nikolas Zimmermann <wildfox@kde.org>
+                  2004, 2005 Rob Buis <buis@kde.org>
+                  2005 Eric Seidel <eric.seidel@kdemail.net>
+
+    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., 59 Temple Place - Suite 330,
+    Boston, MA 02111-1307, USA.
+*/
+
+#include "config.h"
+#if SVG_SUPPORT
+#include "IntRect.h"
+#include <kdebug.h>
+#include <kxmlcore/Assertions.h>
+
+#include "kcanvas/KCanvas.h"
+#include "kcanvas/RenderPath.h"
+#include "KCanvasMatrix.h"
+#include "KRenderingDevice.h"
+#include "KCanvasContainer.h"
+#include "KRenderingFillPainter.h"
+#include "KRenderingStrokePainter.h"
+
+#include "KCanvasRenderingStyle.h"
+#include "SVGRenderStyle.h"
+#include "SVGStyledElementImpl.h"
+
+class RenderPath::Private
+{
+public:
+    RefPtr<KCanvasPath> path;
+
+    FloatRect fillBBox, strokeBbox;
+    QMatrix matrix;
+};        
+
+// RenderPath
+RenderPath::RenderPath(khtml::RenderStyle *style, KSVG::SVGStyledElementImpl *node) : RenderObject((DOM::NodeImpl *)node), d(new Private())
+{
+    ASSERT(style != 0);
+}
+
+RenderPath::~RenderPath()
+{
+    delete d;
+}
+
+QMatrix RenderPath::localTransform() const
+{
+    return d->matrix;
+}
+
+void RenderPath::setLocalTransform(const QMatrix &matrix)
+{
+    d->matrix = matrix;
+}
+
+
+FloatPoint RenderPath::mapAbsolutePointToLocal(const FloatPoint& point) const
+{
+    // FIXME: does it make sense to map incoming points with the inverse of the
+    // absolute transform? 
+    double localX;
+    double localY;
+    absoluteTransform().invert().map(point.x(), point.y(), &localX, &localY);
+    return FloatPoint(localX, localY);
+}
+
+bool RenderPath::fillContains(const FloatPoint& point) const
+{
+    if (!d->path)
+        return false;
+
+    if (!KSVG::KSVGPainterFactory::fillPaintServer(style(), this))
+        return false;
+
+    return path()->containsPoint(mapAbsolutePointToLocal(point),
+                                 KSVG::KSVGPainterFactory::fillPainter(style(), this).fillRule());
+}
+
+bool RenderPath::strokeContains(const FloatPoint& point) const
+{
+    if (!d->path)
+        return false;
+
+    if (!KSVG::KSVGPainterFactory::strokePaintServer(style(), this))
+        return false;
+
+    return path()->strokeContainsPoint(mapAbsolutePointToLocal(point));
+}
+
+FloatRect RenderPath::strokeBBox() const
+{
+    if (KSVG::KSVGPainterFactory::isStroked(style())) {
+        KRenderingStrokePainter strokePainter = KSVG::KSVGPainterFactory::strokePainter(style(), this);
+        return path()->strokeBoundingBox(strokePainter);
+    }
+
+    return path()->boundingBox();
+}
+
+FloatRect RenderPath::relativeBBox(bool includeStroke) const
+{
+    if (!d->path)
+        return FloatRect();
+
+    if (includeStroke) {
+        if (d->strokeBbox.isEmpty())
+            d->strokeBbox = strokeBBox();
+        return d->strokeBbox;
+    }
+
+    if (d->fillBBox.isEmpty())
+        d->fillBBox = path()->boundingBox();
+    return d->fillBBox;
+}
+
+void RenderPath::setPath(KCanvasPath* newPath)
+{
+    d->path = newPath;
+}
+
+KCanvasPath* RenderPath::path() const
+{
+    return d->path.get();
+}
+
+void RenderPath::layout()
+{
+    // FIXME: Currently the DOM does all of the % length calculations, so we
+    // pretend that one of the attributes of the element has changed on the DOM
+    // to force the DOM object to update this render object with new aboslute position values.
+
+    static_cast<KSVG::SVGStyledElementImpl*>(element())->notifyAttributeChange();
+    IntRect layoutRect = getAbsoluteRepaintRect();
+    setWidth(layoutRect.width());
+    setHeight(layoutRect.height());
+    setNeedsLayout(false);
+}
+
+IntRect RenderPath::getAbsoluteRepaintRect()
+{
+    FloatRect repaintRect = absoluteTransform().mapRect(relativeBBox(true));
+    
+    // Filters can expand the bounding box
+    KCanvasFilter *filter = getFilterById(document(), style()->svgStyle()->filter().mid(1));
+    if (filter)
+        repaintRect.unite(filter->filterBBoxForItemBBox(repaintRect));
+    
+    if (!repaintRect.isEmpty())
+        repaintRect.inflate(1); // inflate 1 pixel for antialiasing
+    return enclosingIntRect(repaintRect);
+}
+
+bool RenderPath::requiresLayer()
+{
+    return false;
+}
+
+short RenderPath::lineHeight(bool b, bool isRootLineBox) const
+{
+    return static_cast<short>(relativeBBox(true).height());
+}
+
+short RenderPath::baselinePosition(bool b, bool isRootLineBox) const
+{
+    return static_cast<short>(relativeBBox(true).height());
+}
+
+void RenderPath::paint(PaintInfo &paintInfo, int parentX, int parentY)
+{
+    // No one should be transforming us via these.
+    //ASSERT(parentX == 0);
+    //ASSERT(parentY == 0);
+
+    if (paintInfo.p->paintingDisabled() || (paintInfo.phase != WebCore::PaintActionForeground) || style()->visibility() == khtml::HIDDEN)
+        return;
+    
+    KRenderingDevice *renderingDevice = QPainter::renderingDevice();
+    KRenderingDeviceContext *deviceContext = renderingDevice->currentContext();
+    bool shouldPopContext = false;
+    if (!deviceContext) {
+        // I only need to setup for KCanvas rendering if it hasn't already been done.
+        deviceContext = paintInfo.p->createRenderingDeviceContext();
+        renderingDevice->pushContext(deviceContext);
+        shouldPopContext = true;
+    } else
+        paintInfo.p->save();
+
+    deviceContext->concatCTM(localTransform());
+
+    // setup to apply filters
+    KCanvasFilter *filter = getFilterById(document(), style()->svgStyle()->filter().mid(1));
+    if (filter) {
+        filter->prepareFilter(relativeBBox(true));
+        deviceContext = renderingDevice->currentContext();
+    }
+
+    if (KCanvasClipper *clipper = getClipperById(document(), style()->svgStyle()->clipPath().mid(1)))
+        clipper->applyClip(relativeBBox(true));
+
+    if (KCanvasMasker *masker = getMaskerById(document(), style()->svgStyle()->maskElement().mid(1)))
+        masker->applyMask(relativeBBox(true));
+
+    deviceContext->clearPath();
+    
+    KRenderingPaintServer *fillPaintServer = KSVG::KSVGPainterFactory::fillPaintServer(style(), this);
+    if (fillPaintServer) {
+        deviceContext->addPath(path());
+        fillPaintServer->setActiveClient(this);
+        fillPaintServer->draw(deviceContext, this, APPLY_TO_FILL);
+    }
+    KRenderingPaintServer *strokePaintServer = KSVG::KSVGPainterFactory::strokePaintServer(style(), this);
+    if (strokePaintServer) {
+        deviceContext->addPath(path()); // path is cleared when filled.
+        strokePaintServer->setActiveClient(this);
+        strokePaintServer->draw(deviceContext, this, APPLY_TO_STROKE);
+    }
+
+    drawMarkersIfNeeded(paintInfo.r, path());
+
+    // actually apply the filter
+    if (filter)
+        filter->applyFilter(relativeBBox(true));
+
+    // restore drawing state
+    if (shouldPopContext) {
+        renderingDevice->popContext();
+        delete deviceContext;
+    } else
+        paintInfo.p->restore();
+}
+
+bool RenderPath::nodeAtPoint(NodeInfo& info, int _x, int _y, int _tx, int _ty, WebCore::HitTestAction hitTestAction)
+{
+    // We only draw in the forground phase, so we only hit-test then.
+    if (hitTestAction != WebCore::HitTestForeground)
+        return false;
+
+    if (strokeContains(FloatPoint(_x, _y)) || fillContains(FloatPoint(_x, _y))) {
+        setInnerNode(info);
+        return true;
+    }
+    return false;
+}
+
+// vim:ts=4:noet
+#endif // SVG_SUPPORT
+
similarity index 77%
rename from WebCore/kcanvas/KCanvasItem.h
rename to WebCore/kcanvas/RenderPath.h
index 592bdafd2503530343f5ccd5cf6dbb7909dd6dd9..cadaf20a29759476893372beb64ac071b40ddf50 100644 (file)
@@ -2,6 +2,7 @@
     Copyright (C) 2004, 2005 Nikolas Zimmermann <wildfox@kde.org>
                   2004, 2005 Rob Buis <buis@kde.org>
                   2005 Eric Seidel <eric.seidel@kdemail.net>
+                  2006 Apple Computer, Inc
 
     This file is part of the KDE project
 
@@ -44,6 +45,7 @@ namespace KSVG {
 class KCanvasPath;
 class KCanvasContainer;
 class KCanvasMatrix;
+
 class RenderPath : public khtml::RenderObject
 {
 public:
@@ -57,7 +59,7 @@ public:
     // Returns an unscaled bounding box (not even including localTransform()) for this vector path
     virtual FloatRect relativeBBox(bool includeStroke = true) const;
 
-    void changePath(KCanvasPath* newPath);
+    void setPath(KCanvasPath* newPath);
     KCanvasPath* path() const;
 
     virtual bool isRenderPath() const { return true; }
@@ -66,12 +68,22 @@ public:
     virtual QMatrix localTransform() const;
     virtual void setLocalTransform(const QMatrix &matrix);
     
+    virtual void layout();
+    virtual IntRect getAbsoluteRepaintRect();
+    virtual bool requiresLayer();
+    virtual short lineHeight(bool b, bool isRootLineBox = false) const;
+    virtual short baselinePosition(bool b, bool isRootLineBox = false) const;
+    virtual void paint(PaintInfo&, int parentX, int parentY);
+    
+    virtual bool nodeAtPoint(NodeInfo&, int x, int y, int tx, int ty, WebCore::HitTestAction);
+
 protected:
-    // restricted set of args for passing to paint servers, etc.
-    virtual bool hitsPath(const WebCore::FloatPoint &hitPoint, bool fill) const = 0;
-    virtual FloatRect bboxForPath(bool includeStroke) const = 0;
+    virtual void drawMarkersIfNeeded(const FloatRect&, const KCanvasPath*) const = 0;
 
 private:
+    FloatRect strokeBBox() const;
+    FloatPoint mapAbsolutePointToLocal(const FloatPoint& point) const;
+
     class Private;
     Private *d;
 };
index 018662e12311ce5454cc68ab0446125b0007387f..b6b27572e92fe41898970230cf2129de07c0a9d9 100644 (file)
@@ -32,18 +32,5 @@ public:
     KCanvasItemQuartz(WebCore::RenderStyle*, WebCore::SVGStyledElementImpl*);
     virtual ~KCanvasItemQuartz() { }
     
-    virtual FloatRect bboxForPath(bool includeStroke) const;
-    virtual bool hitsPath(const FloatPoint&, bool fill /* false means stroke */) const;
-    
-    virtual IntRect getAbsoluteRepaintRect();
-    
-    virtual bool requiresLayer();
-    virtual short lineHeight(bool b, bool isRootLineBox = false) const;
-    virtual short baselinePosition(bool b, bool isRootLineBox = false) const;
-    
-    virtual void layout();
-    virtual void paint(PaintInfo&, int parentX, int parentY);
-    virtual bool nodeAtPoint(NodeInfo&, int x, int y, int tx, int ty, WebCore::HitTestAction);
-private:
-    void drawMarkersIfNeeded(const FloatRect&, const KCanvasPath*) const;
+    virtual void drawMarkersIfNeeded(const FloatRect&, const KCanvasPath*) const;
 };
index 224cd092901b8e0d1e86600b56e53d8dbbbcf8e7..26dc40df45406b982a7270f21013c3d872d510db 100644 (file)
@@ -53,18 +53,6 @@ KCanvasItemQuartz::KCanvasItemQuartz(khtml::RenderStyle *style, KSVG::SVGStyledE
 {
 }
 
-void KCanvasItemQuartz::layout()
-{
-    // FIXME: Currently the DOM does all of the % length calculations, so we
-    // pretend that one of the attributes of the element has changed on the DOM
-    // to force the DOM object to update this render object with new aboslute position values.
-    static_cast<KSVG::SVGStyledElementImpl*>(element())->notifyAttributeChange();
-    IntRect layoutRect = getAbsoluteRepaintRect();
-    setWidth(layoutRect.width());
-    setHeight(layoutRect.height());
-    setNeedsLayout(false);
-}
-
 typedef enum {
     Start,
     Mid,
@@ -197,185 +185,4 @@ void KCanvasItemQuartz::drawMarkersIfNeeded(const FloatRect& rect, const KCanvas
     drawMarkerWithData(data.previousMarkerData);
 }
 
-IntRect KCanvasItemQuartz::getAbsoluteRepaintRect()
-{
-    FloatRect repaintRect = absoluteTransform().mapRect(relativeBBox(true));
-    
-    // Filters can expand the bounding box
-    KCanvasFilter *filter = getFilterById(document(), style()->svgStyle()->filter().mid(1));
-    if (filter)
-        repaintRect.unite(filter->filterBBoxForItemBBox(repaintRect));
-    
-    if (!repaintRect.isEmpty())
-        repaintRect.inflate(1); // inflate 1 pixel for antialiasing
-    return enclosingIntRect(repaintRect);
-}
-
-bool KCanvasItemQuartz::requiresLayer()
-{
-    return false;
-}
-
-short KCanvasItemQuartz::lineHeight(bool b, bool isRootLineBox) const
-{
-    return static_cast<short>(bboxForPath(true).height());
-}
-
-short KCanvasItemQuartz::baselinePosition(bool b, bool isRootLineBox) const
-{
-    return static_cast<short>(bboxForPath(true).height());
-}
-
-void KCanvasItemQuartz::paint(PaintInfo &paintInfo, int parentX, int parentY)
-{
-    // No one should be transforming us via these.
-    //ASSERT(parentX == 0);
-    //ASSERT(parentY == 0);
-
-    if (paintInfo.p->paintingDisabled() || (paintInfo.phase != WebCore::PaintActionForeground) || style()->visibility() == khtml::HIDDEN)
-        return;
-    
-    KRenderingDevice *renderingDevice = QPainter::renderingDevice();
-    KRenderingDeviceContext *deviceContext = renderingDevice->currentContext();
-    bool shouldPopContext = false;
-    if (!deviceContext) {
-        // I only need to setup for KCanvas rendering if it hasn't already been done.
-        deviceContext = paintInfo.p->createRenderingDeviceContext();
-        renderingDevice->pushContext(deviceContext);
-        shouldPopContext = true;
-    } else
-        paintInfo.p->save();
-
-    deviceContext->concatCTM(localTransform());
-
-    // setup to apply filters
-    KCanvasFilter *filter = getFilterById(document(), style()->svgStyle()->filter().mid(1));
-    if (filter) {
-        filter->prepareFilter(relativeBBox(true));
-        deviceContext = renderingDevice->currentContext();
-    }
-
-    if (KCanvasClipper *clipper = getClipperById(document(), style()->svgStyle()->clipPath().mid(1)))
-        clipper->applyClip(relativeBBox(true));
-
-    if (KCanvasMasker *masker = getMaskerById(document(), style()->svgStyle()->maskElement().mid(1)))
-        masker->applyMask(relativeBBox(true));
-
-    deviceContext->clearPath();
-    
-    KRenderingPaintServer *fillPaintServer = KSVG::KSVGPainterFactory::fillPaintServer(style(), this);
-    if (fillPaintServer) {
-        deviceContext->addPath(path());
-        fillPaintServer->setActiveClient(this);
-        fillPaintServer->draw(deviceContext, this, APPLY_TO_FILL);
-    }
-    KRenderingPaintServer *strokePaintServer = KSVG::KSVGPainterFactory::strokePaintServer(style(), this);
-    if (strokePaintServer) {
-        deviceContext->addPath(path()); // path is cleared when filled.
-        strokePaintServer->setActiveClient(this);
-        strokePaintServer->draw(deviceContext, this, APPLY_TO_STROKE);
-    }
-
-    drawMarkersIfNeeded(paintInfo.r, path());
-
-    // actually apply the filter
-    if (filter)
-        filter->applyFilter(relativeBBox(true));
-
-    // restore drawing state
-    if (shouldPopContext) {
-        renderingDevice->popContext();
-        delete deviceContext;
-    } else
-        paintInfo.p->restore();
-}
-
-#pragma mark -
-#pragma mark Hit Testing, BBoxes
-
-bool KCanvasItemQuartz::nodeAtPoint(NodeInfo& info, int _x, int _y, int _tx, int _ty, WebCore::HitTestAction hitTestAction)
-{
-    // We only draw in the forground phase, so we only hit-test then.
-    if (hitTestAction != WebCore::HitTestForeground)
-        return false;
-
-    if (hitsPath(FloatPoint(_x, _y), true)) {
-        setInnerNode(info);
-        return true;
-    }
-    return false;
-}
-
-CGContextRef getSharedContext()
-{
-    static CGContextRef sharedContext = NULL;
-    if (!sharedContext) {
-        CFMutableDataRef empty = CFDataCreateMutable(NULL, 0);
-        CGDataConsumerRef consumer = CGDataConsumerCreateWithCFData(empty);
-        sharedContext = CGPDFContextCreate(consumer, NULL, NULL);
-        CGDataConsumerRelease(consumer);
-        CFRelease(empty);
-
-        float black[4] = {0,0,0,1};
-        CGContextSetFillColor(sharedContext, black);
-        CGContextSetStrokeColor(sharedContext, black);
-    }
-    return sharedContext;
-}
-
-FloatRect KCanvasItemQuartz::bboxForPath(bool includeStroke) const
-{
-    CGPathRef cgPath = static_cast<KCanvasPathQuartz*>(path())->cgPath();
-    ASSERT(cgPath != 0);
-    CGRect bbox;
-
-    // the bbox might grow if the path is stroked.
-    // and CGPathGetBoundingBox doesn't support that, so we'll have
-    // to make an alternative call...
-    if (includeStroke && KSVG::KSVGPainterFactory::isStroked(style())) {
-        CGContextRef sharedContext = getSharedContext();
-        
-        CGContextSaveGState(sharedContext);
-        CGContextBeginPath(sharedContext);
-        CGContextAddPath(sharedContext, cgPath);
-        applyStrokeStyleToContext(sharedContext, style(), this);
-        CGContextReplacePathWithStrokedPath(sharedContext);
-        
-        bbox = CGContextGetPathBoundingBox(sharedContext);
-        
-        CGContextRestoreGState(sharedContext);
-    } else
-        // the easy (and efficient) case:
-        bbox = CGPathGetBoundingBox(cgPath);
-    
-    return FloatRect(bbox);
-}
-
-bool KCanvasItemQuartz::hitsPath(const FloatPoint &hitPoint, bool fill) const
-{
-    CGPathRef cgPath = static_cast<KCanvasPathQuartz*>(path())->cgPath();
-    ASSERT(cgPath != 0);
-
-    bool hitSuccess = false;
-    CGContextRef sharedContext = getSharedContext();
-    CGContextSaveGState(sharedContext);
-
-    CGContextBeginPath(sharedContext);
-    CGContextAddPath(sharedContext, cgPath);
-
-    CGAffineTransform transform = CGAffineTransform(absoluteTransform());
-    /* we transform the hit point locally, instead of translating the shape to the hit point. */
-    CGPoint localHitPoint = CGPointApplyAffineTransform(CGPoint(hitPoint), CGAffineTransformInvert(transform));
-
-    if (fill && KSVG::KSVGPainterFactory::fillPaintServer(style(), this)) {
-        CGPathDrawingMode drawMode = (KSVG::KSVGPainterFactory::fillPainter(style(), this).fillRule() == RULE_EVENODD) ? kCGPathEOFill : kCGPathFill;
-        hitSuccess = CGContextPathContainsPoint(sharedContext, localHitPoint, drawMode);
-    } else if (!fill && KSVG::KSVGPainterFactory::strokePaintServer(style(), this))
-        hitSuccess = CGContextPathContainsPoint(sharedContext, localHitPoint, kCGPathStroke);
-
-    CGContextRestoreGState(sharedContext);
-
-    return hitSuccess;
-}
 #endif // SVG_SUPPORT
-
index 479e9f8aae96c3da64f49a8e7799a51b35a3ad7b..f111ee75c59a19b4917d7108202717de5f05a67e 100644 (file)
@@ -39,6 +39,11 @@ public:
     virtual void lineTo(float x, float y);
     virtual void curveTo(float x1, float y1, float x2, float y2, float x3, float y3);
     virtual void closeSubpath();
+
+    virtual FloatRect boundingBox();
+    virtual FloatRect strokeBoundingBox(const KRenderingStrokePainter&);
+    virtual bool containsPoint(const FloatPoint&, KCWindRule);
+    virtual bool strokeContainsPoint(const FloatPoint&);
     
     CGPathRef cgPath() const { return m_cgPath; }
     
index f8296eea8e5135699014a4efb25a2a274079f18f..dc21ce117944ad696e2962b940ae37e8b1d29a98 100644 (file)
@@ -26,6 +26,7 @@
 #include "config.h"
 #if SVG_SUPPORT
 #include "KCanvasPathQuartz.h"
+#include "QuartzSupport.h"
 
 KCanvasPathQuartz::KCanvasPathQuartz()
 {
@@ -61,5 +62,77 @@ void KCanvasPathQuartz::closeSubpath()
 {
     CGPathCloseSubpath(m_cgPath);
 }
+
+FloatRect KCanvasPathQuartz::boundingBox()
+{
+    return CGPathGetBoundingBox(m_cgPath);
+}
+
+CGContextRef scratchContext()
+{
+    static CGContextRef scratch = 0;
+    if (!scratch) {
+        CFMutableDataRef empty = CFDataCreateMutable(NULL, 0);
+        CGDataConsumerRef consumer = CGDataConsumerCreateWithCFData(empty);
+        scratch = CGPDFContextCreate(consumer, NULL, NULL);
+        CGDataConsumerRelease(consumer);
+        CFRelease(empty);
+
+        float black[4] = {0,0,0,1};
+        CGContextSetFillColor(scratch, black);
+        CGContextSetStrokeColor(scratch, black);
+    }
+    return scratch;
+}
+
+FloatRect KCanvasPathQuartz::strokeBoundingBox(const KRenderingStrokePainter& strokePainter)
+{
+    // the bbox might grow if the path is stroked.
+    // and CGPathGetBoundingBox doesn't support that, so we'll have
+    // to make an alternative call...
+
+    // FIXME: since this is mainly used to decide what to repaint,
+    // perhaps it would be sufficien to just outset the fill bbox by
+    // the stroke width - that should be way cheaper and simpler than
+    // what we do here.
+
+    CGContextRef context = scratchContext();
+    CGContextSaveGState(context);
+
+    CGContextBeginPath(context);
+    CGContextAddPath(context, m_cgPath);
+    applyStrokeStyleToContext(context, strokePainter);
+    CGContextReplacePathWithStrokedPath(context);
+    CGRect box = CGContextGetPathBoundingBox(context);
+        
+    CGContextRestoreGState(context);
+
+    return FloatRect(box);
+}
+
+static bool pathContainsPoint(CGMutablePathRef cgPath, const FloatPoint& point, CGPathDrawingMode drawMode)
+{
+   CGContextRef context = scratchContext();
+   CGContextSaveGState(context);
+   
+   CGContextBeginPath(context);
+   CGContextAddPath(context, cgPath);
+   bool hitSuccess = CGContextPathContainsPoint(context, point, drawMode);
+
+   CGContextRestoreGState(context);
+
+   return hitSuccess;
+}
+
+bool KCanvasPathQuartz::containsPoint(const FloatPoint& point, KCWindRule fillRule)
+{
+    return pathContainsPoint(m_cgPath, point, fillRule == RULE_EVENODD ? kCGPathEOFill : kCGPathFill);
+}
+
+bool KCanvasPathQuartz::strokeContainsPoint(const FloatPoint& point)
+{
+    return pathContainsPoint(m_cgPath, point, kCGPathStroke);
+}
+
 #endif // SVG_SUPPORT
 
index bad2fdb61cb2d2eaf9ac55052de6c3f6c3cf6556..eb9794f8b7bbc6c64caf6a22842c6987c91a1a8e 100644 (file)
@@ -218,7 +218,7 @@ KCanvasContainer *KRenderingDeviceQuartz::createContainer(RenderArena *arena, kh
 RenderPath *KRenderingDeviceQuartz::createItem(RenderArena *arena, khtml::RenderStyle *style, KSVG::SVGStyledElementImpl *node, KCanvasPath* path) const
 {
     RenderPath *item = new (arena) KCanvasItemQuartz(style, node);
-    item->changePath(path);
+    item->setPath(path);
     return item;
 }
 
index 83b3916cc209c14c20b43c38ff80dcedcefc78f8..df64124a54041640cd1bbc8bfb28a59fae098813 100644 (file)
@@ -43,6 +43,7 @@ CFStringRef CFStringFromCGPath(CGPathRef path);
 CFStringRef CFStringFromCGAffineTransform(CGAffineTransform t);
 CGAffineTransform CGAffineTransformMakeMapBetweenRects(CGRect source, CGRect dest);
 
+void applyStrokeStyleToContext(CGContextRef, const KRenderingStrokePainter&);
 void applyStrokeStyleToContext(CGContextRef, WebCore::RenderStyle*, const WebCore::RenderObject*);
 
 static inline CGLineCap CGLineCapFromKC(KCCapStyle cap)
index 1e25fd04f7cf274d88481e522bcf77e9b15a34c0..d8c69ec6e896acf72ef46a480ea46605c25096d7 100644 (file)
@@ -90,9 +90,8 @@ CGAffineTransform CGAffineTransformMakeMapBetweenRects(CGRect source, CGRect des
     return transform;
 }
 
-void applyStrokeStyleToContext(CGContextRef context, khtml::RenderStyle* renderStyle, const khtml::RenderObject* renderObject)
+void applyStrokeStyleToContext(CGContextRef context, const KRenderingStrokePainter& strokePainter)
 {
-    KRenderingStrokePainter strokePainter = KSVG::KSVGPainterFactory::strokePainter(renderStyle, renderObject);
 
     /* Shouldn't all these be in the stroke painter? */
     CGContextSetLineWidth(context, strokePainter.strokeWidth());
@@ -116,6 +115,12 @@ void applyStrokeStyleToContext(CGContextRef context, khtml::RenderStyle* renderS
     }
 }
 
+void applyStrokeStyleToContext(CGContextRef context, khtml::RenderStyle* renderStyle, const khtml::RenderObject* renderObject)
+{
+    KRenderingStrokePainter strokePainter = KSVG::KSVGPainterFactory::strokePainter(renderStyle, renderObject);
+    applyStrokeStyleToContext(context, strokePainter);
+}
+
 void CGPathToCFStringApplierFunction(void *info, const CGPathElement *element)
 {
     CFMutableStringRef string = (CFMutableStringRef)info;
index a864a586d70ff8a26aa947aa4faa508a7f65b489..68e47dd2fbfc3cad18e80735e6257065ba977f8a 100644 (file)
@@ -134,7 +134,7 @@ void SVGStyledElementImpl::updateCanvasItem()
         && parentElement->childShouldCreateRenderer(this))
         renderSection = true;
 
-    renderPath->changePath(toPathData());
+    renderPath->setPath(toPathData());
 
     if(renderSection)
         renderPath->setNeedsLayout(true);
@@ -145,7 +145,7 @@ void SVGStyledElementImpl::updateCanvasItem()
 const SVGStyledElementImpl *SVGStyledElementImpl::pushAttributeContext(const SVGStyledElementImpl *)
 {
     if(canvas())
-        static_cast<RenderPath *>(renderer())->changePath(toPathData());
+        static_cast<RenderPath *>(renderer())->setPath(toPathData());
 
     return 0;
 }
index dd50dc2a52dea51634386af33b6388fb9e795018..cb6fb61749887440a51f07aecf08c1c1f0603a37 100644 (file)
@@ -29,7 +29,7 @@
 #include "SVGStyledLocatableElementImpl.h"
 #include "SVGSVGElementImpl.h"
 
-#include <kcanvas/KCanvasItem.h>
+#include <kcanvas/RenderPath.h>
 
 using namespace KSVG;
 
index 8e18d527846eb0219a9ec22e011df8132e3038cf..77d380a1391d6267102901418ccf3ebd6dc42b7b 100644 (file)
@@ -29,7 +29,7 @@
 #include <kdom/core/AttrImpl.h>
 
 #include <kcanvas/KCanvas.h>
-#include <kcanvas/KCanvasItem.h>
+#include <kcanvas/RenderPath.h>
 
 #include "SVGHelper.h"
 #include "SVGMatrixImpl.h"
index 5b8727e18c136e743f39ca1560449776a59957f2..d08b0e8f9e0301a4e78916132af510e316c6ade2 100644 (file)
@@ -39,7 +39,7 @@
 
 #if SVG_SUPPORT
 #include "KCanvasTreeDebug.h"
-#include "KCanvasItem.h"
+#include "RenderPath.h"
 #include "KCanvasContainer.h"
 #endif