summaryrefslogtreecommitdiffstats
path: root/WebCore/svg
diff options
context:
space:
mode:
authorAndrei Popescu <andreip@google.com>2009-08-19 14:09:30 +0100
committerAndrei Popescu <andreip@google.com>2009-08-19 14:09:30 +0100
commit058ccc7ba0a4d59b9f6e92808332aa9895425fc7 (patch)
tree276aad5a2bbc2fd7d65d21bfca42c9de88b3dd20 /WebCore/svg
parent2796dd1bf3b4b01e7e1d96ea91bd3a212f647579 (diff)
downloadexternal_webkit-058ccc7ba0a4d59b9f6e92808332aa9895425fc7.zip
external_webkit-058ccc7ba0a4d59b9f6e92808332aa9895425fc7.tar.gz
external_webkit-058ccc7ba0a4d59b9f6e92808332aa9895425fc7.tar.bz2
Revert "Merge WebKit r47420"
This reverts commit d227fc870c7a697500a3c900c31baf05fb9a8524.
Diffstat (limited to 'WebCore/svg')
-rw-r--r--WebCore/svg/SVGColor.cpp4
-rw-r--r--WebCore/svg/SVGColor.h4
-rw-r--r--WebCore/svg/SVGDocument.h10
-rw-r--r--WebCore/svg/SVGElementInstance.cpp5
-rw-r--r--WebCore/svg/SVGElementInstance.h22
-rw-r--r--WebCore/svg/SVGUseElement.cpp14
-rw-r--r--WebCore/svg/graphics/SVGResourceMasker.cpp6
7 files changed, 35 insertions, 30 deletions
diff --git a/WebCore/svg/SVGColor.cpp b/WebCore/svg/SVGColor.cpp
index d819ebf..f939ef0 100644
--- a/WebCore/svg/SVGColor.cpp
+++ b/WebCore/svg/SVGColor.cpp
@@ -62,9 +62,9 @@ unsigned short SVGColor::colorType() const
return m_colorType;
}
-PassRefPtr<RGBColor> SVGColor::rgbColor() const
+RGBColor* SVGColor::rgbColor() const
{
- return RGBColor::create(m_color.rgb());
+ return RGBColor::create(m_color.rgb()).releaseRef();
}
void SVGColor::setRGBColor(const String& rgbColor, ExceptionCode& ec)
diff --git a/WebCore/svg/SVGColor.h b/WebCore/svg/SVGColor.h
index 406166b..5dfb694 100644
--- a/WebCore/svg/SVGColor.h
+++ b/WebCore/svg/SVGColor.h
@@ -57,8 +57,8 @@ namespace WebCore {
// 'SVGColor' functions
unsigned short colorType() const;
- PassRefPtr<RGBColor> rgbColor() const;
-
+ RGBColor* rgbColor() const;
+
static Color colorFromRGBColorString(const String&);
void setRGBColor(const String& rgbColor) { ExceptionCode ignored = 0; setRGBColor(rgbColor, ignored); }
diff --git a/WebCore/svg/SVGDocument.h b/WebCore/svg/SVGDocument.h
index c7006f9..02e3649 100644
--- a/WebCore/svg/SVGDocument.h
+++ b/WebCore/svg/SVGDocument.h
@@ -35,11 +35,13 @@ namespace WebCore {
public:
static PassRefPtr<SVGDocument> create(Frame* frame)
{
- return adoptRef(new SVGDocument(frame));
+ return new SVGDocument(frame);
}
virtual ~SVGDocument();
+ virtual bool isSVGDocument() const { return true; }
+
SVGSVGElement* rootElement() const;
void dispatchZoomEvent(float prevScale, float newScale);
@@ -50,13 +52,11 @@ namespace WebCore {
void startPan(const FloatPoint& start);
void updatePan(const FloatPoint& pos) const;
+ virtual bool childShouldCreateRenderer(Node*) const;
+
private:
SVGDocument(Frame*);
- virtual bool isSVGDocument() const { return true; }
-
- virtual bool childShouldCreateRenderer(Node*) const;
-
FloatPoint m_translate;
};
diff --git a/WebCore/svg/SVGElementInstance.cpp b/WebCore/svg/SVGElementInstance.cpp
index 3a82067..01555fc 100644
--- a/WebCore/svg/SVGElementInstance.cpp
+++ b/WebCore/svg/SVGElementInstance.cpp
@@ -1,6 +1,8 @@
/*
Copyright (C) 2007, 2008 Nikolas Zimmermann <zimmermann@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
@@ -23,6 +25,7 @@
#include "SVGElementInstance.h"
#include "ContainerNodeAlgorithms.h"
+#include "Document.h"
#include "Event.h"
#include "EventException.h"
#include "EventListener.h"
@@ -43,7 +46,7 @@ namespace WebCore {
static WTF::RefCountedLeakCounter instanceCounter("WebCoreSVGElementInstance");
#endif
-SVGElementInstance::SVGElementInstance(SVGUseElement* useElement, PassRefPtr<SVGElement> originalElement)
+SVGElementInstance::SVGElementInstance(SVGUseElement* useElement, SVGElement* originalElement)
: m_needsUpdate(false)
, m_useElement(useElement)
, m_element(originalElement)
diff --git a/WebCore/svg/SVGElementInstance.h b/WebCore/svg/SVGElementInstance.h
index 048c66c..c477718 100644
--- a/WebCore/svg/SVGElementInstance.h
+++ b/WebCore/svg/SVGElementInstance.h
@@ -1,6 +1,8 @@
/*
Copyright (C) 2007, 2008 Nikolas Zimmermann <zimmermann@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
@@ -25,6 +27,9 @@
#include "SVGElement.h"
#include "TreeShared.h"
+#include <wtf/RefPtr.h>
+#include <wtf/PassRefPtr.h>
+
namespace WebCore {
namespace Private {
@@ -32,6 +37,8 @@ namespace WebCore {
void addChildNodesToDeletionQueue(GenericNode*& head, GenericNode*& tail, GenericNodeContainer* container);
};
+ class EventListener;
+ class Frame;
class SVGUseElement;
class SVGElementInstanceList;
@@ -39,11 +46,7 @@ namespace WebCore {
class SVGElementInstance : public TreeShared<SVGElementInstance>,
public EventTarget {
public:
- static PassRefPtr<SVGElementInstance> create(SVGUseElement* useElement, PassRefPtr<SVGElement> originalElement)
- {
- return adoptRef(new SVGElementInstance(useElement, originalElement));
- }
-
+ SVGElementInstance(SVGUseElement*, SVGElement* originalElement);
virtual ~SVGElementInstance();
bool needsUpdate() const { return m_needsUpdate; }
@@ -51,6 +54,9 @@ namespace WebCore {
virtual ScriptExecutionContext* scriptExecutionContext() const;
+ virtual Node* toNode() { return shadowTreeElement(); }
+ virtual SVGElementInstance* toSVGElementInstance() { return this; }
+
virtual void addEventListener(const AtomicString& eventType, PassRefPtr<EventListener>, bool useCapture);
virtual void removeEventListener(const AtomicString& eventType, EventListener*, bool useCapture);
virtual bool dispatchEvent(PassRefPtr<Event>, ExceptionCode&);
@@ -161,11 +167,6 @@ namespace WebCore {
private:
friend class SVGUseElement;
- SVGElementInstance(SVGUseElement*, PassRefPtr<SVGElement> originalElement);
-
- virtual Node* toNode() { return shadowTreeElement(); }
- virtual SVGElementInstance* toSVGElementInstance() { return this; }
-
void appendChild(PassRefPtr<SVGElementInstance> child);
void setShadowTreeElement(SVGElement*);
void forgetWrapper();
@@ -190,6 +191,7 @@ namespace WebCore {
virtual void refEventTarget() { ref(); }
virtual void derefEventTarget() { deref(); }
+ private:
bool m_needsUpdate : 1;
SVGUseElement* m_useElement;
diff --git a/WebCore/svg/SVGUseElement.cpp b/WebCore/svg/SVGUseElement.cpp
index 9cb3024..b73a692 100644
--- a/WebCore/svg/SVGUseElement.cpp
+++ b/WebCore/svg/SVGUseElement.cpp
@@ -324,7 +324,7 @@ void SVGUseElement::buildPendingResource()
// Spec: If the 'use' element references a simple graphics element such as a 'rect', then there is only a
// single SVGElementInstance object, and the correspondingElement attribute on this SVGElementInstance object
// is the SVGRectElement that corresponds to the referenced 'rect' element.
- m_targetElementInstance = SVGElementInstance::create(this, target);
+ m_targetElementInstance = new SVGElementInstance(this, target);
// Eventually enter recursion to build SVGElementInstance objects for the sub-tree children
bool foundProblem = false;
@@ -474,17 +474,17 @@ void SVGUseElement::buildInstanceTree(SVGElement* target, SVGElementInstance* ta
continue;
// Create SVGElementInstance object, for both container/non-container nodes.
- RefPtr<SVGElementInstance> instancePtr = SVGElementInstance::create(this, element);
- targetInstance->appendChild(instancePtr.get());
+ SVGElementInstance* instancePtr = new SVGElementInstance(this, element);
+ targetInstance->appendChild(instancePtr);
// Enter recursion, appending new instance tree nodes to the "instance" object.
if (element->hasChildNodes())
- buildInstanceTree(element, instancePtr.get(), foundProblem);
+ buildInstanceTree(element, instancePtr, foundProblem);
// Spec: If the referenced object is itself a 'use', or if there are 'use' subelements within the referenced
// object, the instance tree will contain recursive expansion of the indirect references to form a complete tree.
if (element->hasTagName(SVGNames::useTag))
- handleDeepUseReferencing(static_cast<SVGUseElement*>(element), instancePtr.get(), foundProblem);
+ handleDeepUseReferencing(static_cast<SVGUseElement*>(element), instancePtr, foundProblem);
}
// Spec: If the referenced object is itself a 'use', or if there are 'use' subelements within the referenced
@@ -524,11 +524,11 @@ void SVGUseElement::handleDeepUseReferencing(SVGUseElement* use, SVGElementInsta
}
// Create an instance object, even if we're dealing with a cycle
- RefPtr<SVGElementInstance> newInstance = SVGElementInstance::create(this, target);
+ SVGElementInstance* newInstance = new SVGElementInstance(this, target);
targetInstance->appendChild(newInstance);
// Eventually enter recursion to build SVGElementInstance objects for the sub-tree children
- buildInstanceTree(target, newInstance.get(), foundProblem);
+ buildInstanceTree(target, newInstance, foundProblem);
}
void SVGUseElement::alterShadowTreeForSVGTag(SVGElement* target)
diff --git a/WebCore/svg/graphics/SVGResourceMasker.cpp b/WebCore/svg/graphics/SVGResourceMasker.cpp
index 97467c1..d6c401b 100644
--- a/WebCore/svg/graphics/SVGResourceMasker.cpp
+++ b/WebCore/svg/graphics/SVGResourceMasker.cpp
@@ -76,8 +76,8 @@ void SVGResourceMasker::applyMask(GraphicsContext* context, const FloatRect& bou
if (!luminancedImage)
return;
- PassRefPtr<CanvasPixelArray> srcPixelArray(m_mask->getUnmultipliedImageData(intImageRect)->data());
- PassRefPtr<ImageData> destImageData(luminancedImage->getUnmultipliedImageData(intImageRect));
+ PassRefPtr<CanvasPixelArray> srcPixelArray(m_mask->getImageData(intImageRect)->data());
+ PassRefPtr<ImageData> destImageData(luminancedImage->getImageData(intImageRect));
for (unsigned pixelOffset = 0; pixelOffset < srcPixelArray->length(); pixelOffset++) {
unsigned pixelByteOffset = pixelOffset * 4;
@@ -93,7 +93,7 @@ void SVGResourceMasker::applyMask(GraphicsContext* context, const FloatRect& bou
destImageData->data()->set(pixelByteOffset + 3, luma);
}
- luminancedImage->putUnmultipliedImageData(destImageData.get(), intImageRect, IntPoint(0, 0));
+ luminancedImage->putImageData(destImageData.get(), intImageRect, IntPoint(0, 0));
context->clipToImageBuffer(m_maskRect, luminancedImage.get());
}