diff options
Diffstat (limited to 'WebCore/svg')
118 files changed, 432 insertions, 3875 deletions
diff --git a/WebCore/svg/ElementTimeControl.h b/WebCore/svg/ElementTimeControl.h index 4c185b9..4800cb1 100644 --- a/WebCore/svg/ElementTimeControl.h +++ b/WebCore/svg/ElementTimeControl.h @@ -1,5 +1,6 @@ /* * Copyright (C) 2008 Apple Inc. All Rights Reserved. + * Copyright (C) 2009 Cameron McCormack <cam@mcc.id.au> * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -35,10 +36,10 @@ namespace WebCore { class ElementTimeControl { public: virtual ~ElementTimeControl() {} - virtual bool beginElement(ExceptionCode&) = 0; - virtual bool beginElementAt(float offset, ExceptionCode&) = 0; - virtual bool endElement(ExceptionCode&) = 0; - virtual bool endElementAt(float offset, ExceptionCode&) = 0; + virtual void beginElement() = 0; + virtual void beginElementAt(float offset) = 0; + virtual void endElement() = 0; + virtual void endElementAt(float offset) = 0; }; } diff --git a/WebCore/svg/ElementTimeControl.idl b/WebCore/svg/ElementTimeControl.idl index 569fefa..e8ca615 100644 --- a/WebCore/svg/ElementTimeControl.idl +++ b/WebCore/svg/ElementTimeControl.idl @@ -1,5 +1,6 @@ /* * Copyright (C) 2008 Apple Inc. All Rights Reserved. + * Copyright (C) 2009 Cameron McCormack <cam@mcc.id.au> * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -26,14 +27,10 @@ module svg { interface [Conditional=SVG, ObjCProtocol] ElementTimeControl { - boolean beginElement() - raises(DOMException); - boolean beginElementAt(in float offset) - raises(DOMException); - boolean endElement() - raises(DOMException); - boolean endElementAt(in float offset) - raises(DOMException); + void beginElement(); + void beginElementAt(in float offset); + void endElement(); + void endElementAt(in float offset); }; } diff --git a/WebCore/svg/SVGAElement.cpp b/WebCore/svg/SVGAElement.cpp index 9919702..639e3e0 100644 --- a/WebCore/svg/SVGAElement.cpp +++ b/WebCore/svg/SVGAElement.cpp @@ -53,6 +53,7 @@ SVGAElement::SVGAElement(const QualifiedName& tagName, Document *doc) , SVGLangSpace() , SVGExternalResourcesRequired() , m_target(this, SVGNames::targetAttr) + , m_href(this, XLinkNames::hrefAttr) { } @@ -165,20 +166,15 @@ bool SVGAElement::supportsFocus() const { if (isContentEditable()) return SVGStyledTransformableElement::supportsFocus(); - return isFocusable() || (document() && !document()->haveStylesheetsLoaded()); + return true; } bool SVGAElement::isFocusable() const { - if (isContentEditable()) - return SVGStyledTransformableElement::isFocusable(); - - // FIXME: Even if we are not visible, we might have a child that is visible. - // Dave wants to fix that some day with a "has visible content" flag or the like. - if (!renderer() || !(renderer()->style()->visibility() == VISIBLE)) + if (renderer() && renderer()->absoluteClippedOverflowRect().isEmpty()) return false; - return !renderer()->absoluteClippedOverflowRect().isEmpty(); + return SVGElement::isFocusable(); } bool SVGAElement::isMouseFocusable() const diff --git a/WebCore/svg/SVGAElement.h b/WebCore/svg/SVGAElement.h index 8890ca4..77cec67 100644 --- a/WebCore/svg/SVGAElement.h +++ b/WebCore/svg/SVGAElement.h @@ -65,6 +65,9 @@ namespace WebCore { private: ANIMATED_PROPERTY_DECLARATIONS(SVGAElement, SVGNames::aTagString, SVGNames::targetAttrString, String, Target, target) + + // SVGURIReference + ANIMATED_PROPERTY_DECLARATIONS(SVGAElement, SVGURIReferenceIdentifier, XLinkNames::hrefAttrString, String, Href, href) }; } // namespace WebCore diff --git a/WebCore/svg/SVGAllInOne.cpp b/WebCore/svg/SVGAllInOne.cpp index 2e34ee3..6ca4539 100644 --- a/WebCore/svg/SVGAllInOne.cpp +++ b/WebCore/svg/SVGAllInOne.cpp @@ -41,7 +41,6 @@ #include "SVGColor.cpp" #include "SVGComponentTransferFunctionElement.cpp" #include "SVGCursorElement.cpp" -#include "SVGDefinitionSrcElement.cpp" #include "SVGDefsElement.cpp" #include "SVGDescElement.cpp" #include "SVGDocument.cpp" diff --git a/WebCore/svg/SVGAltGlyphElement.cpp b/WebCore/svg/SVGAltGlyphElement.cpp index d9da3f6..f13edf5 100644 --- a/WebCore/svg/SVGAltGlyphElement.cpp +++ b/WebCore/svg/SVGAltGlyphElement.cpp @@ -35,6 +35,7 @@ namespace WebCore { SVGAltGlyphElement::SVGAltGlyphElement(const QualifiedName& tagName, Document* doc) : SVGTextPositioningElement(tagName, doc) + , m_href(this, XLinkNames::hrefAttr) { } diff --git a/WebCore/svg/SVGAltGlyphElement.h b/WebCore/svg/SVGAltGlyphElement.h index 91c99e3..7c67a71 100644 --- a/WebCore/svg/SVGAltGlyphElement.h +++ b/WebCore/svg/SVGAltGlyphElement.h @@ -49,6 +49,10 @@ namespace WebCore { protected: virtual const SVGElement* contextElement() const { return this; } + + private: + // SVGURIReference + ANIMATED_PROPERTY_DECLARATIONS(SVGAltGlyphElement, SVGURIReferenceIdentifier, XLinkNames::hrefAttrString, String, Href, href) }; } // namespace WebCore diff --git a/WebCore/svg/SVGAnimationElement.cpp b/WebCore/svg/SVGAnimationElement.cpp index b817ad8..cf945f8 100644 --- a/WebCore/svg/SVGAnimationElement.cpp +++ b/WebCore/svg/SVGAnimationElement.cpp @@ -3,6 +3,7 @@ 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org> Copyright (C) 2007 Eric Seidel <eric@webkit.org> Copyright (C) 2008 Apple Inc. All rights reserved. + Copyright (C) 2009 Cameron McCormack <cam@mcc.id.au> This file is part of the KDE project @@ -156,29 +157,24 @@ float SVGAnimationElement::getSimpleDuration(ExceptionCode&) const return narrowPrecisionToFloat(simpleDuration().value()); } -bool SVGAnimationElement::beginElement(ExceptionCode& ec) +void SVGAnimationElement::beginElement() { - return beginElementAt(0, ec); + beginElementAt(0); } -bool SVGAnimationElement::beginElementAt(float offset, ExceptionCode&) +void SVGAnimationElement::beginElementAt(float offset) { addBeginTime(elapsed() + offset); - return true; } -bool SVGAnimationElement::endElement(ExceptionCode& ec) +void SVGAnimationElement::endElement() { - return endElementAt(0, ec); + endElementAt(0); } -bool SVGAnimationElement::endElementAt(float offset, ExceptionCode&) +void SVGAnimationElement::endElementAt(float offset) { - if (offset < 0) - return false; - addEndTime(elapsed() + offset); - return true; } SVGAnimationElement::AnimationMode SVGAnimationElement::animationMode() const diff --git a/WebCore/svg/SVGAnimationElement.h b/WebCore/svg/SVGAnimationElement.h index d43ed57..1835a8d 100644 --- a/WebCore/svg/SVGAnimationElement.h +++ b/WebCore/svg/SVGAnimationElement.h @@ -3,6 +3,7 @@ 2004, 2005, 2006 Rob Buis <buis@kde.org> Copyright (C) 2007 Eric Seidel <eric@webkit.org> Copyright (C) 2008 Apple Inc. All rights reserved. + Copyright (C) 2008 Cameron McCormack <cam@mcc.id.au> This file is part of the KDE project @@ -57,10 +58,10 @@ namespace WebCore { float getSimpleDuration(ExceptionCode&) const; // ElementTimeControl - virtual bool beginElement(ExceptionCode&); - virtual bool beginElementAt(float offset, ExceptionCode&); - virtual bool endElement(ExceptionCode&); - virtual bool endElementAt(float offset, ExceptionCode&); + virtual void beginElement(); + virtual void beginElementAt(float offset); + virtual void endElement(); + virtual void endElementAt(float offset); static bool attributeIsCSS(const String& attributeName); diff --git a/WebCore/svg/SVGColor.cpp b/WebCore/svg/SVGColor.cpp index f939ef0..d819ebf 100644 --- a/WebCore/svg/SVGColor.cpp +++ b/WebCore/svg/SVGColor.cpp @@ -62,9 +62,9 @@ unsigned short SVGColor::colorType() const return m_colorType; } -RGBColor* SVGColor::rgbColor() const +PassRefPtr<RGBColor> SVGColor::rgbColor() const { - return RGBColor::create(m_color.rgb()).releaseRef(); + return RGBColor::create(m_color.rgb()); } void SVGColor::setRGBColor(const String& rgbColor, ExceptionCode& ec) diff --git a/WebCore/svg/SVGColor.h b/WebCore/svg/SVGColor.h index 5dfb694..406166b 100644 --- a/WebCore/svg/SVGColor.h +++ b/WebCore/svg/SVGColor.h @@ -57,8 +57,8 @@ namespace WebCore { // 'SVGColor' functions unsigned short colorType() const; - RGBColor* rgbColor() const; - + PassRefPtr<RGBColor> rgbColor() const; + static Color colorFromRGBColorString(const String&); void setRGBColor(const String& rgbColor) { ExceptionCode ignored = 0; setRGBColor(rgbColor, ignored); } diff --git a/WebCore/svg/SVGComponentTransferFunctionElement.h b/WebCore/svg/SVGComponentTransferFunctionElement.h index 82d57b4..a26c953 100644 --- a/WebCore/svg/SVGComponentTransferFunctionElement.h +++ b/WebCore/svg/SVGComponentTransferFunctionElement.h @@ -25,6 +25,7 @@ #if ENABLE(SVG) && ENABLE(FILTERS) #include "SVGElement.h" +#include "SVGNames.h" #include "SVGNumberList.h" #include "FEComponentTransfer.h" diff --git a/WebCore/svg/SVGCursorElement.cpp b/WebCore/svg/SVGCursorElement.cpp index 12e9e5d..5b408f8 100644 --- a/WebCore/svg/SVGCursorElement.cpp +++ b/WebCore/svg/SVGCursorElement.cpp @@ -40,6 +40,7 @@ SVGCursorElement::SVGCursorElement(const QualifiedName& tagName, Document* doc) , SVGURIReference() , m_x(this, SVGNames::xAttr, LengthModeWidth) , m_y(this, SVGNames::yAttr, LengthModeHeight) + , m_href(this, XLinkNames::hrefAttr) { } diff --git a/WebCore/svg/SVGCursorElement.h b/WebCore/svg/SVGCursorElement.h index ddafb76..71963b6 100644 --- a/WebCore/svg/SVGCursorElement.h +++ b/WebCore/svg/SVGCursorElement.h @@ -57,6 +57,9 @@ namespace WebCore { ANIMATED_PROPERTY_DECLARATIONS(SVGCursorElement, SVGNames::cursorTagString, SVGNames::xAttrString, SVGLength, X, x) ANIMATED_PROPERTY_DECLARATIONS(SVGCursorElement, SVGNames::cursorTagString, SVGNames::yAttrString, SVGLength, Y, y) + // SVGURIReference + ANIMATED_PROPERTY_DECLARATIONS(SVGCursorElement, SVGURIReferenceIdentifier, XLinkNames::hrefAttrString, String, Href, href) + HashSet<SVGElement*> m_clients; }; diff --git a/WebCore/svg/SVGDefinitionSrcElement.cpp b/WebCore/svg/SVGDefinitionSrcElement.cpp deleted file mode 100644 index 1419ec0..0000000 --- a/WebCore/svg/SVGDefinitionSrcElement.cpp +++ /dev/null @@ -1,45 +0,0 @@ -/* - Copyright (C) 2007 Eric Seidel <eric@webkit.org> - - 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_FONTS) -#include "SVGDefinitionSrcElement.h" - -#include "SVGFontFaceElement.h" -#include "SVGNames.h" - -namespace WebCore { - -SVGDefinitionSrcElement::SVGDefinitionSrcElement(const QualifiedName& tagName, Document* doc) - : SVGElement(tagName, doc) -{ -} - -void SVGDefinitionSrcElement::childrenChanged(bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta) -{ - SVGElement::childrenChanged(changedByParser, beforeChange, afterChange, childCountDelta); - if (parentNode() && parentNode()->hasTagName(SVGNames::font_faceTag)) - static_cast<SVGFontFaceElement*>(parentNode())->rebuildFontFace(); -} - -} - -#endif // ENABLE(SVG_FONTS) - diff --git a/WebCore/svg/SVGDefinitionSrcElement.h b/WebCore/svg/SVGDefinitionSrcElement.h deleted file mode 100644 index aaefd05..0000000 --- a/WebCore/svg/SVGDefinitionSrcElement.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - Copyright (C) 2007 Eric Seidel <eric@webkit.org> - - 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. - */ - -#ifndef SVGDefinitionSrcElement_h -#define SVGDefinitionSrcElement_h - -#if ENABLE(SVG_FONTS) -#include "SVGElement.h" - -namespace WebCore { - class SVGDefinitionSrcElement : public SVGElement { - public: - SVGDefinitionSrcElement(const QualifiedName&, Document*); - - virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0); - }; - -} // namespace WebCore - -#endif // ENABLE(SVG_FONTS) -#endif - -// vim:ts=4:noet diff --git a/WebCore/svg/SVGDefinitionSrcElement.idl b/WebCore/svg/SVGDefinitionSrcElement.idl deleted file mode 100644 index f221895..0000000 --- a/WebCore/svg/SVGDefinitionSrcElement.idl +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (C) 2007 Eric Seidel <eric@webkit.org> - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``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 APPLE COMPUTER, INC. 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. - */ - -module svg { - - interface [Conditional=SVG&SVG_FONTS] SVGDefinitionSrcElement : SVGElement { - }; - -} diff --git a/WebCore/svg/SVGDocument.h b/WebCore/svg/SVGDocument.h index 02e3649..c7006f9 100644 --- a/WebCore/svg/SVGDocument.h +++ b/WebCore/svg/SVGDocument.h @@ -35,13 +35,11 @@ namespace WebCore { public: static PassRefPtr<SVGDocument> create(Frame* frame) { - return new SVGDocument(frame); + return adoptRef(new SVGDocument(frame)); } virtual ~SVGDocument(); - virtual bool isSVGDocument() const { return true; } - SVGSVGElement* rootElement() const; void dispatchZoomEvent(float prevScale, float newScale); @@ -52,11 +50,13 @@ 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/SVGElement.cpp b/WebCore/svg/SVGElement.cpp index 3a7d3d4..d455717 100644 --- a/WebCore/svg/SVGElement.cpp +++ b/WebCore/svg/SVGElement.cpp @@ -51,14 +51,19 @@ namespace WebCore { using namespace HTMLNames; -SVGElement::SVGElement(const QualifiedName& tagName, Document* doc) - : StyledElement(tagName, doc) +SVGElement::SVGElement(const QualifiedName& tagName, Document* document) + : StyledElement(tagName, document, CreateElementZeroRefCount) , m_shadowParent(0) , m_cursorElement(0) , m_cursorImageValue(0) { } +PassRefPtr<SVGElement> SVGElement::create(const QualifiedName& tagName, Document* document) +{ + return new SVGElement(tagName, document); +} + SVGElement::~SVGElement() { if (m_cursorElement) @@ -185,18 +190,17 @@ bool SVGElement::haveLoadedRequiredResources() return true; } -static bool hasLoadListener(SVGElement* node) +static bool hasLoadListener(Node* node) { - Node* currentNode = node; - while (currentNode && currentNode->isElementNode()) { - const RegisteredEventListenerVector& listeners = static_cast<Element*>(currentNode)->eventListeners(); - size_t size = listeners.size(); - for (size_t i = 0; i < size; ++i) { - const RegisteredEventListener& r = *listeners[i]; - if (r.eventType() == eventNames().loadEvent && r.useCapture() || currentNode == node) + if (node->hasEventListeners(eventNames().loadEvent)) + return true; + + for (node = node->parentNode(); node && node->isElementNode(); node = node->parentNode()) { + const EventListenerVector& entry = node->getEventListeners(eventNames().loadEvent); + for (size_t i = 0; i < entry.size(); ++i) { + if (entry[i].useCapture) return true; } - currentNode = currentNode->parentNode(); } return false; diff --git a/WebCore/svg/SVGElement.h b/WebCore/svg/SVGElement.h index aed7e59..3a17567 100644 --- a/WebCore/svg/SVGElement.h +++ b/WebCore/svg/SVGElement.h @@ -1,8 +1,7 @@ /* Copyright (C) 2004, 2005, 2006, 2008 Nikolas Zimmermann <zimmermann@kde.org> 2004, 2005, 2006 Rob Buis <buis@kde.org> - - This file is part of the KDE project + Copyright (C) 2009 Apple Inc. All rights reserved. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public @@ -26,25 +25,22 @@ #if ENABLE(SVG) #include "StyledElement.h" #include "SVGAnimatedProperty.h" -#include "SVGNames.h" namespace WebCore { - class TransformationMatrix; class CSSCursorImageValue; class Document; class SVGCursorElement; class SVGDocumentExtensions; class SVGElementInstance; class SVGSVGElement; + class TransformationMatrix; class SVGElement : public StyledElement { public: - SVGElement(const QualifiedName&, Document*); + static PassRefPtr<SVGElement> create(const QualifiedName&, Document*); virtual ~SVGElement(); - virtual bool isSVGElement() const { return true; } - virtual bool isSupported(StringImpl* feature, StringImpl* version) const; - + String id() const; void setId(const String&, ExceptionCode&); String xmlbase() const; @@ -52,6 +48,7 @@ namespace WebCore { SVGSVGElement* ownerSVGElement() const; SVGElement* viewportElement() const; + SVGDocumentExtensions* accessDocumentSVGExtensions() const; virtual void parseMappedAttribute(MappedAttribute*); @@ -64,33 +61,53 @@ namespace WebCore { virtual bool isGradientStop() const { return false; } virtual bool isTextContent() const { return false; } - virtual bool isShadowNode() const { return m_shadowParent; } - virtual Node* shadowParentNode() { return m_shadowParent; } void setShadowParentNode(ContainerNode* node) { m_shadowParent = node; } - virtual ContainerNode* eventParentNode(); // For SVGTests virtual bool isValid() const { return true; } - - virtual void finishParsingChildren(); + virtual bool rendererIsNeeded(RenderStyle*) { return false; } virtual bool childShouldCreateRenderer(Node*) const; - virtual void insertedIntoDocument(); - virtual void buildPendingResource() { } - virtual void svgAttributeChanged(const QualifiedName&) { } - virtual void attributeChanged(Attribute*, bool preserveDecls = false); void sendSVGLoadEventIfPossible(bool sendParentLoadEvents = false); virtual TransformationMatrix* supplementalTransform() { return 0; } - virtual void updateAnimatedSVGAttribute(const String&) const; virtual void setSynchronizedSVGAttributes(bool) const; HashSet<SVGElementInstance*> instancesForElement() const; - + + void addSVGPropertySynchronizer(const QualifiedName& attrName, const SVGAnimatedPropertyBase& base) const + { + m_svgPropertyMap.set(attrName.localName(), &base); + } + + void setCursorElement(SVGCursorElement* cursorElement) { m_cursorElement = cursorElement; } + void setCursorImageValue(CSSCursorImageValue* cursorImageValue) { m_cursorImageValue = cursorImageValue; } + + protected: + SVGElement(const QualifiedName&, Document*); + + virtual void finishParsingChildren(); + virtual void insertedIntoDocument(); + virtual void attributeChanged(Attribute*, bool preserveDecls = false); + virtual void updateAnimatedSVGAttribute(const String&) const; + + private: + friend class SVGElementInstance; + + virtual bool isSVGElement() const { return true; } + + virtual bool isSupported(StringImpl* feature, StringImpl* version) const; + + virtual bool isShadowNode() const { return m_shadowParent; } + virtual Node* shadowParentNode() { return m_shadowParent; } + virtual ContainerNode* eventParentNode(); + + virtual void buildPendingResource() { } + // Inlined methods handling SVG property synchronization void invokeSVGPropertySynchronizer(const String& name) const { @@ -114,17 +131,6 @@ namespace WebCore { } } - void addSVGPropertySynchronizer(const QualifiedName& attrName, const SVGAnimatedPropertyBase& base) const - { - m_svgPropertyMap.set(attrName.localName(), &base); - } - - void setCursorElement(SVGCursorElement* cursorElement) { m_cursorElement = cursorElement; } - void setCursorImageValue(CSSCursorImageValue* cursorImageValue) { m_cursorImageValue = cursorImageValue; } - - private: - friend class SVGElementInstance; - void mapInstanceToElement(SVGElementInstance*); void removeInstanceMapping(SVGElementInstance*); diff --git a/WebCore/svg/SVGElementInstance.cpp b/WebCore/svg/SVGElementInstance.cpp index 01555fc..46e8221 100644 --- a/WebCore/svg/SVGElementInstance.cpp +++ b/WebCore/svg/SVGElementInstance.cpp @@ -1,8 +1,6 @@ /* 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,7 +23,6 @@ #include "SVGElementInstance.h" #include "ContainerNodeAlgorithms.h" -#include "Document.h" #include "Event.h" #include "EventException.h" #include "EventListener.h" @@ -46,7 +43,14 @@ namespace WebCore { static WTF::RefCountedLeakCounter instanceCounter("WebCoreSVGElementInstance"); #endif -SVGElementInstance::SVGElementInstance(SVGUseElement* useElement, SVGElement* originalElement) +static EventTargetData& dummyEventTargetData() +{ + DEFINE_STATIC_LOCAL(EventTargetData, dummyEventTargetData, ()); + dummyEventTargetData.eventListenerMap.clear(); + return dummyEventTargetData; +} + +SVGElementInstance::SVGElementInstance(SVGUseElement* useElement, PassRefPtr<SVGElement> originalElement) : m_needsUpdate(false) , m_useElement(useElement) , m_element(originalElement) @@ -140,438 +144,52 @@ ScriptExecutionContext* SVGElementInstance::scriptExecutionContext() const return 0; } -void SVGElementInstance::addEventListener(const AtomicString& eventType, PassRefPtr<EventListener> listener, bool useCapture) -{ - if (SVGElement* element = correspondingElement()) - element->addEventListener(eventType, listener, useCapture); -} - -void SVGElementInstance::removeEventListener(const AtomicString& eventType, EventListener* listener, bool useCapture) +bool SVGElementInstance::addEventListener(const AtomicString& eventType, PassRefPtr<EventListener> listener, bool useCapture) { - if (SVGElement* element = correspondingElement()) - element->removeEventListener(eventType, listener, useCapture); -} - -bool SVGElementInstance::dispatchEvent(PassRefPtr<Event> e, ExceptionCode& ec) -{ - RefPtr<Event> evt(e); - ASSERT(!eventDispatchForbidden()); - if (!evt || evt->type().isEmpty()) { - ec = EventException::UNSPECIFIED_EVENT_TYPE_ERR; - return false; - } - - // The event has to be dispatched to the shadowTreeElement(), not the correspondingElement()! - SVGElement* element = shadowTreeElement(); - if (!element) + if (!correspondingElement()) return false; - - evt->setTarget(this); - - RefPtr<FrameView> view = element->document()->view(); - return element->dispatchGenericEvent(evt.release()); -} - -EventListener* SVGElementInstance::onabort() const -{ - return correspondingElement()->getAttributeEventListener(eventNames().abortEvent); -} - -void SVGElementInstance::setOnabort(PassRefPtr<EventListener> eventListener) -{ - correspondingElement()->setAttributeEventListener(eventNames().abortEvent, eventListener); -} - -EventListener* SVGElementInstance::onblur() const -{ - return correspondingElement()->getAttributeEventListener(eventNames().blurEvent); -} - -void SVGElementInstance::setOnblur(PassRefPtr<EventListener> eventListener) -{ - correspondingElement()->setAttributeEventListener(eventNames().blurEvent, eventListener); -} - -EventListener* SVGElementInstance::onchange() const -{ - return correspondingElement()->getAttributeEventListener(eventNames().changeEvent); -} - -void SVGElementInstance::setOnchange(PassRefPtr<EventListener> eventListener) -{ - correspondingElement()->setAttributeEventListener(eventNames().changeEvent, eventListener); -} - -EventListener* SVGElementInstance::onclick() const -{ - return correspondingElement()->getAttributeEventListener(eventNames().clickEvent); -} - -void SVGElementInstance::setOnclick(PassRefPtr<EventListener> eventListener) -{ - correspondingElement()->setAttributeEventListener(eventNames().clickEvent, eventListener); -} - -EventListener* SVGElementInstance::oncontextmenu() const -{ - return correspondingElement()->getAttributeEventListener(eventNames().contextmenuEvent); -} - -void SVGElementInstance::setOncontextmenu(PassRefPtr<EventListener> eventListener) -{ - correspondingElement()->setAttributeEventListener(eventNames().contextmenuEvent, eventListener); -} - -EventListener* SVGElementInstance::ondblclick() const -{ - return correspondingElement()->getAttributeEventListener(eventNames().dblclickEvent); -} - -void SVGElementInstance::setOndblclick(PassRefPtr<EventListener> eventListener) -{ - correspondingElement()->setAttributeEventListener(eventNames().dblclickEvent, eventListener); -} - -EventListener* SVGElementInstance::onerror() const -{ - return correspondingElement()->getAttributeEventListener(eventNames().errorEvent); -} - -void SVGElementInstance::setOnerror(PassRefPtr<EventListener> eventListener) -{ - correspondingElement()->setAttributeEventListener(eventNames().errorEvent, eventListener); -} - -EventListener* SVGElementInstance::onfocus() const -{ - return correspondingElement()->getAttributeEventListener(eventNames().focusEvent); -} - -void SVGElementInstance::setOnfocus(PassRefPtr<EventListener> eventListener) -{ - correspondingElement()->setAttributeEventListener(eventNames().focusEvent, eventListener); -} - -EventListener* SVGElementInstance::oninput() const -{ - return correspondingElement()->getAttributeEventListener(eventNames().inputEvent); -} - -void SVGElementInstance::setOninput(PassRefPtr<EventListener> eventListener) -{ - correspondingElement()->setAttributeEventListener(eventNames().inputEvent, eventListener); -} - -EventListener* SVGElementInstance::onkeydown() const -{ - return correspondingElement()->getAttributeEventListener(eventNames().keydownEvent); -} - -void SVGElementInstance::setOnkeydown(PassRefPtr<EventListener> eventListener) -{ - correspondingElement()->setAttributeEventListener(eventNames().keydownEvent, eventListener); -} - -EventListener* SVGElementInstance::onkeypress() const -{ - return correspondingElement()->getAttributeEventListener(eventNames().keypressEvent); -} - -void SVGElementInstance::setOnkeypress(PassRefPtr<EventListener> eventListener) -{ - correspondingElement()->setAttributeEventListener(eventNames().keypressEvent, eventListener); -} - -EventListener* SVGElementInstance::onkeyup() const -{ - return correspondingElement()->getAttributeEventListener(eventNames().keyupEvent); -} - -void SVGElementInstance::setOnkeyup(PassRefPtr<EventListener> eventListener) -{ - correspondingElement()->setAttributeEventListener(eventNames().keyupEvent, eventListener); -} - -EventListener* SVGElementInstance::onload() const -{ - return correspondingElement()->getAttributeEventListener(eventNames().loadEvent); -} - -void SVGElementInstance::setOnload(PassRefPtr<EventListener> eventListener) -{ - correspondingElement()->setAttributeEventListener(eventNames().loadEvent, eventListener); -} - -EventListener* SVGElementInstance::onmousedown() const -{ - return correspondingElement()->getAttributeEventListener(eventNames().mousedownEvent); -} - -void SVGElementInstance::setOnmousedown(PassRefPtr<EventListener> eventListener) -{ - correspondingElement()->setAttributeEventListener(eventNames().mousedownEvent, eventListener); -} - -EventListener* SVGElementInstance::onmousemove() const -{ - return correspondingElement()->getAttributeEventListener(eventNames().mousemoveEvent); -} - -void SVGElementInstance::setOnmousemove(PassRefPtr<EventListener> eventListener) -{ - correspondingElement()->setAttributeEventListener(eventNames().mousemoveEvent, eventListener); -} - -EventListener* SVGElementInstance::onmouseout() const -{ - return correspondingElement()->getAttributeEventListener(eventNames().mouseoutEvent); -} - -void SVGElementInstance::setOnmouseout(PassRefPtr<EventListener> eventListener) -{ - correspondingElement()->setAttributeEventListener(eventNames().mouseoutEvent, eventListener); -} - -EventListener* SVGElementInstance::onmouseover() const -{ - return correspondingElement()->getAttributeEventListener(eventNames().mouseoverEvent); -} - -void SVGElementInstance::setOnmouseover(PassRefPtr<EventListener> eventListener) -{ - correspondingElement()->setAttributeEventListener(eventNames().mouseoverEvent, eventListener); -} - -EventListener* SVGElementInstance::onmouseup() const -{ - return correspondingElement()->getAttributeEventListener(eventNames().mouseupEvent); + return correspondingElement()->addEventListener(eventType, listener, useCapture); } -void SVGElementInstance::setOnmouseup(PassRefPtr<EventListener> eventListener) +bool SVGElementInstance::removeEventListener(const AtomicString& eventType, EventListener* listener, bool useCapture) { - correspondingElement()->setAttributeEventListener(eventNames().mouseupEvent, eventListener); -} - -EventListener* SVGElementInstance::onmousewheel() const -{ - return correspondingElement()->getAttributeEventListener(eventNames().mousewheelEvent); -} - -void SVGElementInstance::setOnmousewheel(PassRefPtr<EventListener> eventListener) -{ - correspondingElement()->setAttributeEventListener(eventNames().mousewheelEvent, eventListener); -} - -EventListener* SVGElementInstance::onbeforecut() const -{ - return correspondingElement()->getAttributeEventListener(eventNames().beforecutEvent); -} - -void SVGElementInstance::setOnbeforecut(PassRefPtr<EventListener> eventListener) -{ - correspondingElement()->setAttributeEventListener(eventNames().beforecutEvent, eventListener); -} - -EventListener* SVGElementInstance::oncut() const -{ - return correspondingElement()->getAttributeEventListener(eventNames().cutEvent); -} - -void SVGElementInstance::setOncut(PassRefPtr<EventListener> eventListener) -{ - correspondingElement()->setAttributeEventListener(eventNames().cutEvent, eventListener); -} - -EventListener* SVGElementInstance::onbeforecopy() const -{ - return correspondingElement()->getAttributeEventListener(eventNames().beforecopyEvent); -} - -void SVGElementInstance::setOnbeforecopy(PassRefPtr<EventListener> eventListener) -{ - correspondingElement()->setAttributeEventListener(eventNames().beforecopyEvent, eventListener); -} - -EventListener* SVGElementInstance::oncopy() const -{ - return correspondingElement()->getAttributeEventListener(eventNames().copyEvent); -} - -void SVGElementInstance::setOncopy(PassRefPtr<EventListener> eventListener) -{ - correspondingElement()->setAttributeEventListener(eventNames().copyEvent, eventListener); -} - -EventListener* SVGElementInstance::onbeforepaste() const -{ - return correspondingElement()->getAttributeEventListener(eventNames().beforepasteEvent); -} - -void SVGElementInstance::setOnbeforepaste(PassRefPtr<EventListener> eventListener) -{ - correspondingElement()->setAttributeEventListener(eventNames().beforepasteEvent, eventListener); -} - -EventListener* SVGElementInstance::onpaste() const -{ - return correspondingElement()->getAttributeEventListener(eventNames().pasteEvent); -} - -void SVGElementInstance::setOnpaste(PassRefPtr<EventListener> eventListener) -{ - correspondingElement()->setAttributeEventListener(eventNames().pasteEvent, eventListener); -} - -EventListener* SVGElementInstance::ondragenter() const -{ - return correspondingElement()->getAttributeEventListener(eventNames().dragenterEvent); -} - -void SVGElementInstance::setOndragenter(PassRefPtr<EventListener> eventListener) -{ - correspondingElement()->setAttributeEventListener(eventNames().dragenterEvent, eventListener); -} - -EventListener* SVGElementInstance::ondragover() const -{ - return correspondingElement()->getAttributeEventListener(eventNames().dragoverEvent); -} - -void SVGElementInstance::setOndragover(PassRefPtr<EventListener> eventListener) -{ - correspondingElement()->setAttributeEventListener(eventNames().dragoverEvent, eventListener); -} - -EventListener* SVGElementInstance::ondragleave() const -{ - return correspondingElement()->getAttributeEventListener(eventNames().dragleaveEvent); -} - -void SVGElementInstance::setOndragleave(PassRefPtr<EventListener> eventListener) -{ - correspondingElement()->setAttributeEventListener(eventNames().dragleaveEvent, eventListener); -} - -EventListener* SVGElementInstance::ondrop() const -{ - return correspondingElement()->getAttributeEventListener(eventNames().dropEvent); -} - -void SVGElementInstance::setOndrop(PassRefPtr<EventListener> eventListener) -{ - correspondingElement()->setAttributeEventListener(eventNames().dropEvent, eventListener); -} - -EventListener* SVGElementInstance::ondragstart() const -{ - return correspondingElement()->getAttributeEventListener(eventNames().dragstartEvent); -} - -void SVGElementInstance::setOndragstart(PassRefPtr<EventListener> eventListener) -{ - correspondingElement()->setAttributeEventListener(eventNames().dragstartEvent, eventListener); -} - -EventListener* SVGElementInstance::ondrag() const -{ - return correspondingElement()->getAttributeEventListener(eventNames().dragEvent); -} - -void SVGElementInstance::setOndrag(PassRefPtr<EventListener> eventListener) -{ - correspondingElement()->setAttributeEventListener(eventNames().dragEvent, eventListener); -} - -EventListener* SVGElementInstance::ondragend() const -{ - return correspondingElement()->getAttributeEventListener(eventNames().dragendEvent); -} - -void SVGElementInstance::setOndragend(PassRefPtr<EventListener> eventListener) -{ - correspondingElement()->setAttributeEventListener(eventNames().dragendEvent, eventListener); -} - -EventListener* SVGElementInstance::onreset() const -{ - return correspondingElement()->getAttributeEventListener(eventNames().resetEvent); -} - -void SVGElementInstance::setOnreset(PassRefPtr<EventListener> eventListener) -{ - correspondingElement()->setAttributeEventListener(eventNames().resetEvent, eventListener); -} - -EventListener* SVGElementInstance::onresize() const -{ - return correspondingElement()->getAttributeEventListener(eventNames().resizeEvent); -} - -void SVGElementInstance::setOnresize(PassRefPtr<EventListener> eventListener) -{ - correspondingElement()->setAttributeEventListener(eventNames().resizeEvent, eventListener); -} - -EventListener* SVGElementInstance::onscroll() const -{ - return correspondingElement()->getAttributeEventListener(eventNames().scrollEvent); -} - -void SVGElementInstance::setOnscroll(PassRefPtr<EventListener> eventListener) -{ - correspondingElement()->setAttributeEventListener(eventNames().scrollEvent, eventListener); -} - -EventListener* SVGElementInstance::onsearch() const -{ - return correspondingElement()->getAttributeEventListener(eventNames().searchEvent); -} - -void SVGElementInstance::setOnsearch(PassRefPtr<EventListener> eventListener) -{ - correspondingElement()->setAttributeEventListener(eventNames().searchEvent, eventListener); -} - -EventListener* SVGElementInstance::onselect() const -{ - return correspondingElement()->getAttributeEventListener(eventNames().selectEvent); + if (!correspondingElement()) + return false; + return correspondingElement()->removeEventListener(eventType, listener, useCapture); } -void SVGElementInstance::setOnselect(PassRefPtr<EventListener> eventListener) +void SVGElementInstance::removeAllEventListeners() { - correspondingElement()->setAttributeEventListener(eventNames().selectEvent, eventListener); + if (!correspondingElement()) + return; + correspondingElement()->removeAllEventListeners(); } -EventListener* SVGElementInstance::onselectstart() const +bool SVGElementInstance::dispatchEvent(PassRefPtr<Event> prpEvent) { - return correspondingElement()->getAttributeEventListener(eventNames().selectstartEvent); -} + RefPtr<EventTarget> protect = this; + RefPtr<Event> event = prpEvent; -void SVGElementInstance::setOnselectstart(PassRefPtr<EventListener> eventListener) -{ - correspondingElement()->setAttributeEventListener(eventNames().selectstartEvent, eventListener); -} + event->setTarget(this); -EventListener* SVGElementInstance::onsubmit() const -{ - return correspondingElement()->getAttributeEventListener(eventNames().submitEvent); -} + SVGElement* element = shadowTreeElement(); + if (!element) + return false; -void SVGElementInstance::setOnsubmit(PassRefPtr<EventListener> eventListener) -{ - correspondingElement()->setAttributeEventListener(eventNames().submitEvent, eventListener); + RefPtr<FrameView> view = element->document()->view(); + return element->dispatchGenericEvent(event.release()); } -EventListener* SVGElementInstance::onunload() const +EventTargetData* SVGElementInstance::eventTargetData() { - return correspondingElement()->getAttributeEventListener(eventNames().unloadEvent); + return correspondingElement() ? correspondingElement()->eventTargetData() : 0; } -void SVGElementInstance::setOnunload(PassRefPtr<EventListener> eventListener) +EventTargetData* SVGElementInstance::ensureEventTargetData() { - correspondingElement()->setAttributeEventListener(eventNames().unloadEvent, eventListener); + return &dummyEventTargetData(); // return something, so we don't crash } -} +} // namespace WebCore #endif // ENABLE(SVG) diff --git a/WebCore/svg/SVGElementInstance.h b/WebCore/svg/SVGElementInstance.h index c477718..3cdc761 100644 --- a/WebCore/svg/SVGElementInstance.h +++ b/WebCore/svg/SVGElementInstance.h @@ -1,8 +1,6 @@ /* 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 @@ -27,9 +25,6 @@ #include "SVGElement.h" #include "TreeShared.h" -#include <wtf/RefPtr.h> -#include <wtf/PassRefPtr.h> - namespace WebCore { namespace Private { @@ -37,8 +32,6 @@ namespace WebCore { void addChildNodesToDeletionQueue(GenericNode*& head, GenericNode*& tail, GenericNodeContainer* container); }; - class EventListener; - class Frame; class SVGUseElement; class SVGElementInstanceList; @@ -46,7 +39,11 @@ namespace WebCore { class SVGElementInstance : public TreeShared<SVGElementInstance>, public EventTarget { public: - SVGElementInstance(SVGUseElement*, SVGElement* originalElement); + static PassRefPtr<SVGElementInstance> create(SVGUseElement* useElement, PassRefPtr<SVGElement> originalElement) + { + return adoptRef(new SVGElementInstance(useElement, originalElement)); + } + virtual ~SVGElementInstance(); bool needsUpdate() const { return m_needsUpdate; } @@ -54,13 +51,11 @@ 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&); - const RegisteredEventListenerVector& eventListeners() const { return correspondingElement()->eventListeners(); } + virtual bool addEventListener(const AtomicString& eventType, PassRefPtr<EventListener>, bool useCapture); + virtual bool removeEventListener(const AtomicString& eventType, EventListener*, bool useCapture); + virtual void removeAllEventListeners(); + using EventTarget::dispatchEvent; + virtual bool dispatchEvent(PassRefPtr<Event>); SVGElement* correspondingElement() const { return m_element.get(); } SVGUseElement* correspondingUseElement() const { return m_useElement; } @@ -83,90 +78,55 @@ namespace WebCore { using TreeShared<SVGElementInstance>::deref; // EventTarget API - EventListener* onabort() const; - void setOnabort(PassRefPtr<EventListener>); - EventListener* onblur() const; - void setOnblur(PassRefPtr<EventListener>); - EventListener* onchange() const; - void setOnchange(PassRefPtr<EventListener>); - EventListener* onclick() const; - void setOnclick(PassRefPtr<EventListener>); - EventListener* oncontextmenu() const; - void setOncontextmenu(PassRefPtr<EventListener>); - EventListener* ondblclick() const; - void setOndblclick(PassRefPtr<EventListener>); - EventListener* onerror() const; - void setOnerror(PassRefPtr<EventListener>); - EventListener* onfocus() const; - void setOnfocus(PassRefPtr<EventListener>); - EventListener* oninput() const; - void setOninput(PassRefPtr<EventListener>); - EventListener* onkeydown() const; - void setOnkeydown(PassRefPtr<EventListener>); - EventListener* onkeypress() const; - void setOnkeypress(PassRefPtr<EventListener>); - EventListener* onkeyup() const; - void setOnkeyup(PassRefPtr<EventListener>); - EventListener* onload() const; - void setOnload(PassRefPtr<EventListener>); - EventListener* onmousedown() const; - void setOnmousedown(PassRefPtr<EventListener>); - EventListener* onmousemove() const; - void setOnmousemove(PassRefPtr<EventListener>); - EventListener* onmouseout() const; - void setOnmouseout(PassRefPtr<EventListener>); - EventListener* onmouseover() const; - void setOnmouseover(PassRefPtr<EventListener>); - EventListener* onmouseup() const; - void setOnmouseup(PassRefPtr<EventListener>); - EventListener* onmousewheel() const; - void setOnmousewheel(PassRefPtr<EventListener>); - EventListener* onbeforecut() const; - void setOnbeforecut(PassRefPtr<EventListener>); - EventListener* oncut() const; - void setOncut(PassRefPtr<EventListener>); - EventListener* onbeforecopy() const; - void setOnbeforecopy(PassRefPtr<EventListener>); - EventListener* oncopy() const; - void setOncopy(PassRefPtr<EventListener>); - EventListener* onbeforepaste() const; - void setOnbeforepaste(PassRefPtr<EventListener>); - EventListener* onpaste() const; - void setOnpaste(PassRefPtr<EventListener>); - EventListener* ondragenter() const; - void setOndragenter(PassRefPtr<EventListener>); - EventListener* ondragover() const; - void setOndragover(PassRefPtr<EventListener>); - EventListener* ondragleave() const; - void setOndragleave(PassRefPtr<EventListener>); - EventListener* ondrop() const; - void setOndrop(PassRefPtr<EventListener>); - EventListener* ondragstart() const; - void setOndragstart(PassRefPtr<EventListener>); - EventListener* ondrag() const; - void setOndrag(PassRefPtr<EventListener>); - EventListener* ondragend() const; - void setOndragend(PassRefPtr<EventListener>); - EventListener* onreset() const; - void setOnreset(PassRefPtr<EventListener>); - EventListener* onresize() const; - void setOnresize(PassRefPtr<EventListener>); - EventListener* onscroll() const; - void setOnscroll(PassRefPtr<EventListener>); - EventListener* onsearch() const; - void setOnsearch(PassRefPtr<EventListener>); - EventListener* onselect() const; - void setOnselect(PassRefPtr<EventListener>); - EventListener* onselectstart() const; - void setOnselectstart(PassRefPtr<EventListener>); - EventListener* onsubmit() const; - void setOnsubmit(PassRefPtr<EventListener>); - EventListener* onunload() const; - void setOnunload(PassRefPtr<EventListener>); + DEFINE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), abort); + DEFINE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), blur); + DEFINE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), change); + DEFINE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), click); + DEFINE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), contextmenu); + DEFINE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), dblclick); + DEFINE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), error); + DEFINE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), focus); + DEFINE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), input); + DEFINE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), keydown); + DEFINE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), keypress); + DEFINE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), keyup); + DEFINE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), load); + DEFINE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), mousedown); + DEFINE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), mousemove); + DEFINE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), mouseout); + DEFINE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), mouseover); + DEFINE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), mouseup); + DEFINE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), mousewheel); + DEFINE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), beforecut); + DEFINE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), cut); + DEFINE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), beforecopy); + DEFINE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), copy); + DEFINE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), beforepaste); + DEFINE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), paste); + DEFINE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), dragenter); + DEFINE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), dragover); + DEFINE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), dragleave); + DEFINE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), drop); + DEFINE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), dragstart); + DEFINE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), drag); + DEFINE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), dragend); + DEFINE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), reset); + DEFINE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), resize); + DEFINE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), scroll); + DEFINE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), search); + DEFINE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), select); + DEFINE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), selectstart); + DEFINE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), submit); + DEFINE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(correspondingElement(), unload); 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,8 +150,9 @@ namespace WebCore { virtual void refEventTarget() { ref(); } virtual void derefEventTarget() { deref(); } + virtual EventTargetData* eventTargetData(); + virtual EventTargetData* ensureEventTargetData(); - private: bool m_needsUpdate : 1; SVGUseElement* m_useElement; diff --git a/WebCore/svg/SVGExternalResourcesRequired.h b/WebCore/svg/SVGExternalResourcesRequired.h index 0ab6dc9..e491e4b 100644 --- a/WebCore/svg/SVGExternalResourcesRequired.h +++ b/WebCore/svg/SVGExternalResourcesRequired.h @@ -25,6 +25,7 @@ #if ENABLE(SVG) #include "SVGElement.h" +#include "SVGNames.h" namespace WebCore { diff --git a/WebCore/svg/SVGFEImageElement.cpp b/WebCore/svg/SVGFEImageElement.cpp index 8122960..fade0f7 100644 --- a/WebCore/svg/SVGFEImageElement.cpp +++ b/WebCore/svg/SVGFEImageElement.cpp @@ -43,6 +43,7 @@ SVGFEImageElement::SVGFEImageElement(const QualifiedName& tagName, Document* doc , SVGLangSpace() , SVGExternalResourcesRequired() , m_preserveAspectRatio(this, SVGNames::preserveAspectRatioAttr, SVGPreserveAspectRatio::create()) + , m_href(this, XLinkNames::hrefAttr) { } diff --git a/WebCore/svg/SVGFEImageElement.h b/WebCore/svg/SVGFEImageElement.h index 67f3bd5..0393c66 100644 --- a/WebCore/svg/SVGFEImageElement.h +++ b/WebCore/svg/SVGFEImageElement.h @@ -55,6 +55,9 @@ namespace WebCore { private: ANIMATED_PROPERTY_DECLARATIONS(SVGFEImageElement, SVGNames::feImageTagString, SVGNames::preserveAspectRatioAttrString, SVGPreserveAspectRatio, PreserveAspectRatio, preserveAspectRatio) + // SVGURIReference + ANIMATED_PROPERTY_DECLARATIONS(SVGFEImageElement, SVGURIReferenceIdentifier, XLinkNames::hrefAttrString, String, Href, href) + CachedResourceHandle<CachedImage> m_cachedImage; }; diff --git a/WebCore/svg/SVGFELightElement.h b/WebCore/svg/SVGFELightElement.h index a66ccf5..f6e79fb 100644 --- a/WebCore/svg/SVGFELightElement.h +++ b/WebCore/svg/SVGFELightElement.h @@ -25,6 +25,7 @@ #if ENABLE(SVG) && ENABLE(FILTERS) #include "SVGElement.h" #include "SVGLightSource.h" +#include "SVGNames.h" namespace WebCore { diff --git a/WebCore/svg/SVGFEMergeNodeElement.h b/WebCore/svg/SVGFEMergeNodeElement.h index e2af642..4633f98 100644 --- a/WebCore/svg/SVGFEMergeNodeElement.h +++ b/WebCore/svg/SVGFEMergeNodeElement.h @@ -25,6 +25,7 @@ #if ENABLE(SVG) && ENABLE(FILTERS) #include "SVGElement.h" +#include "SVGNames.h" namespace WebCore { diff --git a/WebCore/svg/SVGFilterElement.cpp b/WebCore/svg/SVGFilterElement.cpp index 7703b6f..bc39475 100644 --- a/WebCore/svg/SVGFilterElement.cpp +++ b/WebCore/svg/SVGFilterElement.cpp @@ -54,6 +54,7 @@ SVGFilterElement::SVGFilterElement(const QualifiedName& tagName, Document* doc) , m_height(this, SVGNames::heightAttr, LengthModeHeight, "120%") , m_filterResX(this, SVGNames::filterResAttr) , m_filterResY(this, SVGNames::filterResAttr) + , m_href(this, XLinkNames::hrefAttr) { // Spec: If the x/y attribute is not specified, the effect is as if a value of "-10%" were specified. // Spec: If the width/height attribute is not specified, the effect is as if a value of "120%" were specified. diff --git a/WebCore/svg/SVGFilterElement.h b/WebCore/svg/SVGFilterElement.h index 541ec14..64b21f6 100644 --- a/WebCore/svg/SVGFilterElement.h +++ b/WebCore/svg/SVGFilterElement.h @@ -64,6 +64,9 @@ namespace WebCore { ANIMATED_PROPERTY_DECLARATIONS(SVGFilterElement, SVGNames::filterTagString, SVGFilterResXIdentifier, long, FilterResX, filterResX) ANIMATED_PROPERTY_DECLARATIONS(SVGFilterElement, SVGNames::filterTagString, SVGFilterResYIdentifier, long, FilterResY, filterResY) + // SVGURIReference + ANIMATED_PROPERTY_DECLARATIONS(SVGFilterElement, SVGURIReferenceIdentifier, XLinkNames::hrefAttrString, String, Href, href) + RefPtr<SVGResourceFilter> m_filter; }; diff --git a/WebCore/svg/SVGFilterPrimitiveStandardAttributes.h b/WebCore/svg/SVGFilterPrimitiveStandardAttributes.h index fa82f6a..3cdbb37 100644 --- a/WebCore/svg/SVGFilterPrimitiveStandardAttributes.h +++ b/WebCore/svg/SVGFilterPrimitiveStandardAttributes.h @@ -25,6 +25,7 @@ #if ENABLE(SVG) && ENABLE(FILTERS) #include "SVGFilterBuilder.h" +#include "SVGNames.h" #include "SVGResourceFilter.h" #include "SVGStyledElement.h" diff --git a/WebCore/svg/SVGFontFaceElement.cpp b/WebCore/svg/SVGFontFaceElement.cpp index 1e5a0fe..aa0b6d8 100644 --- a/WebCore/svg/SVGFontFaceElement.cpp +++ b/WebCore/svg/SVGFontFaceElement.cpp @@ -37,7 +37,6 @@ #include "Document.h" #include "Font.h" #include "MappedAttribute.h" -#include "SVGDefinitionSrcElement.h" #include "SVGFontElement.h" #include "SVGFontFaceSrcElement.h" #include "SVGGlyphElement.h" @@ -277,21 +276,12 @@ void SVGFontFaceElement::rebuildFontFace() // we currently ignore all but the first src element, alternatively we could concat them SVGFontFaceSrcElement* srcElement = 0; - SVGDefinitionSrcElement* definitionSrc = 0; - for (Node* child = firstChild(); child; child = child->nextSibling()) { - if (child->hasTagName(font_face_srcTag) && !srcElement) + for (Node* child = firstChild(); child && !srcElement; child = child->nextSibling()) { + if (child->hasTagName(font_face_srcTag)) srcElement = static_cast<SVGFontFaceSrcElement*>(child); - else if (child->hasTagName(definition_srcTag) && !definitionSrc) - definitionSrc = static_cast<SVGDefinitionSrcElement*>(child); } -#if 0 - // @font-face (CSSFontFace) does not yet support definition-src, as soon as it does this code should do the trick! - if (definitionSrc) - m_styleDeclaration->setProperty(CSSPropertyDefinitionSrc, definitionSrc->getAttribute(XLinkNames::hrefAttr), false); -#endif - bool describesParentFont = parentNode()->hasTagName(fontTag); RefPtr<CSSValueList> list; diff --git a/WebCore/svg/SVGForeignObjectElement.cpp b/WebCore/svg/SVGForeignObjectElement.cpp index 5cfca8a..b93ddeb 100644 --- a/WebCore/svg/SVGForeignObjectElement.cpp +++ b/WebCore/svg/SVGForeignObjectElement.cpp @@ -43,6 +43,7 @@ SVGForeignObjectElement::SVGForeignObjectElement(const QualifiedName& tagName, D , m_y(this, SVGNames::yAttr, LengthModeHeight) , m_width(this, SVGNames::widthAttr, LengthModeWidth) , m_height(this, SVGNames::heightAttr, LengthModeHeight) + , m_href(this, XLinkNames::hrefAttr) { } diff --git a/WebCore/svg/SVGForeignObjectElement.h b/WebCore/svg/SVGForeignObjectElement.h index 14dbe68..7b93bb6 100644 --- a/WebCore/svg/SVGForeignObjectElement.h +++ b/WebCore/svg/SVGForeignObjectElement.h @@ -56,6 +56,9 @@ namespace WebCore { ANIMATED_PROPERTY_DECLARATIONS(SVGForeignObjectElement, SVGNames::foreignObjectTagString, SVGNames::yAttrString, SVGLength, Y, y) ANIMATED_PROPERTY_DECLARATIONS(SVGForeignObjectElement, SVGNames::foreignObjectTagString, SVGNames::widthAttrString, SVGLength, Width, width) ANIMATED_PROPERTY_DECLARATIONS(SVGForeignObjectElement, SVGNames::foreignObjectTagString, SVGNames::heightAttrString, SVGLength, Height, height) + + // SVGURIReference + ANIMATED_PROPERTY_DECLARATIONS(SVGForeignObjectElement, SVGURIReferenceIdentifier, XLinkNames::hrefAttrString, String, Href, href) }; } // namespace WebCore diff --git a/WebCore/svg/SVGGradientElement.cpp b/WebCore/svg/SVGGradientElement.cpp index 8034286..29bbcac 100644 --- a/WebCore/svg/SVGGradientElement.cpp +++ b/WebCore/svg/SVGGradientElement.cpp @@ -48,6 +48,7 @@ SVGGradientElement::SVGGradientElement(const QualifiedName& tagName, Document* d , m_spreadMethod(this, SVGNames::spreadMethodAttr) , m_gradientUnits(this, SVGNames::gradientUnitsAttr, SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX) , m_gradientTransform(this, SVGNames::gradientTransformAttr, SVGTransformList::create(SVGNames::gradientTransformAttr)) + , m_href(this, XLinkNames::hrefAttr) { } diff --git a/WebCore/svg/SVGGradientElement.h b/WebCore/svg/SVGGradientElement.h index 2027258..3c8a760 100644 --- a/WebCore/svg/SVGGradientElement.h +++ b/WebCore/svg/SVGGradientElement.h @@ -66,6 +66,9 @@ namespace WebCore { ANIMATED_PROPERTY_DECLARATIONS(SVGGradientElement, SVGGradientElementIdentifier, SVGNames::spreadMethodAttrString, int, SpreadMethod, spreadMethod) ANIMATED_PROPERTY_DECLARATIONS(SVGGradientElement, SVGGradientElementIdentifier, SVGNames::gradientUnitsAttrString, int, GradientUnits, gradientUnits) ANIMATED_PROPERTY_DECLARATIONS(SVGGradientElement, SVGGradientElementIdentifier, SVGNames::gradientTransformAttrString, SVGTransformList, GradientTransform, gradientTransform) + + // SVGURIReference + ANIMATED_PROPERTY_DECLARATIONS(SVGGradientElement, SVGURIReferenceIdentifier, XLinkNames::hrefAttrString, String, Href, href) }; } // namespace WebCore diff --git a/WebCore/svg/SVGImageElement.cpp b/WebCore/svg/SVGImageElement.cpp index 299828f..5b7dee2 100644 --- a/WebCore/svg/SVGImageElement.cpp +++ b/WebCore/svg/SVGImageElement.cpp @@ -45,7 +45,8 @@ SVGImageElement::SVGImageElement(const QualifiedName& tagName, Document* doc) , m_y(this, SVGNames::yAttr, LengthModeHeight) , m_width(this, SVGNames::widthAttr, LengthModeWidth) , m_height(this, SVGNames::heightAttr, LengthModeHeight) - , m_preserveAspectRatio(this, SVGNames::preserveAspectRatioAttr, SVGPreserveAspectRatio::create()) + , m_preserveAspectRatio(this, SVGNames::preserveAspectRatioAttr, SVGPreserveAspectRatio::create()) + , m_href(this, XLinkNames::hrefAttr) , m_imageLoader(this) { } diff --git a/WebCore/svg/SVGImageElement.h b/WebCore/svg/SVGImageElement.h index 1d242b5..7840fc5 100644 --- a/WebCore/svg/SVGImageElement.h +++ b/WebCore/svg/SVGImageElement.h @@ -70,6 +70,9 @@ namespace WebCore { ANIMATED_PROPERTY_DECLARATIONS(SVGImageElement, SVGNames::imageTagString, SVGNames::heightAttrString, SVGLength, Height, height) ANIMATED_PROPERTY_DECLARATIONS(SVGImageElement, SVGNames::imageTagString, SVGNames::preserveAspectRatioAttrString, SVGPreserveAspectRatio, PreserveAspectRatio, preserveAspectRatio) + // SVGURIReference + ANIMATED_PROPERTY_DECLARATIONS(SVGImageElement, SVGURIReferenceIdentifier, XLinkNames::hrefAttrString, String, Href, href) + SVGImageLoader m_imageLoader; }; diff --git a/WebCore/svg/SVGImageLoader.cpp b/WebCore/svg/SVGImageLoader.cpp index f8380f5..5d5d3bc 100644 --- a/WebCore/svg/SVGImageLoader.cpp +++ b/WebCore/svg/SVGImageLoader.cpp @@ -25,6 +25,7 @@ #if ENABLE(SVG) #include "SVGImageLoader.h" +#include "Event.h" #include "EventNames.h" #include "SVGImageElement.h" #include "RenderImage.h" @@ -43,7 +44,7 @@ SVGImageLoader::~SVGImageLoader() void SVGImageLoader::dispatchLoadEvent() { if (image()->errorOccurred()) - element()->dispatchEvent(eventNames().errorEvent, false, false); + element()->dispatchEvent(Event::create(eventNames().errorEvent, false, false)); else { SVGImageElement* imageElement = static_cast<SVGImageElement*>(element()); if (imageElement->externalResourcesRequiredBaseValue()) diff --git a/WebCore/svg/SVGMPathElement.cpp b/WebCore/svg/SVGMPathElement.cpp index b3214ed..f19580c 100644 --- a/WebCore/svg/SVGMPathElement.cpp +++ b/WebCore/svg/SVGMPathElement.cpp @@ -31,6 +31,7 @@ namespace WebCore { SVGMPathElement::SVGMPathElement(const QualifiedName& qname, Document* doc) : SVGElement(qname, doc) + , m_href(this, XLinkNames::hrefAttr) { } @@ -47,7 +48,7 @@ void SVGMPathElement::parseMappedAttribute(MappedAttribute* attr) SVGPathElement* SVGMPathElement::pathElement() { - Element* target = document()->getElementById(getTarget(SVGURIReference::href())); + Element* target = document()->getElementById(getTarget(href())); if (target && target->hasTagName(SVGNames::pathTag)) return static_cast<SVGPathElement*>(target); return 0; diff --git a/WebCore/svg/SVGMPathElement.h b/WebCore/svg/SVGMPathElement.h index 988cead..463542f 100644 --- a/WebCore/svg/SVGMPathElement.h +++ b/WebCore/svg/SVGMPathElement.h @@ -31,8 +31,8 @@ namespace WebCore { class SVGPathElement; class SVGMPathElement : public SVGElement, - SVGURIReference, - SVGExternalResourcesRequired { + public SVGURIReference, + public SVGExternalResourcesRequired { public: SVGMPathElement(const QualifiedName&, Document*); virtual ~SVGMPathElement(); @@ -43,6 +43,9 @@ namespace WebCore { protected: virtual const SVGElement* contextElement() const { return this; } + + // SVGURIReference + ANIMATED_PROPERTY_DECLARATIONS(SVGMPathElement, SVGURIReferenceIdentifier, XLinkNames::hrefAttrString, String, Href, href) }; } // namespace WebCore diff --git a/WebCore/svg/SVGMaskElement.cpp b/WebCore/svg/SVGMaskElement.cpp index 6b75527..ea11b4a 100644 --- a/WebCore/svg/SVGMaskElement.cpp +++ b/WebCore/svg/SVGMaskElement.cpp @@ -55,6 +55,7 @@ SVGMaskElement::SVGMaskElement(const QualifiedName& tagName, Document* doc) , m_y(this, SVGNames::yAttr, LengthModeHeight, "-10%") , m_width(this, SVGNames::widthAttr, LengthModeWidth, "120%") , m_height(this, SVGNames::heightAttr, LengthModeHeight, "120%") + , m_href(this, XLinkNames::hrefAttr) { // Spec: If the x/y attribute is not specified, the effect is as if a value of "-10%" were specified. // Spec: If the width/height attribute is not specified, the effect is as if a value of "120%" were specified. diff --git a/WebCore/svg/SVGMaskElement.h b/WebCore/svg/SVGMaskElement.h index f2b7ae5..a152093 100644 --- a/WebCore/svg/SVGMaskElement.h +++ b/WebCore/svg/SVGMaskElement.h @@ -65,6 +65,9 @@ namespace WebCore { ANIMATED_PROPERTY_DECLARATIONS(SVGMaskElement, SVGNames::maskTagString, SVGNames::widthAttrString, SVGLength, Width, width) ANIMATED_PROPERTY_DECLARATIONS(SVGMaskElement, SVGNames::maskTagString, SVGNames::heightAttrString, SVGLength, Height, height) + // SVGURIReference + ANIMATED_PROPERTY_DECLARATIONS(SVGMaskElement, SVGURIReferenceIdentifier, XLinkNames::hrefAttrString, String, Href, href) + RefPtr<SVGResourceMasker> m_masker; }; diff --git a/WebCore/svg/SVGNumberList.cpp b/WebCore/svg/SVGNumberList.cpp index be1e895..4e904f4 100644 --- a/WebCore/svg/SVGNumberList.cpp +++ b/WebCore/svg/SVGNumberList.cpp @@ -41,6 +41,7 @@ SVGNumberList::~SVGNumberList() void SVGNumberList::parse(const String& value) { ExceptionCode ec = 0; + clear(ec); float number = 0.0f; diff --git a/WebCore/svg/SVGParserUtilities.cpp b/WebCore/svg/SVGParserUtilities.cpp index 6f696e6..c05e0f8 100644 --- a/WebCore/svg/SVGParserUtilities.cpp +++ b/WebCore/svg/SVGParserUtilities.cpp @@ -509,8 +509,8 @@ bool SVGPathParser::parseSVG(const String& s, bool process) return true; // Check for remaining coordinates in the current command. - if ((*ptr == '+' || *ptr == '-' || (*ptr >= '0' && *ptr <= '9')) && - (command != 'z' && command != 'Z')) { + if ((*ptr == '+' || *ptr == '-' || *ptr == '.' || (*ptr >= '0' && *ptr <= '9')) + && (command != 'z' && command != 'Z')) { if (command == 'M') command = 'L'; else if (command == 'm') diff --git a/WebCore/svg/SVGPatternElement.cpp b/WebCore/svg/SVGPatternElement.cpp index befca85..ef2b29e 100644 --- a/WebCore/svg/SVGPatternElement.cpp +++ b/WebCore/svg/SVGPatternElement.cpp @@ -64,6 +64,7 @@ SVGPatternElement::SVGPatternElement(const QualifiedName& tagName, Document* doc , m_patternUnits(this, SVGNames::patternUnitsAttr, SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX) , m_patternContentUnits(this, SVGNames::patternContentUnitsAttr, SVGUnitTypes::SVG_UNIT_TYPE_USERSPACEONUSE) , m_patternTransform(this, SVGNames::patternTransformAttr, SVGTransformList::create(SVGNames::patternTransformAttr)) + , m_href(this, XLinkNames::hrefAttr) { } diff --git a/WebCore/svg/SVGPatternElement.h b/WebCore/svg/SVGPatternElement.h index 2e6399c..46b031e 100644 --- a/WebCore/svg/SVGPatternElement.h +++ b/WebCore/svg/SVGPatternElement.h @@ -70,6 +70,9 @@ namespace WebCore { ANIMATED_PROPERTY_DECLARATIONS(SVGPatternElement, SVGNames::patternTagString, SVGNames::patternContentUnitsAttrString, int, PatternContentUnits, patternContentUnits) ANIMATED_PROPERTY_DECLARATIONS(SVGPatternElement, SVGNames::patternTagString, SVGNames::patternTransformAttrString, SVGTransformList, PatternTransform, patternTransform) + // SVGURIReference + ANIMATED_PROPERTY_DECLARATIONS(SVGPatternElement, SVGURIReferenceIdentifier, XLinkNames::hrefAttrString, String, Href, href) + mutable RefPtr<SVGPaintServerPattern> m_resource; private: diff --git a/WebCore/svg/SVGSVGElement.cpp b/WebCore/svg/SVGSVGElement.cpp index fcecd8c..29e72b8 100644 --- a/WebCore/svg/SVGSVGElement.cpp +++ b/WebCore/svg/SVGSVGElement.cpp @@ -307,15 +307,14 @@ void SVGSVGElement::svgAttributeChanged(const QualifiedName& attrName) renderer()->setNeedsLayout(true); } -unsigned long SVGSVGElement::suspendRedraw(unsigned long /* max_wait_milliseconds */) +unsigned SVGSVGElement::suspendRedraw(unsigned /* maxWaitMilliseconds */) { // FIXME: Implement me (see bug 11275) return 0; } -void SVGSVGElement::unsuspendRedraw(unsigned long /* suspend_handle_id */, ExceptionCode&) +void SVGSVGElement::unsuspendRedraw(unsigned /* suspendHandleId */) { - // if suspend_handle_id is not found, throw exception // FIXME: Implement me (see bug 11275) } diff --git a/WebCore/svg/SVGSVGElement.h b/WebCore/svg/SVGSVGElement.h index f92ed72..223ebf6 100644 --- a/WebCore/svg/SVGSVGElement.h +++ b/WebCore/svg/SVGSVGElement.h @@ -94,8 +94,8 @@ namespace WebCore { float getCurrentTime() const; void setCurrentTime(float seconds); - unsigned long suspendRedraw(unsigned long max_wait_milliseconds); - void unsuspendRedraw(unsigned long suspend_handle_id, ExceptionCode&); + unsigned suspendRedraw(unsigned maxWaitMilliseconds); + void unsuspendRedraw(unsigned suspendHandleId); void unsuspendRedrawAll(); void forceRedraw(); diff --git a/WebCore/svg/SVGSVGElement.idl b/WebCore/svg/SVGSVGElement.idl index 32b4e3c..b188894 100644 --- a/WebCore/svg/SVGSVGElement.idl +++ b/WebCore/svg/SVGSVGElement.idl @@ -56,8 +56,7 @@ module svg { readonly attribute SVGPoint currentTranslate; unsigned long suspendRedraw(in unsigned long maxWaitMilliseconds); - void unsuspendRedraw(in unsigned long suspendHandleId) - setter raises(DOMException); + void unsuspendRedraw(in unsigned long suspendHandleId); void unsuspendRedrawAll(); void forceRedraw(); void pauseAnimations(); diff --git a/WebCore/svg/SVGScriptElement.cpp b/WebCore/svg/SVGScriptElement.cpp index 2ecf912..5e946ce 100644 --- a/WebCore/svg/SVGScriptElement.cpp +++ b/WebCore/svg/SVGScriptElement.cpp @@ -26,6 +26,7 @@ #include "SVGScriptElement.h" #include "Document.h" +#include "Event.h" #include "EventNames.h" #include "MappedAttribute.h" #include "SVGNames.h" @@ -36,6 +37,7 @@ SVGScriptElement::SVGScriptElement(const QualifiedName& tagName, Document* doc, : SVGElement(tagName, doc) , SVGURIReference() , SVGExternalResourcesRequired() + , m_href(this, XLinkNames::hrefAttr) , m_data(this, this) { m_data.setCreatedByParser(createdByParser); @@ -209,7 +211,7 @@ void SVGScriptElement::dispatchLoadEvent() void SVGScriptElement::dispatchErrorEvent() { - dispatchEvent(eventNames().errorEvent, true, false); + dispatchEvent(Event::create(eventNames().errorEvent, true, false)); } } diff --git a/WebCore/svg/SVGScriptElement.h b/WebCore/svg/SVGScriptElement.h index f2efc8e..0fd85ff 100644 --- a/WebCore/svg/SVGScriptElement.h +++ b/WebCore/svg/SVGScriptElement.h @@ -73,6 +73,10 @@ namespace WebCore { virtual void dispatchErrorEvent(); private: + // SVGURIReference + ANIMATED_PROPERTY_DECLARATIONS(SVGScriptElement, SVGURIReferenceIdentifier, XLinkNames::hrefAttrString, String, Href, href) + + private: ScriptElementData m_data; String m_type; }; diff --git a/WebCore/svg/SVGStopElement.h b/WebCore/svg/SVGStopElement.h index bbfd770..5d14a40 100644 --- a/WebCore/svg/SVGStopElement.h +++ b/WebCore/svg/SVGStopElement.h @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005, 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org> 2004, 2005, 2006 Rob Buis <buis@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 @@ -24,6 +22,7 @@ #define SVGStopElement_h #if ENABLE(SVG) +#include "SVGNames.h" #include "SVGStyledElement.h" namespace WebCore { @@ -33,13 +32,13 @@ namespace WebCore { SVGStopElement(const QualifiedName&, Document*); virtual ~SVGStopElement(); + private: virtual bool isGradientStop() const { return true; } virtual void parseMappedAttribute(MappedAttribute*); virtual RenderObject* createRenderer(RenderArena*, RenderStyle*); - private: ANIMATED_PROPERTY_DECLARATIONS(SVGStopElement, SVGNames::stopTagString, SVGNames::offsetAttrString, float, Offset, offset) }; diff --git a/WebCore/svg/SVGStyleElement.cpp b/WebCore/svg/SVGStyleElement.cpp index 72f70e6..31f5920 100644 --- a/WebCore/svg/SVGStyleElement.cpp +++ b/WebCore/svg/SVGStyleElement.cpp @@ -2,6 +2,7 @@ Copyright (C) 2004, 2005 Nikolas Zimmermann <wildfox@kde.org> 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org> Copyright (C) 2006 Apple Computer, Inc. + Copyright (C) 2009 Cameron McCormack <cam@mcc.id.au> This file is part of the KDE project @@ -29,31 +30,21 @@ #include "CSSStyleSheet.h" #include "Document.h" #include "ExceptionCode.h" -#include "HTMLNames.h" #include "MappedAttribute.h" -#include "XMLNames.h" +#include "SVGNames.h" #include <wtf/StdLibExtras.h> namespace WebCore { -using namespace HTMLNames; +using namespace SVGNames; SVGStyleElement::SVGStyleElement(const QualifiedName& tagName, Document* doc, bool createdByParser) : SVGElement(tagName, doc) + , SVGLangSpace() , m_createdByParser(createdByParser) { } -const AtomicString& SVGStyleElement::xmlspace() const -{ - return getAttribute(XMLNames::spaceAttr); -} - -void SVGStyleElement::setXmlspace(const AtomicString&, ExceptionCode& ec) -{ - ec = NO_MODIFICATION_ALLOWED_ERR; -} - const AtomicString& SVGStyleElement::type() const { DEFINE_STATIC_LOCAL(const AtomicString, defaultValue, ("text/css")); @@ -61,9 +52,9 @@ const AtomicString& SVGStyleElement::type() const return n.isNull() ? defaultValue : n; } -void SVGStyleElement::setType(const AtomicString&, ExceptionCode& ec) +void SVGStyleElement::setType(const AtomicString& type, ExceptionCode& ec) { - ec = NO_MODIFICATION_ALLOWED_ERR; + setAttribute(typeAttr, type, ec); } const AtomicString& SVGStyleElement::media() const @@ -73,9 +64,9 @@ const AtomicString& SVGStyleElement::media() const return n.isNull() ? defaultValue : n; } -void SVGStyleElement::setMedia(const AtomicString&, ExceptionCode& ec) +void SVGStyleElement::setMedia(const AtomicString& media, ExceptionCode& ec) { - ec = NO_MODIFICATION_ALLOWED_ERR; + setAttribute(mediaAttr, media, ec); } String SVGStyleElement::title() const @@ -83,17 +74,20 @@ String SVGStyleElement::title() const return getAttribute(titleAttr); } -void SVGStyleElement::setTitle(const AtomicString&, ExceptionCode& ec) +void SVGStyleElement::setTitle(const AtomicString& title, ExceptionCode& ec) { - ec = NO_MODIFICATION_ALLOWED_ERR; + setAttribute(titleAttr, title, ec); } void SVGStyleElement::parseMappedAttribute(MappedAttribute* attr) { if (attr->name() == titleAttr && m_sheet) m_sheet->setTitle(attr->value()); - else + else { + if (SVGLangSpace::parseMappedAttribute(attr)) + return; SVGElement::parseMappedAttribute(attr); + } } void SVGStyleElement::finishParsingChildren() diff --git a/WebCore/svg/SVGStyleElement.h b/WebCore/svg/SVGStyleElement.h index 48afdb1..3853fb3 100644 --- a/WebCore/svg/SVGStyleElement.h +++ b/WebCore/svg/SVGStyleElement.h @@ -25,11 +25,14 @@ #if ENABLE(SVG) #include <SVGElement.h> +#include "SVGLangSpace.h" #include "StyleElement.h" namespace WebCore { - class SVGStyleElement : public SVGElement, public StyleElement { + class SVGStyleElement : public SVGElement, + public SVGLangSpace, + public StyleElement { public: SVGStyleElement(const QualifiedName&, Document*, bool createdByParser); @@ -41,10 +44,6 @@ namespace WebCore { virtual void finishParsingChildren(); - // 'SVGStyleElement' functions - const AtomicString& xmlspace() const; - void setXmlspace(const AtomicString&, ExceptionCode&); - virtual bool sheetLoaded(); virtual const AtomicString& type() const; diff --git a/WebCore/svg/SVGStyleElement.idl b/WebCore/svg/SVGStyleElement.idl index e87b79f..e47ed1d 100644 --- a/WebCore/svg/SVGStyleElement.idl +++ b/WebCore/svg/SVGStyleElement.idl @@ -26,9 +26,8 @@ module svg { - interface [Conditional=SVG] SVGStyleElement : SVGElement { - attribute core::DOMString xmlspace - setter raises(DOMException); + interface [Conditional=SVG] SVGStyleElement : SVGElement, + SVGLangSpace { attribute core::DOMString type setter raises(DOMException); attribute core::DOMString media diff --git a/WebCore/svg/SVGTRefElement.cpp b/WebCore/svg/SVGTRefElement.cpp index 872e7c8..5b8640a 100644 --- a/WebCore/svg/SVGTRefElement.cpp +++ b/WebCore/svg/SVGTRefElement.cpp @@ -35,6 +35,7 @@ namespace WebCore { SVGTRefElement::SVGTRefElement(const QualifiedName& tagName, Document* doc) : SVGTextPositioningElement(tagName, doc) , SVGURIReference() + , m_href(this, XLinkNames::hrefAttr) { } diff --git a/WebCore/svg/SVGTRefElement.h b/WebCore/svg/SVGTRefElement.h index 88eeef1..63f5fac 100644 --- a/WebCore/svg/SVGTRefElement.h +++ b/WebCore/svg/SVGTRefElement.h @@ -45,6 +45,9 @@ namespace WebCore { private: void updateReferencedText(); + + // SVGURIReference + ANIMATED_PROPERTY_DECLARATIONS(SVGTRefElement, SVGURIReferenceIdentifier, XLinkNames::hrefAttrString, String, Href, href) }; } // namespace WebCore diff --git a/WebCore/svg/SVGTextPathElement.cpp b/WebCore/svg/SVGTextPathElement.cpp index 54a4aa2..ebbb628 100644 --- a/WebCore/svg/SVGTextPathElement.cpp +++ b/WebCore/svg/SVGTextPathElement.cpp @@ -41,6 +41,7 @@ SVGTextPathElement::SVGTextPathElement(const QualifiedName& tagName, Document* d , m_startOffset(this, SVGNames::startOffsetAttr, LengthModeOther) , m_method(this, SVGNames::methodAttr, SVG_TEXTPATH_METHODTYPE_ALIGN) , m_spacing(this, SVGNames::spacingAttr, SVG_TEXTPATH_SPACINGTYPE_EXACT) + , m_href(this, XLinkNames::hrefAttr) { } diff --git a/WebCore/svg/SVGTextPathElement.h b/WebCore/svg/SVGTextPathElement.h index 4e8899a..3266814 100644 --- a/WebCore/svg/SVGTextPathElement.h +++ b/WebCore/svg/SVGTextPathElement.h @@ -71,6 +71,9 @@ namespace WebCore { ANIMATED_PROPERTY_DECLARATIONS(SVGTextPathElement, SVGNames::textPathTagString, SVGNames::startOffsetAttrString, SVGLength, StartOffset, startOffset) ANIMATED_PROPERTY_DECLARATIONS(SVGTextPathElement, SVGNames::textPathTagString, SVGNames::methodAttrString, int, Method, method) ANIMATED_PROPERTY_DECLARATIONS(SVGTextPathElement, SVGNames::textPathTagString, SVGNames::spacingAttrString, int, Spacing, spacing) + + // SVGURIReference + ANIMATED_PROPERTY_DECLARATIONS(SVGTextPathElement, SVGURIReferenceIdentifier, XLinkNames::hrefAttrString, String, Href, href) }; } // namespace WebCore diff --git a/WebCore/svg/SVGURIReference.cpp b/WebCore/svg/SVGURIReference.cpp index 8871229..24febc3 100644 --- a/WebCore/svg/SVGURIReference.cpp +++ b/WebCore/svg/SVGURIReference.cpp @@ -30,7 +30,6 @@ namespace WebCore { char SVGURIReferenceIdentifier[] = "SVGURIReference"; SVGURIReference::SVGURIReference() - : m_href(this, XLinkNames::hrefAttr) { } diff --git a/WebCore/svg/SVGURIReference.h b/WebCore/svg/SVGURIReference.h index 35ac640..812fb59 100644 --- a/WebCore/svg/SVGURIReference.h +++ b/WebCore/svg/SVGURIReference.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2004, 2005, 2008 Nikolas Zimmermann <zimmermann@kde.org> + Copyright (C) 2004, 2005, 2008, 2009 Nikolas Zimmermann <zimmermann@kde.org> 2004, 2005 Rob Buis <buis@kde.org> This file is part of the KDE project @@ -42,10 +42,8 @@ namespace WebCore { static String getTarget(const String& url); - virtual const SVGElement* contextElement() const = 0; - - private: - ANIMATED_PROPERTY_DECLARATIONS(SVGURIReference, SVGURIReferenceIdentifier, XLinkNames::hrefAttrString, String, Href, href) + protected: + virtual void setHrefBaseValue(SVGAnimatedTypeValue<String>::DecoratedType type) = 0; }; } // namespace WebCore diff --git a/WebCore/svg/SVGUseElement.cpp b/WebCore/svg/SVGUseElement.cpp index b73a692..8a2d65f 100644 --- a/WebCore/svg/SVGUseElement.cpp +++ b/WebCore/svg/SVGUseElement.cpp @@ -1,6 +1,7 @@ /* Copyright (C) 2004, 2005, 2006, 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org> 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org> + Copyright (C) Research In Motion Limited 2009. All rights reserved. This file is part of the KDE project @@ -64,6 +65,7 @@ SVGUseElement::SVGUseElement(const QualifiedName& tagName, Document* doc) , m_y(this, SVGNames::yAttr, LengthModeHeight) , m_width(this, SVGNames::widthAttr, LengthModeWidth) , m_height(this, SVGNames::heightAttr, LengthModeHeight) + , m_href(this, XLinkNames::hrefAttr) { } @@ -158,6 +160,9 @@ void SVGUseElement::childrenChanged(bool changedByParser, Node* beforeChange, No static bool shadowTreeContainsChangedNodes(SVGElementInstance* target) { + if (!target) // when use is referencing an non-existing element, there will be no Instance tree built + return false; + if (target->needsUpdate()) return true; @@ -324,7 +329,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 = new SVGElementInstance(this, target); + m_targetElementInstance = SVGElementInstance::create(this, target); // Eventually enter recursion to build SVGElementInstance objects for the sub-tree children bool foundProblem = false; @@ -474,17 +479,17 @@ void SVGUseElement::buildInstanceTree(SVGElement* target, SVGElementInstance* ta continue; // Create SVGElementInstance object, for both container/non-container nodes. - SVGElementInstance* instancePtr = new SVGElementInstance(this, element); - targetInstance->appendChild(instancePtr); + RefPtr<SVGElementInstance> instancePtr = SVGElementInstance::create(this, element); + targetInstance->appendChild(instancePtr.get()); // Enter recursion, appending new instance tree nodes to the "instance" object. if (element->hasChildNodes()) - buildInstanceTree(element, instancePtr, foundProblem); + buildInstanceTree(element, instancePtr.get(), 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, foundProblem); + handleDeepUseReferencing(static_cast<SVGUseElement*>(element), instancePtr.get(), foundProblem); } // Spec: If the referenced object is itself a 'use', or if there are 'use' subelements within the referenced @@ -524,11 +529,11 @@ void SVGUseElement::handleDeepUseReferencing(SVGUseElement* use, SVGElementInsta } // Create an instance object, even if we're dealing with a cycle - SVGElementInstance* newInstance = new SVGElementInstance(this, target); + RefPtr<SVGElementInstance> newInstance = SVGElementInstance::create(this, target); targetInstance->appendChild(newInstance); // Eventually enter recursion to build SVGElementInstance objects for the sub-tree children - buildInstanceTree(target, newInstance, foundProblem); + buildInstanceTree(target, newInstance.get(), foundProblem); } void SVGUseElement::alterShadowTreeForSVGTag(SVGElement* target) @@ -768,18 +773,18 @@ void SVGUseElement::transferEventListenersToShadowTree(SVGElementInstance* targe ASSERT(originalElement); if (SVGElement* shadowTreeElement = target->shadowTreeElement()) { - const RegisteredEventListenerVector& listeners = originalElement->eventListeners(); - size_t size = listeners.size(); - for (size_t i = 0; i < size; ++i) { - const RegisteredEventListener& r = *listeners[i]; - EventListener* listener = r.listener(); - ASSERT(listener); - - // Event listeners created from markup have already been transfered to the shadow tree during cloning! - if (listener->wasCreatedFromMarkup()) - continue; - - shadowTreeElement->addEventListener(r.eventType(), listener, r.useCapture()); + if (EventTargetData* d = originalElement->eventTargetData()) { + EventListenerMap& map = d->eventListenerMap; + EventListenerMap::iterator end = map.end(); + for (EventListenerMap::iterator it = map.begin(); it != end; ++it) { + EventListenerVector& entry = it->second; + for (size_t i = 0; i < entry.size(); ++i) { + // Event listeners created from markup have already been transfered to the shadow tree during cloning. + if (entry[i].listener->wasCreatedFromMarkup()) + continue; + shadowTreeElement->addEventListener(it->first, entry[i].listener, entry[i].useCapture); + } + } } } diff --git a/WebCore/svg/SVGUseElement.h b/WebCore/svg/SVGUseElement.h index 1e5b81c..3eedf21 100644 --- a/WebCore/svg/SVGUseElement.h +++ b/WebCore/svg/SVGUseElement.h @@ -77,6 +77,9 @@ namespace WebCore { ANIMATED_PROPERTY_DECLARATIONS(SVGUseElement, SVGNames::useTagString, SVGNames::widthAttrString, SVGLength, Width, width) ANIMATED_PROPERTY_DECLARATIONS(SVGUseElement, SVGNames::useTagString, SVGNames::heightAttrString, SVGLength, Height, height) + // SVGURIReference + ANIMATED_PROPERTY_DECLARATIONS(SVGUseElement, SVGURIReferenceIdentifier, XLinkNames::hrefAttrString, String, Href, href) + private: // Instance tree handling void buildInstanceTree(SVGElement* target, SVGElementInstance* targetInstance, bool& foundCycle); diff --git a/WebCore/svg/animation/SVGSMILElement.cpp b/WebCore/svg/animation/SVGSMILElement.cpp index 63a0d82..3957b81 100644 --- a/WebCore/svg/animation/SVGSMILElement.cpp +++ b/WebCore/svg/animation/SVGSMILElement.cpp @@ -61,6 +61,15 @@ public: return adoptRef(new ConditionEventListener(animation, eventBase, condition)); } + static const ConditionEventListener* cast(const EventListener* listener) + { + return listener->type() == ConditionEventListenerType + ? static_cast<const ConditionEventListener*>(listener) + : 0; + } + + virtual bool operator==(const EventListener& other); + void unregister() { // If this has only one ref then the event base is dead already and we don't need to remove ourself. @@ -68,25 +77,37 @@ public: m_eventBase->removeEventListener(m_condition->m_name, this, false); } - virtual void handleEvent(Event* event, bool) - { - m_animation->handleConditionEvent(event, m_condition); - } - private: ConditionEventListener(SVGSMILElement* animation, Element* eventBase, SVGSMILElement::Condition* condition) - : m_animation(animation) + : EventListener(ConditionEventListenerType) + , m_animation(animation) , m_condition(condition) , m_eventBase(eventBase) { m_eventBase->addEventListener(m_condition->m_name, this, false); } + virtual void handleEvent(ScriptExecutionContext*, Event*); + SVGSMILElement* m_animation; SVGSMILElement::Condition* m_condition; Element* m_eventBase; }; - + +bool ConditionEventListener::operator==(const EventListener& listener) +{ + if (const ConditionEventListener* conditionEventListener = ConditionEventListener::cast(&listener)) + return m_animation == conditionEventListener->m_animation + && m_condition == conditionEventListener->m_condition + && m_eventBase == conditionEventListener->m_eventBase; + return false; +} + +void ConditionEventListener::handleEvent(ScriptExecutionContext*, Event* event) +{ + m_animation->handleConditionEvent(event, m_condition); +} + SVGSMILElement::Condition::Condition(Type type, BeginOrEnd beginOrEnd, const String& baseID, const String& name, SMILTime offset, int repeats) : m_type(type) , m_beginOrEnd(beginOrEnd) diff --git a/WebCore/svg/graphics/SVGImage.cpp b/WebCore/svg/graphics/SVGImage.cpp index 64eb0e7..dc63582 100644 --- a/WebCore/svg/graphics/SVGImage.cpp +++ b/WebCore/svg/graphics/SVGImage.cpp @@ -228,26 +228,35 @@ bool SVGImage::dataChanged(bool allDataReceived) if (allDataReceived) { static FrameLoaderClient* dummyFrameLoaderClient = new EmptyFrameLoaderClient; static EditorClient* dummyEditorClient = new EmptyEditorClient; +#if ENABLE(CONTEXT_MENUS) static ContextMenuClient* dummyContextMenuClient = new EmptyContextMenuClient; +#else + static ContextMenuClient* dummyContextMenuClient = 0; +#endif +#if ENABLE(DRAG_SUPPORT) static DragClient* dummyDragClient = new EmptyDragClient; +#else + static DragClient* dummyDragClient = 0; +#endif static InspectorClient* dummyInspectorClient = new EmptyInspectorClient; + static PluginHalterClient* dummyPluginHalterClient = new EmptyPluginHalterClient; m_chromeClient.set(new SVGImageChromeClient(this)); // FIXME: If this SVG ends up loading itself, we might leak the world. - // THe comment said that the Cache code does not know about CachedImages + // The comment said that the Cache code does not know about CachedImages // holding Frames and won't know to break the cycle. But - m_page.set(new Page(m_chromeClient.get(), dummyContextMenuClient, dummyEditorClient, dummyDragClient, dummyInspectorClient)); + m_page.set(new Page(m_chromeClient.get(), dummyContextMenuClient, dummyEditorClient, dummyDragClient, dummyInspectorClient, dummyPluginHalterClient)); m_page->settings()->setJavaScriptEnabled(false); m_page->settings()->setPluginsEnabled(false); RefPtr<Frame> frame = Frame::create(m_page.get(), 0, dummyFrameLoaderClient); frame->setView(FrameView::create(frame.get())); frame->init(); - ResourceRequest fakeRequest(KURL("")); + ResourceRequest fakeRequest(KURL(ParsedURLString, "")); FrameLoader* loader = frame->loader(); loader->load(fakeRequest, false); // Make sure the DocumentLoader is created - loader->cancelContentPolicyCheck(); // cancel any policy checks + loader->policyChecker()->cancelCheck(); // cancel any policy checks loader->commitProvisionalLoad(0); loader->setResponseMIMEType("image/svg+xml"); loader->begin(KURL()); // create the empty document diff --git a/WebCore/svg/graphics/SVGResourceMasker.cpp b/WebCore/svg/graphics/SVGResourceMasker.cpp index d6c401b..97467c1 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->getImageData(intImageRect)->data()); - PassRefPtr<ImageData> destImageData(luminancedImage->getImageData(intImageRect)); + PassRefPtr<CanvasPixelArray> srcPixelArray(m_mask->getUnmultipliedImageData(intImageRect)->data()); + PassRefPtr<ImageData> destImageData(luminancedImage->getUnmultipliedImageData(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->putImageData(destImageData.get(), intImageRect, IntPoint(0, 0)); + luminancedImage->putUnmultipliedImageData(destImageData.get(), intImageRect, IntPoint(0, 0)); context->clipToImageBuffer(m_maskRect, luminancedImage.get()); } diff --git a/WebCore/svg/graphics/cairo/SVGResourceFilterCairo.cpp b/WebCore/svg/graphics/cairo/SVGResourceFilterCairo.cpp deleted file mode 100644 index a27038a..0000000 --- a/WebCore/svg/graphics/cairo/SVGResourceFilterCairo.cpp +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (C) 2008 Collabora Ltd. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser 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 - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; 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) && ENABLE(SVG_FILTERS) - -#include "NotImplemented.h" -#include "SVGResourceFilter.h" - -namespace WebCore { - -SVGResourceFilterPlatformData* SVGResourceFilter::createPlatformData() -{ - notImplemented(); - return 0; -} - -void SVGResourceFilter::prepareFilter(GraphicsContext*&, const FloatRect&) -{ - notImplemented(); -} - -void SVGResourceFilter::applyFilter(GraphicsContext*&, const FloatRect&) -{ - notImplemented(); -} - -} // namespace WebCore - -#endif - diff --git a/WebCore/svg/graphics/cg/SVGResourceFilterCg.cpp b/WebCore/svg/graphics/cg/SVGResourceFilterCg.cpp deleted file mode 100644 index ecfcdd8..0000000 --- a/WebCore/svg/graphics/cg/SVGResourceFilterCg.cpp +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (C) 2005, 2006, 2007 Apple Inc. All rights reserved. - * Copyright (C) 2006 Dave MacLachlan (dmaclach@mac.com) - * 2006 Rob Buis <buis@kde.org> - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``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 APPLE COMPUTER, INC. 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) && ENABLE(SVG_FILTERS) -#include "NotImplemented.h" -#include "SVGResourceFilter.h" - -namespace WebCore { - -SVGResourceFilterPlatformData* SVGResourceFilter::createPlatformData() -{ - return 0; -} - -void SVGResourceFilter::prepareFilter(GraphicsContext*&, const FloatRect&) -{ - notImplemented(); -} - -void SVGResourceFilter::applyFilter(GraphicsContext*&, const FloatRect&) -{ - notImplemented(); -} - -} - -#endif // ENABLE(SVG) && ENABLE(SVG_FILTERS) diff --git a/WebCore/svg/graphics/cg/SVGResourceFilterCg.mm b/WebCore/svg/graphics/cg/SVGResourceFilterCg.mm deleted file mode 100644 index a89ec1d..0000000 --- a/WebCore/svg/graphics/cg/SVGResourceFilterCg.mm +++ /dev/null @@ -1,143 +0,0 @@ -/* - * Copyright (C) 2005 Apple Computer, Inc. All rights reserved. - * (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``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 APPLE COMPUTER, INC. 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) && ENABLE(SVG_FILTERS) -#include "SVGResourceFilter.h" - -#include "TransformationMatrix.h" -#include "GraphicsContext.h" - -#include "SVGResourceFilterPlatformDataMac.h" - -#include <QuartzCore/CoreImage.h> - -// Setting to a value > 0 allows to dump the output image as JPEG. -#define DEBUG_OUTPUT_IMAGE 0 - -namespace WebCore { - -SVGResourceFilterPlatformData* SVGResourceFilter::createPlatformData() -{ - return new SVGResourceFilterPlatformDataMac(this); -} - -void SVGResourceFilter::prepareFilter(GraphicsContext*& context, const FloatRect& bbox) -{ - if (bbox.isEmpty() || m_effects.isEmpty()) - return; - - SVGResourceFilterPlatformDataMac* platform = static_cast<SVGResourceFilterPlatformDataMac*>(platformData()); - - CGContextRef cgContext = context->platformContext(); - - // Use of CGBegin/EndTransparencyLayer around this call causes over release - // of cgContext due to it being created on an autorelease pool, and released - // after CGEndTransparencyLayer. Create local pool to fix. - // <http://bugs.webkit.org/show_bug.cgi?id=8425> - // <http://bugs.webkit.org/show_bug.cgi?id=6947> - // <rdar://problem/4647735> - NSAutoreleasePool* filterContextPool = [[NSAutoreleasePool alloc] init]; - platform->m_filterCIContext = [CIContext contextWithCGContext:cgContext options:nil]; - [filterContextPool drain]; - - FloatRect filterRect = filterBBoxForItemBBox(bbox); - - // TODO: Ensure the size is not greater than the nearest <svg> size and/or the window size. - // This is also needed for masking & gradients-on-stroke-of-text. File a bug on this. - float width = filterRect.width(); - float height = filterRect.height(); - - platform->m_filterCGLayer = [platform->m_filterCIContext.get() createCGLayerWithSize:CGSizeMake(width, height) info:NULL]; - - context = new GraphicsContext(CGLayerGetContext(platform->m_filterCGLayer)); - context->save(); - - context->translate(-filterRect.x(), -filterRect.y()); -} - -#ifndef NDEBUG -// Extremly helpful debugging utilities for any paint server / resource that creates -// internal image buffers (ie. gradients on text, masks, filters...) -void dumpCIOutputImage(CIImage* outputImage, NSString* fileName) -{ - CGSize extentSize = [outputImage extent].size; - NSImage* image = [[[NSImage alloc] initWithSize:NSMakeSize(extentSize.width, extentSize.height)] autorelease]; - [image addRepresentation:[NSCIImageRep imageRepWithCIImage:outputImage]]; - - NSData* imageData = [image TIFFRepresentation]; - NSBitmapImageRep* imageRep = [NSBitmapImageRep imageRepWithData:imageData]; - imageData = [imageRep representationUsingType:NSJPEGFileType properties:nil]; - - [imageData writeToFile:fileName atomically:YES]; -} - -void dumpCGOutputImage(CGImage* outputImage, NSString* fileName) -{ - if (CIImage* ciOutputImage = [CIImage imageWithCGImage:outputImage]) - dumpCIOutputImage(ciOutputImage, fileName); -} -#endif - -void SVGResourceFilter::applyFilter(GraphicsContext*& context, const FloatRect& bbox) -{ - if (bbox.isEmpty() || m_effects.isEmpty()) - return; - - SVGResourceFilterPlatformDataMac* platform = static_cast<SVGResourceFilterPlatformDataMac*>(platformData()); - - // actually apply the filter effects - CIImage* inputImage = [CIImage imageWithCGLayer:platform->m_filterCGLayer]; - NSArray* filterStack = platform->getCIFilterStack(inputImage, bbox); - if ([filterStack count]) { - CIImage* outputImage = [[filterStack lastObject] valueForKey:@"outputImage"]; - - if (outputImage) { -#if DEBUG_OUTPUT_IMAGE > 0 - dumpOutputImage(outputImage); -#endif - - FloatRect filterRect = filterBBoxForItemBBox(bbox); - FloatPoint destOrigin = filterRect.location(); - filterRect.setLocation(FloatPoint(0.0f, 0.0f)); - - [platform->m_filterCIContext.get() drawImage:outputImage atPoint:CGPoint(destOrigin) fromRect:filterRect]; - } - } - - CGLayerRelease(platform->m_filterCGLayer); - platform->m_filterCGLayer = 0; - - platform->m_filterCIContext = 0; - - delete context; - context = 0; -} - -} - -#endif // ENABLE(SVG) ENABLE(SVG_FILTERS) diff --git a/WebCore/svg/graphics/filters/cg/SVGFEHelpersCg.h b/WebCore/svg/graphics/filters/cg/SVGFEHelpersCg.h deleted file mode 100644 index f35e028..0000000 --- a/WebCore/svg/graphics/filters/cg/SVGFEHelpersCg.h +++ /dev/null @@ -1,88 +0,0 @@ -/* - Copyright (C) 2006, 2007 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 - 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. -*/ - -#if ENABLE(SVG) && ENABLE(SVG_FILTERS) - -#include "BlockExceptions.h" -#include "SVGFEDisplacementMap.h" -#include "SVGResourceFilter.h" -#include "SVGResourceFilterPlatformDataMac.h" -#include <QuartzCore/CoreImage.h> -#include <wtf/MathExtras.h> - -class Color; -class LightSource; - -namespace WebCore { - -CIVector* getVectorForChannel(ChannelSelectorType channel); -CIColor* ciColor(const Color& c); - -// Lighting -CIFilter* getPointLightVectors(CIFilter* normals, CIVector* lightPosition, float surfaceScale); -CIFilter* getLightVectors(CIFilter* normals, const LightSource* light, float surfaceScale); -CIFilter* getNormalMap(CIImage* bumpMap, float scale); - -}; - -// Macros used by the SVGFE*Cg classes -#define FE_QUARTZ_SETUP_INPUT(name) \ - SVGResourceFilterPlatformDataMac* filterPlatformData = static_cast<SVGResourceFilterPlatformDataMac*>(svgFilter->platformData()); \ - CIImage* inputImage = filterPlatformData->inputImage(this); \ - FE_QUARTZ_CHECK_INPUT(inputImage) \ - CIFilter* filter; \ - BEGIN_BLOCK_OBJC_EXCEPTIONS; \ - filter = [CIFilter filterWithName:name]; \ - [filter setDefaults]; \ - [filter setValue:inputImage forKey:@"inputImage"]; - -#define FE_QUARTZ_CHECK_INPUT(input) \ - if (!input) \ - return nil; - -#define FE_QUARTZ_OUTPUT_RETURN \ - filterPlatformData->setOutputImage(this, [filter valueForKey:@"outputImage"]); \ - return filter; \ - END_BLOCK_OBJC_EXCEPTIONS; \ - return nil; - -#define FE_QUARTZ_MAP_TO_SUBREGION_PREPARE(bbox) \ - FloatRect filterRect = svgFilter->filterBBoxForItemBBox(bbox); \ - FloatRect cropRect = primitiveBBoxForFilterBBox(filterRect, bbox); \ - cropRect.intersect(filterRect); \ - cropRect.move(-filterRect.x(), -filterRect.y()); - -#define FE_QUARTZ_MAP_TO_SUBREGION_APPLY(cropRect) \ - { \ - CIFilter* crop = [CIFilter filterWithName:@"CICrop"]; \ - [crop setDefaults]; \ - if (CIImage* currentFilterOutputImage = [filter valueForKey:@"outputImage"]) { \ - [crop setValue:currentFilterOutputImage forKey:@"inputImage"]; \ - [crop setValue:[CIVector vectorWithX:cropRect.x() Y:cropRect.y() Z:cropRect.width() W:cropRect.height()] forKey:@"inputRectangle"]; \ - filter = crop; \ - } \ - } - -#define FE_QUARTZ_MAP_TO_SUBREGION(bbox) \ - FE_QUARTZ_MAP_TO_SUBREGION_PREPARE(bbox); \ - FE_QUARTZ_MAP_TO_SUBREGION_APPLY(cropRect); - -#endif // ENABLE(SVG) && ENABLE(SVG_FILTERS) diff --git a/WebCore/svg/graphics/filters/cg/SVGFEHelpersCg.mm b/WebCore/svg/graphics/filters/cg/SVGFEHelpersCg.mm deleted file mode 100644 index 399d4c1..0000000 --- a/WebCore/svg/graphics/filters/cg/SVGFEHelpersCg.mm +++ /dev/null @@ -1,162 +0,0 @@ -/* - Copyright (C) 2006 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 - 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) && ENABLE(SVG_FILTERS) -#include "SVGFEHelpersCg.h" - -#include "Color.h" -#include "SVGDistantLightSource.h" -#include "SVGLightSource.h" -#include "SVGPointLightSource.h" -#include "SVGSpotLightSource.h" - -#import "WKDistantLightFilter.h" -#import "WKNormalMapFilter.h" -#import "WKPointLightFilter.h" -#import "WKSpotLightFilter.h" - -#include <wtf/MathExtras.h> - -namespace WebCore { - -CIVector* getVectorForChannel(ChannelSelectorType channel) -{ - switch (channel) { - case CHANNEL_UNKNOWN: - return nil; - case CHANNEL_R: - return [CIVector vectorWithX:1.0f Y:0.0f Z:0.0f W:0.0f]; - case CHANNEL_G: - return [CIVector vectorWithX:0.0f Y:1.0f Z:0.0f W:0.0f]; - case CHANNEL_B: - return [CIVector vectorWithX:0.0f Y:0.0f Z:1.0f W:0.0f]; - case CHANNEL_A: - return [CIVector vectorWithX:0.0f Y:0.0f Z:0.0f W:1.0f]; - default: - return [CIVector vectorWithX:0.0f Y:0.0f Z:0.0f W:0.0f]; - } -} - -CIColor* ciColor(const Color& c) -{ - CGColorRef colorCG = createCGColor(c); - CIColor* colorCI = [CIColor colorWithCGColor:colorCG]; - CGColorRelease(colorCG); - return colorCI; -} - -// Lighting -CIFilter* getPointLightVectors(CIFilter* normals, CIVector* lightPosition, float surfaceScale) -{ - CIFilter* filter; - BEGIN_BLOCK_OBJC_EXCEPTIONS; - filter = [CIFilter filterWithName:@"WKPointLight"]; - if (!filter) - return nil; - [filter setDefaults]; - [filter setValue:[normals valueForKey:@"outputImage"] forKey:@"inputNormalMap"]; - [filter setValue:lightPosition forKey:@"inputLightPosition"]; - [filter setValue:[NSNumber numberWithFloat:surfaceScale] forKey:@"inputSurfaceScale"]; - return filter; - END_BLOCK_OBJC_EXCEPTIONS; - return nil; -} - -CIFilter* getLightVectors(CIFilter* normals, const LightSource* light, float surfaceScale) -{ - [WKDistantLightFilter class]; - [WKPointLightFilter class]; - [WKSpotLightFilter class]; - - CIFilter* filter = nil; - BEGIN_BLOCK_OBJC_EXCEPTIONS; - - switch (light->type()) { - case LS_DISTANT: - { - const DistantLightSource* dlight = static_cast<const DistantLightSource*>(light); - - filter = [CIFilter filterWithName:@"WKDistantLight"]; - if (!filter) - return nil; - [filter setDefaults]; - - float azimuth = dlight->azimuth(); - float elevation = dlight->elevation(); - azimuth = deg2rad(azimuth); - elevation = deg2rad(elevation); - float Lx = cosf(azimuth)*cosf(elevation); - float Ly = sinf(azimuth)*cosf(elevation); - float Lz = sinf(elevation); - - [filter setValue:[normals valueForKey:@"outputImage"] forKey:@"inputNormalMap"]; - [filter setValue:[CIVector vectorWithX:Lx Y:Ly Z:Lz] forKey:@"inputLightDirection"]; - return filter; - } - case LS_POINT: - { - const PointLightSource* plight = static_cast<const PointLightSource*>(light); - return getPointLightVectors(normals, [CIVector vectorWithX:plight->position().x() Y:plight->position().y() Z:plight->position().z()], surfaceScale); - } - case LS_SPOT: - { - const SpotLightSource* slight = static_cast<const SpotLightSource*>(light); - filter = [CIFilter filterWithName:@"WKSpotLight"]; - if (!filter) - return nil; - - CIFilter* pointLightFilter = getPointLightVectors(normals, [CIVector vectorWithX:slight->position().x() Y:slight->position().y() Z:slight->position().z()], surfaceScale); - if (!pointLightFilter) - return nil; - [filter setDefaults]; - - [filter setValue:[pointLightFilter valueForKey:@"outputImage"] forKey:@"inputLightVectors"]; - [filter setValue:[CIVector vectorWithX:slight->direction().x() Y:slight->direction().y() Z:slight->direction().z()] forKey:@"inputLightDirection"]; - [filter setValue:[NSNumber numberWithFloat:slight->specularExponent()] forKey:@"inputSpecularExponent"]; - [filter setValue:[NSNumber numberWithFloat:deg2rad(slight->limitingConeAngle())] forKey:@"inputLimitingConeAngle"]; - return filter; - } - } - - END_BLOCK_OBJC_EXCEPTIONS; - return nil; -} - -CIFilter* getNormalMap(CIImage* bumpMap, float scale) -{ - [WKNormalMapFilter class]; - CIFilter* filter; - BEGIN_BLOCK_OBJC_EXCEPTIONS; - filter = [CIFilter filterWithName:@"WKNormalMap"]; - [filter setDefaults]; - - [filter setValue:bumpMap forKey:@"inputImage"]; - [filter setValue:[NSNumber numberWithFloat:scale] forKey:@"inputSurfaceScale"]; - return filter; - END_BLOCK_OBJC_EXCEPTIONS; - return nil; -} - -} - -#endif // ENABLE(SVG) && ENABLE(SVG_FILTERS) diff --git a/WebCore/svg/graphics/filters/cg/SVGFilterEffectCg.mm b/WebCore/svg/graphics/filters/cg/SVGFilterEffectCg.mm deleted file mode 100644 index 4b0a233..0000000 --- a/WebCore/svg/graphics/filters/cg/SVGFilterEffectCg.mm +++ /dev/null @@ -1,37 +0,0 @@ -/* - Copyright (C) 2006 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 - 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) && ENABLE(SVG_FILTERS) - -#include "SVGFilterEffect.h" - -namespace WebCore { - -CIFilter* SVGFilterEffect::getCIFilter(const FloatRect& bbox) const -{ - return nil; -} - -} - -#endif // ENABLE(SVG) && ENABLE(SVG_FILTERS) diff --git a/WebCore/svg/graphics/filters/cg/WKArithmeticFilter.cikernel b/WebCore/svg/graphics/filters/cg/WKArithmeticFilter.cikernel deleted file mode 100644 index 3c32c3a..0000000 --- a/WebCore/svg/graphics/filters/cg/WKArithmeticFilter.cikernel +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (C) 2005 Oliver Hunt <ojh16@student.canterbury.ac.nz>. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. - */ - -kernel vec4 arithmeticComposite(sampler in1, sampler in2, float k1, float k2, float k3, float k4) -{ - vec4 vin1 = sample(in1, samplerCoord(in1)); - vec4 vin2 = sample(in2, samplerCoord(in2)); - vec4 res = k1*vin1*vin2 + k2*vin1 + k3*vin2 + vec4(k4); - return res; -} diff --git a/WebCore/svg/graphics/filters/cg/WKArithmeticFilter.h b/WebCore/svg/graphics/filters/cg/WKArithmeticFilter.h deleted file mode 100644 index 4693853..0000000 --- a/WebCore/svg/graphics/filters/cg/WKArithmeticFilter.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (C) 2005 Oliver Hunt <ojh16@student.canterbury.ac.nz>. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. - */ - -#import <QuartzCore/CoreImage.h> - -#if ENABLE(SVG) && ENABLE(SVG_FILTERS) - -@interface WKArithmeticFilter : CIFilter { - CIImage *inputImage; - CIImage *inputBackgroundImage; - NSNumber *inputK1; - NSNumber *inputK2; - NSNumber *inputK3; - NSNumber *inputK4; -} - -@end - -#endif // ENABLE(SVG) && ENABLE(SVG_FILTERS) diff --git a/WebCore/svg/graphics/filters/cg/WKArithmeticFilter.m b/WebCore/svg/graphics/filters/cg/WKArithmeticFilter.m deleted file mode 100644 index 389f25d..0000000 --- a/WebCore/svg/graphics/filters/cg/WKArithmeticFilter.m +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright (C) 2005 Oliver Hunt <ojh16@student.canterbury.ac.nz>. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. - */ - -#import "config.h" -#import "WKArithmeticFilter.h" - -#if ENABLE(SVG) && ENABLE(SVG_FILTERS) - -static CIKernel *arithmeticFilter = nil; - -@implementation WKArithmeticFilter -+ (void)initialize -{ - [CIFilter registerFilterName:@"WKArithmeticFilter" - constructor:self - classAttributes:[NSDictionary dictionaryWithObjectsAndKeys: - @"WebKit Arithmetic Filter", kCIAttributeFilterDisplayName, - [NSArray arrayWithObjects:kCICategoryStylize, kCICategoryVideo, - kCICategoryStillImage, kCICategoryNonSquarePixels,nil], kCIAttributeFilterCategories, - [NSDictionary dictionaryWithObjectsAndKeys: - [NSNumber numberWithDouble:0.0], kCIAttributeMin, - [NSNumber numberWithDouble:0.0], kCIAttributeDefault, - [NSNumber numberWithDouble:1.0], kCIAttributeIdentity, - kCIAttributeTypeScalar, kCIAttributeType, - nil], @"inputK1", - [NSDictionary dictionaryWithObjectsAndKeys: - [NSNumber numberWithDouble:0.0], kCIAttributeMin, - [NSNumber numberWithDouble:0.0], kCIAttributeDefault, - [NSNumber numberWithDouble:1.0], kCIAttributeIdentity, - kCIAttributeTypeScalar, kCIAttributeType, - nil], @"inputK2", - [NSDictionary dictionaryWithObjectsAndKeys: - [NSNumber numberWithDouble:0.0], kCIAttributeMin, - [NSNumber numberWithDouble:0.0], kCIAttributeDefault, - [NSNumber numberWithDouble:1.0], kCIAttributeIdentity, - kCIAttributeTypeScalar, kCIAttributeType, - nil], @"inputK3", - [NSDictionary dictionaryWithObjectsAndKeys: - [NSNumber numberWithDouble:0.0], kCIAttributeMin, - [NSNumber numberWithDouble:0.0], kCIAttributeDefault, - [NSNumber numberWithDouble:1.0], kCIAttributeIdentity, - kCIAttributeTypeScalar, kCIAttributeType, - nil], @"inputK4", - nil]]; -} - -+ (CIFilter *)filterWithName:(NSString *)name -{ - return [[[self alloc] init] autorelease]; -} - -- (id)init -{ - if (!arithmeticFilter) { - NSBundle *bundle = [NSBundle bundleForClass:[self class]]; - NSString *kernelFile = [bundle pathForResource:@"WKArithmeticFilter" ofType:@"cikernel"]; - NSString *code = [NSString stringWithContentsOfFile:kernelFile encoding:NSUTF8StringEncoding error:0]; - NSArray *kernels = [CIKernel kernelsWithString:code]; - arithmeticFilter = [[kernels objectAtIndex:0] retain]; - } - return [super init]; -} - -- (CIImage *)outputImage -{ - return [self apply:arithmeticFilter, inputImage, inputBackgroundImage, inputK1, inputK2, inputK3, - inputK4, nil]; -} - -@end - -#endif // ENABLE(SVG) && ENABLE(SVG_FILTERS) diff --git a/WebCore/svg/graphics/filters/cg/WKComponentMergeFilter.cikernel b/WebCore/svg/graphics/filters/cg/WKComponentMergeFilter.cikernel deleted file mode 100644 index f33f20c..0000000 --- a/WebCore/svg/graphics/filters/cg/WKComponentMergeFilter.cikernel +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (C) 2006 Oliver Hunt <ojh16@student.canterbury.ac.nz>. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. - */ - -kernel vec4 mergeComponents(sampler funcR, sampler funcG, sampler funcB, sampler funcA) -{ - float r = sample(funcR, samplerCoord(funcR)).r; - float g = sample(funcG, samplerCoord(funcG)).g; - float b = sample(funcB, samplerCoord(funcB)).b; - float a = sample(funcA, samplerCoord(funcA)).a; - return vec4(r, g, b, a); -} diff --git a/WebCore/svg/graphics/filters/cg/WKComponentMergeFilter.h b/WebCore/svg/graphics/filters/cg/WKComponentMergeFilter.h deleted file mode 100644 index 778e326..0000000 --- a/WebCore/svg/graphics/filters/cg/WKComponentMergeFilter.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (C) 2006 Oliver Hunt <ojh16@student.canterbury.ac.nz>. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. - */ - -#import <QuartzCore/CoreImage.h> - -#if ENABLE(SVG) && ENABLE(SVG_FILTERS) - -@interface WKComponentMergeFilter : CIFilter { - CIImage *inputFuncR; - CIImage *inputFuncG; - CIImage *inputFuncB; - CIImage *inputFuncA; -} - -@end - -#endif // ENABLE(SVG) && ENABLE(SVG_FILTERS) diff --git a/WebCore/svg/graphics/filters/cg/WKComponentMergeFilter.m b/WebCore/svg/graphics/filters/cg/WKComponentMergeFilter.m deleted file mode 100644 index 4f2045a..0000000 --- a/WebCore/svg/graphics/filters/cg/WKComponentMergeFilter.m +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (C) 2006 Oliver Hunt <ojh16@student.canterbury.ac.nz>. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. - */ - -#import "config.h" -#import "WKComponentMergeFilter.h" - -#if ENABLE(SVG) && ENABLE(SVG_FILTERS) - -static CIKernel *componentMergeFilter = nil; - -@implementation WKComponentMergeFilter -+ (void)initialize -{ - [CIFilter registerFilterName:@"WKComponentMerge" - constructor:self - classAttributes:[NSDictionary dictionaryWithObjectsAndKeys: - @"WebKit Component Merge", kCIAttributeFilterDisplayName, - [NSArray arrayWithObjects:kCICategoryStylize, kCICategoryVideo, - kCICategoryStillImage, kCICategoryNonSquarePixels,nil], kCIAttributeFilterCategories, - nil]]; -} - -+ (CIFilter *)filterWithName:(NSString *)name -{ - return [[[self alloc] init] autorelease]; -} - -- (id)init -{ - if (!componentMergeFilter) { - NSBundle *bundle = [NSBundle bundleForClass:[self class]]; - NSString *kernelFile = [bundle pathForResource:@"WKComponentMergeFilter" ofType:@"cikernel"]; - NSString *code = [NSString stringWithContentsOfFile:kernelFile encoding:NSUTF8StringEncoding error:0]; - NSArray *kernels = [CIKernel kernelsWithString:code]; - componentMergeFilter = [[kernels objectAtIndex:0] retain]; - } - return [super init]; -} - -- (CIImage *)outputImage -{ - return [self apply:componentMergeFilter, [CISampler samplerWithImage: inputFuncR], - [CISampler samplerWithImage: inputFuncG], [CISampler samplerWithImage: inputFuncB], [CISampler samplerWithImage: inputFuncA], @"definition", [inputFuncR definition], nil]; -} - -@end - -#endif // ENABLE(SVG) && ENABLE(SVG_FILTERS) diff --git a/WebCore/svg/graphics/filters/cg/WKDiffuseLightingFilter.cikernel b/WebCore/svg/graphics/filters/cg/WKDiffuseLightingFilter.cikernel deleted file mode 100644 index 870956a..0000000 --- a/WebCore/svg/graphics/filters/cg/WKDiffuseLightingFilter.cikernel +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (C) 2005 Oliver Hunt <ojh16@student.canterbury.ac.nz>. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. - */ - -kernel vec4 diffuseLighting(sampler normalVectors, sampler lightVectors, __color lightingColor, - float surfaceScale, float diffuseConstant, float kernelLengthX, float kernelLengthY) -{ - vec2 pos = samplerCoord(lightVectors); - vec2 posn = samplerCoord(normalVectors); - vec4 l4 = sample(lightVectors, pos); - vec3 l = l4.xyz; - l = normalize(l); - vec3 n = sample(normalVectors, posn).xyz; - float nl = dot(l, n) * diffuseConstant; - vec4 res = vec4(lightingColor.r * nl, lightingColor.g * nl, lightingColor.b * nl, 1.0); - res.xyz *= l4.w; - return res; -} diff --git a/WebCore/svg/graphics/filters/cg/WKDiffuseLightingFilter.h b/WebCore/svg/graphics/filters/cg/WKDiffuseLightingFilter.h deleted file mode 100644 index 2731986..0000000 --- a/WebCore/svg/graphics/filters/cg/WKDiffuseLightingFilter.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (C) 2005 Apple Computer, 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: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``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 APPLE COMPUTER, INC. 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. - */ - -#import <QuartzCore/CoreImage.h> - -#if ENABLE(SVG) && ENABLE(SVG_FILTERS) - -@interface WKDiffuseLightingFilter : CIFilter { - CISampler *inputNormalMap; - CISampler *inputLightVectors; - CIColor *inputLightingColor; - NSNumber *inputSurfaceScale; - NSNumber *inputDiffuseConstant; - NSNumber *inputKernelUnitLengthX; - NSNumber *inputKernelUnitLengthY; -} -@end - -#endif // ENABLE(SVG) && ENABLE(SVG_FILTERS) diff --git a/WebCore/svg/graphics/filters/cg/WKDiffuseLightingFilter.m b/WebCore/svg/graphics/filters/cg/WKDiffuseLightingFilter.m deleted file mode 100644 index 3675af8..0000000 --- a/WebCore/svg/graphics/filters/cg/WKDiffuseLightingFilter.m +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Copyright (C) 2005 Apple Computer, 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: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``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 APPLE COMPUTER, INC. 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. - */ - -#import "config.h" -#import "WKDiffuseLightingFilter.h" - -#if ENABLE(SVG) && ENABLE(SVG_FILTERS) - -static CIKernel *diffuseLightingFilter = nil; -@implementation WKDiffuseLightingFilter - -+ (void)initialize -{ - [CIFilter registerFilterName:@"WKDiffuseLighting" - constructor:self - classAttributes:[NSDictionary dictionaryWithObjectsAndKeys: - @"WebKit Diffuse Lighting", kCIAttributeFilterDisplayName, - [NSArray arrayWithObjects:kCICategoryStylize, kCICategoryVideo, - kCICategoryStillImage, kCICategoryNonSquarePixels,nil], kCIAttributeFilterCategories, - [NSDictionary dictionaryWithObjectsAndKeys: - [CIColor colorWithRed:1.0f green:1.0f blue:1.0f alpha:1.0f], - kCIAttributeDefault, nil], @"inputLightingColor", - [NSDictionary dictionaryWithObjectsAndKeys: - [NSNumber numberWithDouble:0.0], kCIAttributeMin, - [NSNumber numberWithDouble:1.0], kCIAttributeDefault, - [NSNumber numberWithDouble:1.0], kCIAttributeIdentity, - kCIAttributeTypeScalar, kCIAttributeType, - nil], @"inputSurfaceScale", - [NSDictionary dictionaryWithObjectsAndKeys: - [NSNumber numberWithDouble:0.0], kCIAttributeMin, - [NSNumber numberWithDouble:1.0], kCIAttributeDefault, - [NSNumber numberWithDouble:1.0], kCIAttributeIdentity, - kCIAttributeTypeScalar, kCIAttributeType, - nil], @"inputDiffuseConstant", - [NSDictionary dictionaryWithObjectsAndKeys: - [NSNumber numberWithDouble:0.0], kCIAttributeMin, - [NSNumber numberWithDouble:1.0], kCIAttributeDefault, - [NSNumber numberWithDouble:1.0], kCIAttributeIdentity, - kCIAttributeTypeScalar, kCIAttributeType, - nil], @"inputKernelUnitLengthX", - [NSDictionary dictionaryWithObjectsAndKeys: - [NSNumber numberWithDouble:0.0], kCIAttributeMin, - [NSNumber numberWithDouble:1.0], kCIAttributeDefault, - [NSNumber numberWithDouble:1.0], kCIAttributeIdentity, - kCIAttributeTypeScalar, kCIAttributeType, - nil], @"inputKernelUnitLengthY", - nil]]; -} - -+ (CIFilter *)filterWithName:(NSString *)name -{ - return [[[self alloc] init] autorelease]; -} - -- (id)init -{ - if (!diffuseLightingFilter) { - NSBundle *bundle = [NSBundle bundleForClass:[self class]]; - NSString *kernelFile = [bundle pathForResource:@"WKDiffuseLightingFilter" ofType:@"cikernel"]; - NSString *code = [NSString stringWithContentsOfFile:kernelFile encoding:NSUTF8StringEncoding error:0]; - NSArray *kernels = [CIKernel kernelsWithString:code]; - diffuseLightingFilter = [[kernels objectAtIndex:0] retain]; - } - return [super init]; -} - -- (CIImage *)outputImage -{ - return [self apply:diffuseLightingFilter, inputNormalMap, inputLightVectors, inputLightingColor, inputSurfaceScale, inputDiffuseConstant, - inputKernelUnitLengthX, inputKernelUnitLengthY, nil]; -} - -@end - -#endif // ENABLE(SVG) && ENABLE(SVG_FILTERS) diff --git a/WebCore/svg/graphics/filters/cg/WKDiscreteTransferFilter.cikernel b/WebCore/svg/graphics/filters/cg/WKDiscreteTransferFilter.cikernel deleted file mode 100644 index db3cefd..0000000 --- a/WebCore/svg/graphics/filters/cg/WKDiscreteTransferFilter.cikernel +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (C) 2006 Oliver Hunt <ojh16@student.canterbury.ac.nz>. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. - */ - -kernel vec4 discreteTransfer(sampler image, sampler table, vec4 rgbaSelector, float maxIndex) -{ - vec4 C = sample(image, samplerCoord(image)); - float k = floor(dot(rgbaSelector, C) * maxIndex); - vec4 res = sample(table, vec2(k+0.0, 0.0)); - return res; -} diff --git a/WebCore/svg/graphics/filters/cg/WKDiscreteTransferFilter.h b/WebCore/svg/graphics/filters/cg/WKDiscreteTransferFilter.h deleted file mode 100644 index d444c75..0000000 --- a/WebCore/svg/graphics/filters/cg/WKDiscreteTransferFilter.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (C) 2006 Oliver Hunt <ojh16@student.canterbury.ac.nz>. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. - */ - -#import <QuartzCore/CoreImage.h> - -#if ENABLE(SVG) && ENABLE(SVG_FILTERS) - -@interface WKDiscreteTransferFilter : CIFilter { - CIImage *inputImage; - CIImage *inputTable; - CIVector *inputSelector; -} - -@end - -#endif // ENABLE(SVG) && ENABLE(SVG_FILTERS) diff --git a/WebCore/svg/graphics/filters/cg/WKDiscreteTransferFilter.m b/WebCore/svg/graphics/filters/cg/WKDiscreteTransferFilter.m deleted file mode 100644 index dc6ca76..0000000 --- a/WebCore/svg/graphics/filters/cg/WKDiscreteTransferFilter.m +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (C) 2006 Oliver Hunt <ojh16@student.canterbury.ac.nz>. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. - */ - -#import "config.h" -#import "WKDiscreteTransferFilter.h" - -#if ENABLE(SVG) && ENABLE(SVG_FILTERS) - -static CIKernel *discreteTransferFilter = nil; - -@implementation WKDiscreteTransferFilter -+ (void)initialize -{ - [CIFilter registerFilterName:@"WKDiscreteTransfer" - constructor:self - classAttributes:[NSDictionary dictionaryWithObjectsAndKeys: - @"WebKit Discrete Transfer", kCIAttributeFilterDisplayName, - [NSArray arrayWithObjects:kCICategoryStylize, kCICategoryVideo, - kCICategoryStillImage, kCICategoryNonSquarePixels,nil], kCIAttributeFilterCategories, - nil]]; -} - -+ (CIFilter *)filterWithName:(NSString *)name -{ - return [[[self alloc] init] autorelease]; -} - -- (id)init -{ - if (!discreteTransferFilter) { - NSBundle *bundle = [NSBundle bundleForClass:[self class]]; - NSString *kernelFile = [bundle pathForResource:@"WKDiscreteTransferFilter" ofType:@"cikernel"]; - NSString *code = [NSString stringWithContentsOfFile:kernelFile encoding:NSUTF8StringEncoding error:0]; - NSArray *kernels = [CIKernel kernelsWithString:code]; - discreteTransferFilter = [[kernels objectAtIndex:0] retain]; - } - return [super init]; -} - -- (CIImage *)outputImage -{ - CISampler *inputSampler = [CISampler samplerWithImage: inputImage]; - CISampler *tableSampler = [CISampler samplerWithImage: inputTable keysAndValues:kCISamplerFilterMode, kCISamplerFilterNearest, kCISamplerWrapMode, kCISamplerWrapClamp, nil]; - NSArray *args = [NSArray arrayWithObjects:inputSampler, tableSampler, inputSelector, - [NSNumber numberWithDouble:[inputTable extent].size.width - 1.0f], @"definition", [inputSampler definition], nil]; - return [self apply:discreteTransferFilter arguments:args options:nil]; -} - -@end - -#endif // ENABLE(SVG) && ENABLE(SVG_FILTERS) diff --git a/WebCore/svg/graphics/filters/cg/WKDisplacementMapFilter.cikernel b/WebCore/svg/graphics/filters/cg/WKDisplacementMapFilter.cikernel deleted file mode 100644 index 95b19c6..0000000 --- a/WebCore/svg/graphics/filters/cg/WKDisplacementMapFilter.cikernel +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (C) 2006 Oliver Hunt <ojh16@student.canterbury.ac.nz>. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. - */ - -/* - * Performs the transformation: - * P'(x,y) <- P( x + scale * (XC(x,y) - .5), y + scale * (YC(x,y) - .5)) - * - * x/ychannel arguments are used to select the appropriate channel for x and - * y displacement. Hence each vector should have only one non-zero element, - * which should have the value 1.0. - * - */ - -kernel vec4 displacementMap(sampler image, sampler map, vec4 xchannel, vec4 ychannel, float scale) -{ - vec2 samplePos = samplerCoord(image); - vec4 XCYC = sample(map, samplerCoord(map)); - float xc = dot(XCYC, xchannel); - float yc = dot(XCYC, ychannel); - samplePos.x += scale*(xc-0.5); - samplePos.y += scale*(yc-0.5); - return sample(image, samplePos); -} diff --git a/WebCore/svg/graphics/filters/cg/WKDisplacementMapFilter.h b/WebCore/svg/graphics/filters/cg/WKDisplacementMapFilter.h deleted file mode 100644 index e594495..0000000 --- a/WebCore/svg/graphics/filters/cg/WKDisplacementMapFilter.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (C) 2006 Oliver Hunt <ojh16@student.canterbury.ac.nz>. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. - */ - -#import <QuartzCore/CoreImage.h> - -#if ENABLE(SVG) && ENABLE(SVG_FILTERS) - -@interface WKDisplacementMapFilter : CIFilter { - CIImage *inputImage; - CIImage *inputDisplacementMap; - CIVector *inputXChannelSelector; - CIVector *inputYChannelSelector; - NSNumber *inputScale; -} - -@end - -#endif // ENABLE(SVG) && ENABLE(SVG_FILTERS) diff --git a/WebCore/svg/graphics/filters/cg/WKDisplacementMapFilter.m b/WebCore/svg/graphics/filters/cg/WKDisplacementMapFilter.m deleted file mode 100644 index 8ccd52c..0000000 --- a/WebCore/svg/graphics/filters/cg/WKDisplacementMapFilter.m +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright (C) 2006 Oliver Hunt <ojh16@student.canterbury.ac.nz>. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. - */ - -#import "config.h" -#import "WKDisplacementMapFilter.h" - -#if ENABLE(SVG) && ENABLE(SVG_FILTERS) - -static CIKernel *displacementMapFilter = nil; - -@implementation WKDisplacementMapFilter - -+ (void)initialize -{ - [CIFilter registerFilterName:@"WKDisplacementMapFilter" - constructor:self - classAttributes:[NSDictionary dictionaryWithObjectsAndKeys: - @"WebKit Displacement Map Filter", kCIAttributeFilterDisplayName, - [NSArray arrayWithObjects:kCICategoryStylize, kCICategoryVideo, - kCICategoryStillImage, kCICategoryNonSquarePixels,nil], kCIAttributeFilterCategories, - [NSDictionary dictionaryWithObjectsAndKeys: - [CIVector vectorWithX:1.0f Y:0.0f Z:0.0f W:0.0f], - kCIAttributeDefault, nil], @"inputXChannelSelector", - [NSDictionary dictionaryWithObjectsAndKeys: - [CIVector vectorWithX:0.0f Y:1.0f Z:0.0f W:0.0f], - kCIAttributeDefault, nil], @"inputYChannelSelector", - [NSDictionary dictionaryWithObjectsAndKeys: - [NSNumber numberWithDouble:0.0], kCIAttributeDefault, - [NSNumber numberWithDouble:0.0], kCIAttributeIdentity, - kCIAttributeTypeScalar, kCIAttributeType, - nil], @"inputScale", - nil]]; -} - -+ (CIFilter *)filterWithName:(NSString *)name -{ - return [[[self alloc] init] autorelease]; -} - -- (id)init -{ - if (!displacementMapFilter) { - NSBundle *bundle = [NSBundle bundleForClass:[self class]]; - NSString *kernelFile = [bundle pathForResource:@"WKDisplacementMapFilter" ofType:@"cikernel"]; - NSString *code = [NSString stringWithContentsOfFile:kernelFile encoding:NSUTF8StringEncoding error:0]; - NSArray *kernels = [CIKernel kernelsWithString:code]; - displacementMapFilter = [[kernels objectAtIndex:0] retain]; - } - return [super init]; -} - -- (CIImage *)outputImage -{ - return [self apply:displacementMapFilter, inputImage, inputDisplacementMap, inputXChannelSelector, inputYChannelSelector, inputScale, nil]; -} - -@end - -#endif // ENABLE(SVG) && ENABLE(SVG_FILTERS) diff --git a/WebCore/svg/graphics/filters/cg/WKDistantLightFilter.cikernel b/WebCore/svg/graphics/filters/cg/WKDistantLightFilter.cikernel deleted file mode 100644 index c14677c..0000000 --- a/WebCore/svg/graphics/filters/cg/WKDistantLightFilter.cikernel +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (C) 2005 Oliver Hunt <ojh16@student.canterbury.ac.nz>. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. - */ - -kernel vec4 distantLightGenerator(sampler image, vec3 direction) -{ - return vec4(direction.x, direction.y, direction.z, 1.0); -} diff --git a/WebCore/svg/graphics/filters/cg/WKDistantLightFilter.h b/WebCore/svg/graphics/filters/cg/WKDistantLightFilter.h deleted file mode 100644 index e5fe15a..0000000 --- a/WebCore/svg/graphics/filters/cg/WKDistantLightFilter.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (C) 2005 Apple Computer, 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: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``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 APPLE COMPUTER, INC. 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. - */ - -#import <QuartzCore/CoreImage.h> - -#if ENABLE(SVG) && ENABLE(SVG_FILTERS) - -@interface WKDistantLightFilter : CIFilter { - CIImage * inputNormalMap; - CIVector * inputLightDirection; -} -@end - -#endif // ENABLE(SVG) && ENABLE(SVG_FILTERS) diff --git a/WebCore/svg/graphics/filters/cg/WKDistantLightFilter.m b/WebCore/svg/graphics/filters/cg/WKDistantLightFilter.m deleted file mode 100644 index 29e3caf..0000000 --- a/WebCore/svg/graphics/filters/cg/WKDistantLightFilter.m +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (C) 2005 Apple Computer, 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: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``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 APPLE COMPUTER, INC. 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. - */ - -#import "config.h" -#import "WKDistantLightFilter.h" - -#if ENABLE(SVG) && ENABLE(SVG_FILTERS) - -static CIKernel *distantLightFilter = nil; - -@implementation WKDistantLightFilter - -+ (void)initialize -{ - [CIFilter registerFilterName:@"WKDistantLight" - constructor:self - classAttributes:[NSDictionary dictionaryWithObjectsAndKeys: - @"WebKit Distant Light", kCIAttributeFilterDisplayName, - [NSArray arrayWithObjects:kCICategoryStylize, kCICategoryVideo, - kCICategoryStillImage, kCICategoryNonSquarePixels,nil], kCIAttributeFilterCategories, - [NSDictionary dictionaryWithObjectsAndKeys: - kCIAttributeTypePosition3, kCIAttributeType, - nil], @"inputLightDirection", - nil]]; -} - -+ (CIFilter *)filterWithName:(NSString *)name -{ - return [[[self alloc] init] autorelease]; -} - -- (id)init -{ - if (!distantLightFilter) { - NSBundle *bundle = [NSBundle bundleForClass:[self class]]; - NSString *kernelFile = [bundle pathForResource:@"WKDistantLightFilter" ofType:@"cikernel"]; - NSString *code = [NSString stringWithContentsOfFile:kernelFile encoding:NSUTF8StringEncoding error:0]; - NSArray *kernels = [CIKernel kernelsWithString:code]; - distantLightFilter = [[kernels objectAtIndex:0] retain]; - } - return [super init]; -} - -- (CIImage *)outputImage -{ - return [self apply:distantLightFilter, [CISampler samplerWithImage:inputNormalMap], inputLightDirection, nil]; -} - -@end - -#endif // ENABLE(SVG) && ENABLE(SVG_FILTERS) diff --git a/WebCore/svg/graphics/filters/cg/WKGammaTransferFilter.cikernel b/WebCore/svg/graphics/filters/cg/WKGammaTransferFilter.cikernel deleted file mode 100644 index 810edb6..0000000 --- a/WebCore/svg/graphics/filters/cg/WKGammaTransferFilter.cikernel +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (C) 2006 Oliver Hunt <ojh16@student.canterbury.ac.nz>. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. - */ - -kernel vec4 gammaTransfer(sampler image, float amplitude, float exponent, float offset) -{ - vec4 C = sample(image, samplerCoord(image)); - return amplitude * pow(C, vec4(exponent)) + offset; -} diff --git a/WebCore/svg/graphics/filters/cg/WKGammaTransferFilter.h b/WebCore/svg/graphics/filters/cg/WKGammaTransferFilter.h deleted file mode 100644 index 7e0c1e4..0000000 --- a/WebCore/svg/graphics/filters/cg/WKGammaTransferFilter.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (C) 2006 Oliver Hunt <ojh16@student.canterbury.ac.nz>. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. - */ - -#import <QuartzCore/CoreImage.h> - -#if ENABLE(SVG) && ENABLE(SVG_FILTERS) - -@interface WKGammaTransferFilter : CIFilter { - CIImage *inputImage; - NSNumber *inputAmplitude; - NSNumber *inputExponent; - NSNumber *inputOffset; -} - -@end - -#endif // ENABLE(SVG) && ENABLE(SVG_FILTERS) diff --git a/WebCore/svg/graphics/filters/cg/WKGammaTransferFilter.m b/WebCore/svg/graphics/filters/cg/WKGammaTransferFilter.m deleted file mode 100644 index 8642931..0000000 --- a/WebCore/svg/graphics/filters/cg/WKGammaTransferFilter.m +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright (C) 2006 Oliver Hunt <ojh16@student.canterbury.ac.nz>. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. - */ - -#import "config.h" -#import "WKGammaTransferFilter.h" - -#if ENABLE(SVG) && ENABLE(SVG_FILTERS) - -static CIKernel *gammaTransferFilter = nil; - -@implementation WKGammaTransferFilter -+ (void)initialize -{ - [CIFilter registerFilterName:@"WKGammaTransfer" - constructor:self - classAttributes:[NSDictionary dictionaryWithObjectsAndKeys: - @"WebKit Gamma Transfer", kCIAttributeFilterDisplayName, - [NSArray arrayWithObjects:kCICategoryStylize, kCICategoryVideo, - kCICategoryStillImage, kCICategoryNonSquarePixels,nil], kCIAttributeFilterCategories, - [NSDictionary dictionaryWithObjectsAndKeys: - [NSNumber numberWithDouble:1.0], kCIAttributeDefault, - [NSNumber numberWithDouble:1.0], kCIAttributeIdentity, - kCIAttributeTypeScalar, kCIAttributeType, - nil], @"inputAmplitude", - [NSDictionary dictionaryWithObjectsAndKeys: - [NSNumber numberWithDouble:1.0], kCIAttributeDefault, - [NSNumber numberWithDouble:1.0], kCIAttributeIdentity, - kCIAttributeTypeScalar, kCIAttributeType, - nil], @"inputExponent", - [NSDictionary dictionaryWithObjectsAndKeys: - [NSNumber numberWithDouble:0.0], kCIAttributeDefault, - [NSNumber numberWithDouble:0.0], kCIAttributeIdentity, - kCIAttributeTypeScalar, kCIAttributeType, - nil], @"inputOffset", - nil]]; -} - -+ (CIFilter *)filterWithName:(NSString *)name -{ - return [[[self alloc] init] autorelease]; -} - -- (id)init -{ - if (!gammaTransferFilter) { - NSBundle *bundle = [NSBundle bundleForClass:[self class]]; - NSString *kernelFile = [bundle pathForResource:@"WKGammaTransferFilter" ofType:@"cikernel"]; - NSString *code = [NSString stringWithContentsOfFile:kernelFile encoding:NSUTF8StringEncoding error:0]; - NSArray *kernels = [CIKernel kernelsWithString:code]; - gammaTransferFilter = [[kernels objectAtIndex:0] retain]; - } - return [super init]; -} - -- (CIImage *)outputImage -{ - CISampler *inputSampler = [CISampler samplerWithImage: inputImage]; - return [self apply:gammaTransferFilter, inputSampler, inputAmplitude, inputExponent, inputOffset, @"definition", [inputSampler definition], nil]; -} - -@end - -#endif // ENABLE(SVG) && ENABLE(SVG_FILTERS) diff --git a/WebCore/svg/graphics/filters/cg/WKIdentityTransferFilter.h b/WebCore/svg/graphics/filters/cg/WKIdentityTransferFilter.h deleted file mode 100644 index 0c36daa..0000000 --- a/WebCore/svg/graphics/filters/cg/WKIdentityTransferFilter.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (C) 2006 Oliver Hunt <ojh16@student.canterbury.ac.nz>. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. - */ - -#import <QuartzCore/CoreImage.h> - -#if ENABLE(SVG) && ENABLE(SVG_FILTERS) - -@interface WKIdentityTransferFilter : CIFilter { - CIImage *inputImage; -} - -@end - -#endif // ENABLE(SVG) && ENABLE(SVG_FILTERS) diff --git a/WebCore/svg/graphics/filters/cg/WKIdentityTransferFilter.m b/WebCore/svg/graphics/filters/cg/WKIdentityTransferFilter.m deleted file mode 100644 index 935c305..0000000 --- a/WebCore/svg/graphics/filters/cg/WKIdentityTransferFilter.m +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (C) 2006 Oliver Hunt <ojh16@student.canterbury.ac.nz>. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. - */ - -#import "config.h" -#import "WKIdentityTransferFilter.h" - -#if ENABLE(SVG) && ENABLE(SVG_FILTERS) - -@implementation WKIdentityTransferFilter -+ (void)initialize -{ - [CIFilter registerFilterName:@"WKIdentityTransfer" - constructor:self - classAttributes:[NSDictionary dictionaryWithObjectsAndKeys: - @"WebKit Identity Transfer", kCIAttributeFilterDisplayName, - [NSArray arrayWithObjects:kCICategoryStylize, kCICategoryVideo, - kCICategoryStillImage, kCICategoryNonSquarePixels,nil], kCIAttributeFilterCategories, - nil]]; -} - -+ (CIFilter *)filterWithName:(NSString *)name -{ - return [[[self alloc] init] autorelease]; -} - -- (id)init -{ - return [super init]; -} - -- (CIImage *)outputImage -{ - return inputImage; -} - -@end - -#endif // ENABLE(SVG) && ENABLE(SVG_FILTERS) diff --git a/WebCore/svg/graphics/filters/cg/WKLinearTransferFilter.cikernel b/WebCore/svg/graphics/filters/cg/WKLinearTransferFilter.cikernel deleted file mode 100644 index 17d57e4..0000000 --- a/WebCore/svg/graphics/filters/cg/WKLinearTransferFilter.cikernel +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (C) 2006 Oliver Hunt <ojh16@student.canterbury.ac.nz>. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. - */ - -kernel vec4 linearTransfer(sampler image, float slope, float intercept) -{ - vec4 C = sample(image, samplerCoord(image)); - return slope * C + intercept; -} diff --git a/WebCore/svg/graphics/filters/cg/WKLinearTransferFilter.h b/WebCore/svg/graphics/filters/cg/WKLinearTransferFilter.h deleted file mode 100644 index 91a99f5..0000000 --- a/WebCore/svg/graphics/filters/cg/WKLinearTransferFilter.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (C) 2006 Oliver Hunt <ojh16@student.canterbury.ac.nz>. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. - */ - -#import <QuartzCore/CoreImage.h> - -#if ENABLE(SVG) && ENABLE(SVG_FILTERS) - -@interface WKLinearTransferFilter : CIFilter { - CIImage *inputImage; - NSNumber *inputSlope; - NSNumber *inputIntercept; -} - -@end - -#endif // ENABLE(SVG) && ENABLE(SVG_FILTERS) diff --git a/WebCore/svg/graphics/filters/cg/WKLinearTransferFilter.m b/WebCore/svg/graphics/filters/cg/WKLinearTransferFilter.m deleted file mode 100644 index 6582f9f..0000000 --- a/WebCore/svg/graphics/filters/cg/WKLinearTransferFilter.m +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright (C) 2006 Oliver Hunt <ojh16@student.canterbury.ac.nz>. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. - */ - -#import "config.h" -#import "WKLinearTransferFilter.h" - -#if ENABLE(SVG) && ENABLE(SVG_FILTERS) - -static CIKernel *linearTransferFilter = nil; - -@implementation WKLinearTransferFilter -+ (void)initialize -{ - [CIFilter registerFilterName:@"WKLinearTransfer" - constructor:self - classAttributes:[NSDictionary dictionaryWithObjectsAndKeys: - @"WebKit Linear Transfer", kCIAttributeFilterDisplayName, - [NSArray arrayWithObjects:kCICategoryStylize, kCICategoryVideo, - kCICategoryStillImage, kCICategoryNonSquarePixels,nil], kCIAttributeFilterCategories, - [NSDictionary dictionaryWithObjectsAndKeys: - [NSNumber numberWithDouble:1.0], kCIAttributeDefault, - [NSNumber numberWithDouble:1.0], kCIAttributeIdentity, - kCIAttributeTypeScalar, kCIAttributeType, - nil], @"inputSlope", - [NSDictionary dictionaryWithObjectsAndKeys: - [NSNumber numberWithDouble:0.0], kCIAttributeDefault, - [NSNumber numberWithDouble:0.0], kCIAttributeIdentity, - kCIAttributeTypeScalar, kCIAttributeType, - nil], @"inputIntersection", - nil]]; -} - -+ (CIFilter *)filterWithName:(NSString *)name -{ - return [[[self alloc] init] autorelease]; -} - -- (id)init -{ - if (!linearTransferFilter) { - NSBundle *bundle = [NSBundle bundleForClass:[self class]]; - NSString *kernelFile = [bundle pathForResource:@"WKLinearTransferFilter" ofType:@"cikernel"]; - NSString *code = [NSString stringWithContentsOfFile:kernelFile encoding:NSUTF8StringEncoding error:0]; - NSArray *kernels = [CIKernel kernelsWithString:code]; - linearTransferFilter = [[kernels objectAtIndex:0] retain]; - } - return [super init]; -} - -- (CIImage *)outputImage -{ - CISampler *inputSampler = [CISampler samplerWithImage: inputImage]; - return [self apply:linearTransferFilter, inputSampler, inputSlope, inputIntercept, @"definition", [inputSampler definition], nil]; -} - -@end - -#endif // ENABLE(SVG) && ENABLE(SVG_FILTERS) diff --git a/WebCore/svg/graphics/filters/cg/WKNormalMapFilter.cikernel b/WebCore/svg/graphics/filters/cg/WKNormalMapFilter.cikernel deleted file mode 100644 index 589f475..0000000 --- a/WebCore/svg/graphics/filters/cg/WKNormalMapFilter.cikernel +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (C) 2005 Oliver Hunt <ojh16@student.canterbury.ac.nz>. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. - */ - -//TODO: We currently ignore the input kernel lengths -kernel vec4 convolve3x3(sampler image, float divisor, float bias, - vec3 m0, vec3 m1, vec3 m2) -{ - vec4 colour = vec4(0.0, 0.0, 0.0, 0.0); - vec2 pos= samplerCoord(image); - colour = sample(image, pos + vec2(-1.0, -1.0)) *m0.x; - colour += sample(image, pos + vec2(-1.0, 0.0)) *m0.y; - colour += sample(image, pos + vec2(-1.0, 1.0)) *m0.z; - colour += sample(image, pos + vec2( 0.0, -1.0)) *m1.x; - colour += sample(image, pos) * m1.y; - colour += sample(image, pos + vec2( 0.0, 1.0))*m1.z; - colour += sample(image, pos + vec2( 1.0, -1.0))*m2.x; - colour += sample(image, pos + vec2( 1.0, 0.0))*m2.y; - colour += sample(image, pos + vec2( 1.0, 1.0))*m2.z; - return colour / divisor + bias; -} - -kernel vec4 mergeNormals(sampler Nx, sampler Ny, sampler src, float surfaceScale) -{ - vec3 N = vec3(surfaceScale * sample(Nx, samplerCoord(Nx)).a, -surfaceScale * sample(Ny, samplerCoord(Ny)).a, 1.0); - N = normalize(N); - return vec4(N.x, N.y, N.z, sample(src, samplerCoord(src)).a); -} diff --git a/WebCore/svg/graphics/filters/cg/WKNormalMapFilter.h b/WebCore/svg/graphics/filters/cg/WKNormalMapFilter.h deleted file mode 100644 index fb27447..0000000 --- a/WebCore/svg/graphics/filters/cg/WKNormalMapFilter.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (C) 2005 Apple Computer, 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: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``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 APPLE COMPUTER, INC. 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. - */ - -#import <QuartzCore/CoreImage.h> - -#if ENABLE(SVG) && ENABLE(SVG_FILTERS) - -@interface WKNormalMapFilter : CIFilter { - CIImage *inputImage; - NSNumber *inputSurfaceScale; -} -@end - -#endif // ENABLE(SVG) && ENABLE(SVG_FILTERS) diff --git a/WebCore/svg/graphics/filters/cg/WKNormalMapFilter.m b/WebCore/svg/graphics/filters/cg/WKNormalMapFilter.m deleted file mode 100644 index b462008..0000000 --- a/WebCore/svg/graphics/filters/cg/WKNormalMapFilter.m +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Copyright (C) 2005 Apple Computer, 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: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``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 APPLE COMPUTER, INC. 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. - */ - -#import "config.h" -#import "WKNormalMapFilter.h" - -#if ENABLE(SVG) && ENABLE(SVG_FILTERS) - -static CIKernel *convolveKernel = nil; -static CIKernel *normalMapKernel = nil; - -@implementation WKNormalMapFilter - -+ (void)initialize -{ - [CIFilter registerFilterName:@"WKNormalMap" - constructor:self - classAttributes:[NSDictionary dictionaryWithObjectsAndKeys: - @"WebKit Normal Map", kCIAttributeFilterDisplayName, - [NSArray arrayWithObjects: kCICategoryBlur, kCICategoryVideo, - kCICategoryStillImage, kCICategoryNonSquarePixels, nil], kCIAttributeFilterCategories, - [NSDictionary dictionaryWithObjectsAndKeys: - [NSNumber numberWithDouble:0.0], kCIAttributeMin, - [NSNumber numberWithDouble:1.0], kCIAttributeDefault, - [NSNumber numberWithDouble:1.0], kCIAttributeIdentity, - kCIAttributeTypeScalar, kCIAttributeType, - nil], @"inputSurfaceScale", - nil]]; -} - -+ (CIFilter *)filterWithName:(NSString *)name -{ - return [[[self alloc] init] autorelease]; -} - -- (id)init -{ - if (!normalMapKernel) { - NSBundle *bundle = [NSBundle bundleForClass:[self class]]; - NSString *kernelFile = [bundle pathForResource:@"WKNormalMapFilter" ofType:@"cikernel"]; - NSString *code = [NSString stringWithContentsOfFile:kernelFile encoding:NSUTF8StringEncoding error:0]; - NSArray *kernels = [CIKernel kernelsWithString:code]; - convolveKernel = [[kernels objectAtIndex:0] retain]; - normalMapKernel = [[kernels objectAtIndex:1] retain]; - } - return [super init]; -} - -- (NSArray *)xConvolveArgsWithBumpMap:(CISampler *)bumpMap { - return [NSArray arrayWithObjects: - bumpMap, - [NSNumber numberWithFloat:4], - [NSNumber numberWithFloat:0], - [CIVector vectorWithX:1 Y:2 Z:1], - [CIVector vectorWithX:0 Y:0 Z:0], - [CIVector vectorWithX:-1 Y:-2 Z:-1], - nil]; -} - -- (NSArray *)yConvolveArgsWithBumpMap:(CISampler *)bumpMap { - return [NSArray arrayWithObjects: - bumpMap, - [NSNumber numberWithFloat:4], - [NSNumber numberWithFloat:0], - [CIVector vectorWithX:1 Y:0 Z:-1], - [CIVector vectorWithX:2 Y:0 Z:-2], - [CIVector vectorWithX:1 Y:0 Z:-1], - nil]; -} - -- (CIImage *)outputImage -{ - CISampler *image = [CISampler samplerWithImage:inputImage]; - NSDictionary *applyOptions = [NSDictionary dictionaryWithObjectsAndKeys:[image definition], kCIApplyOptionDefinition, nil]; - - CIImage *convolveX = [self apply:convolveKernel arguments:[self xConvolveArgsWithBumpMap:image] options:applyOptions]; - CIImage *convolveY = [self apply:convolveKernel arguments:[self yConvolveArgsWithBumpMap:image] options:applyOptions]; - CISampler *samplerX = [CISampler samplerWithImage:convolveX]; - CISampler *samplerY = [CISampler samplerWithImage:convolveY]; - - NSArray *normalMapArgs = [NSArray arrayWithObjects:samplerX, samplerY, image, inputSurfaceScale, nil]; - return [self apply:normalMapKernel arguments:normalMapArgs options:applyOptions]; -} - -@end - -#endif // ENABLE(SVG) && ENABLE(SVG_FILTERS) diff --git a/WebCore/svg/graphics/filters/cg/WKPointLightFilter.cikernel b/WebCore/svg/graphics/filters/cg/WKPointLightFilter.cikernel deleted file mode 100644 index fd0a851..0000000 --- a/WebCore/svg/graphics/filters/cg/WKPointLightFilter.cikernel +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (C) 2005 Oliver Hunt <ojh16@student.canterbury.ac.nz>. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. - */ - -kernel vec4 genPointLight(sampler normalMap, vec3 lightPos, float surfaceScale) -{ - vec2 pos = samplerCoord(normalMap); - vec3 P = vec3(pos.x, pos.y, surfaceScale * sample(normalMap, pos).a); - vec3 L = lightPos - P; - L = normalize(L); - return vec4(L.x, L.y, L.z, 1.0); -} diff --git a/WebCore/svg/graphics/filters/cg/WKPointLightFilter.h b/WebCore/svg/graphics/filters/cg/WKPointLightFilter.h deleted file mode 100644 index 58ec689..0000000 --- a/WebCore/svg/graphics/filters/cg/WKPointLightFilter.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (C) 2005 Apple Computer, 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: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``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 APPLE COMPUTER, INC. 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. - */ - -#import <QuartzCore/CoreImage.h> - -#if ENABLE(SVG) && ENABLE(SVG_FILTERS) - -@interface WKPointLightFilter : CIFilter { - CIImage *inputNormalMap; - CIVector *inputLightPosition; - NSNumber *inputSurfaceScale; -} - -@end - -#endif // ENABLE(SVG) && ENABLE(SVG_FILTERS) diff --git a/WebCore/svg/graphics/filters/cg/WKPointLightFilter.m b/WebCore/svg/graphics/filters/cg/WKPointLightFilter.m deleted file mode 100644 index 331207e..0000000 --- a/WebCore/svg/graphics/filters/cg/WKPointLightFilter.m +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (C) 2005 Apple Computer, 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: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``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 APPLE COMPUTER, INC. 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. - */ - -#import "config.h" -#import "WKPointLightFilter.h" - -#if ENABLE(SVG) && ENABLE(SVG_FILTERS) - -static CIKernel *pointLightFilter = nil; - -@implementation WKPointLightFilter - -+ (void)initialize -{ - [CIFilter registerFilterName:@"WKPointLight" - constructor:self - classAttributes:[NSDictionary dictionaryWithObjectsAndKeys: - @"WebKit Point Light", kCIAttributeFilterDisplayName, - [NSArray arrayWithObjects:kCICategoryStylize, kCICategoryVideo, - kCICategoryStillImage, kCICategoryNonSquarePixels,nil], kCIAttributeFilterCategories, - [NSDictionary dictionaryWithObjectsAndKeys: - kCIAttributeTypePosition3, kCIAttributeType, - nil], @"inputLightPosition", - nil]]; -} - -+ (CIFilter *)filterWithName:(NSString *)name -{ - return [[[self alloc] init] autorelease]; -} - -- (id)init -{ - if (!pointLightFilter) { - NSBundle *bundle = [NSBundle bundleForClass:[self class]]; - NSString *kernelFile = [bundle pathForResource:@"WKPointLightFilter" ofType:@"cikernel"]; - NSString *code = [NSString stringWithContentsOfFile:kernelFile encoding:NSUTF8StringEncoding error:0]; - NSArray *kernels = [CIKernel kernelsWithString:code]; - pointLightFilter = [[kernels objectAtIndex:0] retain]; - } - return [super init]; -} - -- (CIImage *)outputImage -{ - return [self apply:pointLightFilter, inputNormalMap, inputLightPosition, inputSurfaceScale, nil]; -} - -@end - -#endif // ENABLE(SVG) && ENABLE(SVG_FILTERS) diff --git a/WebCore/svg/graphics/filters/cg/WKSpecularLightingFilter.cikernel b/WebCore/svg/graphics/filters/cg/WKSpecularLightingFilter.cikernel deleted file mode 100644 index 64228f0..0000000 --- a/WebCore/svg/graphics/filters/cg/WKSpecularLightingFilter.cikernel +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (C) 2005 Oliver Hunt <ojh16@student.canterbury.ac.nz>. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. - */ - -kernel vec4 basic(sampler inputNormalVectors, sampler inputLightVectors, __color inputLightingColor, float inputSurfaceScale, float inputSpecularConstant, - float inputSpecularExponent, float inputKernelUnitLengthX, float inputKernelUnitLengthY) -{ - vec2 pos = samplerCoord(inputLightVectors); - vec2 posn = samplerCoord(inputNormalVectors); - vec3 l = sample(inputLightVectors, pos).xyz; - vec3 n = sample(inputNormalVectors, posn).xyz; - vec3 h = l+vec3(0.0, 0.0, 1.0); - h = normalize(h); - float nh = inputSpecularConstant*pow((dot(n, h)), inputSpecularExponent); - vec4 res = inputLightingColor * nh; - res.a = max(res.r, res.g); - res.a = max(res.a, res.b); - return res; -} diff --git a/WebCore/svg/graphics/filters/cg/WKSpecularLightingFilter.h b/WebCore/svg/graphics/filters/cg/WKSpecularLightingFilter.h deleted file mode 100644 index cce9e06..0000000 --- a/WebCore/svg/graphics/filters/cg/WKSpecularLightingFilter.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (C) 2005 Apple Computer, 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: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``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 APPLE COMPUTER, INC. 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. - */ - -#import <QuartzCore/CoreImage.h> - -#if ENABLE(SVG) && ENABLE(SVG_FILTERS) - -@interface WKSpecularLightingFilter : CIFilter { - CISampler *inputNormalMap; - CISampler *inputLightVectors; - CIColor *inputLightingColor; - NSNumber *inputSurfaceScale; - NSNumber *inputSpecularConstant; - NSNumber *inputSpecularExponent; - NSNumber *inputKernelUnitLengthX; - NSNumber *inputKernelUnitLengthY; -} -@end - -#endif // ENABLE(SVG) && ENABLE(SVG_FILTERS) diff --git a/WebCore/svg/graphics/filters/cg/WKSpecularLightingFilter.m b/WebCore/svg/graphics/filters/cg/WKSpecularLightingFilter.m deleted file mode 100644 index 22495ae..0000000 --- a/WebCore/svg/graphics/filters/cg/WKSpecularLightingFilter.m +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Copyright (C) 2005 Apple Computer, 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: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``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 APPLE COMPUTER, INC. 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. - */ - -#import "config.h" -#import "WKSpecularLightingFilter.h" - -#if ENABLE(SVG) && ENABLE(SVG_FILTERS) - -static CIKernel *specularLightingFilter = nil; - -@implementation WKSpecularLightingFilter - -+ (void)initialize -{ - [CIFilter registerFilterName:@"WKSpecularLighting" - constructor:self - classAttributes:[NSDictionary dictionaryWithObjectsAndKeys: - @"WebKit Specular Lighting", kCIAttributeFilterDisplayName, - [NSArray arrayWithObjects:kCICategoryStylize, kCICategoryVideo, - kCICategoryStillImage, kCICategoryNonSquarePixels,nil], kCIAttributeFilterCategories, - [NSDictionary dictionaryWithObjectsAndKeys: - [CIColor colorWithRed:1.0f green:1.0f blue:1.0f alpha:1.0f], - kCIAttributeDefault, nil], @"inputLightingColor", - [NSDictionary dictionaryWithObjectsAndKeys: - [NSNumber numberWithDouble:0.0], kCIAttributeMin, - [NSNumber numberWithDouble:1.0], kCIAttributeDefault, - [NSNumber numberWithDouble:1.0], kCIAttributeIdentity, - kCIAttributeTypeScalar, kCIAttributeType, - nil], @"inputSurfaceScale", - [NSDictionary dictionaryWithObjectsAndKeys: - [NSNumber numberWithDouble:0.0], kCIAttributeMin, - [NSNumber numberWithDouble:1.0], kCIAttributeDefault, - [NSNumber numberWithDouble:1.0], kCIAttributeIdentity, - kCIAttributeTypeScalar, kCIAttributeType, - nil], @"inputSpecularConstant", - [NSDictionary dictionaryWithObjectsAndKeys: - [NSNumber numberWithDouble:0.0], kCIAttributeMin, - [NSNumber numberWithDouble:128.0], kCIAttributeMin, - [NSNumber numberWithDouble:1.0], kCIAttributeDefault, - [NSNumber numberWithDouble:1.0], kCIAttributeIdentity, - kCIAttributeTypeScalar, kCIAttributeType, - nil], @"inputSpecularExponent", - [NSDictionary dictionaryWithObjectsAndKeys: - kCIAttributeTypeOffset, kCIAttributeType, - nil], @"inputKernelUnitLength", - nil]]; -} - -+ (CIFilter *)filterWithName:(NSString *)name -{ - return [[[self alloc] init] autorelease]; -} - -- (id)init -{ - if (!specularLightingFilter) { - NSBundle *bundle = [NSBundle bundleForClass:[self class]]; - NSString *kernelFile = [bundle pathForResource:@"WKSpecularLightingFilter" ofType:@"cikernel"]; - NSString *code = [NSString stringWithContentsOfFile:kernelFile encoding:NSUTF8StringEncoding error:0]; - NSArray *kernels = [CIKernel kernelsWithString:code]; - specularLightingFilter = [[kernels objectAtIndex:0] retain]; - } - return [super init]; -} - -- (CIImage *)outputImage -{ - return [self apply:specularLightingFilter, inputNormalMap, inputLightVectors, inputLightingColor, inputSurfaceScale, inputSpecularConstant, - inputSpecularExponent, inputKernelUnitLengthX, inputKernelUnitLengthY, nil]; -} - -@end - -#endif // ENABLE(SVG) && ENABLE(SVG_FILTERS) diff --git a/WebCore/svg/graphics/filters/cg/WKSpotLightFilter.cikernel b/WebCore/svg/graphics/filters/cg/WKSpotLightFilter.cikernel deleted file mode 100644 index 0fa83a8..0000000 --- a/WebCore/svg/graphics/filters/cg/WKSpotLightFilter.cikernel +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (C) 2005 Oliver Hunt <ojh16@student.canterbury.ac.nz>. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. - */ - -kernel vec4 spotLightFilter(sampler lightVectors, vec3 lightDirection, float specularExponent, float cosCutoffAngle) -{ - vec2 pos = samplerCoord(lightVectors); - vec3 l = sample(lightVectors, pos).xyz; - float sl = -dot(lightDirection, l); - sl = max(sl, 0.0); - sl = pow(sl, specularExponent) * sign(sl - cosCutoffAngle); - return vec4(l.x, l.y, l.z, sl); -} diff --git a/WebCore/svg/graphics/filters/cg/WKSpotLightFilter.h b/WebCore/svg/graphics/filters/cg/WKSpotLightFilter.h deleted file mode 100644 index d87beca..0000000 --- a/WebCore/svg/graphics/filters/cg/WKSpotLightFilter.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (C) 2005 Apple Computer, 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: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``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 APPLE COMPUTER, INC. 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. - */ - -#import <QuartzCore/CoreImage.h> - -#if ENABLE(SVG) && ENABLE(SVG_FILTERS) - -@interface WKSpotLightFilter : CIFilter { - CIImage *inputLightVectors; - CIVector *inputLightDirection; - NSNumber *inputSpecularExponent; - NSNumber *inputLimitingConeAngle; -} -@end - -#endif // ENABLE(SVG) && ENABLE(SVG_FILTERS) diff --git a/WebCore/svg/graphics/filters/cg/WKSpotLightFilter.m b/WebCore/svg/graphics/filters/cg/WKSpotLightFilter.m deleted file mode 100644 index 62973ef..0000000 --- a/WebCore/svg/graphics/filters/cg/WKSpotLightFilter.m +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright (C) 2005 Apple Computer, 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: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``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 APPLE COMPUTER, INC. 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. - */ - -#import "config.h" -#import "WKSpotLightFilter.h" - -#if ENABLE(SVG) && ENABLE(SVG_FILTERS) - -static CIKernel *spotLightFilter = nil; - -@implementation WKSpotLightFilter - -+ (void)initialize -{ - [CIFilter registerFilterName:@"WKSpotLight" - constructor:self - classAttributes:[NSDictionary dictionaryWithObjectsAndKeys: - @"WebKit Spot Light", kCIAttributeFilterDisplayName, - [NSArray arrayWithObjects:kCICategoryStylize, kCICategoryVideo, - kCICategoryStillImage, kCICategoryNonSquarePixels,nil], kCIAttributeFilterCategories, - [NSDictionary dictionaryWithObjectsAndKeys: - kCIAttributeTypePosition3, kCIAttributeType, - nil], @"inputLightDirection", - [NSDictionary dictionaryWithObjectsAndKeys: - [NSNumber numberWithDouble:1.0], kCIAttributeDefault, - [NSNumber numberWithDouble:1.0], kCIAttributeIdentity, - kCIAttributeTypeScalar, kCIAttributeType, - nil], @"inputSpecularExponent", - [NSDictionary dictionaryWithObjectsAndKeys: - kCIAttributeTypeAngle, kCIAttributeType, - nil], @"inputLimitingConeAngle", - nil]]; -} - -+ (CIFilter *)filterWithName:(NSString *)name -{ - return [[[self alloc] init] autorelease]; -} - -- (id)init -{ - if (!spotLightFilter) { - NSBundle *bundle = [NSBundle bundleForClass:[self class]]; - NSString *kernelFile = [bundle pathForResource:@"WKSpotLightFilter" ofType:@"cikernel"]; - NSString *code = [NSString stringWithContentsOfFile:kernelFile encoding:NSUTF8StringEncoding error:0]; - NSArray *kernels = [CIKernel kernelsWithString:code]; - spotLightFilter = [[kernels objectAtIndex:0] retain]; - } - return [super init]; -} - -- (CIImage *)outputImage -{ - float coscutoff = cosf([inputLimitingConeAngle floatValue]); - if (coscutoff < 0) - coscutoff = -coscutoff; - return [self apply:spotLightFilter, inputLightVectors, inputLightDirection, inputSpecularExponent, [NSNumber numberWithFloat:coscutoff], nil]; -} - -@end - -#endif // ENABLE(SVG) && ENABLE(SVG_FILTERS) diff --git a/WebCore/svg/graphics/filters/cg/WKTableTransferFilter.cikernel b/WebCore/svg/graphics/filters/cg/WKTableTransferFilter.cikernel deleted file mode 100644 index 19dfcdf..0000000 --- a/WebCore/svg/graphics/filters/cg/WKTableTransferFilter.cikernel +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (C) 2006 Oliver Hunt <ojh16@student.canterbury.ac.nz>. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. - */ - -/* For some reason CI is ignoring the request to interpolate the colour returned - * when we sample the lookup table. Therefore it is necessary to implement the - * blend operation ourselves. - */ -kernel vec4 tableTransfer(sampler image, sampler table, vec4 rgbaSelector, float maxIndex) -{ - vec4 C = sample(image, samplerCoord(image)); - float k = dot(rgbaSelector, C) * maxIndex; - float t = fract(k); - k = floor(k); - vec4 res = sample(table, vec2(k, 0.0))*(1.0-t)+sample(table, vec2(k+1.0, 0.0))*(t); - return res; -} diff --git a/WebCore/svg/graphics/filters/cg/WKTableTransferFilter.h b/WebCore/svg/graphics/filters/cg/WKTableTransferFilter.h deleted file mode 100644 index 34adf00..0000000 --- a/WebCore/svg/graphics/filters/cg/WKTableTransferFilter.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (C) 2006 Oliver Hunt <ojh16@student.canterbury.ac.nz>. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. - */ - -#import <QuartzCore/CoreImage.h> - -#if ENABLE(SVG) && ENABLE(SVG_FILTERS) - -@interface WKTableTransferFilter : CIFilter { - CIImage *inputImage; - CIImage *inputTable; - CIVector *inputSelector; -} - -@end - -#endif diff --git a/WebCore/svg/graphics/filters/cg/WKTableTransferFilter.m b/WebCore/svg/graphics/filters/cg/WKTableTransferFilter.m deleted file mode 100644 index 55d7c9d..0000000 --- a/WebCore/svg/graphics/filters/cg/WKTableTransferFilter.m +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (C) 2006 Oliver Hunt <ojh16@student.canterbury.ac.nz>. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. - */ - -#import "config.h" -#import "WKTableTransferFilter.h" - -#if ENABLE(SVG) && ENABLE(SVG_FILTERS) - -static CIKernel *tableTransferFilter = nil; - -@implementation WKTableTransferFilter -+ (void)initialize -{ - [CIFilter registerFilterName:@"WKTableTransfer" - constructor:self - classAttributes:[NSDictionary dictionaryWithObjectsAndKeys: - @"WebKit Table Transfer", kCIAttributeFilterDisplayName, - [NSArray arrayWithObjects:kCICategoryStylize, kCICategoryVideo, - kCICategoryStillImage, kCICategoryNonSquarePixels,nil], kCIAttributeFilterCategories, - [NSDictionary dictionaryWithObjectsAndKeys: - kCIAttributeTypeGradient, kCIAttributeType, - nil], @"inputTable", - nil]]; -} - -+ (CIFilter *)filterWithName:(NSString *)name -{ - return [[[self alloc] init] autorelease]; -} - -- (id)init -{ - if (!tableTransferFilter) { - NSBundle *bundle = [NSBundle bundleForClass:[self class]]; - NSString *kernelFile = [bundle pathForResource:@"WKTableTransferFilter" ofType:@"cikernel"]; - NSString *code = [NSString stringWithContentsOfFile:kernelFile encoding:NSUTF8StringEncoding error:0]; - NSArray *kernels = [CIKernel kernelsWithString:code]; - tableTransferFilter = [[kernels objectAtIndex:0] retain]; - } - return [super init]; -} - -- (CIImage *)outputImage -{ - CISampler *inputSampler = [CISampler samplerWithImage: inputImage]; - CISampler *tableSampler = [CISampler samplerWithImage: inputTable keysAndValues:kCISamplerFilterMode, kCISamplerFilterLinear, kCISamplerWrapMode, kCISamplerWrapClamp, nil]; - NSArray *args = [NSArray arrayWithObjects:inputSampler, tableSampler, inputSelector, - [NSNumber numberWithDouble:[inputTable extent].size.width - 1.0f], @"definition", [inputSampler definition], nil]; - return [self apply:tableTransferFilter arguments:args options:nil]; -} - -@end - -#endif // ENABLE(SVG) && ENABLE(SVG_FILTERS) diff --git a/WebCore/svg/graphics/mac/SVGResourceFilterPlatformDataMac.h b/WebCore/svg/graphics/mac/SVGResourceFilterPlatformDataMac.h deleted file mode 100644 index 54f8237..0000000 --- a/WebCore/svg/graphics/mac/SVGResourceFilterPlatformDataMac.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (C) 2007 Eric Seidel <eric@webkit.org> - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``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 APPLE COMPUTER, INC. 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. - */ - -#ifndef SVGResourceFilterPlatformDataMac_h -#define SVGResourceFilterPlatformDataMac_h - -#if ENABLE(SVG) && ENABLE(SVG_FILTERS) - -#include "SVGResourceFilter.h" - -#include <ApplicationServices/ApplicationServices.h> -#include <wtf/RetainPtr.h> - -@class CIImage; -@class CIFilter; -@class CIContext; -@class NSArray; -@class NSMutableDictionary; - -namespace WebCore { - class SVGResourceFilterPlatformDataMac : public SVGResourceFilterPlatformData { - public: - SVGResourceFilterPlatformDataMac(SVGResourceFilter*); - virtual ~SVGResourceFilterPlatformDataMac(); - - CIImage* imageForName(const String&) const; - void setImageForName(CIImage*, const String&); - - void setOutputImage(const SVGFilterEffect*, CIImage*); - CIImage* inputImage(const SVGFilterEffect*); - - NSArray* getCIFilterStack(CIImage* inputImage, const FloatRect& bbox); - - RetainPtr<CIContext> m_filterCIContext; - CGLayerRef m_filterCGLayer; - RetainPtr<NSMutableDictionary> m_imagesByName; - SVGResourceFilter* m_filter; - }; -} - -#endif // #if ENABLE(SVG) && ENABLE(SVG_FILTERS) - -#endif // SVGResourceFilterPlatformDataMac_h diff --git a/WebCore/svg/graphics/mac/SVGResourceFilterPlatformDataMac.mm b/WebCore/svg/graphics/mac/SVGResourceFilterPlatformDataMac.mm deleted file mode 100644 index 225c649..0000000 --- a/WebCore/svg/graphics/mac/SVGResourceFilterPlatformDataMac.mm +++ /dev/null @@ -1,128 +0,0 @@ -/* - * Copyright (C) 2007 Eric Seidel <eric@webkit.org> - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``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 APPLE COMPUTER, INC. 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) && ENABLE(SVG_FILTERS) - -#include "SVGResourceFilterPlatformDataMac.h" -#include <QuartzCore/CoreImage.h> - -namespace WebCore { - -static const char* const SVGPreviousFilterOutputName = "__previousOutput__"; - -SVGResourceFilterPlatformDataMac::SVGResourceFilterPlatformDataMac(SVGResourceFilter* filter) - : m_filterCGLayer(0) - , m_imagesByName(AdoptNS, [[NSMutableDictionary alloc] init]) - , m_filter(filter) -{ -} - -SVGResourceFilterPlatformDataMac::~SVGResourceFilterPlatformDataMac() -{ - ASSERT(!m_filterCGLayer); - ASSERT(!m_filterCIContext); -} - - -NSArray* SVGResourceFilterPlatformDataMac::getCIFilterStack(CIImage* inputImage, const FloatRect& bbox) -{ - NSMutableArray* filterEffects = [NSMutableArray array]; - - setImageForName(inputImage, "SourceGraphic"); // input - - for (unsigned int i = 0; i < m_filter->effects().size(); i++) { - CIFilter* filter = m_filter->effects()[i]->getCIFilter(bbox); - if (filter) - [filterEffects addObject:filter]; - } - - [m_imagesByName.get() removeAllObjects]; // clean up before next time. - - return filterEffects; -} - -static inline CIImage* alphaImageForImage(CIImage* image) -{ - CIFilter* onlyAlpha = [CIFilter filterWithName:@"CIColorMatrix"]; - CGFloat zero[4] = {0, 0, 0, 0}; - [onlyAlpha setDefaults]; - [onlyAlpha setValue:image forKey:@"inputImage"]; - [onlyAlpha setValue:[CIVector vectorWithValues:zero count:4] forKey:@"inputRVector"]; - [onlyAlpha setValue:[CIVector vectorWithValues:zero count:4] forKey:@"inputGVector"]; - [onlyAlpha setValue:[CIVector vectorWithValues:zero count:4] forKey:@"inputBVector"]; - return [onlyAlpha valueForKey:@"outputImage"]; -} - -CIImage* SVGResourceFilterPlatformDataMac::imageForName(const String& name) const -{ - return [m_imagesByName.get() objectForKey:name]; -} - -void SVGResourceFilterPlatformDataMac::setImageForName(CIImage* image, const String& name) -{ - [m_imagesByName.get() setValue:image forKey:name]; -} - -void SVGResourceFilterPlatformDataMac::setOutputImage(const SVGFilterEffect* filterEffect, CIImage* output) -{ - if (!filterEffect->result().isEmpty()) - setImageForName(output, filterEffect->result()); - - setImageForName(output, SVGPreviousFilterOutputName); -} - -CIImage* SVGResourceFilterPlatformDataMac::inputImage(const SVGFilterEffect* filterEffect) -{ - if (filterEffect->in().isEmpty()) { - CIImage* inImage = imageForName(SVGPreviousFilterOutputName); - - if (!inImage) - inImage = imageForName("SourceGraphic"); - - return inImage; - } else if (filterEffect->in() == "SourceAlpha") { - CIImage* sourceAlpha = imageForName(filterEffect->in()); - - if (!sourceAlpha) { - CIImage* sourceGraphic = imageForName("SourceGraphic"); - - if (!sourceGraphic) - return nil; - - sourceAlpha = alphaImageForImage(sourceGraphic); - setImageForName(sourceAlpha, "SourceAlpha"); - } - - return sourceAlpha; - } - - return imageForName(filterEffect->in()); -} - - -} - -#endif // #if ENABLE(SVG) && ENABLE(SVG_FILTERS) diff --git a/WebCore/svg/graphics/qt/SVGResourceFilterQt.cpp b/WebCore/svg/graphics/qt/SVGResourceFilterQt.cpp deleted file mode 100644 index cbf90cd..0000000 --- a/WebCore/svg/graphics/qt/SVGResourceFilterQt.cpp +++ /dev/null @@ -1,50 +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) && ENABLE(SVG_FILTERS) -#include "SVGResourceFilter.h" -#include "NotImplemented.h" - -namespace WebCore { - -SVGResourceFilterPlatformData* SVGResourceFilter::createPlatformData() -{ - notImplemented(); - return 0; -} - -void SVGResourceFilter::prepareFilter(GraphicsContext*&, const FloatRect&) -{ - notImplemented(); -} - -void SVGResourceFilter::applyFilter(GraphicsContext*&, const FloatRect&) -{ - notImplemented(); -} - -} // namespace WebCore - -#endif - -// vim:ts=4:noet diff --git a/WebCore/svg/graphics/skia/SVGResourceFilterSkia.cpp b/WebCore/svg/graphics/skia/SVGResourceFilterSkia.cpp deleted file mode 100644 index b54eb4b..0000000 --- a/WebCore/svg/graphics/skia/SVGResourceFilterSkia.cpp +++ /dev/null @@ -1,55 +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) && ENABLE(SVG_FILTERS) -#include "NotImplemented.h" -#include "SVGResourceFilter.h" - -namespace WebCore { - -SVGResourceFilterPlatformData* SVGResourceFilter::createPlatformData() -{ - return 0; -} - -void SVGResourceFilter::prepareFilter(GraphicsContext*&, const FloatRect&) -{ - notImplemented(); -} - -void SVGResourceFilter::applyFilter(GraphicsContext*&, const FloatRect&) -{ - notImplemented(); -} - -} - -#endif // ENABLE(SVG) && ENABLE(SVG_FILTERS) diff --git a/WebCore/svg/svgtags.in b/WebCore/svg/svgtags.in index 6ac430d..471c77b 100644 --- a/WebCore/svg/svgtags.in +++ b/WebCore/svg/svgtags.in @@ -3,114 +3,111 @@ namespaceURI="http://www.w3.org/2000/svg" guardFactoryWith="ENABLE(SVG)" exportStrings -a +a createWithNew #if ENABLE_SVG_FONTS -altGlyph +altGlyph createWithNew #endif #if 0 -altGlyphDef -altGlyphItem +altGlyphDef createWithNew +altGlyphItem createWithNew #endif #if ENABLE_SVG_ANIMATION -animate -animateColor -animateMotion JSInterfaceName=SVGElement -animateTransform -set +animate createWithNew +animateColor createWithNew +animateMotion JSInterfaceName=SVGElement, createWithNew +animateTransform createWithNew +set createWithNew #endif -circle -clipPath +circle createWithNew +clipPath createWithNew #if 0 -color_profile +color_profile createWithNew #endif -cursor -#if ENABLE_SVG_FONTS -definition_src -#endif -defs -desc -ellipse +cursor createWithNew +defs createWithNew +desc createWithNew +ellipse createWithNew #if ENABLE_FILTERS -feBlend -feColorMatrix -feComponentTransfer -feComposite +feBlend createWithNew +feColorMatrix createWithNew +feComponentTransfer createWithNew +feComposite createWithNew #if 0 -feConvolveMatrix +feConvolveMatrix createWithNew #endif -feDiffuseLighting -feDisplacementMap -feDistantLight -feFlood -feFuncA -feFuncB -feFuncG -feFuncR -feGaussianBlur -feImage -feMerge -feMergeNode +feDiffuseLighting createWithNew +feDisplacementMap createWithNew +feDistantLight createWithNew +feFlood createWithNew +feFuncA createWithNew +feFuncB createWithNew +feFuncG createWithNew +feFuncR createWithNew +feGaussianBlur createWithNew +feImage createWithNew +feMerge createWithNew +feMergeNode createWithNew #if 0 -feMorphology +feMorphology createWithNew #endif -feOffset -fePointLight -feSpecularLighting -feSpotLight -feTile -feTurbulence -filter +feOffset createWithNew +fePointLight createWithNew +feSpecularLighting createWithNew +feSpotLight createWithNew +feTile createWithNew +feTurbulence createWithNew +filter createWithNew #endif #if ENABLE_SVG_FONTS -font -font_face -font_face_format -font_face_name -font_face_src -font_face_uri +font createWithNew +font_face createWithNew +font_face_format createWithNew +font_face_name createWithNew +font_face_src createWithNew +font_face_uri createWithNew #endif #if ENABLE_SVG_FOREIGN_OBJECT -foreignObject +foreignObject createWithNew #endif -g +g createWithNew #if ENABLE_SVG_FONTS -glyph +glyph createWithNew #endif #if 0 -glyphRef +glyphRef createWithNew #endif #if ENABLE_SVG_FONTS -hkern interfaceName=SVGHKernElement, JSInterfaceName=SVGElement +hkern interfaceName=SVGHKernElement, JSInterfaceName=SVGElement, createWithNew #endif -image -line -linearGradient -marker -mask -metadata +image createWithNew +line createWithNew +linearGradient createWithNew +marker createWithNew +mask createWithNew +metadata createWithNew #if ENABLE_SVG_FONTS -missing_glyph +missing_glyph createWithNew #endif -mpath interfaceName=SVGMPathElement, JSInterfaceName=SVGElement -path -pattern -polygon -polyline -radialGradient -rect -script constructorNeedsCreatedByParser -stop -style constructorNeedsCreatedByParser -svg interfaceName=SVGSVGElement -switch -symbol -text -textPath -title -tref interfaceName=SVGTRefElement -tspan interfaceName=SVGTSpanElement -use -view +mpath interfaceName=SVGMPathElement, JSInterfaceName=SVGElement, createWithNew +path createWithNew +pattern createWithNew +polygon createWithNew +polyline createWithNew +radialGradient createWithNew +rect createWithNew +script constructorNeedsCreatedByParser, createWithNew +stop createWithNew +style constructorNeedsCreatedByParser, createWithNew +svg interfaceName=SVGSVGElement, createWithNew +switch createWithNew +symbol createWithNew +text createWithNew +textPath createWithNew +title createWithNew +tref interfaceName=SVGTRefElement, createWithNew +tspan interfaceName=SVGTSpanElement, createWithNew +use createWithNew +view createWithNew #if 0 -vkern interfaceName=SVGVKernElement +vkern interfaceName=SVGVKernElement, createWithNew #endif |