diff options
author | Steve Block <steveblock@google.com> | 2009-12-15 10:12:09 +0000 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2009-12-17 17:41:10 +0000 |
commit | 643ca7872b450ea4efacab6188849e5aac2ba161 (patch) | |
tree | 6982576c228bcd1a7efe98afed544d840751094c /WebCore/svg | |
parent | d026980fde6eb3b01c1fe49441174e89cd1be298 (diff) | |
download | external_webkit-643ca7872b450ea4efacab6188849e5aac2ba161.zip external_webkit-643ca7872b450ea4efacab6188849e5aac2ba161.tar.gz external_webkit-643ca7872b450ea4efacab6188849e5aac2ba161.tar.bz2 |
Merge webkit.org at r51976 : Initial merge by git.
Change-Id: Ib0e7e2f0fb4bee5a186610272edf3186f0986b43
Diffstat (limited to 'WebCore/svg')
215 files changed, 506 insertions, 467 deletions
diff --git a/WebCore/svg/GradientAttributes.h b/WebCore/svg/GradientAttributes.h index 6b3408e..941e816 100644 --- a/WebCore/svg/GradientAttributes.h +++ b/WebCore/svg/GradientAttributes.h @@ -1,8 +1,6 @@ /* 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 diff --git a/WebCore/svg/LinearGradientAttributes.h b/WebCore/svg/LinearGradientAttributes.h index 0aefbac..b71dc22 100644 --- a/WebCore/svg/LinearGradientAttributes.h +++ b/WebCore/svg/LinearGradientAttributes.h @@ -1,8 +1,6 @@ /* 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 diff --git a/WebCore/svg/PatternAttributes.h b/WebCore/svg/PatternAttributes.h index b43d87e..36d1765 100644 --- a/WebCore/svg/PatternAttributes.h +++ b/WebCore/svg/PatternAttributes.h @@ -1,8 +1,6 @@ /* 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 diff --git a/WebCore/svg/RadialGradientAttributes.h b/WebCore/svg/RadialGradientAttributes.h index 7645721..76a78ec 100644 --- a/WebCore/svg/RadialGradientAttributes.h +++ b/WebCore/svg/RadialGradientAttributes.h @@ -1,8 +1,6 @@ /* 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 diff --git a/WebCore/svg/SVGAElement.cpp b/WebCore/svg/SVGAElement.cpp index 7cb7b3e..d0d3613 100644 --- a/WebCore/svg/SVGAElement.cpp +++ b/WebCore/svg/SVGAElement.cpp @@ -3,8 +3,6 @@ 2004, 2005, 2007 Rob Buis <buis@kde.org> 2007 Eric Seidel <eric@webkit.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 diff --git a/WebCore/svg/SVGAngle.idl b/WebCore/svg/SVGAngle.idl index fc7c1e1..1a05646 100644 --- a/WebCore/svg/SVGAngle.idl +++ b/WebCore/svg/SVGAngle.idl @@ -4,8 +4,6 @@ Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com> Copyright (C) 2006 Apple Computer, Inc. All rights reserved. - 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 diff --git a/WebCore/svg/SVGAnimateColorElement.cpp b/WebCore/svg/SVGAnimateColorElement.cpp index 1555f5e..ab48f18 100644 --- a/WebCore/svg/SVGAnimateColorElement.cpp +++ b/WebCore/svg/SVGAnimateColorElement.cpp @@ -3,8 +3,6 @@ 2004, 2005, 2006 Rob Buis <buis@kde.org> Copyright (C) 2007 Eric Seidel <eric@webkit.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 diff --git a/WebCore/svg/SVGAnimateColorElement.h b/WebCore/svg/SVGAnimateColorElement.h index 595f0a9..9071185 100644 --- a/WebCore/svg/SVGAnimateColorElement.h +++ b/WebCore/svg/SVGAnimateColorElement.h @@ -3,8 +3,6 @@ 2004, 2005, 2006 Rob Buis <buis@kde.org> Copyright (C) 2007 Eric Seidel <eric@webkit.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 diff --git a/WebCore/svg/SVGAnimateElement.cpp b/WebCore/svg/SVGAnimateElement.cpp index c2a83c0..31d681b 100644 --- a/WebCore/svg/SVGAnimateElement.cpp +++ b/WebCore/svg/SVGAnimateElement.cpp @@ -3,8 +3,6 @@ 2004, 2005, 2006 Rob Buis <buis@kde.org> Copyright (C) 2008 Apple Inc. All rights reserved. - 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 @@ -64,7 +62,7 @@ static bool parseNumberValueAndUnit(const String& in, double& value, String& uni unitLength = 4; String newUnit = parse.right(unitLength); String number = parse.left(parse.length() - unitLength); - if (!unit.isEmpty() && newUnit != unit || number.isEmpty()) + if ((!unit.isEmpty() && newUnit != unit) || number.isEmpty()) return false; UChar last = number[number.length() - 1]; if (last < '0' || last > '9') diff --git a/WebCore/svg/SVGAnimateElement.h b/WebCore/svg/SVGAnimateElement.h index b90e5c8..ac5883c 100644 --- a/WebCore/svg/SVGAnimateElement.h +++ b/WebCore/svg/SVGAnimateElement.h @@ -3,8 +3,6 @@ 2004, 2005 Rob Buis <buis@kde.org> Copyright (C) 2008 Apple Inc. All rights reserved. - 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 diff --git a/WebCore/svg/SVGAnimateTransformElement.h b/WebCore/svg/SVGAnimateTransformElement.h index 9b1f192..c9139c4 100644 --- a/WebCore/svg/SVGAnimateTransformElement.h +++ b/WebCore/svg/SVGAnimateTransformElement.h @@ -4,8 +4,6 @@ Copyright (C) 2007 Eric Seidel <eric@webkit.org> Copyright (C) 2008 Apple Inc. All Rights Reserved. - 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 diff --git a/WebCore/svg/SVGAnimatedPathData.cpp b/WebCore/svg/SVGAnimatedPathData.cpp index be75809..0f43f2c 100644 --- a/WebCore/svg/SVGAnimatedPathData.cpp +++ b/WebCore/svg/SVGAnimatedPathData.cpp @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005, 2006 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 diff --git a/WebCore/svg/SVGAnimatedPathData.h b/WebCore/svg/SVGAnimatedPathData.h index 88b994b..79bd586 100644 --- a/WebCore/svg/SVGAnimatedPathData.h +++ b/WebCore/svg/SVGAnimatedPathData.h @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005, 2006 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 diff --git a/WebCore/svg/SVGAnimatedPoints.cpp b/WebCore/svg/SVGAnimatedPoints.cpp index 584f875..57101b3 100644 --- a/WebCore/svg/SVGAnimatedPoints.cpp +++ b/WebCore/svg/SVGAnimatedPoints.cpp @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005, 2006 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 diff --git a/WebCore/svg/SVGAnimatedPoints.h b/WebCore/svg/SVGAnimatedPoints.h index 1e61057..9f44e1f 100644 --- a/WebCore/svg/SVGAnimatedPoints.h +++ b/WebCore/svg/SVGAnimatedPoints.h @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005, 2006 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 diff --git a/WebCore/svg/SVGAnimatedTemplate.h b/WebCore/svg/SVGAnimatedTemplate.h index e7c49c1..d65fe0b 100644 --- a/WebCore/svg/SVGAnimatedTemplate.h +++ b/WebCore/svg/SVGAnimatedTemplate.h @@ -172,7 +172,7 @@ namespace WebCore { typedef Type* DecoratedType; static Type null() { return 0; } - static AtomicString toString(Type type) { return type ? AtomicString(type->valueAsString()) : nullAtom; } + static String toString(Type type) { return type ? type->valueAsString() : String(); } }; template<> @@ -181,7 +181,7 @@ namespace WebCore { typedef bool DecoratedType; static bool null() { return false; } - static AtomicString toString(bool type) { return type ? "true" : "false"; } + static String toString(bool type) { return type ? "true" : "false"; } }; template<> @@ -190,7 +190,7 @@ namespace WebCore { typedef int DecoratedType; static int null() { return 0; } - static AtomicString toString(int type) { return String::number(type); } + static String toString(int type) { return String::number(type); } }; template<> @@ -199,7 +199,7 @@ namespace WebCore { typedef long DecoratedType; static long null() { return 0l; } - static AtomicString toString(long type) { return String::number(type); } + static String toString(long type) { return String::number(type); } }; template<> @@ -208,7 +208,7 @@ namespace WebCore { typedef SVGLength DecoratedType; static SVGLength null() { return SVGLength(); } - static AtomicString toString(const SVGLength& type) { return type.valueAsString(); } + static String toString(const SVGLength& type) { return type.valueAsString(); } }; template<> @@ -217,7 +217,7 @@ namespace WebCore { typedef float DecoratedType; static float null() { return 0.0f; } - static AtomicString toString(float type) { return String::number(type); } + static String toString(float type) { return String::number(type); } }; template<> @@ -226,7 +226,7 @@ namespace WebCore { typedef FloatRect DecoratedType; static FloatRect null() { return FloatRect(); } - static AtomicString toString(const FloatRect& type) { return String::format("%f %f %f %f", type.x(), type.y(), type.width(), type.height()); } + static String toString(const FloatRect& type) { return String::format("%f %f %f %f", type.x(), type.y(), type.width(), type.height()); } }; template<> @@ -235,7 +235,7 @@ namespace WebCore { typedef String DecoratedType; static String null() { return String(); } - static AtomicString toString(const String& type) { return type; } + static String toString(const String& type) { return type; } }; // Common type definitions, to ease IDL generation. diff --git a/WebCore/svg/SVGAnimationElement.cpp b/WebCore/svg/SVGAnimationElement.cpp index 67e32e0..ce3670d 100644 --- a/WebCore/svg/SVGAnimationElement.cpp +++ b/WebCore/svg/SVGAnimationElement.cpp @@ -5,8 +5,6 @@ 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 - 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 @@ -489,7 +487,7 @@ void SVGAnimationElement::startedActiveInterval() m_animationValid = m_values.size() > 1 && (calcMode == CalcModePaced || !hasAttribute(SVGNames::keyTimesAttr) || hasAttribute(SVGNames::keyPointsAttr) || (m_values.size() == m_keyTimes.size())) && (calcMode == CalcModeDiscrete || !m_keyTimes.size() || m_keyTimes.last() == 1.0) - && (calcMode != CalcModeSpline || (m_keySplines.size() && (m_keySplines.size() == m_values.size() - 1) || m_keySplines.size() == m_keyPoints.size() - 1)) + && (calcMode != CalcModeSpline || ((m_keySplines.size() && (m_keySplines.size() == m_values.size() - 1)) || m_keySplines.size() == m_keyPoints.size() - 1)) && (!hasAttribute(SVGNames::keyPointsAttr) || (m_keyTimes.size() > 1 && m_keyTimes.size() == m_keyPoints.size())); if (calcMode == CalcModePaced && m_animationValid) calculateKeyTimesForCalcModePaced(); diff --git a/WebCore/svg/SVGCircleElement.cpp b/WebCore/svg/SVGCircleElement.cpp index 2329299..d96842a 100644 --- a/WebCore/svg/SVGCircleElement.cpp +++ b/WebCore/svg/SVGCircleElement.cpp @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005, 2006, 2008 Nikolas Zimmermann <zimmermann@kde.org> 2004, 2005, 2006, 2007 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 diff --git a/WebCore/svg/SVGClipPathElement.cpp b/WebCore/svg/SVGClipPathElement.cpp index bbeac91..d5df29c 100644 --- a/WebCore/svg/SVGClipPathElement.cpp +++ b/WebCore/svg/SVGClipPathElement.cpp @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005, 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org> 2004, 2005, 2006, 2007, 2008 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 diff --git a/WebCore/svg/SVGColor.cpp b/WebCore/svg/SVGColor.cpp index d819ebf..ede0b0a 100644 --- a/WebCore/svg/SVGColor.cpp +++ b/WebCore/svg/SVGColor.cpp @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005 Nikolas Zimmermann <wildfox@kde.org> 2004, 2005, 2006, 2007 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 diff --git a/WebCore/svg/SVGColor.idl b/WebCore/svg/SVGColor.idl index 320a9b7..43bcb70 100644 --- a/WebCore/svg/SVGColor.idl +++ b/WebCore/svg/SVGColor.idl @@ -3,8 +3,6 @@ 2004, 2005 Rob Buis <buis@kde.org> Copyright (C) 2006 Apple Computer, Inc. All rights reserved. - 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 diff --git a/WebCore/svg/SVGComponentTransferFunctionElement.cpp b/WebCore/svg/SVGComponentTransferFunctionElement.cpp index e479fae..bb08ebb 100644 --- a/WebCore/svg/SVGComponentTransferFunctionElement.cpp +++ b/WebCore/svg/SVGComponentTransferFunctionElement.cpp @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005, 2007 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 diff --git a/WebCore/svg/SVGComponentTransferFunctionElement.h b/WebCore/svg/SVGComponentTransferFunctionElement.h index a26c953..c955df5 100644 --- a/WebCore/svg/SVGComponentTransferFunctionElement.h +++ b/WebCore/svg/SVGComponentTransferFunctionElement.h @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005, 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 diff --git a/WebCore/svg/SVGCursorElement.cpp b/WebCore/svg/SVGCursorElement.cpp index b282aa3..f5aa615 100644 --- a/WebCore/svg/SVGCursorElement.cpp +++ b/WebCore/svg/SVGCursorElement.cpp @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005, 2006, 2008 Nikolas Zimmermann <zimmermann@kde.org> 2004, 2005, 2006, 2007 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 diff --git a/WebCore/svg/SVGDefsElement.cpp b/WebCore/svg/SVGDefsElement.cpp index c03c09b..051edeb 100644 --- a/WebCore/svg/SVGDefsElement.cpp +++ b/WebCore/svg/SVGDefsElement.cpp @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005 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 diff --git a/WebCore/svg/SVGDescElement.cpp b/WebCore/svg/SVGDescElement.cpp index 0297ad2..319dfda 100644 --- a/WebCore/svg/SVGDescElement.cpp +++ b/WebCore/svg/SVGDescElement.cpp @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005 Nikolas Zimmermann <wildfox@kde.org> 2004, 2005 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 diff --git a/WebCore/svg/SVGDescElement.h b/WebCore/svg/SVGDescElement.h index c8bc501..846a23e 100644 --- a/WebCore/svg/SVGDescElement.h +++ b/WebCore/svg/SVGDescElement.h @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005 Nikolas Zimmermann <zimmermann@kde.org> 2004, 2005 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 diff --git a/WebCore/svg/SVGDocument.idl b/WebCore/svg/SVGDocument.idl index 61f4e2e..26b70d1 100644 --- a/WebCore/svg/SVGDocument.idl +++ b/WebCore/svg/SVGDocument.idl @@ -3,8 +3,6 @@ 2004, 2005 Rob Buis <buis@kde.org> Copyright (C) 2006 Apple Computer, Inc. All rights reserved. - 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 diff --git a/WebCore/svg/SVGDocumentExtensions.cpp b/WebCore/svg/SVGDocumentExtensions.cpp index 61645f4..b2492b4 100644 --- a/WebCore/svg/SVGDocumentExtensions.cpp +++ b/WebCore/svg/SVGDocumentExtensions.cpp @@ -34,6 +34,7 @@ #include "Frame.h" #include "FrameLoader.h" #include "Page.h" +#include "SVGSMILElement.h" #include "SVGSVGElement.h" #include "SMILTimeContainer.h" #include "XMLTokenizer.h" @@ -86,6 +87,17 @@ void SVGDocumentExtensions::unpauseAnimations() (*itr)->unpauseAnimations(); } +bool SVGDocumentExtensions::sampleAnimationAtTime(const String& elementId, SVGSMILElement* element, double time) +{ + ASSERT(element); + SMILTimeContainer* container = element->timeContainer(); + if (!container || container->isPaused()) + return false; + + container->sampleAnimationAtTime(elementId, time); + return true; +} + void SVGDocumentExtensions::reportWarning(const String& message) { if (Frame* frame = m_doc->frame()) diff --git a/WebCore/svg/SVGDocumentExtensions.h b/WebCore/svg/SVGDocumentExtensions.h index cd20a30..b66e2dc 100644 --- a/WebCore/svg/SVGDocumentExtensions.h +++ b/WebCore/svg/SVGDocumentExtensions.h @@ -41,9 +41,10 @@ class Node; class String; class SVGElementInstance; class SVGStyledElement; +class SVGSMILElement; class SVGSVGElement; -class SVGDocumentExtensions { +class SVGDocumentExtensions : public Noncopyable { public: SVGDocumentExtensions(Document*); ~SVGDocumentExtensions(); @@ -54,6 +55,7 @@ public: void startAnimations(); void pauseAnimations(); void unpauseAnimations(); + bool sampleAnimationAtTime(const String& elementId, SVGSMILElement*, double time); void reportWarning(const String&); void reportError(const String&); diff --git a/WebCore/svg/SVGElement.idl b/WebCore/svg/SVGElement.idl index e4112c1..27fcb8d 100644 --- a/WebCore/svg/SVGElement.idl +++ b/WebCore/svg/SVGElement.idl @@ -4,8 +4,6 @@ Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com> Copyright (C) 2006 Apple Computer, Inc. All rights reserved. - 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 diff --git a/WebCore/svg/SVGElementInstanceList.cpp b/WebCore/svg/SVGElementInstanceList.cpp index f039d44..9404734 100644 --- a/WebCore/svg/SVGElementInstanceList.cpp +++ b/WebCore/svg/SVGElementInstanceList.cpp @@ -1,8 +1,6 @@ /* Copyright (C) 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 diff --git a/WebCore/svg/SVGElementInstanceList.h b/WebCore/svg/SVGElementInstanceList.h index ef4c73c..9da4cdc 100644 --- a/WebCore/svg/SVGElementInstanceList.h +++ b/WebCore/svg/SVGElementInstanceList.h @@ -1,8 +1,6 @@ /* Copyright (C) 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 diff --git a/WebCore/svg/SVGEllipseElement.cpp b/WebCore/svg/SVGEllipseElement.cpp index 4c67ff3..3946fb9 100644 --- a/WebCore/svg/SVGEllipseElement.cpp +++ b/WebCore/svg/SVGEllipseElement.cpp @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005, 2006, 2008 Nikolas Zimmermann <zimmermann@kde.org> 2004, 2005, 2006, 2007 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 diff --git a/WebCore/svg/SVGExternalResourcesRequired.cpp b/WebCore/svg/SVGExternalResourcesRequired.cpp index 201ecbf..b6b62d1 100644 --- a/WebCore/svg/SVGExternalResourcesRequired.cpp +++ b/WebCore/svg/SVGExternalResourcesRequired.cpp @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005, 2008 Nikolas Zimmermann <zimmermann@kde.org> 2004, 2005, 2007 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 diff --git a/WebCore/svg/SVGFEBlendElement.cpp b/WebCore/svg/SVGFEBlendElement.cpp index 0497ea9..03c5795 100644 --- a/WebCore/svg/SVGFEBlendElement.cpp +++ b/WebCore/svg/SVGFEBlendElement.cpp @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005, 2007 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 diff --git a/WebCore/svg/SVGFEBlendElement.h b/WebCore/svg/SVGFEBlendElement.h index bed649f..c32eabd 100644 --- a/WebCore/svg/SVGFEBlendElement.h +++ b/WebCore/svg/SVGFEBlendElement.h @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005, 2007 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 diff --git a/WebCore/svg/SVGFEColorMatrixElement.cpp b/WebCore/svg/SVGFEColorMatrixElement.cpp index c2d605b..88a0d66 100644 --- a/WebCore/svg/SVGFEColorMatrixElement.cpp +++ b/WebCore/svg/SVGFEColorMatrixElement.cpp @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005, 2007 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 diff --git a/WebCore/svg/SVGFEColorMatrixElement.h b/WebCore/svg/SVGFEColorMatrixElement.h index 5b7a9ae..f3329e4 100644 --- a/WebCore/svg/SVGFEColorMatrixElement.h +++ b/WebCore/svg/SVGFEColorMatrixElement.h @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005, 2007 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 diff --git a/WebCore/svg/SVGFEComponentTransferElement.cpp b/WebCore/svg/SVGFEComponentTransferElement.cpp index 691d5cd..f1df08c 100644 --- a/WebCore/svg/SVGFEComponentTransferElement.cpp +++ b/WebCore/svg/SVGFEComponentTransferElement.cpp @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org> 2004, 2005 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 diff --git a/WebCore/svg/SVGFEComponentTransferElement.h b/WebCore/svg/SVGFEComponentTransferElement.h index 21c95d2..46d6d9d 100644 --- a/WebCore/svg/SVGFEComponentTransferElement.h +++ b/WebCore/svg/SVGFEComponentTransferElement.h @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org> 2004, 2005 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 diff --git a/WebCore/svg/SVGFECompositeElement.cpp b/WebCore/svg/SVGFECompositeElement.cpp index 6eec6ea..a2dd05a 100644 --- a/WebCore/svg/SVGFECompositeElement.cpp +++ b/WebCore/svg/SVGFECompositeElement.cpp @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005, 2007 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 diff --git a/WebCore/svg/SVGFECompositeElement.h b/WebCore/svg/SVGFECompositeElement.h index fc97169..1bb6b05 100644 --- a/WebCore/svg/SVGFECompositeElement.h +++ b/WebCore/svg/SVGFECompositeElement.h @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005, 2007 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 diff --git a/WebCore/svg/SVGFEDiffuseLightingElement.cpp b/WebCore/svg/SVGFEDiffuseLightingElement.cpp index edbd852..ed6e353 100644 --- a/WebCore/svg/SVGFEDiffuseLightingElement.cpp +++ b/WebCore/svg/SVGFEDiffuseLightingElement.cpp @@ -88,20 +88,18 @@ bool SVGFEDiffuseLightingElement::build(SVGResourceFilter* filterResource) return true; } -LightSource* SVGFEDiffuseLightingElement::findLights() const +PassRefPtr<LightSource> SVGFEDiffuseLightingElement::findLights() const { - LightSource* light = 0; for (Node* n = firstChild(); n; n = n->nextSibling()) { if (n->hasTagName(SVGNames::feDistantLightTag) || n->hasTagName(SVGNames::fePointLightTag) || n->hasTagName(SVGNames::feSpotLightTag)) { SVGFELightElement* lightNode = static_cast<SVGFELightElement*>(n); - light = lightNode->lightSource(); - break; + return lightNode->lightSource(); } } - return light; + return 0; } } diff --git a/WebCore/svg/SVGFEDiffuseLightingElement.h b/WebCore/svg/SVGFEDiffuseLightingElement.h index fcb5eee..ed117a4 100644 --- a/WebCore/svg/SVGFEDiffuseLightingElement.h +++ b/WebCore/svg/SVGFEDiffuseLightingElement.h @@ -49,7 +49,7 @@ namespace WebCore { ANIMATED_PROPERTY_DECLARATIONS(SVGFEDiffuseLightingElement, SVGNames::feDiffuseLightingTagString, SVGKernelUnitLengthXIdentifier, float, KernelUnitLengthX, kernelUnitLengthX) ANIMATED_PROPERTY_DECLARATIONS(SVGFEDiffuseLightingElement, SVGNames::feDiffuseLightingTagString, SVGKernelUnitLengthYIdentifier, float, KernelUnitLengthY, kernelUnitLengthY) - LightSource* findLights() const; + PassRefPtr<LightSource> findLights() const; }; } // namespace WebCore diff --git a/WebCore/svg/SVGFEDistantLightElement.cpp b/WebCore/svg/SVGFEDistantLightElement.cpp index 35c487b..8322a3a 100644 --- a/WebCore/svg/SVGFEDistantLightElement.cpp +++ b/WebCore/svg/SVGFEDistantLightElement.cpp @@ -34,9 +34,9 @@ SVGFEDistantLightElement::~SVGFEDistantLightElement() { } -LightSource* SVGFEDistantLightElement::lightSource() const +PassRefPtr<LightSource> SVGFEDistantLightElement::lightSource() const { - return new DistantLightSource(azimuth(), elevation()); + return DistantLightSource::create(azimuth(), elevation()); } } diff --git a/WebCore/svg/SVGFEDistantLightElement.h b/WebCore/svg/SVGFEDistantLightElement.h index 95f45c8..3d0c039 100644 --- a/WebCore/svg/SVGFEDistantLightElement.h +++ b/WebCore/svg/SVGFEDistantLightElement.h @@ -29,7 +29,7 @@ namespace WebCore { SVGFEDistantLightElement(const QualifiedName&, Document*); virtual ~SVGFEDistantLightElement(); - virtual LightSource* lightSource() const; + virtual PassRefPtr<LightSource> lightSource() const; }; } // namespace WebCore diff --git a/WebCore/svg/SVGFEFloodElement.cpp b/WebCore/svg/SVGFEFloodElement.cpp index 3d80799..d69c240 100644 --- a/WebCore/svg/SVGFEFloodElement.cpp +++ b/WebCore/svg/SVGFEFloodElement.cpp @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org> 2004, 2005, 2007, 2008 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 diff --git a/WebCore/svg/SVGFEFloodElement.h b/WebCore/svg/SVGFEFloodElement.h index e83fc94..b8b49e7 100644 --- a/WebCore/svg/SVGFEFloodElement.h +++ b/WebCore/svg/SVGFEFloodElement.h @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org> 2004, 2005, 2008 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 diff --git a/WebCore/svg/SVGFEFuncAElement.cpp b/WebCore/svg/SVGFEFuncAElement.cpp index 41118fe..a02b0e5 100644 --- a/WebCore/svg/SVGFEFuncAElement.cpp +++ b/WebCore/svg/SVGFEFuncAElement.cpp @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005 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 diff --git a/WebCore/svg/SVGFEFuncAElement.h b/WebCore/svg/SVGFEFuncAElement.h index 8ec6b1c..55a3c9d 100644 --- a/WebCore/svg/SVGFEFuncAElement.h +++ b/WebCore/svg/SVGFEFuncAElement.h @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005 Nikolas Zimmermann <zimmermann@kde.org> 2004, 2005 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 diff --git a/WebCore/svg/SVGFEFuncBElement.cpp b/WebCore/svg/SVGFEFuncBElement.cpp index 190b23a..2bf939b 100644 --- a/WebCore/svg/SVGFEFuncBElement.cpp +++ b/WebCore/svg/SVGFEFuncBElement.cpp @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005 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 diff --git a/WebCore/svg/SVGFEFuncBElement.h b/WebCore/svg/SVGFEFuncBElement.h index 5d86f87..177ed26 100644 --- a/WebCore/svg/SVGFEFuncBElement.h +++ b/WebCore/svg/SVGFEFuncBElement.h @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005 Nikolas Zimmermann <zimmermann@kde.org> 2004, 2005 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 diff --git a/WebCore/svg/SVGFEFuncGElement.cpp b/WebCore/svg/SVGFEFuncGElement.cpp index d5e5625..e0d60f4 100644 --- a/WebCore/svg/SVGFEFuncGElement.cpp +++ b/WebCore/svg/SVGFEFuncGElement.cpp @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005 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 diff --git a/WebCore/svg/SVGFEFuncGElement.h b/WebCore/svg/SVGFEFuncGElement.h index 9f5d3d7..4eeafa0 100644 --- a/WebCore/svg/SVGFEFuncGElement.h +++ b/WebCore/svg/SVGFEFuncGElement.h @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005 Nikolas Zimmermann <zimmermann@kde.org> 2004, 2005 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 diff --git a/WebCore/svg/SVGFEFuncRElement.cpp b/WebCore/svg/SVGFEFuncRElement.cpp index e3d7ee4..e8e6b99 100644 --- a/WebCore/svg/SVGFEFuncRElement.cpp +++ b/WebCore/svg/SVGFEFuncRElement.cpp @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005 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 diff --git a/WebCore/svg/SVGFEFuncRElement.h b/WebCore/svg/SVGFEFuncRElement.h index 0a0d115..196cfa3 100644 --- a/WebCore/svg/SVGFEFuncRElement.h +++ b/WebCore/svg/SVGFEFuncRElement.h @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005 Nikolas Zimmermann <zimmermann@kde.org> 2004, 2005 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 diff --git a/WebCore/svg/SVGFEGaussianBlurElement.cpp b/WebCore/svg/SVGFEGaussianBlurElement.cpp index 4cddb5a..b2970b3 100644 --- a/WebCore/svg/SVGFEGaussianBlurElement.cpp +++ b/WebCore/svg/SVGFEGaussianBlurElement.cpp @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005, 2007 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 diff --git a/WebCore/svg/SVGFEGaussianBlurElement.h b/WebCore/svg/SVGFEGaussianBlurElement.h index c9bb613..9a5c058 100644 --- a/WebCore/svg/SVGFEGaussianBlurElement.h +++ b/WebCore/svg/SVGFEGaussianBlurElement.h @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005, 2007 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 diff --git a/WebCore/svg/SVGFEImageElement.cpp b/WebCore/svg/SVGFEImageElement.cpp index 269d6b2..52531ee 100644 --- a/WebCore/svg/SVGFEImageElement.cpp +++ b/WebCore/svg/SVGFEImageElement.cpp @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org> 2004, 2005 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 diff --git a/WebCore/svg/SVGFELightElement.h b/WebCore/svg/SVGFELightElement.h index 92947a1..705eeaa 100644 --- a/WebCore/svg/SVGFELightElement.h +++ b/WebCore/svg/SVGFELightElement.h @@ -36,7 +36,7 @@ namespace WebCore { SVGFELightElement(const QualifiedName&, Document*); virtual ~SVGFELightElement(); - virtual LightSource* lightSource() const = 0; + virtual PassRefPtr<LightSource> lightSource() const = 0; virtual void parseMappedAttribute(MappedAttribute*); private: diff --git a/WebCore/svg/SVGFEMergeElement.cpp b/WebCore/svg/SVGFEMergeElement.cpp index 8f4eed9..6c703ca 100644 --- a/WebCore/svg/SVGFEMergeElement.cpp +++ b/WebCore/svg/SVGFEMergeElement.cpp @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005, 2007 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 diff --git a/WebCore/svg/SVGFEMergeElement.h b/WebCore/svg/SVGFEMergeElement.h index e63ed04..f84ddce 100644 --- a/WebCore/svg/SVGFEMergeElement.h +++ b/WebCore/svg/SVGFEMergeElement.h @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005, 2007 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 diff --git a/WebCore/svg/SVGFEMergeNodeElement.cpp b/WebCore/svg/SVGFEMergeNodeElement.cpp index ae08706..4161de8 100644 --- a/WebCore/svg/SVGFEMergeNodeElement.cpp +++ b/WebCore/svg/SVGFEMergeNodeElement.cpp @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005 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 diff --git a/WebCore/svg/SVGFEOffsetElement.cpp b/WebCore/svg/SVGFEOffsetElement.cpp index 945a9da..95cbc8d 100644 --- a/WebCore/svg/SVGFEOffsetElement.cpp +++ b/WebCore/svg/SVGFEOffsetElement.cpp @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org> 2004, 2005 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 diff --git a/WebCore/svg/SVGFEOffsetElement.h b/WebCore/svg/SVGFEOffsetElement.h index 1471abe..ae07ed8 100644 --- a/WebCore/svg/SVGFEOffsetElement.h +++ b/WebCore/svg/SVGFEOffsetElement.h @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org> 2004, 2005 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 diff --git a/WebCore/svg/SVGFEPointLightElement.cpp b/WebCore/svg/SVGFEPointLightElement.cpp index 088f878..36ed2e9 100644 --- a/WebCore/svg/SVGFEPointLightElement.cpp +++ b/WebCore/svg/SVGFEPointLightElement.cpp @@ -34,10 +34,10 @@ SVGFEPointLightElement::~SVGFEPointLightElement() { } -LightSource* SVGFEPointLightElement::lightSource() const +PassRefPtr<LightSource> SVGFEPointLightElement::lightSource() const { FloatPoint3D pos(x(), y(), z()); - return new PointLightSource(pos); + return PointLightSource::create(pos); } } diff --git a/WebCore/svg/SVGFEPointLightElement.h b/WebCore/svg/SVGFEPointLightElement.h index b39fffa..9b1f997 100644 --- a/WebCore/svg/SVGFEPointLightElement.h +++ b/WebCore/svg/SVGFEPointLightElement.h @@ -29,7 +29,7 @@ namespace WebCore { SVGFEPointLightElement(const QualifiedName&, Document*); virtual ~SVGFEPointLightElement(); - virtual LightSource* lightSource() const; + virtual PassRefPtr<LightSource> lightSource() const; }; } // namespace WebCore diff --git a/WebCore/svg/SVGFESpecularLightingElement.cpp b/WebCore/svg/SVGFESpecularLightingElement.cpp index 7afa4cc..90e9cb3 100644 --- a/WebCore/svg/SVGFESpecularLightingElement.cpp +++ b/WebCore/svg/SVGFESpecularLightingElement.cpp @@ -70,20 +70,18 @@ void SVGFESpecularLightingElement::parseMappedAttribute(MappedAttribute* attr) SVGFilterPrimitiveStandardAttributes::parseMappedAttribute(attr); } -LightSource* SVGFESpecularLightingElement::findLights() const +PassRefPtr<LightSource> SVGFESpecularLightingElement::findLights() const { - LightSource* light = 0; for (Node* n = firstChild(); n; n = n->nextSibling()) { if (n->hasTagName(SVGNames::feDistantLightTag) || n->hasTagName(SVGNames::fePointLightTag) || n->hasTagName(SVGNames::feSpotLightTag)) { SVGFELightElement* lightNode = static_cast<SVGFELightElement*>(n); - light = lightNode->lightSource(); - break; + return lightNode->lightSource(); } } - return light; + return 0; } bool SVGFESpecularLightingElement::build(SVGResourceFilter* filterResource) diff --git a/WebCore/svg/SVGFESpecularLightingElement.h b/WebCore/svg/SVGFESpecularLightingElement.h index 8ef490a..b3771fe 100644 --- a/WebCore/svg/SVGFESpecularLightingElement.h +++ b/WebCore/svg/SVGFESpecularLightingElement.h @@ -48,8 +48,8 @@ namespace WebCore { ANIMATED_PROPERTY_DECLARATIONS(SVGFESpecularLightingElement, SVGNames::feSpecularLightingTagString, SVGNames::surfaceScaleAttrString, float, SurfaceScale, surfaceScale) ANIMATED_PROPERTY_DECLARATIONS(SVGFESpecularLightingElement, SVGNames::feSpecularLightingTagString, SVGKernelUnitLengthXIdentifier, float, KernelUnitLengthX, kernelUnitLengthX) ANIMATED_PROPERTY_DECLARATIONS(SVGFESpecularLightingElement, SVGNames::feSpecularLightingTagString, SVGKernelUnitLengthYIdentifier, float, KernelUnitLengthY, kernelUnitLengthY) - - LightSource* findLights() const; + + PassRefPtr<LightSource> findLights() const; }; } // namespace WebCore diff --git a/WebCore/svg/SVGFESpotLightElement.cpp b/WebCore/svg/SVGFESpotLightElement.cpp index 980a3bb..01fe54e 100644 --- a/WebCore/svg/SVGFESpotLightElement.cpp +++ b/WebCore/svg/SVGFESpotLightElement.cpp @@ -34,7 +34,7 @@ SVGFESpotLightElement::~SVGFESpotLightElement() { } -LightSource* SVGFESpotLightElement::lightSource() const +PassRefPtr<LightSource> SVGFESpotLightElement::lightSource() const { FloatPoint3D pos(x(), y(), z()); @@ -44,7 +44,7 @@ LightSource* SVGFESpotLightElement::lightSource() const pointsAtZ() - pos.z()); direction.normalize(); - return new SpotLightSource(pos, direction, specularExponent(), limitingConeAngle()); + return SpotLightSource::create(pos, direction, specularExponent(), limitingConeAngle()); } } diff --git a/WebCore/svg/SVGFESpotLightElement.h b/WebCore/svg/SVGFESpotLightElement.h index 440c664..d54e232 100644 --- a/WebCore/svg/SVGFESpotLightElement.h +++ b/WebCore/svg/SVGFESpotLightElement.h @@ -29,7 +29,7 @@ namespace WebCore { SVGFESpotLightElement(const QualifiedName&, Document*); virtual ~SVGFESpotLightElement(); - virtual LightSource* lightSource() const; + virtual PassRefPtr<LightSource> lightSource() const; }; } // namespace WebCore diff --git a/WebCore/svg/SVGFETileElement.cpp b/WebCore/svg/SVGFETileElement.cpp index 14af25f..8894d4b 100644 --- a/WebCore/svg/SVGFETileElement.cpp +++ b/WebCore/svg/SVGFETileElement.cpp @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org> 2004, 2005 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 diff --git a/WebCore/svg/SVGFETileElement.h b/WebCore/svg/SVGFETileElement.h index b4fc0c5..142a797 100644 --- a/WebCore/svg/SVGFETileElement.h +++ b/WebCore/svg/SVGFETileElement.h @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org> 2004, 2005 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 diff --git a/WebCore/svg/SVGFETurbulenceElement.cpp b/WebCore/svg/SVGFETurbulenceElement.cpp index b296e00..57114a3 100644 --- a/WebCore/svg/SVGFETurbulenceElement.cpp +++ b/WebCore/svg/SVGFETurbulenceElement.cpp @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005, 2007 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 diff --git a/WebCore/svg/SVGFETurbulenceElement.h b/WebCore/svg/SVGFETurbulenceElement.h index 3c95da8..f024f57 100644 --- a/WebCore/svg/SVGFETurbulenceElement.h +++ b/WebCore/svg/SVGFETurbulenceElement.h @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005, 2007 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 diff --git a/WebCore/svg/SVGFilterElement.cpp b/WebCore/svg/SVGFilterElement.cpp index db46179..bb14448 100644 --- a/WebCore/svg/SVGFilterElement.cpp +++ b/WebCore/svg/SVGFilterElement.cpp @@ -4,8 +4,6 @@ Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com> Copyright (C) 2009 Dirk Schulze <krit@webkit.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 @@ -28,12 +26,14 @@ #include "SVGFilterElement.h" #include "Attr.h" -#include "SVGFilterBuilder.h" +#include "FloatSize.h" #include "MappedAttribute.h" #include "PlatformString.h" +#include "SVGFilterBuilder.h" #include "SVGFilterPrimitiveStandardAttributes.h" #include "SVGLength.h" #include "SVGNames.h" +#include "SVGParserUtilities.h" #include "SVGResourceFilter.h" #include "SVGUnitTypes.h" @@ -91,7 +91,13 @@ void SVGFilterElement::parseMappedAttribute(MappedAttribute* attr) setWidthBaseValue(SVGLength(LengthModeWidth, value)); else if (attr->name() == SVGNames::heightAttr) setHeightBaseValue(SVGLength(LengthModeHeight, value)); - else { + else if (attr->name() == SVGNames::filterResAttr) { + float x, y; + if (parseNumberOptionalNumber(value, x, y)) { + setFilterResXBaseValue(x); + setFilterResYBaseValue(y); + } + } else { if (SVGURIReference::parseMappedAttribute(attr)) return; if (SVGLangSpace::parseMappedAttribute(attr)) @@ -132,6 +138,11 @@ void SVGFilterElement::buildFilter(const FloatRect& targetRect) const m_filter->setEffectBoundingBoxMode(primitiveBBoxMode); m_filter->setFilterBoundingBoxMode(filterBBoxMode); + if (hasAttribute(SVGNames::filterResAttr)) { + m_filter->setHasFilterResolution(true); + m_filter->setFilterResolution(FloatSize(filterResX(), filterResY())); + } + // Add effects to the filter m_filter->builder()->clearEffects(); for (Node* n = firstChild(); n != 0; n = n->nextSibling()) { diff --git a/WebCore/svg/SVGFilterPrimitiveStandardAttributes.cpp b/WebCore/svg/SVGFilterPrimitiveStandardAttributes.cpp index 67c8bff..08559b4 100644 --- a/WebCore/svg/SVGFilterPrimitiveStandardAttributes.cpp +++ b/WebCore/svg/SVGFilterPrimitiveStandardAttributes.cpp @@ -97,7 +97,7 @@ void SVGFilterPrimitiveStandardAttributes::setStandardAttributes(SVGResourceFilt width().value(this), height().value(this)); - filterEffect->setSubRegion(effectBBox); + filterEffect->setEffectBoundaries(effectBBox); } } diff --git a/WebCore/svg/SVGFontData.h b/WebCore/svg/SVGFontData.h index 4df3db2..3f17e3e 100644 --- a/WebCore/svg/SVGFontData.h +++ b/WebCore/svg/SVGFontData.h @@ -26,7 +26,7 @@ namespace WebCore { -class SVGFontData { +class SVGFontData : public Noncopyable { public: SVGFontData(SVGFontFaceElement*); virtual ~SVGFontData(); diff --git a/WebCore/svg/SVGGElement.cpp b/WebCore/svg/SVGGElement.cpp index 241f264..ef46af4 100644 --- a/WebCore/svg/SVGGElement.cpp +++ b/WebCore/svg/SVGGElement.cpp @@ -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 diff --git a/WebCore/svg/SVGGradientElement.cpp b/WebCore/svg/SVGGradientElement.cpp index 93e2cb4..b4fe21d 100644 --- a/WebCore/svg/SVGGradientElement.cpp +++ b/WebCore/svg/SVGGradientElement.cpp @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005, 2006, 2008 Nikolas Zimmermann <zimmermann@kde.org> 2004, 2005, 2006, 2007 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 diff --git a/WebCore/svg/SVGHKernElement.idl b/WebCore/svg/SVGHKernElement.idl index 1971aef..7706578 100644 --- a/WebCore/svg/SVGHKernElement.idl +++ b/WebCore/svg/SVGHKernElement.idl @@ -1,8 +1,6 @@ /* Copyright (C) 2008 Apple Computer, Inc. All rights reserved. - 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 diff --git a/WebCore/svg/SVGLangSpace.cpp b/WebCore/svg/SVGLangSpace.cpp index d49e09a..f0d6997 100644 --- a/WebCore/svg/SVGLangSpace.cpp +++ b/WebCore/svg/SVGLangSpace.cpp @@ -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 diff --git a/WebCore/svg/SVGLangSpace.h b/WebCore/svg/SVGLangSpace.h index df8606e..1613998 100644 --- a/WebCore/svg/SVGLangSpace.h +++ b/WebCore/svg/SVGLangSpace.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 diff --git a/WebCore/svg/SVGLength.cpp b/WebCore/svg/SVGLength.cpp index ca3bac3..2884507 100644 --- a/WebCore/svg/SVGLength.cpp +++ b/WebCore/svg/SVGLength.cpp @@ -3,8 +3,6 @@ 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org> 2007 Apple Inc. All rights reserved. - 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 diff --git a/WebCore/svg/SVGLength.h b/WebCore/svg/SVGLength.h index 7846b4a..a14bc68 100644 --- a/WebCore/svg/SVGLength.h +++ b/WebCore/svg/SVGLength.h @@ -2,8 +2,6 @@ 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 - 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 diff --git a/WebCore/svg/SVGLength.idl b/WebCore/svg/SVGLength.idl index 20748b1..3938a2c 100644 --- a/WebCore/svg/SVGLength.idl +++ b/WebCore/svg/SVGLength.idl @@ -4,8 +4,6 @@ Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com> Copyright (C) 2006 Apple Computer, Inc. All rights reserved. - 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 diff --git a/WebCore/svg/SVGLengthList.cpp b/WebCore/svg/SVGLengthList.cpp index 20b61d6..367befb 100644 --- a/WebCore/svg/SVGLengthList.cpp +++ b/WebCore/svg/SVGLengthList.cpp @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005, 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 diff --git a/WebCore/svg/SVGLengthList.h b/WebCore/svg/SVGLengthList.h index e83fee8..00fc3f8 100644 --- a/WebCore/svg/SVGLengthList.h +++ b/WebCore/svg/SVGLengthList.h @@ -2,8 +2,6 @@ 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 - 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 diff --git a/WebCore/svg/SVGLineElement.cpp b/WebCore/svg/SVGLineElement.cpp index 4f7b7e5..a359698 100644 --- a/WebCore/svg/SVGLineElement.cpp +++ b/WebCore/svg/SVGLineElement.cpp @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005, 2006, 2008 Nikolas Zimmermann <zimmermann@kde.org> 2004, 2005, 2006, 2007 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 diff --git a/WebCore/svg/SVGLinearGradientElement.h b/WebCore/svg/SVGLinearGradientElement.h index 0e1efd4..492c366 100644 --- a/WebCore/svg/SVGLinearGradientElement.h +++ b/WebCore/svg/SVGLinearGradientElement.h @@ -2,8 +2,6 @@ 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 - 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 diff --git a/WebCore/svg/SVGList.h b/WebCore/svg/SVGList.h index c04c200..8fb3bc1 100644 --- a/WebCore/svg/SVGList.h +++ b/WebCore/svg/SVGList.h @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005, 2006, 2008 Nikolas Zimmermann <zimmermann@kde.org> 2004, 2005 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 @@ -41,6 +39,10 @@ namespace WebCore { { return SVGListTraits<UsesDefaultInitializer<Item>::value, Item>::nullItem(); } + static bool isNull(const Item& it) + { + return SVGListTraits<UsesDefaultInitializer<Item>::value, Item>::isNull(it); + } }; template<typename Item> @@ -58,6 +60,10 @@ namespace WebCore { Item initialize(Item newItem, ExceptionCode& ec) { + if (TypeOperations::isNull(newItem)) { + ec = TYPE_MISMATCH_ERR; + return TypeOperations::nullItem(); + } clear(ec); return appendItem(newItem, ec); } @@ -94,8 +100,13 @@ namespace WebCore { return m_vector[index]; } - Item insertItemBefore(Item newItem, unsigned int index, ExceptionCode&) + Item insertItemBefore(Item newItem, unsigned int index, ExceptionCode& ec) { + if (TypeOperations::isNull(newItem)) { + ec = TYPE_MISMATCH_ERR; + return TypeOperations::nullItem(); + } + if (index < m_vector.size()) { m_vector.insert(index, newItem); } else { @@ -110,6 +121,11 @@ namespace WebCore { ec = INDEX_SIZE_ERR; return TypeOperations::nullItem(); } + + if (TypeOperations::isNull(newItem)) { + ec = TYPE_MISMATCH_ERR; + return TypeOperations::nullItem(); + } m_vector[index] = newItem; return newItem; @@ -127,8 +143,13 @@ namespace WebCore { return item; } - Item appendItem(Item newItem, ExceptionCode&) + Item appendItem(Item newItem, ExceptionCode& ec) { + if (TypeOperations::isNull(newItem)) { + ec = TYPE_MISMATCH_ERR; + return TypeOperations::nullItem(); + } + m_vector.append(newItem); return newItem; } diff --git a/WebCore/svg/SVGListTraits.h b/WebCore/svg/SVGListTraits.h index d96bc67..f58b9b9 100644 --- a/WebCore/svg/SVGListTraits.h +++ b/WebCore/svg/SVGListTraits.h @@ -2,8 +2,6 @@ Copyright (C) 2006 Nikolas Zimmermann <wildfox@kde.org> 2006 Apple Computer Inc. - 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,24 +23,48 @@ #if ENABLE(SVG) +#include <wtf/RefPtr.h> + namespace WebCore { template<typename Item> struct UsesDefaultInitializer { static const bool value = true; }; template<> struct UsesDefaultInitializer<double> { static const bool value = false; }; + template<> struct UsesDefaultInitializer<float> { static const bool value = false; }; template<bool usesDefaultInitializer, typename Item> struct SVGListTraits { }; + template<typename ItemPtr> + struct SVGListTraits<true, ItemPtr*> { + static ItemPtr* nullItem() { return 0; } + static bool isNull(ItemPtr* it) { return !it; } + }; + + template<typename ItemPtr> + struct SVGListTraits<true, RefPtr<ItemPtr> > { + static RefPtr<ItemPtr> nullItem() { return 0; } + static bool isNull(const RefPtr<ItemPtr>& it) { return !it; } + }; + template<typename Item> struct SVGListTraits<true, Item> { - static Item nullItem() { return Item(); } + static Item nullItem() { return Item(); } + static bool isNull(Item it) { return !it; } }; template<> struct SVGListTraits<false, double> { static double nullItem() { return 0.0; } + static bool isNull(double) { return false; } }; + template<> + struct SVGListTraits<false, float> { + static float nullItem() { return 0; } + static bool isNull(float) { return false; } + }; + + } // namespace WebCore #endif // SVG_SUPPORT diff --git a/WebCore/svg/SVGLocatable.h b/WebCore/svg/SVGLocatable.h index ccb9072..180dae5 100644 --- a/WebCore/svg/SVGLocatable.h +++ b/WebCore/svg/SVGLocatable.h @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005 Nikolas Zimmermann <wildfox@kde.org> 2004, 2005, 2007 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 diff --git a/WebCore/svg/SVGMaskElement.cpp b/WebCore/svg/SVGMaskElement.cpp index 127f6f4..e131d34 100644 --- a/WebCore/svg/SVGMaskElement.cpp +++ b/WebCore/svg/SVGMaskElement.cpp @@ -2,8 +2,7 @@ Copyright (C) 2004, 2005, 2006, 2008 Nikolas Zimmermann <zimmermann@kde.org> 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org> 2005 Alexander Kellett <lypanov@kde.org> - - This file is part of the KDE project + 2009 Dirk Schulze <krit@webkit.org> This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public @@ -158,11 +157,14 @@ PassOwnPtr<ImageBuffer> SVGMaskElement::drawMaskerContent(const FloatRect& targe return 0; FloatPoint maskContextLocation = maskDestRect.location(); - if (maskUnits() == SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX) + if (maskUnits() == SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX) { maskDestRect.move(targetRect.x(), targetRect.y()); - - if (maskContentUnits() != SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX) - maskContextLocation.move(targetRect.x(), targetRect.y()); + if (maskContentUnits() == SVGUnitTypes::SVG_UNIT_TYPE_USERSPACEONUSE) + maskContextLocation.move(targetRect.x(), targetRect.y()); + } else { + if (maskContentUnits() == SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX) + maskContextLocation.move(-targetRect.x(), -targetRect.y()); + } GraphicsContext* maskImageContext = maskImage->context(); ASSERT(maskImageContext); diff --git a/WebCore/svg/SVGMatrix.idl b/WebCore/svg/SVGMatrix.idl index cb8c08b..d064aa9 100644 --- a/WebCore/svg/SVGMatrix.idl +++ b/WebCore/svg/SVGMatrix.idl @@ -4,8 +4,6 @@ Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com> Copyright (C) 2006 Apple Computer, Inc. All rights reserved. - 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 @@ -34,7 +32,7 @@ module svg { attribute double e; attribute double f; - [Immutable] SVGMatrix multiply(in SVGMatrix secondMatrix); + [Custom] SVGMatrix multiply(in SVGMatrix secondMatrix); [Custom] SVGMatrix inverse() raises(SVGException); [Immutable] SVGMatrix translate(in float x, in float y); diff --git a/WebCore/svg/SVGMetadataElement.cpp b/WebCore/svg/SVGMetadataElement.cpp index a18f73a..2cefc7d 100644 --- a/WebCore/svg/SVGMetadataElement.cpp +++ b/WebCore/svg/SVGMetadataElement.cpp @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005 Nikolas Zimmermann <wildfox@kde.org> 2004, 2005 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 diff --git a/WebCore/svg/SVGMetadataElement.h b/WebCore/svg/SVGMetadataElement.h index 63d0aae..afa6a8e 100644 --- a/WebCore/svg/SVGMetadataElement.h +++ b/WebCore/svg/SVGMetadataElement.h @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005 Nikolas Zimmermann <wildfox@kde.org> 2004, 2005 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 diff --git a/WebCore/svg/SVGMetadataElement.idl b/WebCore/svg/SVGMetadataElement.idl index ce65b5e..9434f4d 100644 --- a/WebCore/svg/SVGMetadataElement.idl +++ b/WebCore/svg/SVGMetadataElement.idl @@ -3,8 +3,6 @@ 2004, 2005 Rob Buis <buis@kde.org> Copyright (C) 2006 Apple Computer, Inc. All rights reserved. - 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 diff --git a/WebCore/svg/SVGNumber.idl b/WebCore/svg/SVGNumber.idl index 7e4c8bd..7e1a117 100644 --- a/WebCore/svg/SVGNumber.idl +++ b/WebCore/svg/SVGNumber.idl @@ -4,8 +4,6 @@ Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com> Copyright (C) 2006 Apple Computer, Inc. All rights reserved. - 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 diff --git a/WebCore/svg/SVGNumberList.cpp b/WebCore/svg/SVGNumberList.cpp index 4e904f4..c73e397 100644 --- a/WebCore/svg/SVGNumberList.cpp +++ b/WebCore/svg/SVGNumberList.cpp @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005, 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 diff --git a/WebCore/svg/SVGNumberList.h b/WebCore/svg/SVGNumberList.h index 6cd43ff..29de27e 100644 --- a/WebCore/svg/SVGNumberList.h +++ b/WebCore/svg/SVGNumberList.h @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005, 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 diff --git a/WebCore/svg/SVGPaint.cpp b/WebCore/svg/SVGPaint.cpp index 45abe69..3b39b91 100644 --- a/WebCore/svg/SVGPaint.cpp +++ b/WebCore/svg/SVGPaint.cpp @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005 Nikolas Zimmermann <wildfox@kde.org> 2004, 2005, 2006, 2007 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 diff --git a/WebCore/svg/SVGPathElement.cpp b/WebCore/svg/SVGPathElement.cpp index 7079929..d53fbb2 100644 --- a/WebCore/svg/SVGPathElement.cpp +++ b/WebCore/svg/SVGPathElement.cpp @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005, 2006, 2008 Nikolas Zimmermann <zimmermann@kde.org> 2004, 2005, 2006, 2007 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 @@ -71,9 +69,9 @@ FloatPoint SVGPathElement::getPointAtLength(float length) return toPathData().pointAtLength(length, ok); } -unsigned long SVGPathElement::getPathSegAtLength(float length) +unsigned long SVGPathElement::getPathSegAtLength(float length, ExceptionCode& ec) { - return pathSegList()->getPathSegAtLength(length); + return pathSegList()->getPathSegAtLength(length, ec); } PassRefPtr<SVGPathSegClosePath> SVGPathElement::createSVGPathSegClosePath() diff --git a/WebCore/svg/SVGPathElement.h b/WebCore/svg/SVGPathElement.h index 7ea010b..266bfdd 100644 --- a/WebCore/svg/SVGPathElement.h +++ b/WebCore/svg/SVGPathElement.h @@ -62,7 +62,7 @@ namespace WebCore { virtual bool isValid() const { return SVGTests::isValid(); } float getTotalLength(); FloatPoint getPointAtLength(float distance); - unsigned long getPathSegAtLength(float distance); + unsigned long getPathSegAtLength(float distance, ExceptionCode&); static PassRefPtr<SVGPathSegClosePath> createSVGPathSegClosePath(); static PassRefPtr<SVGPathSegMovetoAbs> createSVGPathSegMovetoAbs(float x, float y); diff --git a/WebCore/svg/SVGPathElement.idl b/WebCore/svg/SVGPathElement.idl index d66df1d..9a389c8 100644 --- a/WebCore/svg/SVGPathElement.idl +++ b/WebCore/svg/SVGPathElement.idl @@ -37,7 +37,8 @@ module svg { float getTotalLength(); SVGPoint getPointAtLength(in float distance); - unsigned long getPathSegAtLength(in float distance); + unsigned long getPathSegAtLength(in float distance) + raises(DOMException, SVGException); SVGPathSegClosePath createSVGPathSegClosePath(); diff --git a/WebCore/svg/SVGPathSeg.h b/WebCore/svg/SVGPathSeg.h index 84de92f..b88806c 100644 --- a/WebCore/svg/SVGPathSeg.h +++ b/WebCore/svg/SVGPathSeg.h @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005, 2006, 2008 Nikolas Zimmermann <zimmermann@kde.org> 2004, 2005, 2006, 2008 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 diff --git a/WebCore/svg/SVGPathSegArc.cpp b/WebCore/svg/SVGPathSegArc.cpp index a54f057..5fb0243 100644 --- a/WebCore/svg/SVGPathSegArc.cpp +++ b/WebCore/svg/SVGPathSegArc.cpp @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org> 2004, 2005, 2006, 2008 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 diff --git a/WebCore/svg/SVGPathSegArc.h b/WebCore/svg/SVGPathSegArc.h index 8611e8a..e1cbeb1 100644 --- a/WebCore/svg/SVGPathSegArc.h +++ b/WebCore/svg/SVGPathSegArc.h @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org> 2004, 2005, 2006, 2008 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 diff --git a/WebCore/svg/SVGPathSegClosePath.cpp b/WebCore/svg/SVGPathSegClosePath.cpp index 04b711c..1f58096 100644 --- a/WebCore/svg/SVGPathSegClosePath.cpp +++ b/WebCore/svg/SVGPathSegClosePath.cpp @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005, 2006 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 diff --git a/WebCore/svg/SVGPathSegClosePath.h b/WebCore/svg/SVGPathSegClosePath.h index 190af9e..0e29bb3 100644 --- a/WebCore/svg/SVGPathSegClosePath.h +++ b/WebCore/svg/SVGPathSegClosePath.h @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005, 2006 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 diff --git a/WebCore/svg/SVGPathSegCurvetoCubic.cpp b/WebCore/svg/SVGPathSegCurvetoCubic.cpp index 14359de..6b87f55 100644 --- a/WebCore/svg/SVGPathSegCurvetoCubic.cpp +++ b/WebCore/svg/SVGPathSegCurvetoCubic.cpp @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org> 2004, 2005, 2006, 2008 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 diff --git a/WebCore/svg/SVGPathSegCurvetoCubic.h b/WebCore/svg/SVGPathSegCurvetoCubic.h index 68e3311..125b3a3 100644 --- a/WebCore/svg/SVGPathSegCurvetoCubic.h +++ b/WebCore/svg/SVGPathSegCurvetoCubic.h @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org> 2004, 2005, 2006, 2008 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 diff --git a/WebCore/svg/SVGPathSegCurvetoCubicSmooth.cpp b/WebCore/svg/SVGPathSegCurvetoCubicSmooth.cpp index 26babdb..97b256b 100644 --- a/WebCore/svg/SVGPathSegCurvetoCubicSmooth.cpp +++ b/WebCore/svg/SVGPathSegCurvetoCubicSmooth.cpp @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org> 2004, 2005, 2006, 2008 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 diff --git a/WebCore/svg/SVGPathSegCurvetoCubicSmooth.h b/WebCore/svg/SVGPathSegCurvetoCubicSmooth.h index 816ba0f..db71dac 100644 --- a/WebCore/svg/SVGPathSegCurvetoCubicSmooth.h +++ b/WebCore/svg/SVGPathSegCurvetoCubicSmooth.h @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org> 2004, 2005, 2006, 2008 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 diff --git a/WebCore/svg/SVGPathSegCurvetoQuadratic.cpp b/WebCore/svg/SVGPathSegCurvetoQuadratic.cpp index 8594fde..f3de513 100644 --- a/WebCore/svg/SVGPathSegCurvetoQuadratic.cpp +++ b/WebCore/svg/SVGPathSegCurvetoQuadratic.cpp @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org> 2004, 2005, 2006, 2008 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 diff --git a/WebCore/svg/SVGPathSegCurvetoQuadratic.h b/WebCore/svg/SVGPathSegCurvetoQuadratic.h index 1625f13..eb8b0d5 100644 --- a/WebCore/svg/SVGPathSegCurvetoQuadratic.h +++ b/WebCore/svg/SVGPathSegCurvetoQuadratic.h @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org> 2004, 2005, 2006, 2008 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 diff --git a/WebCore/svg/SVGPathSegCurvetoQuadraticSmooth.cpp b/WebCore/svg/SVGPathSegCurvetoQuadraticSmooth.cpp index 3377709..a64cbb6 100644 --- a/WebCore/svg/SVGPathSegCurvetoQuadraticSmooth.cpp +++ b/WebCore/svg/SVGPathSegCurvetoQuadraticSmooth.cpp @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org> 2004, 2005, 2006, 2008 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 diff --git a/WebCore/svg/SVGPathSegCurvetoQuadraticSmooth.h b/WebCore/svg/SVGPathSegCurvetoQuadraticSmooth.h index 3017689..00eeec7 100644 --- a/WebCore/svg/SVGPathSegCurvetoQuadraticSmooth.h +++ b/WebCore/svg/SVGPathSegCurvetoQuadraticSmooth.h @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org> 2004, 2005, 2006, 2008 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 diff --git a/WebCore/svg/SVGPathSegLineto.cpp b/WebCore/svg/SVGPathSegLineto.cpp index ac3a8bd..9ad300e 100644 --- a/WebCore/svg/SVGPathSegLineto.cpp +++ b/WebCore/svg/SVGPathSegLineto.cpp @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org> 2004, 2005, 2008 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 diff --git a/WebCore/svg/SVGPathSegLineto.h b/WebCore/svg/SVGPathSegLineto.h index 1818ad2..500d5e4 100644 --- a/WebCore/svg/SVGPathSegLineto.h +++ b/WebCore/svg/SVGPathSegLineto.h @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org> 2004, 2005, 2006, 2008 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 diff --git a/WebCore/svg/SVGPathSegLinetoHorizontal.cpp b/WebCore/svg/SVGPathSegLinetoHorizontal.cpp index 3de2cc7..f217919 100644 --- a/WebCore/svg/SVGPathSegLinetoHorizontal.cpp +++ b/WebCore/svg/SVGPathSegLinetoHorizontal.cpp @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org> 2004, 2005, 2008 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 diff --git a/WebCore/svg/SVGPathSegLinetoHorizontal.h b/WebCore/svg/SVGPathSegLinetoHorizontal.h index 84965a5..87d6475 100644 --- a/WebCore/svg/SVGPathSegLinetoHorizontal.h +++ b/WebCore/svg/SVGPathSegLinetoHorizontal.h @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org> 2004, 2005, 2006, 2008 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 diff --git a/WebCore/svg/SVGPathSegLinetoVertical.cpp b/WebCore/svg/SVGPathSegLinetoVertical.cpp index 4f667ee..341ab02 100644 --- a/WebCore/svg/SVGPathSegLinetoVertical.cpp +++ b/WebCore/svg/SVGPathSegLinetoVertical.cpp @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org> 2004, 2005, 2006, 2008 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 diff --git a/WebCore/svg/SVGPathSegLinetoVertical.h b/WebCore/svg/SVGPathSegLinetoVertical.h index 8d4ba29..844f2f2 100644 --- a/WebCore/svg/SVGPathSegLinetoVertical.h +++ b/WebCore/svg/SVGPathSegLinetoVertical.h @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org> 2004, 2005, 2006, 2008 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 diff --git a/WebCore/svg/SVGPathSegList.cpp b/WebCore/svg/SVGPathSegList.cpp index 8d6fdef..11cad14 100644 --- a/WebCore/svg/SVGPathSegList.cpp +++ b/WebCore/svg/SVGPathSegList.cpp @@ -51,15 +51,16 @@ SVGPathSegList::~SVGPathSegList() { } -unsigned SVGPathSegList::getPathSegAtLength(double) +unsigned SVGPathSegList::getPathSegAtLength(double, ExceptionCode& ec) { // FIXME : to be useful this will need to support non-normalized SVGPathSegLists - ExceptionCode ec = 0; int len = numberOfItems(); // FIXME: Eventually this will likely move to a "path applier"-like model, until then PathTraversalState is less useful as we could just use locals PathTraversalState traversalState(PathTraversalState::TraversalSegmentAtLength); for (int i = 0; i < len; ++i) { SVGPathSeg* segment = getItem(i, ec).get(); + if (ec) + return 0; float segmentLength = 0; switch (segment->pathSegType()) { case SVGPathSeg::PATHSEG_MOVETO_ABS: @@ -104,10 +105,12 @@ Path SVGPathSegList::toPathData() { // FIXME : This should also support non-normalized PathSegLists Path pathData; - ExceptionCode ec = 0; int len = numberOfItems(); + ExceptionCode ec = 0; for (int i = 0; i < len; ++i) { SVGPathSeg* segment = getItem(i, ec).get(); + if (ec) + return Path(); switch (segment->pathSegType()) { case SVGPathSeg::PATHSEG_MOVETO_ABS: { @@ -182,10 +185,14 @@ PassRefPtr<SVGPathSegList> SVGPathSegList::createAnimated(const SVGPathSegList* if (!itemCount || itemCount != toList->numberOfItems()) return 0; RefPtr<SVGPathSegList> result = create(fromList->associatedAttributeName()); - ExceptionCode ec; + ExceptionCode ec = 0; for (unsigned n = 0; n < itemCount; ++n) { SVGPathSeg* from = fromList->getItem(n, ec).get(); + if (ec) + return 0; SVGPathSeg* to = toList->getItem(n, ec).get(); + if (ec) + return 0; if (from->pathSegType() == SVGPathSeg::PATHSEG_UNKNOWN || from->pathSegType() != to->pathSegType()) return 0; RefPtr<SVGPathSeg> segment = 0; @@ -251,6 +258,8 @@ PassRefPtr<SVGPathSegList> SVGPathSegList::createAnimated(const SVGPathSegList* ASSERT_NOT_REACHED(); } result->appendItem(segment, ec); + if (ec) + return 0; } return result.release(); } diff --git a/WebCore/svg/SVGPathSegList.h b/WebCore/svg/SVGPathSegList.h index d9325ce..d2999f0 100644 --- a/WebCore/svg/SVGPathSegList.h +++ b/WebCore/svg/SVGPathSegList.h @@ -36,7 +36,7 @@ namespace WebCore { static PassRefPtr<SVGPathSegList> create(const QualifiedName& attributeName) { return adoptRef(new SVGPathSegList(attributeName)); } virtual ~SVGPathSegList(); - unsigned getPathSegAtLength(double); + unsigned getPathSegAtLength(double, ExceptionCode&); Path toPathData(); static PassRefPtr<SVGPathSegList> createAnimated(const SVGPathSegList* fromList, const SVGPathSegList* toList, float progress); diff --git a/WebCore/svg/SVGPathSegMoveto.cpp b/WebCore/svg/SVGPathSegMoveto.cpp index fc67b29..1144779 100644 --- a/WebCore/svg/SVGPathSegMoveto.cpp +++ b/WebCore/svg/SVGPathSegMoveto.cpp @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org> 2004, 2005, 2006, 2008 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 diff --git a/WebCore/svg/SVGPathSegMoveto.h b/WebCore/svg/SVGPathSegMoveto.h index 726b819..5d30633 100644 --- a/WebCore/svg/SVGPathSegMoveto.h +++ b/WebCore/svg/SVGPathSegMoveto.h @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org> 2004, 2005, 2006, 2008 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 diff --git a/WebCore/svg/SVGPatternElement.cpp b/WebCore/svg/SVGPatternElement.cpp index 34b7db4..a10c2c2 100644 --- a/WebCore/svg/SVGPatternElement.cpp +++ b/WebCore/svg/SVGPatternElement.cpp @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005, 2006, 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org> 2004, 2005, 2006, 2007 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 diff --git a/WebCore/svg/SVGPoint.idl b/WebCore/svg/SVGPoint.idl index 1a0d227..1bf96f8 100644 --- a/WebCore/svg/SVGPoint.idl +++ b/WebCore/svg/SVGPoint.idl @@ -4,8 +4,6 @@ Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com> Copyright (C) 2006 Apple Computer, Inc. All rights reserved. - 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 diff --git a/WebCore/svg/SVGPointList.cpp b/WebCore/svg/SVGPointList.cpp index c5a6dd2..02a67ed 100644 --- a/WebCore/svg/SVGPointList.cpp +++ b/WebCore/svg/SVGPointList.cpp @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005, 2006, 2008 Nikolas Zimmermann <zimmermann@kde.org> 2004, 2005 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 diff --git a/WebCore/svg/SVGPointList.h b/WebCore/svg/SVGPointList.h index d443e2d..cc12366 100644 --- a/WebCore/svg/SVGPointList.h +++ b/WebCore/svg/SVGPointList.h @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005, 2006, 2008 Nikolas Zimmermann <zimmermann@kde.org> 2004, 2005 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 diff --git a/WebCore/svg/SVGPolyElement.cpp b/WebCore/svg/SVGPolyElement.cpp index 62e53a3..61725b5 100644 --- a/WebCore/svg/SVGPolyElement.cpp +++ b/WebCore/svg/SVGPolyElement.cpp @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005, 2006, 2008 Nikolas Zimmermann <zimmermann@kde.org> 2004, 2005, 2006, 2007 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 diff --git a/WebCore/svg/SVGPolygonElement.cpp b/WebCore/svg/SVGPolygonElement.cpp index 95513e4..a4a62af 100644 --- a/WebCore/svg/SVGPolygonElement.cpp +++ b/WebCore/svg/SVGPolygonElement.cpp @@ -2,8 +2,6 @@ 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 - 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 diff --git a/WebCore/svg/SVGPolygonElement.h b/WebCore/svg/SVGPolygonElement.h index 7afb553..fa6eef6 100644 --- a/WebCore/svg/SVGPolygonElement.h +++ b/WebCore/svg/SVGPolygonElement.h @@ -2,8 +2,6 @@ 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 - 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 diff --git a/WebCore/svg/SVGPolylineElement.cpp b/WebCore/svg/SVGPolylineElement.cpp index 9ea136e..899c072 100644 --- a/WebCore/svg/SVGPolylineElement.cpp +++ b/WebCore/svg/SVGPolylineElement.cpp @@ -2,8 +2,6 @@ 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 - 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 diff --git a/WebCore/svg/SVGPolylineElement.h b/WebCore/svg/SVGPolylineElement.h index d43dbbe..e070c9f 100644 --- a/WebCore/svg/SVGPolylineElement.h +++ b/WebCore/svg/SVGPolylineElement.h @@ -2,8 +2,6 @@ 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 - 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 diff --git a/WebCore/svg/SVGPreserveAspectRatio.cpp b/WebCore/svg/SVGPreserveAspectRatio.cpp index 5793976..e6452c3 100644 --- a/WebCore/svg/SVGPreserveAspectRatio.cpp +++ b/WebCore/svg/SVGPreserveAspectRatio.cpp @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005, 2008 Nikolas Zimmermann <zimmermann@kde.org> 2004, 2005, 2006, 2007 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 @@ -180,7 +178,7 @@ TransformationMatrix SVGPreserveAspectRatio::getCTM(double logicX, double logicY if (align() == SVG_PRESERVEASPECTRATIO_NONE) { temp.scaleNonUniform(physWidth / logicWidth, physHeight / logicHeight); temp.translate(-logicX, -logicY); - } else if (vpar < svgar && (meetOrSlice() == SVG_MEETORSLICE_MEET) || vpar >= svgar && (meetOrSlice() == SVG_MEETORSLICE_SLICE)) { + } else if ((vpar < svgar && (meetOrSlice() == SVG_MEETORSLICE_MEET)) || (vpar >= svgar && (meetOrSlice() == SVG_MEETORSLICE_SLICE))) { temp.scaleNonUniform(physHeight / logicHeight, physHeight / logicHeight); if (align() == SVG_PRESERVEASPECTRATIO_XMINYMIN || align() == SVG_PRESERVEASPECTRATIO_XMINYMID || align() == SVG_PRESERVEASPECTRATIO_XMINYMAX) diff --git a/WebCore/svg/SVGPreserveAspectRatio.h b/WebCore/svg/SVGPreserveAspectRatio.h index a0100ff..18a89dd 100644 --- a/WebCore/svg/SVGPreserveAspectRatio.h +++ b/WebCore/svg/SVGPreserveAspectRatio.h @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005, 2008 Nikolas Zimmermann <zimmermann@kde.org> 2004, 2005, 2006, 2007 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 diff --git a/WebCore/svg/SVGRadialGradientElement.cpp b/WebCore/svg/SVGRadialGradientElement.cpp index a9b5cff..270de6f 100644 --- a/WebCore/svg/SVGRadialGradientElement.cpp +++ b/WebCore/svg/SVGRadialGradientElement.cpp @@ -105,23 +105,37 @@ void SVGRadialGradientElement::buildGradient() const radius = attributes.r().value(this); } - float adjustedFocusX = focalPoint.x(); - float adjustedFocusY = focalPoint.y(); - - float fdx = focalPoint.x() - centerPoint.x(); - float fdy = focalPoint.y() - centerPoint.y(); + FloatPoint adjustedFocalPoint = focalPoint; + float dfx = focalPoint.x() - centerPoint.x(); + float dfy = focalPoint.y() - centerPoint.y(); // Spec: If (fx, fy) lies outside the circle defined by (cx, cy) and // r, set (fx, fy) to the point of intersection of the line through // (fx, fy) and the circle. - if (sqrt(fdx * fdx + fdy * fdy) > radius) { - float angle = atan2f(focalPoint.y() * 100.0f, focalPoint.x() * 100.0f); - adjustedFocusX = cosf(angle) * radius; - adjustedFocusY = sinf(angle) * radius; + if (sqrt(dfx * dfx + dfy * dfy) >= radius) { + float angle = atan2f(dfx, dfy); + + // The maximum deviation of 0.2% is needed on Cairo, since Cairo + // is working with fixed point numbers. +#if PLATFORM(CAIRO) + if (focalPoint.x() < centerPoint.x()) + dfx = cosf(angle) * radius + 0.002f; + else + dfx = cosf(angle) * radius - 0.002f; + if (focalPoint.y() < centerPoint.y()) + dfy = sinf(angle) * radius + 0.002f; + else + dfy = sinf(angle) * radius - 0.002f; +#else + dfx = cosf(angle) * radius; + dfy = sinf(angle) * radius; +#endif + + adjustedFocalPoint = FloatPoint(dfx + centerPoint.x(), dfy + centerPoint.y()); } RefPtr<Gradient> gradient = Gradient::create( - FloatPoint(adjustedFocusX, adjustedFocusY), + adjustedFocalPoint, 0.f, // SVG does not support a "focus radius" centerPoint, radius); diff --git a/WebCore/svg/SVGRadialGradientElement.h b/WebCore/svg/SVGRadialGradientElement.h index 6813e65..61f56f5 100644 --- a/WebCore/svg/SVGRadialGradientElement.h +++ b/WebCore/svg/SVGRadialGradientElement.h @@ -2,8 +2,6 @@ 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 - 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 diff --git a/WebCore/svg/SVGRect.idl b/WebCore/svg/SVGRect.idl index 7fdce65..0278030 100644 --- a/WebCore/svg/SVGRect.idl +++ b/WebCore/svg/SVGRect.idl @@ -4,8 +4,6 @@ Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com> Copyright (C) 2006 Apple Computer, Inc. All rights reserved. - 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 diff --git a/WebCore/svg/SVGRectElement.cpp b/WebCore/svg/SVGRectElement.cpp index 966976a..f9b04c8 100644 --- a/WebCore/svg/SVGRectElement.cpp +++ b/WebCore/svg/SVGRectElement.cpp @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005, 2006, 2008 Nikolas Zimmermann <zimmermann@kde.org> 2004, 2005, 2006, 2007 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 diff --git a/WebCore/svg/SVGRenderingIntent.h b/WebCore/svg/SVGRenderingIntent.h index 699f228..f4bfa6a 100644 --- a/WebCore/svg/SVGRenderingIntent.h +++ b/WebCore/svg/SVGRenderingIntent.h @@ -1,8 +1,6 @@ /* 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 diff --git a/WebCore/svg/SVGSVGElement.idl b/WebCore/svg/SVGSVGElement.idl index b188894..46a17b0 100644 --- a/WebCore/svg/SVGSVGElement.idl +++ b/WebCore/svg/SVGSVGElement.idl @@ -4,8 +4,6 @@ Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com> Copyright (C) 2006 Apple Computer, Inc. All rights reserved. - 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 diff --git a/WebCore/svg/SVGScriptElement.cpp b/WebCore/svg/SVGScriptElement.cpp index c2f4a6e..7be72dc 100644 --- a/WebCore/svg/SVGScriptElement.cpp +++ b/WebCore/svg/SVGScriptElement.cpp @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005, 2008 Nikolas Zimmermann <zimmermann@kde.org> 2004, 2005, 2007 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 diff --git a/WebCore/svg/SVGSetElement.cpp b/WebCore/svg/SVGSetElement.cpp index 5800580..a6e81b3 100644 --- a/WebCore/svg/SVGSetElement.cpp +++ b/WebCore/svg/SVGSetElement.cpp @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005 Nikolas Zimmermann <wildfox@kde.org> 2004, 2005 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 diff --git a/WebCore/svg/SVGSetElement.h b/WebCore/svg/SVGSetElement.h index fda6919..7d0eced 100644 --- a/WebCore/svg/SVGSetElement.h +++ b/WebCore/svg/SVGSetElement.h @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005 Nikolas Zimmermann <wildfox@kde.org> 2004, 2005 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 diff --git a/WebCore/svg/SVGStopElement.cpp b/WebCore/svg/SVGStopElement.cpp index 51582d7..0549031 100644 --- a/WebCore/svg/SVGStopElement.cpp +++ b/WebCore/svg/SVGStopElement.cpp @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005, 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org> 2004, 2005, 2006, 2007 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 diff --git a/WebCore/svg/SVGStringList.cpp b/WebCore/svg/SVGStringList.cpp index 9a23a4a..70bfad8 100644 --- a/WebCore/svg/SVGStringList.cpp +++ b/WebCore/svg/SVGStringList.cpp @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005, 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 diff --git a/WebCore/svg/SVGStringList.h b/WebCore/svg/SVGStringList.h index 1cbe9d2..2fca6bc 100644 --- a/WebCore/svg/SVGStringList.h +++ b/WebCore/svg/SVGStringList.h @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005, 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 diff --git a/WebCore/svg/SVGStylable.cpp b/WebCore/svg/SVGStylable.cpp index 5d063c3..c72843a 100644 --- a/WebCore/svg/SVGStylable.cpp +++ b/WebCore/svg/SVGStylable.cpp @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005, 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 diff --git a/WebCore/svg/SVGStylable.h b/WebCore/svg/SVGStylable.h index ade5c2f..7e13d35 100644 --- a/WebCore/svg/SVGStylable.h +++ b/WebCore/svg/SVGStylable.h @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005, 2008 Nikolas Zimmermann <zimmermann@kde.org> 2004, 2005, 2006, 2007 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 diff --git a/WebCore/svg/SVGStyleElement.cpp b/WebCore/svg/SVGStyleElement.cpp index 31f5920..0a2195a 100644 --- a/WebCore/svg/SVGStyleElement.cpp +++ b/WebCore/svg/SVGStyleElement.cpp @@ -4,8 +4,6 @@ Copyright (C) 2006 Apple Computer, Inc. Copyright (C) 2009 Cameron McCormack <cam@mcc.id.au> - 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 diff --git a/WebCore/svg/SVGStyleElement.h b/WebCore/svg/SVGStyleElement.h index 3853fb3..de37f5d 100644 --- a/WebCore/svg/SVGStyleElement.h +++ b/WebCore/svg/SVGStyleElement.h @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005 Nikolas Zimmermann <wildfox@kde.org> 2004, 2005, 2006, 2007 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 diff --git a/WebCore/svg/SVGStyledElement.h b/WebCore/svg/SVGStyledElement.h index e21db97..9cc21c5 100644 --- a/WebCore/svg/SVGStyledElement.h +++ b/WebCore/svg/SVGStyledElement.h @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005, 2006, 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org> 2004, 2005, 2007 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 diff --git a/WebCore/svg/SVGStyledLocatableElement.cpp b/WebCore/svg/SVGStyledLocatableElement.cpp index 39ecb7d..a48082c 100644 --- a/WebCore/svg/SVGStyledLocatableElement.cpp +++ b/WebCore/svg/SVGStyledLocatableElement.cpp @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005, 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 diff --git a/WebCore/svg/SVGStyledLocatableElement.h b/WebCore/svg/SVGStyledLocatableElement.h index 41a034d..3902c73 100644 --- a/WebCore/svg/SVGStyledLocatableElement.h +++ b/WebCore/svg/SVGStyledLocatableElement.h @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005, 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 diff --git a/WebCore/svg/SVGStyledTransformableElement.cpp b/WebCore/svg/SVGStyledTransformableElement.cpp index b7cf979..4e97c83 100644 --- a/WebCore/svg/SVGStyledTransformableElement.cpp +++ b/WebCore/svg/SVGStyledTransformableElement.cpp @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005, 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 diff --git a/WebCore/svg/SVGStyledTransformableElement.h b/WebCore/svg/SVGStyledTransformableElement.h index cf5713e..3145e6f 100644 --- a/WebCore/svg/SVGStyledTransformableElement.h +++ b/WebCore/svg/SVGStyledTransformableElement.h @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005, 2008 Nikolas Zimmermann <zimmermann@kde.org> 2004, 2005, 2006, 2007 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 diff --git a/WebCore/svg/SVGSwitchElement.cpp b/WebCore/svg/SVGSwitchElement.cpp index a07b2a7..6d0f5d1 100644 --- a/WebCore/svg/SVGSwitchElement.cpp +++ b/WebCore/svg/SVGSwitchElement.cpp @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005 Nikolas Zimmermann <wildfox@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 diff --git a/WebCore/svg/SVGSymbolElement.cpp b/WebCore/svg/SVGSymbolElement.cpp index 4155b0c..6f3a644 100644 --- a/WebCore/svg/SVGSymbolElement.cpp +++ b/WebCore/svg/SVGSymbolElement.cpp @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005 Nikolas Zimmermann <wildfox@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 diff --git a/WebCore/svg/SVGTRefElement.cpp b/WebCore/svg/SVGTRefElement.cpp index 5b8640a..1f32e90 100644 --- a/WebCore/svg/SVGTRefElement.cpp +++ b/WebCore/svg/SVGTRefElement.cpp @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005 Nikolas Zimmermann <wildfox@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 diff --git a/WebCore/svg/SVGTSpanElement.cpp b/WebCore/svg/SVGTSpanElement.cpp index eadae1e..12bf377 100644 --- a/WebCore/svg/SVGTSpanElement.cpp +++ b/WebCore/svg/SVGTSpanElement.cpp @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005, 2007 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 diff --git a/WebCore/svg/SVGTSpanElement.h b/WebCore/svg/SVGTSpanElement.h index 7a29e96..17445d3 100644 --- a/WebCore/svg/SVGTSpanElement.h +++ b/WebCore/svg/SVGTSpanElement.h @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005, 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 diff --git a/WebCore/svg/SVGTests.h b/WebCore/svg/SVGTests.h index 2d82cb4..a2abddf 100644 --- a/WebCore/svg/SVGTests.h +++ b/WebCore/svg/SVGTests.h @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005, 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 diff --git a/WebCore/svg/SVGTextElement.cpp b/WebCore/svg/SVGTextElement.cpp index b8c7331..c1481cf 100644 --- a/WebCore/svg/SVGTextElement.cpp +++ b/WebCore/svg/SVGTextElement.cpp @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005, 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org> 2004, 2005, 2006, 2008 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 diff --git a/WebCore/svg/SVGTextElement.h b/WebCore/svg/SVGTextElement.h index a5cb382..400aa47 100644 --- a/WebCore/svg/SVGTextElement.h +++ b/WebCore/svg/SVGTextElement.h @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005, 2008 Nikolas Zimmermann <zimmermann@kde.org> 2004, 2005, 2006, 2008 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 diff --git a/WebCore/svg/SVGTextPathElement.cpp b/WebCore/svg/SVGTextPathElement.cpp index ebbb628..8a01ad9 100644 --- a/WebCore/svg/SVGTextPathElement.cpp +++ b/WebCore/svg/SVGTextPathElement.cpp @@ -1,8 +1,6 @@ /* Copyright (C) 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 diff --git a/WebCore/svg/SVGTextPositioningElement.cpp b/WebCore/svg/SVGTextPositioningElement.cpp index 32d9dc0..fd7c8aa 100644 --- a/WebCore/svg/SVGTextPositioningElement.cpp +++ b/WebCore/svg/SVGTextPositioningElement.cpp @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005, 2008 Nikolas Zimmermann <zimmermann@kde.org> 2004, 2005, 2006, 2007, 2008 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 diff --git a/WebCore/svg/SVGTextPositioningElement.h b/WebCore/svg/SVGTextPositioningElement.h index 3e01dab..2b07d09 100644 --- a/WebCore/svg/SVGTextPositioningElement.h +++ b/WebCore/svg/SVGTextPositioningElement.h @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005, 2008 Nikolas Zimmermann <zimmermann@kde.org> 2004, 2005, 2006, 2008 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 diff --git a/WebCore/svg/SVGTitleElement.cpp b/WebCore/svg/SVGTitleElement.cpp index 3e23a1b..5afde8d 100644 --- a/WebCore/svg/SVGTitleElement.cpp +++ b/WebCore/svg/SVGTitleElement.cpp @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005 Nikolas Zimmermann <wildfox@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 diff --git a/WebCore/svg/SVGTitleElement.h b/WebCore/svg/SVGTitleElement.h index e053a42..340f725 100644 --- a/WebCore/svg/SVGTitleElement.h +++ b/WebCore/svg/SVGTitleElement.h @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005 Nikolas Zimmermann <wildfox@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 diff --git a/WebCore/svg/SVGTransform.cpp b/WebCore/svg/SVGTransform.cpp index 17d9b8f..9fe770c 100644 --- a/WebCore/svg/SVGTransform.cpp +++ b/WebCore/svg/SVGTransform.cpp @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005 Nikolas Zimmermann <wildfox@kde.org> 2004, 2005 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 diff --git a/WebCore/svg/SVGTransform.h b/WebCore/svg/SVGTransform.h index 0a5e410..1e15468 100644 --- a/WebCore/svg/SVGTransform.h +++ b/WebCore/svg/SVGTransform.h @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005, 2008 Nikolas Zimmermann <zimmermann@kde.org> 2004, 2005 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 diff --git a/WebCore/svg/SVGTransform.idl b/WebCore/svg/SVGTransform.idl index 3163cd6..0fd3a1e 100644 --- a/WebCore/svg/SVGTransform.idl +++ b/WebCore/svg/SVGTransform.idl @@ -3,8 +3,6 @@ 2004, 2005 Rob Buis <buis@kde.org> Copyright (C) 2006 Apple Computer, Inc. All rights reserved. - 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 diff --git a/WebCore/svg/SVGTransformList.cpp b/WebCore/svg/SVGTransformList.cpp index 648f1e9..f4f0965 100644 --- a/WebCore/svg/SVGTransformList.cpp +++ b/WebCore/svg/SVGTransformList.cpp @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005, 2008 Nikolas Zimmermann <zimmermann@kde.org> 2004, 2005 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 diff --git a/WebCore/svg/SVGTransformList.h b/WebCore/svg/SVGTransformList.h index d095fe4..9aea524 100644 --- a/WebCore/svg/SVGTransformList.h +++ b/WebCore/svg/SVGTransformList.h @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005, 2008 Nikolas Zimmermann <zimmermann@kde.org> 2004, 2005 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 diff --git a/WebCore/svg/SVGTransformable.h b/WebCore/svg/SVGTransformable.h index da31c75..1e87b78 100644 --- a/WebCore/svg/SVGTransformable.h +++ b/WebCore/svg/SVGTransformable.h @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005, 2008 Nikolas Zimmermann <zimmermann@kde.org> 2004, 2005, 2006, 2007 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 diff --git a/WebCore/svg/SVGURIReference.h b/WebCore/svg/SVGURIReference.h index 812fb59..7f91b72 100644 --- a/WebCore/svg/SVGURIReference.h +++ b/WebCore/svg/SVGURIReference.h @@ -2,8 +2,6 @@ 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 - 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 diff --git a/WebCore/svg/SVGUnitTypes.h b/WebCore/svg/SVGUnitTypes.h index 6be737f..b639f29 100644 --- a/WebCore/svg/SVGUnitTypes.h +++ b/WebCore/svg/SVGUnitTypes.h @@ -1,8 +1,6 @@ /* 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 diff --git a/WebCore/svg/SVGUseElement.cpp b/WebCore/svg/SVGUseElement.cpp index 42517bd..a566992 100644 --- a/WebCore/svg/SVGUseElement.cpp +++ b/WebCore/svg/SVGUseElement.cpp @@ -3,8 +3,6 @@ 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 - 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 @@ -446,6 +444,9 @@ Path SVGUseElement::toClipPath() const if (!m_shadowTreeRootElement) const_cast<SVGUseElement*>(this)->buildPendingResource(); + if (!m_shadowTreeRootElement) + return Path(); + Node* n = m_shadowTreeRootElement->firstChild(); if (n->isSVGElement() && static_cast<SVGElement*>(n)->isStyledTransformable()) { if (!isDirectReference(n)) @@ -772,7 +773,7 @@ void SVGUseElement::transferEventListenersToShadowTree(SVGElementInstance* targe EventListenerMap& map = d->eventListenerMap; EventListenerMap::iterator end = map.end(); for (EventListenerMap::iterator it = map.begin(); it != end; ++it) { - EventListenerVector& entry = it->second; + 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()) diff --git a/WebCore/svg/SVGViewElement.cpp b/WebCore/svg/SVGViewElement.cpp index af1d1fe..0fe6a90 100644 --- a/WebCore/svg/SVGViewElement.cpp +++ b/WebCore/svg/SVGViewElement.cpp @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005, 2008 Nikolas Zimmermann <zimmermann@kde.org> 2004, 2005, 2007 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 diff --git a/WebCore/svg/SVGViewSpec.h b/WebCore/svg/SVGViewSpec.h index 090b7ae..5f963af 100644 --- a/WebCore/svg/SVGViewSpec.h +++ b/WebCore/svg/SVGViewSpec.h @@ -33,7 +33,8 @@ namespace WebCore { class SVGTransformList; class SVGViewSpec : public SVGFitToViewBox, - public SVGZoomAndPan { + public SVGZoomAndPan, + public Noncopyable { public: SVGViewSpec(const SVGSVGElement*); virtual ~SVGViewSpec(); diff --git a/WebCore/svg/SVGZoomAndPan.cpp b/WebCore/svg/SVGZoomAndPan.cpp index c5eafb2..b1ea995 100644 --- a/WebCore/svg/SVGZoomAndPan.cpp +++ b/WebCore/svg/SVGZoomAndPan.cpp @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005, 2008 Nikolas Zimmermann <zimmermann@kde.org> 2004, 2005, 2006, 2007 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 diff --git a/WebCore/svg/SVGZoomAndPan.h b/WebCore/svg/SVGZoomAndPan.h index d7be342..c11f8e2 100644 --- a/WebCore/svg/SVGZoomAndPan.h +++ b/WebCore/svg/SVGZoomAndPan.h @@ -2,8 +2,6 @@ Copyright (C) 2004, 2005, 2008 Nikolas Zimmermann <zimmermann@kde.org> 2004, 2005, 2006, 2007 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 diff --git a/WebCore/svg/SVGZoomEvent.cpp b/WebCore/svg/SVGZoomEvent.cpp index 2d5a870..92609b1 100644 --- a/WebCore/svg/SVGZoomEvent.cpp +++ b/WebCore/svg/SVGZoomEvent.cpp @@ -3,8 +3,6 @@ Copyright (C) 2004, 2005 Rob Buis <buis@kde.org> Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) - 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 diff --git a/WebCore/svg/animation/SMILTimeContainer.cpp b/WebCore/svg/animation/SMILTimeContainer.cpp index a37e481..f0b479d 100644 --- a/WebCore/svg/animation/SMILTimeContainer.cpp +++ b/WebCore/svg/animation/SMILTimeContainer.cpp @@ -46,6 +46,7 @@ SMILTimeContainer::SMILTimeContainer(SVGSVGElement* owner) : m_beginTime(0) , m_pauseTime(0) , m_accumulatedPauseTime(0) + , m_nextManualSampleTime(0) , m_documentOrderIndexesDirty(false) , m_timer(this, &SMILTimeContainer::timerFired) , m_ownerSVGElement(owner) @@ -207,14 +208,45 @@ String SMILTimeContainer::baseValueFor(ElementAttributePair key) m_savedBaseValues.add(key, baseValue); return baseValue; } - + +void SMILTimeContainer::sampleAnimationAtTime(const String& elementId, double newTime) +{ + ASSERT(m_beginTime); + ASSERT(!isPaused()); + + // Fast-forward to the time DRT wants to sample + m_timer.stop(); + m_nextSamplingTarget = elementId; + m_nextManualSampleTime = newTime; + + updateAnimations(elapsed()); +} + void SMILTimeContainer::updateAnimations(SMILTime elapsed) { SMILTime earliersFireTime = SMILTime::unresolved(); Vector<SVGSMILElement*> toAnimate; copyToVector(m_scheduledAnimations, toAnimate); - + + if (m_nextManualSampleTime) { + SMILTime samplingDiff; + for (unsigned n = 0; n < toAnimate.size(); ++n) { + SVGSMILElement* animation = toAnimate[n]; + ASSERT(animation->timeContainer() == this); + + SVGElement* targetElement = animation->targetElement(); + if (!targetElement || targetElement->getIDAttribute() != m_nextSamplingTarget) + continue; + + samplingDiff = animation->intervalBegin(); + break; + } + + elapsed = SMILTime(m_nextManualSampleTime) + samplingDiff; + m_nextManualSampleTime = 0; + } + // Sort according to priority. Elements with later begin time have higher priority. // In case of a tie, document order decides. // FIXME: This should also consider timing relationships between the elements. Dependents diff --git a/WebCore/svg/animation/SMILTimeContainer.h b/WebCore/svg/animation/SMILTimeContainer.h index 5cef507..a6a61c0 100644 --- a/WebCore/svg/animation/SMILTimeContainer.h +++ b/WebCore/svg/animation/SMILTimeContainer.h @@ -60,6 +60,9 @@ namespace WebCore { void setDocumentOrderIndexesDirty() { m_documentOrderIndexesDirty = true; } + // Move to a specific time. Only used for DRT testing purposes. + void sampleAnimationAtTime(const String& elementId, double seconds); + private: SMILTimeContainer(SVGSVGElement* owner); @@ -76,7 +79,9 @@ namespace WebCore { double m_beginTime; double m_pauseTime; double m_accumulatedPauseTime; - + double m_nextManualSampleTime; + String m_nextSamplingTarget; + bool m_documentOrderIndexesDirty; Timer<SMILTimeContainer> m_timer; diff --git a/WebCore/svg/graphics/SVGImage.cpp b/WebCore/svg/graphics/SVGImage.cpp index 0a506f8..c4be11e 100644 --- a/WebCore/svg/graphics/SVGImage.cpp +++ b/WebCore/svg/graphics/SVGImage.cpp @@ -173,7 +173,7 @@ bool SVGImage::hasRelativeHeight() const return rootElement->height().unitType() == LengthTypePercentage; } -void SVGImage::draw(GraphicsContext* context, const FloatRect& dstRect, const FloatRect& srcRect, CompositeOperator compositeOp) +void SVGImage::draw(GraphicsContext* context, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace, CompositeOperator compositeOp) { if (!m_page) return; diff --git a/WebCore/svg/graphics/SVGImage.h b/WebCore/svg/graphics/SVGImage.h index 2cea91a..10f39ba 100644 --- a/WebCore/svg/graphics/SVGImage.h +++ b/WebCore/svg/graphics/SVGImage.h @@ -64,7 +64,7 @@ namespace WebCore { virtual NativeImagePtr frameAtIndex(size_t) { return 0; } SVGImage(ImageObserver*); - virtual void draw(GraphicsContext*, const FloatRect& fromRect, const FloatRect& toRect, CompositeOperator); + virtual void draw(GraphicsContext*, const FloatRect& fromRect, const FloatRect& toRect, ColorSpace styleColorSpace, CompositeOperator); virtual NativeImagePtr nativeImageForCurrentFrame(); diff --git a/WebCore/svg/graphics/SVGPaintServerGradient.cpp b/WebCore/svg/graphics/SVGPaintServerGradient.cpp index 4a8e9e0..74e3c22 100644 --- a/WebCore/svg/graphics/SVGPaintServerGradient.cpp +++ b/WebCore/svg/graphics/SVGPaintServerGradient.cpp @@ -233,7 +233,7 @@ bool SVGPaintServerGradient::setup(GraphicsContext*& context, const RenderObject // lines or rectangles without width or height. if (bbox.width() == 0 || bbox.height() == 0) { Color color(0, 0, 0); - context->setStrokeColor(color); + context->setStrokeColor(color, object->style()->colorSpace()); return true; } matrix.translate(bbox.x(), bbox.y()); diff --git a/WebCore/svg/graphics/SVGPaintServerPattern.cpp b/WebCore/svg/graphics/SVGPaintServerPattern.cpp index e825a0b..289c40c 100644 --- a/WebCore/svg/graphics/SVGPaintServerPattern.cpp +++ b/WebCore/svg/graphics/SVGPaintServerPattern.cpp @@ -131,7 +131,7 @@ bool SVGPaintServerPattern::setup(GraphicsContext*& context, const RenderObject* tileImageContext->translate(0, patternBoundaries().height()); for (int j = numX; j > 0; j--) { tileImageContext->translate(patternBoundaries().width(), 0); - tileImageContext->drawImage(tile()->image(), tileRect, tileRect); + tileImageContext->drawImage(tile()->image(), object->style()->colorSpace(), tileRect, tileRect); } tileImageContext->translate(-patternBoundaries().width() * numX, 0); } diff --git a/WebCore/svg/graphics/SVGPaintServerSolid.cpp b/WebCore/svg/graphics/SVGPaintServerSolid.cpp index b333042..72baad2 100644 --- a/WebCore/svg/graphics/SVGPaintServerSolid.cpp +++ b/WebCore/svg/graphics/SVGPaintServerSolid.cpp @@ -64,10 +64,11 @@ bool SVGPaintServerSolid::setup(GraphicsContext*& context, const RenderObject* o { RenderStyle* style = object ? object->style() : 0; const SVGRenderStyle* svgStyle = style ? style->svgStyle() : 0; + ColorSpace colorSpace = style ? style->colorSpace() : DeviceColorSpace; if ((type & ApplyToFillTargetType) && (!style || svgStyle->hasFill())) { context->setAlpha(style ? svgStyle->fillOpacity() : 1); - context->setFillColor(color().rgb()); + context->setFillColor(color().rgb(), colorSpace); context->setFillRule(style ? svgStyle->fillRule() : RULE_NONZERO); if (isPaintingText) @@ -76,7 +77,7 @@ bool SVGPaintServerSolid::setup(GraphicsContext*& context, const RenderObject* o if ((type & ApplyToStrokeTargetType) && (!style || svgStyle->hasStroke())) { context->setAlpha(style ? svgStyle->strokeOpacity() : 1); - context->setStrokeColor(color().rgb()); + context->setStrokeColor(color().rgb(), colorSpace); if (style) applyStrokeStyleToContext(context, style, object); diff --git a/WebCore/svg/graphics/SVGResource.cpp b/WebCore/svg/graphics/SVGResource.cpp index 049edc7..514b70d 100644 --- a/WebCore/svg/graphics/SVGResource.cpp +++ b/WebCore/svg/graphics/SVGResource.cpp @@ -39,7 +39,7 @@ SVGResource::SVGResource() { } -struct ResourceSet { +struct ResourceSet : Noncopyable { ResourceSet() { for (int i = 0; i < _ResourceTypeCount; i++) diff --git a/WebCore/svg/graphics/SVGResourceFilter.cpp b/WebCore/svg/graphics/SVGResourceFilter.cpp index 973743c..fcf0e40 100644 --- a/WebCore/svg/graphics/SVGResourceFilter.cpp +++ b/WebCore/svg/graphics/SVGResourceFilter.cpp @@ -35,6 +35,10 @@ #include "SVGRenderTreeAsText.h" #include "SVGFilterPrimitiveStandardAttributes.h" +static const float kMaxFilterSize = 5000.0f; + +using std::min; + namespace WebCore { SVGResourceFilter::SVGResourceFilter(const SVGFilterElement* ownerElement) @@ -42,6 +46,9 @@ SVGResourceFilter::SVGResourceFilter(const SVGFilterElement* ownerElement) , m_ownerElement(ownerElement) , m_filterBBoxMode(false) , m_effectBBoxMode(false) + , m_filterRes(false) + , m_scaleX(1.f) + , m_scaleY(1.f) , m_savedContext(0) , m_sourceGraphicBuffer(0) { @@ -52,27 +59,72 @@ SVGResourceFilter::~SVGResourceFilter() { } +static inline bool shouldProcessFilter(SVGResourceFilter* filter) +{ + return (!filter->scaleX() || !filter->scaleY() || !filter->filterBoundingBox().width() + || !filter->filterBoundingBox().height()); +} + void SVGResourceFilter::addFilterEffect(SVGFilterPrimitiveStandardAttributes* effectAttributes, PassRefPtr<FilterEffect> effect) { effectAttributes->setStandardAttributes(this, effect.get()); builder()->add(effectAttributes->result(), effect); } +bool SVGResourceFilter::fitsInMaximumImageSize(const FloatSize& size) +{ + bool matchesFilterSize = true; + if (size.width() > kMaxFilterSize) { + m_scaleX *= kMaxFilterSize / size.width(); + matchesFilterSize = false; + } + if (size.height() > kMaxFilterSize) { + m_scaleY *= kMaxFilterSize / size.height(); + matchesFilterSize = false; + } + + return matchesFilterSize; +} + void SVGResourceFilter::prepareFilter(GraphicsContext*& context, const RenderObject* object) { FloatRect targetRect = object->objectBoundingBox(); m_ownerElement->buildFilter(targetRect); + if (shouldProcessFilter(this)) + return; + // clip sourceImage to filterRegion FloatRect clippedSourceRect = targetRect; clippedSourceRect.intersect(m_filterBBox); + // scale filter size to filterRes + FloatRect tempSourceRect = clippedSourceRect; + if (m_filterRes) { + m_scaleX = m_filterResSize.width() / m_filterBBox.width(); + m_scaleY = m_filterResSize.height() / m_filterBBox.height(); + } + + // scale to big sourceImage size to kMaxFilterSize + tempSourceRect.scale(m_scaleX, m_scaleY); + fitsInMaximumImageSize(tempSourceRect.size()); + // prepare Filters m_filter = SVGFilter::create(targetRect, m_filterBBox, m_effectBBoxMode); + m_filter->setFilterResolution(FloatSize(m_scaleX, m_scaleY)); FilterEffect* lastEffect = m_filterBuilder->lastEffect(); - if (lastEffect) + if (lastEffect) { lastEffect->calculateEffectRect(m_filter.get()); + // at least one FilterEffect has a too big image size, + // recalculate the effect sizes with new scale factors + if (!fitsInMaximumImageSize(m_filter->maxImageSize())) { + m_filter->setFilterResolution(FloatSize(m_scaleX, m_scaleY)); + lastEffect->calculateEffectRect(m_filter.get()); + } + } + + clippedSourceRect.scale(m_scaleX, m_scaleY); // Draw the content of the current element and it's childs to a imageBuffer to get the SourceGraphic. // The size of the SourceGraphic is clipped to the size of the filterRegion. @@ -83,6 +135,7 @@ void SVGResourceFilter::prepareFilter(GraphicsContext*& context, const RenderObj return; GraphicsContext* sourceGraphicContext = sourceGraphic->context(); + sourceGraphicContext->scale(FloatSize(m_scaleX, m_scaleY)); sourceGraphicContext->translate(-targetRect.x(), -targetRect.y()); sourceGraphicContext->clearRect(FloatRect(FloatPoint(), targetRect.size())); m_sourceGraphicBuffer.set(sourceGraphic.release()); @@ -91,8 +144,11 @@ void SVGResourceFilter::prepareFilter(GraphicsContext*& context, const RenderObj context = sourceGraphicContext; } -void SVGResourceFilter::applyFilter(GraphicsContext*& context, const RenderObject*) +void SVGResourceFilter::applyFilter(GraphicsContext*& context, const RenderObject* object) { + if (shouldProcessFilter(this)) + return; + if (!m_savedContext) return; @@ -113,7 +169,10 @@ void SVGResourceFilter::applyFilter(GraphicsContext*& context, const RenderObjec #if !PLATFORM(CG) resultImage->transformColorSpace(LinearRGB, DeviceRGB); #endif - context->drawImage(resultImage->image(), lastEffect->subRegion()); + ColorSpace colorSpace = DeviceColorSpace; + if (object) + colorSpace = object->style()->colorSpace(); + context->drawImage(resultImage->image(), colorSpace, lastEffect->subRegion()); } } diff --git a/WebCore/svg/graphics/SVGResourceFilter.h b/WebCore/svg/graphics/SVGResourceFilter.h index 86b11fe..ffd926d 100644 --- a/WebCore/svg/graphics/SVGResourceFilter.h +++ b/WebCore/svg/graphics/SVGResourceFilter.h @@ -53,6 +53,9 @@ public: virtual SVGResourceType resourceType() const { return FilterResourceType; } + void setFilterResolution(const FloatSize& filterResSize) { m_filterResSize = filterResSize; } + void setHasFilterResolution(bool filterRes) { m_filterRes = filterRes; } + bool filterBoundingBoxMode() const { return m_filterBBoxMode; } void setFilterBoundingBoxMode(bool bboxMode) { m_filterBBoxMode = bboxMode; } @@ -62,12 +65,17 @@ public: FloatRect filterRect() const { return m_filterRect; } void setFilterRect(const FloatRect& rect) { m_filterRect = rect; } + float scaleX() const { return m_scaleX; } + float scaleY() const { return m_scaleY; } + FloatRect filterBoundingBox() { return m_filterBBox; } void setFilterBoundingBox(const FloatRect& rect) { m_filterBBox = rect; } void prepareFilter(GraphicsContext*&, const RenderObject*); void applyFilter(GraphicsContext*&, const RenderObject*); + bool fitsInMaximumImageSize(const FloatSize&); + void addFilterEffect(SVGFilterPrimitiveStandardAttributes*, PassRefPtr<FilterEffect>); SVGFilterBuilder* builder() { return m_filterBuilder.get(); } @@ -81,9 +89,13 @@ private: bool m_filterBBoxMode : 1; bool m_effectBBoxMode : 1; + bool m_filterRes : 1; + float m_scaleX; + float m_scaleY; FloatRect m_filterRect; FloatRect m_filterBBox; + FloatSize m_filterResSize; OwnPtr<SVGFilterBuilder> m_filterBuilder; GraphicsContext* m_savedContext; diff --git a/WebCore/svg/graphics/filters/SVGDistantLightSource.h b/WebCore/svg/graphics/filters/SVGDistantLightSource.h index 07ac16c..db9b59d 100644 --- a/WebCore/svg/graphics/filters/SVGDistantLightSource.h +++ b/WebCore/svg/graphics/filters/SVGDistantLightSource.h @@ -30,11 +30,10 @@ namespace WebCore { class DistantLightSource : public LightSource { public: - DistantLightSource(float azimuth, float elevation) - : LightSource(LS_DISTANT) - , m_azimuth(azimuth) - , m_elevation(elevation) - { } + static PassRefPtr<DistantLightSource> create(float azimuth, float elevation) + { + return adoptRef(new DistantLightSource(azimuth, elevation)); + } float azimuth() const { return m_azimuth; } float elevation() const { return m_elevation; } @@ -42,6 +41,13 @@ namespace WebCore { virtual TextStream& externalRepresentation(TextStream&) const; private: + DistantLightSource(float azimuth, float elevation) + : LightSource(LS_DISTANT) + , m_azimuth(azimuth) + , m_elevation(elevation) + { + } + float m_azimuth; float m_elevation; }; diff --git a/WebCore/svg/graphics/filters/SVGFEDiffuseLighting.cpp b/WebCore/svg/graphics/filters/SVGFEDiffuseLighting.cpp index c536478..93921df 100644 --- a/WebCore/svg/graphics/filters/SVGFEDiffuseLighting.cpp +++ b/WebCore/svg/graphics/filters/SVGFEDiffuseLighting.cpp @@ -30,7 +30,7 @@ namespace WebCore { FEDiffuseLighting::FEDiffuseLighting(FilterEffect* in , const Color& lightingColor, const float& surfaceScale, - const float& diffuseConstant, const float& kernelUnitLengthX, const float& kernelUnitLengthY, LightSource* lightSource) + const float& diffuseConstant, const float& kernelUnitLengthX, const float& kernelUnitLengthY, PassRefPtr<LightSource> lightSource) : FilterEffect() , m_in(in) , m_lightingColor(lightingColor) @@ -44,7 +44,7 @@ FEDiffuseLighting::FEDiffuseLighting(FilterEffect* in , const Color& lightingCol PassRefPtr<FEDiffuseLighting> FEDiffuseLighting::create(FilterEffect* in , const Color& lightingColor, const float& surfaceScale, const float& diffuseConstant, const float& kernelUnitLengthX, - const float& kernelUnitLengthY, LightSource* lightSource) + const float& kernelUnitLengthY, PassRefPtr<LightSource> lightSource) { return adoptRef(new FEDiffuseLighting(in, lightingColor, surfaceScale, diffuseConstant, kernelUnitLengthX, kernelUnitLengthY, lightSource)); } @@ -108,7 +108,7 @@ const LightSource* FEDiffuseLighting::lightSource() const return m_lightSource.get(); } -void FEDiffuseLighting::setLightSource(LightSource* lightSource) +void FEDiffuseLighting::setLightSource(PassRefPtr<LightSource> lightSource) { m_lightSource = lightSource; } diff --git a/WebCore/svg/graphics/filters/SVGFEDiffuseLighting.h b/WebCore/svg/graphics/filters/SVGFEDiffuseLighting.h index 71f8e22..bf7f28e 100644 --- a/WebCore/svg/graphics/filters/SVGFEDiffuseLighting.h +++ b/WebCore/svg/graphics/filters/SVGFEDiffuseLighting.h @@ -34,7 +34,7 @@ namespace WebCore { class FEDiffuseLighting : public FilterEffect { public: static PassRefPtr<FEDiffuseLighting> create(FilterEffect*, const Color&, const float&, const float&, - const float&, const float&, LightSource*); + const float&, const float&, PassRefPtr<LightSource>); virtual ~FEDiffuseLighting(); Color lightingColor() const; @@ -53,7 +53,7 @@ namespace WebCore { void setKernelUnitLengthY(float); const LightSource* lightSource() const; - void setLightSource(LightSource*); + void setLightSource(PassRefPtr<LightSource>); virtual FloatRect uniteChildEffectSubregions(Filter* filter) { return calculateUnionOfChildEffectSubregions(filter, m_in.get()); } void apply(Filter*); @@ -62,7 +62,7 @@ namespace WebCore { private: FEDiffuseLighting(FilterEffect*, const Color&, const float&, const float&, - const float&, const float&, LightSource*); + const float&, const float&, PassRefPtr<LightSource>); RefPtr<FilterEffect> m_in; Color m_lightingColor; diff --git a/WebCore/svg/graphics/filters/SVGFEDisplacementMap.cpp b/WebCore/svg/graphics/filters/SVGFEDisplacementMap.cpp index abb57ee..a22bc94 100644 --- a/WebCore/svg/graphics/filters/SVGFEDisplacementMap.cpp +++ b/WebCore/svg/graphics/filters/SVGFEDisplacementMap.cpp @@ -2,6 +2,7 @@ Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org> 2004, 2005 Rob Buis <buis@kde.org> 2005 Eric Seidel <eric@webkit.org> + 2009 Dirk Schulze <krit@webkit.org> This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public @@ -23,8 +24,12 @@ #if ENABLE(SVG) && ENABLE(FILTERS) #include "SVGFEDisplacementMap.h" -#include "SVGRenderTreeAsText.h" + +#include "CanvasPixelArray.h" #include "Filter.h" +#include "GraphicsContext.h" +#include "ImageData.h" +#include "SVGRenderTreeAsText.h" namespace WebCore { @@ -75,8 +80,53 @@ void FEDisplacementMap::setScale(float scale) m_scale = scale; } -void FEDisplacementMap::apply(Filter*) +void FEDisplacementMap::apply(Filter* filter) { + m_in->apply(filter); + m_in2->apply(filter); + if (!m_in->resultImage() || !m_in2->resultImage()) + return; + + if (m_xChannelSelector == CHANNEL_UNKNOWN || m_yChannelSelector == CHANNEL_UNKNOWN) + return; + + if (!getEffectContext()) + return; + + IntRect effectADrawingRect = calculateDrawingIntRect(m_in->scaledSubRegion()); + RefPtr<CanvasPixelArray> srcPixelArrayA(m_in->resultImage()->getPremultipliedImageData(effectADrawingRect)->data()); + + IntRect effectBDrawingRect = calculateDrawingIntRect(m_in2->scaledSubRegion()); + RefPtr<CanvasPixelArray> srcPixelArrayB(m_in2->resultImage()->getUnmultipliedImageData(effectBDrawingRect)->data()); + + IntRect imageRect(IntPoint(), resultImage()->size()); + RefPtr<ImageData> imageData = ImageData::create(imageRect.width(), imageRect.height()); + + ASSERT(srcPixelArrayA->length() == srcPixelArrayB->length()); + + float scaleX = m_scale / 255.f * filter->filterResolution().width(); + float scaleY = m_scale / 255.f * filter->filterResolution().height(); + float scaleAdjustmentX = (0.5f - 0.5f * m_scale) * filter->filterResolution().width(); + float scaleAdjustmentY = (0.5f - 0.5f * m_scale) * filter->filterResolution().height(); + int stride = imageRect.width() * 4; + for (int y = 0; y < imageRect.height(); ++y) { + int line = y * stride; + for (int x = 0; x < imageRect.width(); ++x) { + int dstIndex = line + x * 4; + int srcX = x + static_cast<int>(scaleX * srcPixelArrayB->get(dstIndex + m_xChannelSelector - 1) + scaleAdjustmentX); + int srcY = y + static_cast<int>(scaleY * srcPixelArrayB->get(dstIndex + m_yChannelSelector - 1) + scaleAdjustmentY); + for (unsigned channel = 0; channel < 4; ++channel) { + if (srcX < 0 || srcX >= imageRect.width() || srcY < 0 || srcY >= imageRect.height()) + imageData->data()->set(dstIndex + channel, static_cast<unsigned char>(0)); + else { + unsigned char pixelValue = srcPixelArrayA->get(srcY * stride + srcX * 4 + channel); + imageData->data()->set(dstIndex + channel, pixelValue); + } + } + + } + } + resultImage()->putPremultipliedImageData(imageData.get(), imageRect, IntPoint()); } void FEDisplacementMap::dump() diff --git a/WebCore/svg/graphics/filters/SVGFEFlood.cpp b/WebCore/svg/graphics/filters/SVGFEFlood.cpp index 668209f..648bf54 100644 --- a/WebCore/svg/graphics/filters/SVGFEFlood.cpp +++ b/WebCore/svg/graphics/filters/SVGFEFlood.cpp @@ -70,7 +70,7 @@ void FEFlood::apply(Filter*) return; Color color = colorWithOverrideAlpha(floodColor().rgb(), floodOpacity()); - filterContext->fillRect(FloatRect(FloatPoint(), subRegion().size()), color); + filterContext->fillRect(FloatRect(FloatPoint(), scaledSubRegion().size()), color, DeviceColorSpace); } void FEFlood::dump() diff --git a/WebCore/svg/graphics/filters/SVGFEMerge.cpp b/WebCore/svg/graphics/filters/SVGFEMerge.cpp index acf3c45..3f9ad38 100644 --- a/WebCore/svg/graphics/filters/SVGFEMerge.cpp +++ b/WebCore/svg/graphics/filters/SVGFEMerge.cpp @@ -78,8 +78,8 @@ void FEMerge::apply(Filter* filter) return; for (unsigned i = 0; i < m_mergeInputs.size(); i++) { - FloatRect destRect = calculateDrawingRect(m_mergeInputs[i]->subRegion()); - filterContext->drawImage(m_mergeInputs[i]->resultImage()->image(), destRect); + FloatRect destRect = calculateDrawingRect(m_mergeInputs[i]->scaledSubRegion()); + filterContext->drawImage(m_mergeInputs[i]->resultImage()->image(), DeviceColorSpace, destRect); } } diff --git a/WebCore/svg/graphics/filters/SVGFEMorphology.cpp b/WebCore/svg/graphics/filters/SVGFEMorphology.cpp index f7fc5d8..20d109a 100644 --- a/WebCore/svg/graphics/filters/SVGFEMorphology.cpp +++ b/WebCore/svg/graphics/filters/SVGFEMorphology.cpp @@ -2,6 +2,7 @@ Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org> 2004, 2005 Rob Buis <buis@kde.org> 2005 Eric Seidel <eric@webkit.org> + 2009 Dirk Schulze <krit@webkit.org> This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public @@ -23,8 +24,16 @@ #if ENABLE(SVG) && ENABLE(FILTERS) #include "SVGFEMorphology.h" -#include "SVGRenderTreeAsText.h" + +#include "CanvasPixelArray.h" #include "Filter.h" +#include "ImageData.h" +#include "SVGRenderTreeAsText.h" + +#include <wtf/Vector.h> + +using std::min; +using std::max; namespace WebCore { @@ -72,8 +81,73 @@ void FEMorphology::setRadiusY(float radiusY) m_radiusY = radiusY; } -void FEMorphology::apply(Filter*) +void FEMorphology::apply(Filter* filter) { + m_in->apply(filter); + if (!m_in->resultImage()) + return; + + if (!getEffectContext()) + return; + + if (!m_radiusX || !m_radiusY) + return; + + IntRect imageRect(IntPoint(), resultImage()->size()); + IntRect effectDrawingRect = calculateDrawingIntRect(m_in->scaledSubRegion()); + RefPtr<CanvasPixelArray> srcPixelArray(m_in->resultImage()->getPremultipliedImageData(effectDrawingRect)->data()); + RefPtr<ImageData> imageData = ImageData::create(imageRect.width(), imageRect.height()); + + int radiusX = static_cast<int>(m_radiusX * filter->filterResolution().width()); + int radiusY = static_cast<int>(m_radiusY * filter->filterResolution().height()); + int effectWidth = effectDrawingRect.width() * 4; + + // Limit the radius size to effect width + radiusX = min(effectDrawingRect.width() - 1, radiusX); + + Vector<unsigned char> extrema; + for (int y = 0; y < effectDrawingRect.height(); ++y) { + int startY = max(0, y - radiusY); + int endY = min(effectDrawingRect.height() - 1, y + radiusY); + for (unsigned channel = 0; channel < 4; ++channel) { + // Fill the kernel + extrema.clear(); + for (int j = 0; j <= radiusX; ++j) { + unsigned char columnExtrema = srcPixelArray->get(startY * effectWidth + 4 * j + channel); + for (int i = startY; i <= endY; ++i) { + unsigned char pixel = srcPixelArray->get(i * effectWidth + 4 * j + channel); + if ((m_type == FEMORPHOLOGY_OPERATOR_ERODE && pixel <= columnExtrema) || + (m_type == FEMORPHOLOGY_OPERATOR_DILATE && pixel >= columnExtrema)) + columnExtrema = pixel; + } + extrema.append(columnExtrema); + } + + // Kernel is filled, get extrema of next column + for (int x = 0; x < effectDrawingRect.width(); ++x) { + unsigned endX = min(x + radiusX, effectDrawingRect.width() - 1); + unsigned char columnExtrema = srcPixelArray->get(startY * effectWidth + endX * 4 + channel); + for (int i = startY; i <= endY; ++i) { + unsigned char pixel = srcPixelArray->get(i * effectWidth + endX * 4 + channel); + if ((m_type == FEMORPHOLOGY_OPERATOR_ERODE && pixel <= columnExtrema) || + (m_type == FEMORPHOLOGY_OPERATOR_DILATE && pixel >= columnExtrema)) + columnExtrema = pixel; + } + if (x - radiusX >= 0) + extrema.remove(0); + if (x + radiusX <= effectDrawingRect.width()) + extrema.append(columnExtrema); + unsigned char entireExtrema = extrema[0]; + for (unsigned kernelIndex = 0; kernelIndex < extrema.size(); ++kernelIndex) { + if ((m_type == FEMORPHOLOGY_OPERATOR_ERODE && extrema[kernelIndex] <= entireExtrema) || + (m_type == FEMORPHOLOGY_OPERATOR_DILATE && extrema[kernelIndex] >= entireExtrema)) + entireExtrema = extrema[kernelIndex]; + } + imageData->data()->set(y * effectWidth + 4 * x + channel, entireExtrema); + } + } + } + resultImage()->putPremultipliedImageData(imageData.get(), imageRect, IntPoint()); } void FEMorphology::dump() diff --git a/WebCore/svg/graphics/filters/SVGFEOffset.cpp b/WebCore/svg/graphics/filters/SVGFEOffset.cpp index ce9ee3d..9fd50ed 100644 --- a/WebCore/svg/graphics/filters/SVGFEOffset.cpp +++ b/WebCore/svg/graphics/filters/SVGFEOffset.cpp @@ -74,17 +74,22 @@ void FEOffset::apply(Filter* filter) if (!filterContext) return; + FloatRect sourceImageRect = filter->sourceImageRect(); + sourceImageRect.scale(filter->filterResolution().width(), filter->filterResolution().height()); + if (filter->effectBoundingBoxMode()) { - setDx(dx() * filter->sourceImageRect().width()); - setDy(dy() * filter->sourceImageRect().height()); + m_dx *= sourceImageRect.width(); + m_dy *= sourceImageRect.height(); } + m_dx *= filter->filterResolution().width(); + m_dy *= filter->filterResolution().height(); - FloatRect dstRect = FloatRect(dx() + m_in->subRegion().x() - subRegion().x(), - dy() + m_in->subRegion().y() - subRegion().y(), - m_in->subRegion().width(), - m_in->subRegion().height()); + FloatRect dstRect = FloatRect(m_dx + m_in->scaledSubRegion().x() - scaledSubRegion().x(), + m_dy + m_in->scaledSubRegion().y() - scaledSubRegion().y(), + m_in->scaledSubRegion().width(), + m_in->scaledSubRegion().height()); - filterContext->drawImage(m_in->resultImage()->image(), dstRect); + filterContext->drawImage(m_in->resultImage()->image(), DeviceColorSpace, dstRect); } void FEOffset::dump() diff --git a/WebCore/svg/graphics/filters/SVGFESpecularLighting.cpp b/WebCore/svg/graphics/filters/SVGFESpecularLighting.cpp index eb0c280..0b43aba 100644 --- a/WebCore/svg/graphics/filters/SVGFESpecularLighting.cpp +++ b/WebCore/svg/graphics/filters/SVGFESpecularLighting.cpp @@ -30,7 +30,7 @@ namespace WebCore { FESpecularLighting::FESpecularLighting(FilterEffect* in, const Color& lightingColor, const float& surfaceScale, const float& specularConstant, const float& specularExponent, const float& kernelUnitLengthX, - const float& kernelUnitLengthY, LightSource* lightSource) + const float& kernelUnitLengthY, PassRefPtr<LightSource> lightSource) : FilterEffect() , m_in(in) , m_lightingColor(lightingColor) @@ -45,7 +45,7 @@ FESpecularLighting::FESpecularLighting(FilterEffect* in, const Color& lightingCo PassRefPtr<FESpecularLighting> FESpecularLighting::create(FilterEffect* in, const Color& lightingColor, const float& surfaceScale, const float& specularConstant, const float& specularExponent, - const float& kernelUnitLengthX, const float& kernelUnitLengthY, LightSource* lightSource) + const float& kernelUnitLengthX, const float& kernelUnitLengthY, PassRefPtr<LightSource> lightSource) { return adoptRef(new FESpecularLighting(in, lightingColor, surfaceScale, specularConstant, specularExponent, kernelUnitLengthX, kernelUnitLengthY, lightSource)); @@ -120,7 +120,7 @@ const LightSource* FESpecularLighting::lightSource() const return m_lightSource.get(); } -void FESpecularLighting::setLightSource(LightSource* lightSource) +void FESpecularLighting::setLightSource(PassRefPtr<LightSource> lightSource) { m_lightSource = lightSource; } diff --git a/WebCore/svg/graphics/filters/SVGFESpecularLighting.h b/WebCore/svg/graphics/filters/SVGFESpecularLighting.h index dec5163..f4947fd 100644 --- a/WebCore/svg/graphics/filters/SVGFESpecularLighting.h +++ b/WebCore/svg/graphics/filters/SVGFESpecularLighting.h @@ -33,7 +33,7 @@ namespace WebCore { class FESpecularLighting : public FilterEffect { public: static PassRefPtr<FESpecularLighting> create(FilterEffect*, const Color&, const float&, const float&, - const float&, const float&, const float&, LightSource*); + const float&, const float&, const float&, PassRefPtr<LightSource>); virtual ~FESpecularLighting(); Color lightingColor() const; @@ -55,7 +55,7 @@ namespace WebCore { void setKernelUnitLengthY(float); const LightSource* lightSource() const; - void setLightSource(LightSource*); + void setLightSource(PassRefPtr<LightSource>); virtual FloatRect uniteEffectRect(Filter* filter) { return calculateUnionOfChildEffectSubregions(filter, m_in.get()); } void apply(Filter*); @@ -64,7 +64,7 @@ namespace WebCore { private: FESpecularLighting(FilterEffect*, const Color&, const float&, const float&, const float&, - const float&, const float&, LightSource*); + const float&, const float&, PassRefPtr<LightSource>); RefPtr<FilterEffect> m_in; Color m_lightingColor; diff --git a/WebCore/svg/graphics/filters/SVGFETile.cpp b/WebCore/svg/graphics/filters/SVGFETile.cpp index 3071501..e97f68f 100644 --- a/WebCore/svg/graphics/filters/SVGFETile.cpp +++ b/WebCore/svg/graphics/filters/SVGFETile.cpp @@ -58,24 +58,27 @@ void FETile::apply(Filter* filter) if (!filterContext) return; - IntRect tileRect = enclosingIntRect(m_in->subRegion()); + IntRect tileRect = enclosingIntRect(m_in->scaledSubRegion()); // Source input needs more attention. It has the size of the filterRegion but gives the // size of the cutted sourceImage back. This is part of the specification and optimization. - if (m_in->isSourceInput()) - tileRect = enclosingIntRect(filter->filterRegion()); + if (m_in->isSourceInput()) { + FloatRect filterRegion = filter->filterRegion(); + filterRegion.scale(filter->filterResolution().width(), filter->filterResolution().height()); + tileRect = enclosingIntRect(filterRegion); + } OwnPtr<ImageBuffer> tileImage = ImageBuffer::create(tileRect.size()); GraphicsContext* tileImageContext = tileImage->context(); - tileImageContext->drawImage(m_in->resultImage()->image(), IntPoint()); + tileImageContext->drawImage(m_in->resultImage()->image(), DeviceColorSpace, IntPoint()); RefPtr<Pattern> pattern = Pattern::create(tileImage->image(), true, true); TransformationMatrix matrix; - matrix.translate(m_in->subRegion().x() - subRegion().x(), m_in->subRegion().y() - subRegion().y()); + matrix.translate(m_in->scaledSubRegion().x() - scaledSubRegion().x(), m_in->scaledSubRegion().y() - scaledSubRegion().y()); pattern.get()->setPatternSpaceTransform(matrix); filterContext->setFillPattern(pattern); - filterContext->fillRect(FloatRect(FloatPoint(), subRegion().size())); + filterContext->fillRect(FloatRect(FloatPoint(), scaledSubRegion().size())); } void FETile::dump() diff --git a/WebCore/svg/graphics/filters/SVGFilter.cpp b/WebCore/svg/graphics/filters/SVGFilter.cpp index 6bfcf39..4ec4e6e 100644 --- a/WebCore/svg/graphics/filters/SVGFilter.cpp +++ b/WebCore/svg/graphics/filters/SVGFilter.cpp @@ -34,7 +34,7 @@ SVGFilter::SVGFilter(const FloatRect& itemBox, const FloatRect& filterRect, bool void SVGFilter::calculateEffectSubRegion(FilterEffect* effect) { - FloatRect subRegionBBox = effect->subRegion(); + FloatRect subRegionBBox = effect->effectBoundaries(); FloatRect useBBox = effect->unionOfChildEffectSubregions(); FloatRect newSubRegion = subRegionBBox; @@ -70,6 +70,9 @@ void SVGFilter::calculateEffectSubRegion(FilterEffect* effect) newSubRegion.intersect(m_filterRect); effect->setSubRegion(newSubRegion); + newSubRegion.scale(filterResolution().width(), filterResolution().height()); + effect->setScaledSubRegion(newSubRegion); + m_maxImageSize = m_maxImageSize.expandedTo(newSubRegion.size()); } PassRefPtr<SVGFilter> SVGFilter::create(const FloatRect& itemBox, const FloatRect& filterRect, bool effectBBoxMode) diff --git a/WebCore/svg/graphics/filters/SVGFilter.h b/WebCore/svg/graphics/filters/SVGFilter.h index f23d1ea..c4714c6 100644 --- a/WebCore/svg/graphics/filters/SVGFilter.h +++ b/WebCore/svg/graphics/filters/SVGFilter.h @@ -24,6 +24,7 @@ #include "Filter.h" #include "FilterEffect.h" #include "FloatRect.h" +#include "FloatSize.h" #include <wtf/PassRefPtr.h> #include <wtf/RefCounted.h> @@ -35,15 +36,18 @@ namespace WebCore { public: static PassRefPtr<SVGFilter> create(const FloatRect&, const FloatRect&, bool); - bool effectBoundingBoxMode() { return m_effectBBoxMode; } + virtual bool effectBoundingBoxMode() const { return m_effectBBoxMode; } - FloatRect filterRegion() { return m_filterRect; } - FloatRect sourceImageRect() { return m_itemBox; } - void calculateEffectSubRegion(FilterEffect*); + virtual FloatRect filterRegion() const { return m_filterRect; } + virtual FloatRect sourceImageRect() const { return m_itemBox; } + + virtual FloatSize maxImageSize() const { return m_maxImageSize; } + virtual void calculateEffectSubRegion(FilterEffect*); private: SVGFilter(const FloatRect& itemBox, const FloatRect& filterRect, bool effectBBoxMode); + FloatSize m_maxImageSize; FloatRect m_itemBox; FloatRect m_filterRect; bool m_effectBBoxMode; diff --git a/WebCore/svg/graphics/filters/SVGLightSource.h b/WebCore/svg/graphics/filters/SVGLightSource.h index 22b43c8..6f0075c 100644 --- a/WebCore/svg/graphics/filters/SVGLightSource.h +++ b/WebCore/svg/graphics/filters/SVGLightSource.h @@ -24,6 +24,7 @@ #define SVGLightSource_h #if ENABLE(SVG) && ENABLE(FILTERS) +#include <wtf/PassRefPtr.h> #include <wtf/RefCounted.h> namespace WebCore { diff --git a/WebCore/svg/graphics/filters/SVGPointLightSource.h b/WebCore/svg/graphics/filters/SVGPointLightSource.h index 772e278..1e966cc 100644 --- a/WebCore/svg/graphics/filters/SVGPointLightSource.h +++ b/WebCore/svg/graphics/filters/SVGPointLightSource.h @@ -31,16 +31,22 @@ namespace WebCore { class PointLightSource : public LightSource { public: - PointLightSource(const FloatPoint3D& position) - : LightSource(LS_POINT) - , m_position(position) - { } + static PassRefPtr<PointLightSource> create(const FloatPoint3D& position) + { + return adoptRef(new PointLightSource(position)); + } const FloatPoint3D& position() const { return m_position; } virtual TextStream& externalRepresentation(TextStream&) const; private: + PointLightSource(const FloatPoint3D& position) + : LightSource(LS_POINT) + , m_position(position) + { + } + FloatPoint3D m_position; }; diff --git a/WebCore/svg/graphics/filters/SVGSpotLightSource.h b/WebCore/svg/graphics/filters/SVGSpotLightSource.h index 9a787fb..05280d2 100644 --- a/WebCore/svg/graphics/filters/SVGSpotLightSource.h +++ b/WebCore/svg/graphics/filters/SVGSpotLightSource.h @@ -31,13 +31,11 @@ namespace WebCore { class SpotLightSource : public LightSource { public: - SpotLightSource(const FloatPoint3D& position, const FloatPoint3D& direction, float specularExponent, float limitingConeAngle) - : LightSource(LS_SPOT) - , m_position(position) - , m_direction(direction) - , m_specularExponent(specularExponent) - , m_limitingConeAngle(limitingConeAngle) - { } + static PassRefPtr<SpotLightSource> create(const FloatPoint3D& position, const FloatPoint3D& direction, + float specularExponent, float limitingConeAngle) + { + return adoptRef(new SpotLightSource(position, direction, specularExponent, limitingConeAngle)); + } const FloatPoint3D& position() const { return m_position; } const FloatPoint3D& direction() const { return m_direction; } @@ -48,6 +46,16 @@ namespace WebCore { virtual TextStream& externalRepresentation(TextStream&) const; private: + SpotLightSource(const FloatPoint3D& position, const FloatPoint3D& direction, + float specularExponent, float limitingConeAngle) + : LightSource(LS_SPOT) + , m_position(position) + , m_direction(direction) + , m_specularExponent(specularExponent) + , m_limitingConeAngle(limitingConeAngle) + { + } + FloatPoint3D m_position; FloatPoint3D m_direction; diff --git a/WebCore/svg/svgtags.in b/WebCore/svg/svgtags.in index 30a0e4c..ca1ea89 100644 --- a/WebCore/svg/svgtags.in +++ b/WebCore/svg/svgtags.in @@ -2,7 +2,7 @@ namespace="SVG" namespaceURI="http://www.w3.org/2000/svg" guardFactoryWith="ENABLE(SVG)" exportStrings - + a createWithNew #if ENABLE_SVG_FONTS altGlyph createWithNew |