2006-04-28 Eric Seidel <eseidel@apple.com>
authoreseidel <eseidel@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 28 Apr 2006 11:50:03 +0000 (11:50 +0000)
committereseidel <eseidel@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 28 Apr 2006 11:50:03 +0000 (11:50 +0000)
        Reviewed by andersca.

        Remove KCanvasContainerQuartz, pushing all logic into KCanvasContainer.

        * kcanvas/KCanvasContainer.cpp:
        (WebCore::KCanvasContainer::canHaveChildren):
        (WebCore::KCanvasContainer::requiresLayer):
        (WebCore::KCanvasContainer::lineHeight):
        (WebCore::KCanvasContainer::baselinePosition):
        (WebCore::KCanvasContainer::calcMinMaxWidth):
        (WebCore::KCanvasContainer::layout):
        (WebCore::KCanvasContainer::paint):
        (WebCore::KCanvasContainer::setViewport):
        (WebCore::KCanvasContainer::viewport):
        (WebCore::KCanvasContainer::setViewBox):
        (WebCore::KCanvasContainer::viewBox):
        (WebCore::KCanvasContainer::setAlign):
        (WebCore::KCanvasContainer::align):
        (WebCore::KCanvasContainer::viewportTransform):
        (WebCore::KCanvasContainer::getAbsoluteRepaintRect):
        (WebCore::KCanvasContainer::absoluteTransform):
        (WebCore::KCanvasContainer::getAspectRatio):
        * kcanvas/KCanvasContainer.h:
        (WebCore::KCanvasContainer::renderName):
        * kcanvas/device/KRenderingDevice.h:
        * kcanvas/device/quartz/KCanvasResourcesQuartz.h:
        * kcanvas/device/quartz/KCanvasResourcesQuartz.mm:
        * kcanvas/device/quartz/KRenderingDeviceQuartz.h:
        * kcanvas/device/quartz/KRenderingDeviceQuartz.mm:
        (WebCore::KRenderingDeviceQuartz::createPaintServer):
        * ksvg2/svg/SVGAElement.cpp:
        (WebCore::SVGAElement::createRenderer):
        * ksvg2/svg/SVGGElement.cpp:
        (SVGGElement::createRenderer):
        * ksvg2/svg/SVGMarkerElement.cpp:
        (WebCore::SVGMarkerElement::createRenderer):
        * ksvg2/svg/SVGMaskElement.cpp:
        (WebCore::SVGMaskElement::createRenderer):
        * ksvg2/svg/SVGPatternElement.cpp:
        (WebCore::SVGPatternElement::createRenderer):
        * ksvg2/svg/SVGSVGElement.cpp:
        (WebCore::SVGSVGElement::createRenderer):
        * ksvg2/svg/SVGSwitchElement.cpp:
        (WebCore::SVGSwitchElement::createRenderer):
        * ksvg2/svg/SVGUseElement.cpp:
        (SVGUseElement::createRenderer):

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

16 files changed:
WebCore/ChangeLog
WebCore/kcanvas/KCanvasContainer.cpp
WebCore/kcanvas/KCanvasContainer.h
WebCore/kcanvas/device/KRenderingDevice.h
WebCore/kcanvas/device/quartz/KCanvasResourcesQuartz.h
WebCore/kcanvas/device/quartz/KCanvasResourcesQuartz.mm
WebCore/kcanvas/device/quartz/KRenderingDeviceQuartz.h
WebCore/kcanvas/device/quartz/KRenderingDeviceQuartz.mm
WebCore/ksvg2/svg/SVGAElement.cpp
WebCore/ksvg2/svg/SVGGElement.cpp
WebCore/ksvg2/svg/SVGMarkerElement.cpp
WebCore/ksvg2/svg/SVGMaskElement.cpp
WebCore/ksvg2/svg/SVGPatternElement.cpp
WebCore/ksvg2/svg/SVGSVGElement.cpp
WebCore/ksvg2/svg/SVGSwitchElement.cpp
WebCore/ksvg2/svg/SVGUseElement.cpp

