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

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

Issue 2436793002: Simplify SVGAnimated* initialization (Closed)
Patch Set: Created 4 years, 2 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, 2008 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2004, 2005, 2006, 2008 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) Research In Motion Limited 2010. All rights reserved. 4 * Copyright (C) Research In Motion Limited 2010. 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 29 matching lines...) Expand all
40 } 40 }
41 return entries; 41 return entries;
42 } 42 }
43 43
44 SVGGradientElement::SVGGradientElement(const QualifiedName& tagName, 44 SVGGradientElement::SVGGradientElement(const QualifiedName& tagName,
45 Document& document) 45 Document& document)
46 : SVGElement(tagName, document), 46 : SVGElement(tagName, document),
47 SVGURIReference(this), 47 SVGURIReference(this),
48 m_gradientTransform( 48 m_gradientTransform(
49 SVGAnimatedTransformList::create(this, 49 SVGAnimatedTransformList::create(this,
50 SVGNames::gradientTransformAttr, 50 SVGNames::gradientTransformAttr)),
51 SVGTransformList::create())),
52 m_spreadMethod(SVGAnimatedEnumeration<SVGSpreadMethodType>::create( 51 m_spreadMethod(SVGAnimatedEnumeration<SVGSpreadMethodType>::create(
53 this, 52 this,
54 SVGNames::spreadMethodAttr, 53 SVGNames::spreadMethodAttr,
55 SVGSpreadMethodPad)), 54 SVGSpreadMethodPad)),
56 m_gradientUnits(SVGAnimatedEnumeration<SVGUnitTypes::SVGUnitType>::create( 55 m_gradientUnits(SVGAnimatedEnumeration<SVGUnitTypes::SVGUnitType>::create(
57 this, 56 this,
58 SVGNames::gradientUnitsAttr, 57 SVGNames::gradientUnitsAttr,
59 SVGUnitTypes::kSvgUnitTypeObjectboundingbox)) { 58 SVGUnitTypes::kSvgUnitTypeObjectboundingbox)) {
60 addToPropertyMap(m_gradientTransform); 59 addToPropertyMap(m_gradientTransform);
61 addToPropertyMap(m_spreadMethod); 60 addToPropertyMap(m_spreadMethod);
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 float offset = stop.offset()->currentValue()->value(); 108 float offset = stop.offset()->currentValue()->value();
110 offset = std::min(std::max(previousOffset, offset), 1.0f); 109 offset = std::min(std::max(previousOffset, offset), 1.0f);
111 previousOffset = offset; 110 previousOffset = offset;
112 111
113 stops.append(Gradient::ColorStop(offset, stop.stopColorIncludingOpacity())); 112 stops.append(Gradient::ColorStop(offset, stop.stopColorIncludingOpacity()));
114 } 113 }
115 return stops; 114 return stops;
116 } 115 }
117 116
118 } // namespace blink 117 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/svg/SVGFitToViewBox.cpp ('k') | third_party/WebKit/Source/core/svg/SVGGraphicsElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698