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

Side by Side Diff: Source/core/svg/SVGAnimatedRect.cpp

Issue 19096011: Get rid of SVGRect special case from the bindings generator (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase on master 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/svg/SVGAnimatedRect.h ('k') | Source/core/svg/SVGAnimatedType.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) Research In Motion Limited 2011. All rights reserved. 2 * Copyright (C) Research In Motion Limited 2011. All rights reserved.
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 15 matching lines...) Expand all
26 26
27 namespace WebCore { 27 namespace WebCore {
28 28
29 SVGAnimatedRectAnimator::SVGAnimatedRectAnimator(SVGAnimationElement* animationE lement, SVGElement* contextElement) 29 SVGAnimatedRectAnimator::SVGAnimatedRectAnimator(SVGAnimationElement* animationE lement, SVGElement* contextElement)
30 : SVGAnimatedTypeAnimator(AnimatedRect, animationElement, contextElement) 30 : SVGAnimatedTypeAnimator(AnimatedRect, animationElement, contextElement)
31 { 31 {
32 } 32 }
33 33
34 PassOwnPtr<SVGAnimatedType> SVGAnimatedRectAnimator::constructFromString(const S tring& string) 34 PassOwnPtr<SVGAnimatedType> SVGAnimatedRectAnimator::constructFromString(const S tring& string)
35 { 35 {
36 OwnPtr<SVGAnimatedType> animatedType = SVGAnimatedType::createRect(new Float Rect); 36 OwnPtr<SVGAnimatedType> animatedType = SVGAnimatedType::createRect(new SVGRe ct);
37 parseRect(string, animatedType->rect()); 37 parseRect(string, animatedType->rect());
38 return animatedType.release(); 38 return animatedType.release();
39 } 39 }
40 40
41 PassOwnPtr<SVGAnimatedType> SVGAnimatedRectAnimator::startAnimValAnimation(const SVGElementAnimatedPropertyList& animatedTypes) 41 PassOwnPtr<SVGAnimatedType> SVGAnimatedRectAnimator::startAnimValAnimation(const SVGElementAnimatedPropertyList& animatedTypes)
42 { 42 {
43 return SVGAnimatedType::createRect(constructFromBaseValue<SVGAnimatedRect>(a nimatedTypes)); 43 return SVGAnimatedType::createRect(constructFromBaseValue<SVGAnimatedRect>(a nimatedTypes));
44 } 44 }
45 45
46 void SVGAnimatedRectAnimator::stopAnimValAnimation(const SVGElementAnimatedPrope rtyList& animatedTypes) 46 void SVGAnimatedRectAnimator::stopAnimValAnimation(const SVGElementAnimatedPrope rtyList& animatedTypes)
(...skipping 22 matching lines...) Expand all
69 ASSERT(from->type() == to->type()); 69 ASSERT(from->type() == to->type());
70 70
71 to->rect() += from->rect(); 71 to->rect() += from->rect();
72 } 72 }
73 73
74 void SVGAnimatedRectAnimator::calculateAnimatedValue(float percentage, unsigned repeatCount, SVGAnimatedType* from, SVGAnimatedType* to, SVGAnimatedType* toAtEn dOfDuration, SVGAnimatedType* animated) 74 void SVGAnimatedRectAnimator::calculateAnimatedValue(float percentage, unsigned repeatCount, SVGAnimatedType* from, SVGAnimatedType* to, SVGAnimatedType* toAtEn dOfDuration, SVGAnimatedType* animated)
75 { 75 {
76 ASSERT(m_animationElement); 76 ASSERT(m_animationElement);
77 ASSERT(m_contextElement); 77 ASSERT(m_contextElement);
78 78
79 const FloatRect& fromRect = m_animationElement->animationMode() == ToAnimati on ? animated->rect() : from->rect(); 79 const SVGRect& fromRect = m_animationElement->animationMode() == ToAnimation ? animated->rect() : from->rect();
80 const FloatRect& toRect = to->rect(); 80 const SVGRect& toRect = to->rect();
81 const FloatRect& toAtEndOfDurationRect = toAtEndOfDuration->rect(); 81 const SVGRect& toAtEndOfDurationRect = toAtEndOfDuration->rect();
82 FloatRect& animatedRect = animated->rect(); 82 SVGRect& animatedRect = animated->rect();
83 83
84 float animatedX = animatedRect.x(); 84 float animatedX = animatedRect.x();
85 float animatedY = animatedRect.y(); 85 float animatedY = animatedRect.y();
86 float animatedWidth = animatedRect.width(); 86 float animatedWidth = animatedRect.width();
87 float animatedHeight = animatedRect.height(); 87 float animatedHeight = animatedRect.height();
88 m_animationElement->animateAdditiveNumber(percentage, repeatCount, fromRect. x(), toRect.x(), toAtEndOfDurationRect.x(), animatedX); 88 m_animationElement->animateAdditiveNumber(percentage, repeatCount, fromRect. x(), toRect.x(), toAtEndOfDurationRect.x(), animatedX);
89 m_animationElement->animateAdditiveNumber(percentage, repeatCount, fromRect. y(), toRect.y(), toAtEndOfDurationRect.y(), animatedY); 89 m_animationElement->animateAdditiveNumber(percentage, repeatCount, fromRect. y(), toRect.y(), toAtEndOfDurationRect.y(), animatedY);
90 m_animationElement->animateAdditiveNumber(percentage, repeatCount, fromRect. width(), toRect.width(), toAtEndOfDurationRect.width(), animatedWidth); 90 m_animationElement->animateAdditiveNumber(percentage, repeatCount, fromRect. width(), toRect.width(), toAtEndOfDurationRect.width(), animatedWidth);
91 m_animationElement->animateAdditiveNumber(percentage, repeatCount, fromRect. height(), toRect.height(), toAtEndOfDurationRect.height(), animatedHeight); 91 m_animationElement->animateAdditiveNumber(percentage, repeatCount, fromRect. height(), toRect.height(), toAtEndOfDurationRect.height(), animatedHeight);
92 92
93 animatedRect = FloatRect(animatedX, animatedY, animatedWidth, animatedHeight ); 93 animatedRect = SVGRect(animatedX, animatedY, animatedWidth, animatedHeight);
94 } 94 }
95 95
96 float SVGAnimatedRectAnimator::calculateDistance(const String&, const String&) 96 float SVGAnimatedRectAnimator::calculateDistance(const String&, const String&)
97 { 97 {
98 // FIXME: Distance calculation is not possible for SVGRect right now. We nee d the distance of for every single value. 98 // FIXME: Distance calculation is not possible for SVGRect right now. We nee d the distance of for every single value.
99 return -1; 99 return -1;
100 } 100 }
101 101
102 } 102 }
OLDNEW
« no previous file with comments | « Source/core/svg/SVGAnimatedRect.h ('k') | Source/core/svg/SVGAnimatedType.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698