index 91ddd05..f3a9c0b 100644 (file)
@@ -1,3 +1,54 @@
+2006-04-28  Eric Seidel  <eseidel@apple.com>
+
+        Reviewed by andersca.
+
+        Remove KCanvasContainerQuartz, pushing all logic into KCanvasContainer.
+        
+        No tests affected.
+
+        * kcanvas/KCanvasContainer.cpp:
+        (WebCore::KCanvasContainer::canHaveChildren):
+        (WebCore::KCanvasContainer::requiresLayer):
+        (WebCore::KCanvasContainer::lineHeight):
+        (WebCore::KCanvasContainer::baselinePosition):
+        (WebCore::KCanvasContainer::calcMinMaxWidth):
+        (WebCore::KCanvasContainer::layout):
+        (WebCore::KCanvasContainer::paint):
+        (WebCore::KCanvasContainer::setViewport):
+        (WebCore::KCanvasContainer::viewport):
+        (WebCore::KCanvasContainer::setViewBox):
+        (WebCore::KCanvasContainer::viewBox):
+        (WebCore::KCanvasContainer::setAlign):
+        (WebCore::KCanvasContainer::align):
+        (WebCore::KCanvasContainer::viewportTransform):
+        (WebCore::KCanvasContainer::getAbsoluteRepaintRect):
+        (WebCore::KCanvasContainer::absoluteTransform):
+        (WebCore::KCanvasContainer::getAspectRatio):
+        * kcanvas/KCanvasContainer.h:
+        (WebCore::KCanvasContainer::renderName):
+        * kcanvas/device/KRenderingDevice.h:
+        * kcanvas/device/quartz/KCanvasResourcesQuartz.h:
+        * kcanvas/device/quartz/KCanvasResourcesQuartz.mm:
+        * kcanvas/device/quartz/KRenderingDeviceQuartz.h:
+        * kcanvas/device/quartz/KRenderingDeviceQuartz.mm:
+        (WebCore::KRenderingDeviceQuartz::createPaintServer):
+        * ksvg2/svg/SVGAElement.cpp:
+        (WebCore::SVGAElement::createRenderer):
+        * ksvg2/svg/SVGGElement.cpp:
+        (SVGGElement::createRenderer):
+        * ksvg2/svg/SVGMarkerElement.cpp:
+        (WebCore::SVGMarkerElement::createRenderer):
+        * ksvg2/svg/SVGMaskElement.cpp:
+        (WebCore::SVGMaskElement::createRenderer):
+        * ksvg2/svg/SVGPatternElement.cpp:
+        (WebCore::SVGPatternElement::createRenderer):
+        * ksvg2/svg/SVGSVGElement.cpp:
+        (WebCore::SVGSVGElement::createRenderer):
+        * ksvg2/svg/SVGSwitchElement.cpp:
+        (WebCore::SVGSwitchElement::createRenderer):
+        * ksvg2/svg/SVGUseElement.cpp:
+        (SVGUseElement::createRenderer):
+
 2006-04-27  Eric Seidel  <eseidel@apple.com>
 
         Reviewed by andersca.
index 48bb2ba..c902e3e 100644 (file)
@@ -26,6 +26,7 @@
 #include "KRenderingDevice.h"
 #include "KCanvasContainer.h"
 #include "SVGStyledElement.h"
+#include "GraphicsContext.h"
 
 namespace WebCore {
 
@@ -38,6 +39,10 @@ public:
     bool drawsContents : 1;
     bool slice : 1;
     QMatrix matrix;
+    
+    FloatRect viewport;
+    FloatRect viewBox;
+    KCAlign align;
 };
 
 KCanvasContainer::KCanvasContainer(SVGStyledElement *node)
@@ -71,13 +76,197 @@ void KCanvasContainer::setLocalTransform(const QMatrix &matrix)
     d->matrix = matrix;
 }
 
