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

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

Issue 1686483002: Oilpan: Remove most WillBe types from the code base (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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, 2006 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2004, 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org>
3 * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org> 3 * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org>
4 * Copyright (C) 2007 Apple Inc. All rights reserved. 4 * Copyright (C) 2007 Apple Inc. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 21 matching lines...) Expand all
32 : m_isValid(true) 32 : m_isValid(true)
33 { 33 {
34 } 34 }
35 35
36 SVGRect::SVGRect(const FloatRect& rect) 36 SVGRect::SVGRect(const FloatRect& rect)
37 : m_isValid(true) 37 : m_isValid(true)
38 , m_value(rect) 38 , m_value(rect)
39 { 39 {
40 } 40 }
41 41
42 PassRefPtrWillBeRawPtr<SVGRect> SVGRect::clone() const 42 RawPtr<SVGRect> SVGRect::clone() const
43 { 43 {
44 return SVGRect::create(m_value); 44 return SVGRect::create(m_value);
45 } 45 }
46 46
47 template<typename CharType> 47 template<typename CharType>
48 SVGParsingError SVGRect::parse(const CharType*& ptr, const CharType* end) 48 SVGParsingError SVGRect::parse(const CharType*& ptr, const CharType* end)
49 { 49 {
50 const CharType* start = ptr; 50 const CharType* start = ptr;
51 float x = 0; 51 float x = 0;
52 float y = 0; 52 float y = 0;
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 builder.appendNumber(x()); 97 builder.appendNumber(x());
98 builder.append(' '); 98 builder.append(' ');
99 builder.appendNumber(y()); 99 builder.appendNumber(y());
100 builder.append(' '); 100 builder.append(' ');
101 builder.appendNumber(width()); 101 builder.appendNumber(width());
102 builder.append(' '); 102 builder.append(' ');
103 builder.appendNumber(height()); 103 builder.appendNumber(height());
104 return builder.toString(); 104 return builder.toString();
105 } 105 }
106 106
107 void SVGRect::add(PassRefPtrWillBeRawPtr<SVGPropertyBase> other, SVGElement*) 107 void SVGRect::add(RawPtr<SVGPropertyBase> other, SVGElement*)
108 { 108 {
109 m_value += toSVGRect(other)->value(); 109 m_value += toSVGRect(other)->value();
110 } 110 }
111 111
112 void SVGRect::calculateAnimatedValue(SVGAnimationElement* animationElement, floa t percentage, unsigned repeatCount, PassRefPtrWillBeRawPtr<SVGPropertyBase> from Value, PassRefPtrWillBeRawPtr<SVGPropertyBase> toValue, PassRefPtrWillBeRawPtr<S VGPropertyBase> toAtEndOfDurationValue, SVGElement*) 112 void SVGRect::calculateAnimatedValue(SVGAnimationElement* animationElement, floa t percentage, unsigned repeatCount, RawPtr<SVGPropertyBase> fromValue, RawPtr<SV GPropertyBase> toValue, RawPtr<SVGPropertyBase> toAtEndOfDurationValue, SVGEleme nt*)
113 { 113 {
114 ASSERT(animationElement); 114 ASSERT(animationElement);
115 RefPtrWillBeRawPtr<SVGRect> fromRect = animationElement->animationMode() == ToAnimation ? PassRefPtrWillBeRawPtr<SVGRect>(this) : toSVGRect(fromValue); 115 RawPtr<SVGRect> fromRect = animationElement->animationMode() == ToAnimation ? RawPtr<SVGRect>(this) : toSVGRect(fromValue);
116 RefPtrWillBeRawPtr<SVGRect> toRect = toSVGRect(toValue); 116 RawPtr<SVGRect> toRect = toSVGRect(toValue);
117 RefPtrWillBeRawPtr<SVGRect> toAtEndOfDurationRect = toSVGRect(toAtEndOfDurat ionValue); 117 RawPtr<SVGRect> toAtEndOfDurationRect = toSVGRect(toAtEndOfDurationValue);
118 118
119 float animatedX = x(); 119 float animatedX = x();
120 float animatedY = y(); 120 float animatedY = y();
121 float animatedWidth = width(); 121 float animatedWidth = width();
122 float animatedHeight = height(); 122 float animatedHeight = height();
123 animationElement->animateAdditiveNumber(percentage, repeatCount, fromRect->x (), toRect->x(), toAtEndOfDurationRect->x(), animatedX); 123 animationElement->animateAdditiveNumber(percentage, repeatCount, fromRect->x (), toRect->x(), toAtEndOfDurationRect->x(), animatedX);
124 animationElement->animateAdditiveNumber(percentage, repeatCount, fromRect->y (), toRect->y(), toAtEndOfDurationRect->y(), animatedY); 124 animationElement->animateAdditiveNumber(percentage, repeatCount, fromRect->y (), toRect->y(), toAtEndOfDurationRect->y(), animatedY);
125 animationElement->animateAdditiveNumber(percentage, repeatCount, fromRect->w idth(), toRect->width(), toAtEndOfDurationRect->width(), animatedWidth); 125 animationElement->animateAdditiveNumber(percentage, repeatCount, fromRect->w idth(), toRect->width(), toAtEndOfDurationRect->width(), animatedWidth);
126 animationElement->animateAdditiveNumber(percentage, repeatCount, fromRect->h eight(), toRect->height(), toAtEndOfDurationRect->height(), animatedHeight); 126 animationElement->animateAdditiveNumber(percentage, repeatCount, fromRect->h eight(), toRect->height(), toAtEndOfDurationRect->height(), animatedHeight);
127 127
128 m_value = FloatRect(animatedX, animatedY, animatedWidth, animatedHeight); 128 m_value = FloatRect(animatedX, animatedY, animatedWidth, animatedHeight);
129 } 129 }
130 130
131 float SVGRect::calculateDistance(PassRefPtrWillBeRawPtr<SVGPropertyBase> to, SVG Element* contextElement) 131 float SVGRect::calculateDistance(RawPtr<SVGPropertyBase> to, SVGElement* context Element)
132 { 132 {
133 // FIXME: Distance calculation is not possible for SVGRect right now. We nee d the distance for every single value. 133 // FIXME: Distance calculation is not possible for SVGRect right now. We nee d the distance for every single value.
134 return -1; 134 return -1;
135 } 135 }
136 136
137 void SVGRect::setInvalid() 137 void SVGRect::setInvalid()
138 { 138 {
139 m_value = FloatRect(0.0f, 0.0f, 0.0f, 0.0f); 139 m_value = FloatRect(0.0f, 0.0f, 0.0f, 0.0f);
140 m_isValid = false; 140 m_isValid = false;
141 } 141 }
142 142
143 } // namespace blink 143 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698