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

Side by Side Diff: third_party/WebKit/Source/core/svg/SVGAnimateElement.cpp

Issue 1743863002: Rename enums/functions that collide in chromium style in core/svg,xml (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: get-names-10: rebase Created 4 years, 9 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2005 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2004, 2005 Nikolas Zimmermann <zimmermann@kde.org>
3 * Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org> 3 * Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org>
4 * Copyright (C) 2008 Apple Inc. All rights reserved. 4 * Copyright (C) 2008 Apple Inc. All rights reserved.
5 * Copyright (C) Research In Motion Limited 2011. All rights reserved. 5 * Copyright (C) Research In Motion Limited 2011. All rights reserved.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 ASSERT(m_fromProperty->type() == animatedPropertyType()); 99 ASSERT(m_fromProperty->type() == animatedPropertyType());
100 ASSERT(m_toProperty); 100 ASSERT(m_toProperty);
101 101
102 SVGAnimateElement* resultAnimationElement = toSVGAnimateElement(resultElemen t); 102 SVGAnimateElement* resultAnimationElement = toSVGAnimateElement(resultElemen t);
103 ASSERT(resultAnimationElement->m_animatedProperty); 103 ASSERT(resultAnimationElement->m_animatedProperty);
104 ASSERT(resultAnimationElement->animatedPropertyType() == animatedPropertyTyp e()); 104 ASSERT(resultAnimationElement->animatedPropertyType() == animatedPropertyTyp e());
105 105
106 if (isSVGSetElement(*this)) 106 if (isSVGSetElement(*this))
107 percentage = 1; 107 percentage = 1;
108 108
109 if (calcMode() == CalcModeDiscrete) 109 if (getCalcMode() == CalcModeDiscrete)
110 percentage = percentage < 0.5 ? 0 : 1; 110 percentage = percentage < 0.5 ? 0 : 1;
111 111
112 // Target element might have changed. 112 // Target element might have changed.
113 m_animator.setContextElement(targetElement); 113 m_animator.setContextElement(targetElement);
114 114
115 // Values-animation accumulates using the last values entry corresponding to the end of duration time. 115 // Values-animation accumulates using the last values entry corresponding to the end of duration time.
116 SVGPropertyBase* toAtEndOfDurationProperty = m_toAtEndOfDurationProperty ? m _toAtEndOfDurationProperty.get() : m_toProperty.get(); 116 SVGPropertyBase* toAtEndOfDurationProperty = m_toAtEndOfDurationProperty ? m _toAtEndOfDurationProperty.get() : m_toProperty.get();
117 m_animator.calculateAnimatedValue(percentage, repeatCount, m_fromProperty.ge t(), m_toProperty.get(), toAtEndOfDurationProperty, resultAnimationElement->m_an imatedProperty.get()); 117 m_animator.calculateAnimatedValue(percentage, repeatCount, m_fromProperty.ge t(), m_toProperty.get(), toAtEndOfDurationProperty, resultAnimationElement->m_an imatedProperty.get());
118 } 118 }
119 119
(...skipping 15 matching lines...) Expand all
135 m_animator.calculateFromAndToValues(m_fromProperty, m_toProperty, fromString , toString); 135 m_animator.calculateFromAndToValues(m_fromProperty, m_toProperty, fromString , toString);
136 return true; 136 return true;
137 } 137 }
138 138
139 bool SVGAnimateElement::calculateFromAndByValues(const String& fromString, const String& byString) 139 bool SVGAnimateElement::calculateFromAndByValues(const String& fromString, const String& byString)
140 { 140 {
141 SVGElement* targetElement = this->targetElement(); 141 SVGElement* targetElement = this->targetElement();
142 if (!targetElement) 142 if (!targetElement)
143 return false; 143 return false;
144 144
145 if (animationMode() == ByAnimation && !isAdditive()) 145 if (getAnimationMode() == ByAnimation && !isAdditive())
146 return false; 146 return false;
147 147
148 // from-by animation may only be used with attributes that support addition (e.g. most numeric attributes). 148 // from-by animation may only be used with attributes that support addition (e.g. most numeric attributes).
149 if (animationMode() == FromByAnimation && !animatedPropertyTypeSupportsAddit ion()) 149 if (getAnimationMode() == FromByAnimation && !animatedPropertyTypeSupportsAd dition())
150 return false; 150 return false;
151 151
152 ASSERT(!isSVGSetElement(*this)); 152 ASSERT(!isSVGSetElement(*this));
153 153
154 determinePropertyValueTypes(fromString, byString); 154 determinePropertyValueTypes(fromString, byString);
155 m_animator.calculateFromAndByValues(m_fromProperty, m_toProperty, fromString , byString); 155 m_animator.calculateFromAndByValues(m_fromProperty, m_toProperty, fromString , byString);
156 return true; 156 return true;
157 } 157 }
158 158
159 SVGElementInstances SVGAnimateElement::findElementInstances(SVGElement* targetEl ement) 159 SVGElementInstances SVGAnimateElement::findElementInstances(SVGElement* targetEl ement)
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 case AnimatedString: 359 case AnimatedString:
360 case AnimatedUnknown: 360 case AnimatedUnknown:
361 return false; 361 return false;
362 default: 362 default:
363 return true; 363 return true;
364 } 364 }
365 } 365 }
366 366
367 bool SVGAnimateElement::isAdditive() 367 bool SVGAnimateElement::isAdditive()
368 { 368 {
369 if (animationMode() == ByAnimation || animationMode() == FromByAnimation) { 369 if (getAnimationMode() == ByAnimation || getAnimationMode() == FromByAnimati on) {
370 if (!animatedPropertyTypeSupportsAddition()) 370 if (!animatedPropertyTypeSupportsAddition())
371 return false; 371 return false;
372 } 372 }
373 373
374 return SVGAnimationElement::isAdditive(); 374 return SVGAnimationElement::isAdditive();
375 } 375 }
376 376
377 float SVGAnimateElement::calculateDistance(const String& fromString, const Strin g& toString) 377 float SVGAnimateElement::calculateDistance(const String& fromString, const Strin g& toString)
378 { 378 {
379 // FIXME: A return value of float is not enough to support paced animations on lists. 379 // FIXME: A return value of float is not enough to support paced animations on lists.
(...skipping 29 matching lines...) Expand all
409 { 409 {
410 visitor->trace(m_fromProperty); 410 visitor->trace(m_fromProperty);
411 visitor->trace(m_toProperty); 411 visitor->trace(m_toProperty);
412 visitor->trace(m_toAtEndOfDurationProperty); 412 visitor->trace(m_toAtEndOfDurationProperty);
413 visitor->trace(m_animatedProperty); 413 visitor->trace(m_animatedProperty);
414 visitor->trace(m_animator); 414 visitor->trace(m_animator);
415 SVGAnimationElement::trace(visitor); 415 SVGAnimationElement::trace(visitor);
416 } 416 }
417 417
418 } // namespace blink 418 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/svg/SVGAngle.cpp ('k') | third_party/WebKit/Source/core/svg/SVGAnimateMotionElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698