+bool KCanvasContainer::canHaveChildren() const
+{
+    return true;
+}
+    
+bool KCanvasContainer::requiresLayer()
+{
+    return false;
+}
+
+short KCanvasContainer::lineHeight(bool b, bool isRootLineBox) const
+{
+    return height() + marginTop() + marginBottom();
+}
+
+short KCanvasContainer::baselinePosition(bool b, bool isRootLineBox) const
+{
+    return height() + marginTop() + marginBottom();
+}
+
+void KCanvasContainer::calcMinMaxWidth()
+{
+    KHTMLAssert(!minMaxKnown());
+    m_minWidth = m_maxWidth = 0;
+    setMinMaxKnown();
+}
+
+void KCanvasContainer::layout()
+{
+    KHTMLAssert(needsLayout());
+    KHTMLAssert(minMaxKnown());
+
+    IntRect oldBounds;
+    bool checkForRepaint = checkForRepaintDuringLayout();
+    if (checkForRepaint)
+        oldBounds = getAbsoluteRepaintRect();
+
+    calcWidth();
+    calcHeight();
+
+    if (checkForRepaint)
+        repaintAfterLayoutIfNeeded(oldBounds, oldBounds);
+        
+    RenderContainer::layout();
+}
+
+void KCanvasContainer::paint(PaintInfo &paintInfo, int parentX, int parentY)
+{
+    if (paintInfo.p->paintingDisabled())
+        return;
+    
+    // No one should be transforming us via these.
+    //ASSERT(d->x == 0);
+    //ASSERT(d->y == 0);
+        
+    if (shouldPaintBackgroundOrBorder() && (paintInfo.phase == PaintPhaseForeground || paintInfo.phase == PaintPhaseSelection)) 
+        paintBoxDecorations(paintInfo, parentX, parentY);
+    
+    if ((paintInfo.phase == PaintPhaseOutline || paintInfo.phase == PaintPhaseSelfOutline) && style()->outlineWidth() && style()->visibility() == VISIBLE)
+        paintOutline(paintInfo.p, parentX, parentY, width(), height(), style());
+    
+    if (paintInfo.phase != WebCore::PaintPhaseForeground || !drawsContents() || style()->visibility() == HIDDEN)
+        return;
+    
+    KCanvasFilter *filter = getFilterById(document(), style()->svgStyle()->filter().mid(1));
+    if (!firstChild() && !filter)
+        return; // Spec: groups w/o children still may render filter content.
+    
+    KRenderingDevice* device = renderingDevice();
+    KRenderingDeviceContext *deviceContext = device->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();
+        device->pushContext(deviceContext);
+        shouldPopContext = true;
+    } else
+        paintInfo.p->save();
+    
+    if (parentX != 0 || parentY != 0) {
+        // Translate from parent offsets (khtml) to a relative transform (ksvg2/kcanvas)
+        deviceContext->concatCTM(QMatrix().translate(parentX, parentY));
+        parentX = parentY = 0;
+    }
+    
+    if (!viewport().isEmpty())
+        deviceContext->concatCTM(QMatrix().translate(viewport().x(), viewport().y()));
+    
+    if (!localTransform().isIdentity())
+        deviceContext->concatCTM(localTransform());
+    
+    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));
+
+    float opacity = style()->opacity();
+    if (opacity < 1.0f)
+        paintInfo.p->beginTransparencyLayer(opacity);
+
+    if (filter)
+        filter->prepareFilter(relativeBBox(true));
+    
+    if (!viewBox().isEmpty())
+        deviceContext->concatCTM(viewportTransform());
+    
+    RenderContainer::paint(paintInfo, 0, 0);
+    
+    if (filter)
+        filter->applyFilter(relativeBBox(true));
+    
+    if (opacity < 1.0f)
+        paintInfo.p->endTransparencyLayer();
+    
+    // restore drawing state
+    if (shouldPopContext) {
+        device->popContext();
+        delete deviceContext;
+    } else
+        paintInfo.p->restore();
+}
+
+void KCanvasContainer::setViewport(const FloatRect& viewport)
+{
+    d->viewport = viewport;
+}
+
+FloatRect KCanvasContainer::viewport() const
+{
+   return d->viewport;
+}
+
+void KCanvasContainer::setViewBox(const FloatRect& viewBox)
+{
+    d->viewBox = viewBox;
+}
+
+FloatRect KCanvasContainer::viewBox() const
+{
+    return d->viewBox;
+}
+
+void KCanvasContainer::setAlign(KCAlign align)
+{
+    d->align = align;
+}
+
+KCAlign KCanvasContainer::align() const
+{
+    return d->align;
+}
+
+QMatrix KCanvasContainer::viewportTransform() const
+{
+    if (!viewBox().isEmpty()) {
+        FloatRect viewportRect = viewport();
+        if (!parent()->isKCanvasContainer())
+            viewportRect = FloatRect(viewport().x(), viewport().y(), width(), height());
+        return getAspectRatio(viewBox(), viewportRect).qmatrix();
+    }
+    return QMatrix();
+}
+
+IntRect KCanvasContainer::getAbsoluteRepaintRect()
+{
+    IntRect repaintRect;
+    
+    for (RenderObject *current = firstChild(); current != 0; current = current->nextSibling())
+        repaintRect.unite(current->getAbsoluteRepaintRect());
+    
+    // Filters can expand the bounding box
+    KCanvasFilter *filter = getFilterById(document(), style()->svgStyle()->filter().mid(1));
+    if (filter)
+        repaintRect.unite(enclosingIntRect(filter->filterBBoxForItemBBox(repaintRect)));
+
+    return repaintRect;
+}
+
+QMatrix KCanvasContainer::absoluteTransform() const
+{
+    return viewportTransform() * RenderContainer::absoluteTransform();
+}
+
 bool KCanvasContainer::fillContains(const FloatPoint &p) const
 {
     RenderObject *current = firstChild();
-    for (; current != 0; current = current->nextSibling())
-    {
+    while (current != 0) {
         if (current->isRenderPath() && static_cast<RenderPath *>(current)->fillContains(p))
             return true;
+        current = current->nextSibling();
     }
 
     return false;
@@ -86,10 +275,10 @@ bool KCanvasContainer::fillContains(const FloatPoint &p) const
 bool KCanvasContainer::strokeContains(const FloatPoint &p) const
 {
     RenderObject *current = firstChild();
-    for (; current != 0; current = current->nextSibling())
-    {
+    while (current != 0) {
         if (current->isRenderPath() && static_cast<RenderPath *>(current)->strokeContains(p))
             return true;
+        current = current->nextSibling();
     }
 
     return false;
@@ -119,7 +308,7 @@ bool KCanvasContainer::slice() const
     return d->slice;
 }
 
-KCanvasMatrix KCanvasContainer::getAspectRatio(const FloatRect logical, const FloatRect physical) const
+KCanvasMatrix KCanvasContainer::getAspectRatio(const FloatRect& logical, const FloatRect& physical) const
 {
     KCanvasMatrix temp;
 
index b5127ab..61d213f 100644 (file)
@@ -47,43 +47,56 @@ class KCanvasRenderingStyle;
 class KCanvasContainer : public RenderContainer
 {
 public:
-    KCanvasContainer(SVGStyledElement *node);
-    virtual ~KCanvasContainer();
+    KCanvasContainer(SVGStyledElement*);
+    ~KCanvasContainer();
 
     // Some containers do not want it's children
     // to be drawn, because they may be 'referenced'
     // Example: <marker> children in SVG
-    void setDrawsContents(bool drawsContents);
+    void setDrawsContents(bool);
     bool drawsContents() const;
 
     virtual bool isKCanvasContainer() const { return true; }
-    virtual const char *renderName() const { return "KCanvasContainer"; }
+    virtual const char* renderName() const { return "KCanvasContainer"; }
+    
+    virtual bool canHaveChildren() const;
+    
+    virtual bool requiresLayer();
+    virtual short lineHeight(bool b, bool isRootLineBox = false) const;
+    virtual short baselinePosition(bool b, bool isRootLineBox = false) const;
+    
+    virtual void calcMinMaxWidth();
+    virtual void layout();
+    virtual void paint(PaintInfo &paintInfo, int parentX, int parentY);
+    
+    virtual IntRect getAbsoluteRepaintRect();
+    virtual QMatrix absoluteTransform() const;
 
-    virtual bool fillContains(const FloatPoint &p) const;
-    virtual bool strokeContains(const FloatPoint &p) const;
-    virtual FloatRect relativeBBox(bool includeStroke = true) const;
+    bool fillContains(const FloatPoint&) const;
+    bool strokeContains(const FloatPoint&) const;
+    FloatRect relativeBBox(bool includeStroke = true) const;
     
     virtual QMatrix localTransform() const;
-    virtual void setLocalTransform(const QMatrix &matrix);
+    void setLocalTransform(const QMatrix&);
     
-    virtual void setViewport(const FloatRect& viewport) = 0;
-    virtual FloatRect viewport() const = 0;
+    void setViewport(const FloatRect&);
+    FloatRect viewport() const;
 
-    virtual void setViewBox(const FloatRect& viewBox) = 0;
-    virtual FloatRect viewBox() const = 0;
+    void setViewBox(const FloatRect&);
+    FloatRect viewBox() const;
 
-    virtual void setAlign(KCAlign align) = 0;
-    virtual KCAlign align() const = 0;
+    void setAlign(KCAlign);
+    KCAlign align() const;
 
-    void setSlice(bool slice);
+    void setSlice(bool);
     bool slice() const;
     
-protected:
-    KCanvasMatrix getAspectRatio(const FloatRect logical, const FloatRect physical) const;
-
 private:
+    KCanvasMatrix getAspectRatio(const FloatRect& logical, const FloatRect& physical) const;
+    QMatrix viewportTransform() const;
+
     class Private;
-    Private *d;
+    Privated;
 };
 
 }
index eca7ac5..bc33141 100644 (file)
@@ -77,7 +77,6 @@ public:
     virtual KRenderingPaintServer *createPaintServer(const KCPaintServerType &type) const = 0;
 
     virtual RenderPath *createItem(RenderArena *arena, RenderStyle *style, SVGStyledElement *node, KCanvasPath* path) const = 0;
-    virtual KCanvasContainer *createContainer(RenderArena *arena, RenderStyle *style, SVGStyledElement *node) const = 0;
     virtual KCanvasPath* createPath() const = 0;
 
 private:
index 2a8c7dd..56c0fe4 100644 (file)
@@ -35,40 +35,6 @@ typedef struct CGLayer *CGLayerRef;
 
 namespace WebCore {
 
-class KCanvasContainerQuartz : public KCanvasContainer {
-public:
-    KCanvasContainerQuartz(SVGStyledElement *node) : KCanvasContainer(node) { }
-    
-    virtual bool canHaveChildren() const;
-    
-    virtual bool requiresLayer();
-    virtual short lineHeight(bool b, bool isRootLineBox = false) const;
-    virtual short baselinePosition(bool b, bool isRootLineBox = false) const;
-    
-    virtual void calcMinMaxWidth();
-    virtual void layout();
-    virtual void paint(PaintInfo &paintInfo, int parentX, int parentY);
-    
-    virtual IntRect getAbsoluteRepaintRect();
-    virtual QMatrix absoluteTransform() const;
-
-    virtual void setViewport(const FloatRect&);
-    virtual FloatRect viewport() const;
-
-    virtual void setViewBox(const FloatRect&);
-    virtual FloatRect viewBox() const;
-
-    virtual void setAlign(KCAlign align);
-    virtual KCAlign align() const;
-    
-private:
-    QMatrix viewportTransform() const;
-
-    FloatRect m_viewport;
-    FloatRect m_viewBox;
-    KCAlign m_align;
-};
-
 class KCanvasClipperQuartz : public KCanvasClipper {
 public:
     KCanvasClipperQuartz() { }
index 9a1e478..94587a3 100644 (file)
 
 namespace WebCore {
 
-bool KCanvasContainerQuartz::canHaveChildren() const
-{
-    return true;
-}
-    
-bool KCanvasContainerQuartz::requiresLayer()
-{
-    return false;
-}
-
-short KCanvasContainerQuartz::lineHeight(bool b, bool isRootLineBox) const
-{
-    return height() + marginTop() + marginBottom();
-}
-
-short KCanvasContainerQuartz::baselinePosition(bool b, bool isRootLineBox) const
-{
-    return height() + marginTop() + marginBottom();
-}
-
-void KCanvasContainerQuartz::calcMinMaxWidth()
-{
-    KHTMLAssert( !minMaxKnown());
-    m_minWidth = m_maxWidth = 0;
-    setMinMaxKnown();
-}
-
-void KCanvasContainerQuartz::layout()
-{
-    KHTMLAssert(needsLayout());
-    KHTMLAssert(minMaxKnown());
-
-    IntRect oldBounds;
-    bool checkForRepaint = checkForRepaintDuringLayout();
-    if (checkForRepaint)
-        oldBounds = getAbsoluteRepaintRect();
-
-    calcWidth();
-    calcHeight();
-
-    if (checkForRepaint)
-        repaintAfterLayoutIfNeeded(oldBounds, oldBounds);
-        
-    RenderContainer::layout();
-}
-
-void KCanvasContainerQuartz::paint(PaintInfo &paintInfo, int parentX, int parentY)
-{
-    if (paintInfo.p->paintingDisabled())
-        return;
-    
-    // No one should be transforming us via these.
-    //ASSERT(m_x == 0);
-    //ASSERT(m_y == 0);
-        
-    if (shouldPaintBackgroundOrBorder() && (paintInfo.phase == PaintPhaseForeground || paintInfo.phase == PaintPhaseSelection)) 
-        paintBoxDecorations(paintInfo, parentX, parentY);
-    
-    if ((paintInfo.phase == PaintPhaseOutline || paintInfo.phase == PaintPhaseSelfOutline) && style()->outlineWidth() && style()->visibility() == VISIBLE)
-        paintOutline(paintInfo.p, parentX, parentY, width(), height(), style());
-    
-    if (paintInfo.phase != WebCore::PaintPhaseForeground || !drawsContents() || style()->visibility() == HIDDEN)
-        return;
-    
-    KCanvasFilter *filter = getFilterById(document(), style()->svgStyle()->filter().mid(1));
-    if (!firstChild() && !filter)
-        return; // Spec: groups w/o children still may render filter content.
-    
-    KRenderingDeviceQuartz *quartzDevice = static_cast<KRenderingDeviceQuartz *>(renderingDevice());
-    KRenderingDeviceContext *deviceContext = quartzDevice->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();
-        quartzDevice->pushContext(deviceContext);
-        shouldPopContext = true;
-    } else
-        paintInfo.p->save();
-    
-    if (parentX != 0 || parentY != 0) {
-        // Translate from parent offsets (khtml) to a relative transform (ksvg2/kcanvas)
-        deviceContext->concatCTM(QMatrix().translate(parentX, parentY));
-        parentX = parentY = 0;
-    }
-    
-    if (!viewport().isEmpty())
-        deviceContext->concatCTM(QMatrix().translate(viewport().x(), viewport().y()));
-    
-    if (!localTransform().isIdentity())
-        deviceContext->concatCTM(localTransform());
-    
-    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));
-
-    float opacity = style()->opacity();
-    if (opacity < 1.0f)
-        paintInfo.p->beginTransparencyLayer(opacity);
-
-    if (filter)
-        filter->prepareFilter(relativeBBox(true));
-    
-    if (!viewBox().isEmpty())
-        deviceContext->concatCTM(viewportTransform());
-    
-    RenderContainer::paint(paintInfo, 0, 0);
-    
-    if (filter)
-        filter->applyFilter(relativeBBox(true));
-    
-    if (opacity < 1.0f)
-        paintInfo.p->endTransparencyLayer();
-    
-    // restore drawing state
-    if (shouldPopContext) {
-        quartzDevice->popContext();
-        delete deviceContext;
-    } else
-        paintInfo.p->restore();
-}
-
-void KCanvasContainerQuartz::setViewport(const FloatRect& viewport)
-{
-    m_viewport = viewport;
-}
-
-FloatRect KCanvasContainerQuartz::viewport() const
-{
-   return m_viewport;
-}
-
-void KCanvasContainerQuartz::setViewBox(const FloatRect& viewBox)
-{
-    m_viewBox = viewBox;
-}
-
-FloatRect KCanvasContainerQuartz::viewBox() const
-{
-    return m_viewBox;
-}
-
-void KCanvasContainerQuartz::setAlign(KCAlign align)
-{
-    m_align = align;
-}
-
-KCAlign KCanvasContainerQuartz::align() const
-{
-    return m_align;
-}
-
-QMatrix KCanvasContainerQuartz::viewportTransform() const
-{
-    if (!viewBox().isEmpty()) {
-        FloatRect viewportRect = viewport();
-        if (!parent()->isKCanvasContainer())
-            viewportRect = FloatRect(viewport().x(), viewport().y(), width(), height());
-        return getAspectRatio(viewBox(), viewportRect).qmatrix();
-    }
-    return QMatrix();
-}
-
-IntRect KCanvasContainerQuartz::getAbsoluteRepaintRect()
-{
-    IntRect repaintRect;
-    
-    for (RenderObject *current = firstChild(); current != 0; current = current->nextSibling())
-        repaintRect.unite(current->getAbsoluteRepaintRect());
-    
-    // Filters can expand the bounding box
-    KCanvasFilter *filter = getFilterById(document(), style()->svgStyle()->filter().mid(1));
-    if (filter)
-        repaintRect.unite(enclosingIntRect(filter->filterBBoxForItemBBox(repaintRect)));
-
-    return repaintRect;
-}
-
-QMatrix KCanvasContainerQuartz::absoluteTransform() const
-{
-    return viewportTransform() * KCanvasContainer::absoluteTransform();
-}
-
 void KCanvasClipperQuartz::applyClip(const FloatRect& boundingBox) const
 {
     KRenderingDeviceContext *context = renderingDevice()->currentContext();
index 3a3660f..28dcf48 100644 (file)
@@ -92,7 +92,6 @@ public:
     
     // item creation
     virtual RenderPath *createItem(RenderArena *arena, RenderStyle *style, SVGStyledElement *node, KCanvasPath* path) const;
-    virtual KCanvasContainer *createContainer(RenderArena *arena, RenderStyle *style, SVGStyledElement *node) const;
 
     // filters (mostly debugging)
     static bool filtersEnabled();
index 687b7ed..4b2cff0 100644 (file)
@@ -215,11 +215,6 @@ KRenderingPaintServer *KRenderingDeviceQuartz::createPaintServer(const KCPaintSe
     }
     return newServer;
 }
-KCanvasContainer *KRenderingDeviceQuartz::createContainer(RenderArena *arena, RenderStyle *style, SVGStyledElement *node) const
-{
-    return new (arena) KCanvasContainerQuartz(node);
-}
 
 RenderPath *KRenderingDeviceQuartz::createItem(RenderArena *arena, RenderStyle *style, SVGStyledElement *node, KCanvasPath* path) const
 {
index 8b60eac..90a26f1 100644 (file)
@@ -71,9 +71,9 @@ void SVGAElement::parseMappedAttribute(MappedAttribute *attr)
     }
 }
 
-RenderObject *SVGAElement::createRenderer(RenderArena *arena, RenderStyle *style)
+RenderObject* SVGAElement::createRenderer(RenderArena* arena, RenderStyle* style)
 {
-    return renderingDevice()->createContainer(arena, style, this);
+    return new (arena) KCanvasContainer(this);
 }
 
 void SVGAElement::defaultEventHandler(Event *evt)
index 2e6dc98..6411527 100644 (file)
@@ -46,9 +46,9 @@ void SVGGElement::parseMappedAttribute(MappedAttribute *attr)
     SVGStyledTransformableElement::parseMappedAttribute(attr);
 }
 
-RenderObject *SVGGElement::createRenderer(RenderArena *arena, RenderStyle *style)
+RenderObject* SVGGElement::createRenderer(RenderArena* arena, RenderStyle* style)
 {
-    return renderingDevice()->createContainer(arena, style, this);
+    return new (arena) KCanvasContainer(this);
 }
 
 // Helper class for <use> support
index fe4cb20..9836c75 100644 (file)
@@ -173,9 +173,9 @@ KCanvasMarker *SVGMarkerElement::canvasResource()
     return m_marker;
 }
 
