Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1246)

Unified Diff: Source/core/svg/SVGAnimatedTypeAnimator.h

Issue 18707002: Reduce number of header includes in SVG (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Attempt to fix bots Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/svg/SVGAnimatedTypeAnimator.h
diff --git a/Source/core/svg/SVGAnimatedTypeAnimator.h b/Source/core/svg/SVGAnimatedTypeAnimator.h
index b690fdd9d91bc49ba0046447240d55662e024f37..e2b0d3c87a674efa12eb0a35c1540ffd9af6f214 100644
--- a/Source/core/svg/SVGAnimatedTypeAnimator.h
+++ b/Source/core/svg/SVGAnimatedTypeAnimator.h
@@ -23,20 +23,14 @@
#include "core/svg/SVGAnimatedType.h"
#include "core/svg/SVGElementInstance.h"
#include "core/svg/properties/SVGAnimatedProperty.h"
-#include "core/svg/properties/SVGAttributeToPropertyMap.h"
#include <wtf/PassOwnPtr.h>
namespace WebCore {
struct SVGElementAnimatedProperties {
- SVGElementAnimatedProperties()
- : element(0)
- { }
+ SVGElementAnimatedProperties();
- SVGElementAnimatedProperties(SVGElement* element, Vector<RefPtr<SVGAnimatedProperty> >& properties)
- : element(element)
- , properties(properties)
- { }
+ SVGElementAnimatedProperties(SVGElement*, Vector<RefPtr<SVGAnimatedProperty> >&);
SVGElement* element;
Vector<RefPtr<SVGAnimatedProperty> > properties;
@@ -48,7 +42,7 @@ class SVGAnimationElement;
class SVGAnimatedTypeAnimator {
WTF_MAKE_FAST_ALLOCATED;
public:
- virtual ~SVGAnimatedTypeAnimator() { }
+ virtual ~SVGAnimatedTypeAnimator();
virtual PassOwnPtr<SVGAnimatedType> constructFromString(const String&) = 0;
virtual PassOwnPtr<SVGAnimatedType> startAnimValAnimation(const SVGElementAnimatedPropertyList&) = 0;
@@ -61,75 +55,16 @@ public:
virtual void calculateAnimatedValue(float percentage, unsigned repeatCount, SVGAnimatedType*, SVGAnimatedType*, SVGAnimatedType*, SVGAnimatedType*) = 0;
virtual float calculateDistance(const String& fromString, const String& toString) = 0;
- void calculateFromAndToValues(OwnPtr<SVGAnimatedType>& from, OwnPtr<SVGAnimatedType>& to, const String& fromString, const String& toString)
- {
- from = constructFromString(fromString);
- to = constructFromString(toString);
- }
-
- void calculateFromAndByValues(OwnPtr<SVGAnimatedType>& from, OwnPtr<SVGAnimatedType>& to, const String& fromString, const String& byString)
- {
- from = constructFromString(fromString);
- to = constructFromString(byString);
- addAnimatedTypes(from.get(), to.get());
- }
+ void calculateFromAndToValues(OwnPtr<SVGAnimatedType>& from, OwnPtr<SVGAnimatedType>& to, const String& fromString, const String& toString);
+ void calculateFromAndByValues(OwnPtr<SVGAnimatedType>& from, OwnPtr<SVGAnimatedType>& to, const String& fromString, const String& byString);
void setContextElement(SVGElement* contextElement) { m_contextElement = contextElement; }
AnimatedPropertyType type() const { return m_type; }
- SVGElementAnimatedPropertyList findAnimatedPropertiesForAttributeName(SVGElement* targetElement, const QualifiedName& attributeName)
- {
- ASSERT(targetElement);
-
- SVGElementAnimatedPropertyList propertiesByInstance;
-
- Vector<RefPtr<SVGAnimatedProperty> > targetProperties;
- targetElement->localAttributeToPropertyMap().animatedPropertiesForAttribute(targetElement, attributeName, targetProperties);
-
- if (!SVGAnimatedType::supportsAnimVal(m_type))
- return SVGElementAnimatedPropertyList();
-
- SVGElementAnimatedProperties propertiesPair(targetElement, targetProperties);
- propertiesByInstance.append(propertiesPair);
-
- const HashSet<SVGElementInstance*>& instances = targetElement->instancesForElement();
- const HashSet<SVGElementInstance*>::const_iterator end = instances.end();
- for (HashSet<SVGElementInstance*>::const_iterator it = instances.begin(); it != end; ++it) {
- SVGElement* shadowTreeElement = (*it)->shadowTreeElement();
- if (!shadowTreeElement)
- continue;
-
- Vector<RefPtr<SVGAnimatedProperty> > instanceProperties;
- targetElement->localAttributeToPropertyMap().animatedPropertiesForAttribute(shadowTreeElement, attributeName, instanceProperties);
-
- SVGElementAnimatedProperties instancePropertiesPair(shadowTreeElement, instanceProperties);
- propertiesByInstance.append(instancePropertiesPair);
- }
-
-#if !ASSERT_DISABLED
- SVGElementAnimatedPropertyList::const_iterator propertiesEnd = propertiesByInstance.end();
- for (SVGElementAnimatedPropertyList::const_iterator it = propertiesByInstance.begin(); it != propertiesEnd; ++it) {
- size_t propertiesSize = it->properties.size();
- for (size_t i = 0; i < propertiesSize; ++i) {
- RefPtr<SVGAnimatedProperty> property = it->properties[i];
- if (property->animatedPropertyType() != m_type) {
- ASSERT(m_type == AnimatedAngle);
- ASSERT(property->animatedPropertyType() == AnimatedEnumeration);
- }
- }
- }
-#endif
-
- return propertiesByInstance;
- }
+ SVGElementAnimatedPropertyList findAnimatedPropertiesForAttributeName(SVGElement*, const QualifiedName&);
protected:
- SVGAnimatedTypeAnimator(AnimatedPropertyType type, SVGAnimationElement* animationElement, SVGElement* contextElement)
- : m_type(type)
- , m_animationElement(animationElement)
- , m_contextElement(contextElement)
- {
- }
+ SVGAnimatedTypeAnimator(AnimatedPropertyType, SVGAnimationElement*, SVGElement*);
// Helpers for animators that operate on single types, eg. just one SVGAnimatedInteger.
template<typename AnimValType>

Powered by Google App Engine
This is Rietveld 408576698