-RenderObject *SVGMarkerElement::createRenderer(RenderArena *arena, RenderStyle *style)
+RenderObject* SVGMarkerElement::createRenderer(RenderArena* arena, RenderStyle* style)
 {
-    KCanvasContainer *markerContainer = renderingDevice()->createContainer(arena, style, this);
+    KCanvasContainer *markerContainer = new (arena) KCanvasContainer(this);
     markerContainer->setDrawsContents(false); // Marker contents will be explicitly drawn.
     return markerContainer;
 }
index e5ae5cb..4ffda2c 100644 (file)
@@ -137,9 +137,9 @@ KCanvasImage *SVGMaskElement::drawMaskerContent()
     return maskImage;
 }
 
-RenderObject *SVGMaskElement::createRenderer(RenderArena *arena, RenderStyle *style)
+RenderObject* SVGMaskElement::createRenderer(RenderArena* arena, RenderStyle*)
 {
-    KCanvasContainer *maskContainer = renderingDevice()->createContainer(arena, style, this);
+    KCanvasContainer* maskContainer = new (arena) KCanvasContainer(this);
     maskContainer->setDrawsContents(false);
     return maskContainer;
 }
index cb33b14..13d3056 100644 (file)
@@ -356,9 +356,9 @@ void SVGPatternElement::notifyAttributeChange() const
     m_ignoreAttributeChanges = false;
 }
 
-RenderObject *SVGPatternElement::createRenderer(RenderArena *arena, RenderStyle *style)
+RenderObject* SVGPatternElement::createRenderer(RenderArena* arena, RenderStyle*)
 {
-    KCanvasContainer *patternContainer = renderingDevice()->createContainer(arena, style, this);
+    KCanvasContainer* patternContainer = new (arena) KCanvasContainer(this);
     patternContainer->setDrawsContents(false);
     return patternContainer;
 }
index f6a469b..4730eba 100644 (file)
@@ -400,9 +400,9 @@ SVGMatrix *SVGSVGElement::getScreenCTM() const
     return mat;
 }
 
-RenderObject *SVGSVGElement::createRenderer(RenderArena *arena, RenderStyle *style)
+RenderObject* SVGSVGElement::createRenderer(RenderArena* arena, RenderStyle*)
 {
-    KCanvasContainer *rootContainer = renderingDevice()->createContainer(arena, style, this);
+    KCanvasContainer *rootContainer = new (arena) KCanvasContainer(this);
 
     // FIXME: all this setup should be done after attributesChanged, not here.
     float _x = x()->baseVal()->value();
index d44e384..7e374c1 100644 (file)
@@ -34,7 +34,7 @@
 #include "SVGSwitchElement.h"
 #include "SVGAnimatedLength.h"
 
-using namespace WebCore;
+namespace WebCore {
 
 SVGSwitchElement::SVGSwitchElement(const QualifiedName& tagName, Document *doc)
 : SVGStyledTransformableElement(tagName, doc), SVGTests(), SVGLangSpace(), SVGExternalResourcesRequired()
@@ -56,9 +56,11 @@ bool SVGSwitchElement::childShouldCreateRenderer(Node *child) const
     return false;
 }
 
-RenderObject *SVGSwitchElement::createRenderer(RenderArena *arena, RenderStyle *style)
+RenderObject* SVGSwitchElement::createRenderer(RenderArena* arena, RenderStyle*)
 {
-    return renderingDevice()->createContainer(arena, style, this);
+    return new (arena) KCanvasContainer(this);
+}
+
 }
 
 // vim:ts=4:noet
index 763134a..31b2db5 100644 (file)
@@ -163,9 +163,9 @@ bool SVGUseElement::hasChildNodes() const
     return false;
 }
 
-RenderObject *SVGUseElement::createRenderer(RenderArena *arena, RenderStyle *style)
+RenderObject* SVGUseElement::createRenderer(RenderArena* arena, RenderStyle*)
 {
-    return renderingDevice()->createContainer(arena, style, this);
+    return new (arena) KCanvasContainer(this);
 }
 
 // vim:ts=4:noet