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

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

Issue 2617783002: Migrate WTF::Vector::append() to ::push_back() [part 12 of N] (Closed)
Patch Set: rebase Created 3 years, 11 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 17 matching lines...) Expand all
28 #include "core/svg/SVGStopElement.h" 28 #include "core/svg/SVGStopElement.h"
29 #include "core/svg/SVGTransformList.h" 29 #include "core/svg/SVGTransformList.h"
30 30
31 namespace blink { 31 namespace blink {
32 32
33 template <> 33 template <>
34 const SVGEnumerationStringEntries& 34 const SVGEnumerationStringEntries&
35 getStaticStringEntries<SVGSpreadMethodType>() { 35 getStaticStringEntries<SVGSpreadMethodType>() {
36 DEFINE_STATIC_LOCAL(SVGEnumerationStringEntries, entries, ()); 36 DEFINE_STATIC_LOCAL(SVGEnumerationStringEntries, entries, ());
37 if (entries.isEmpty()) { 37 if (entries.isEmpty()) {
38 entries.append(std::make_pair(SVGSpreadMethodPad, "pad")); 38 entries.push_back(std::make_pair(SVGSpreadMethodPad, "pad"));
39 entries.append(std::make_pair(SVGSpreadMethodReflect, "reflect")); 39 entries.push_back(std::make_pair(SVGSpreadMethodReflect, "reflect"));
40 entries.append(std::make_pair(SVGSpreadMethodRepeat, "repeat")); 40 entries.push_back(std::make_pair(SVGSpreadMethodRepeat, "repeat"));
41 } 41 }
42 return entries; 42 return entries;
43 } 43 }
44 44
45 SVGGradientElement::SVGGradientElement(const QualifiedName& tagName, 45 SVGGradientElement::SVGGradientElement(const QualifiedName& tagName,
46 Document& document) 46 Document& document)
47 : SVGElement(tagName, document), 47 : SVGElement(tagName, document),
48 SVGURIReference(this), 48 SVGURIReference(this),
49 m_gradientTransform( 49 m_gradientTransform(
50 SVGAnimatedTransformList::create(this, 50 SVGAnimatedTransformList::create(this,
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 Vector<Gradient::ColorStop> stops; 123 Vector<Gradient::ColorStop> stops;
124 124
125 float previousOffset = 0.0f; 125 float previousOffset = 0.0f;
126 for (const SVGStopElement& stop : 126 for (const SVGStopElement& stop :
127 Traversal<SVGStopElement>::childrenOf(*this)) { 127 Traversal<SVGStopElement>::childrenOf(*this)) {
128 // Figure out right monotonic offset. 128 // Figure out right monotonic offset.
129 float offset = stop.offset()->currentValue()->value(); 129 float offset = stop.offset()->currentValue()->value();
130 offset = std::min(std::max(previousOffset, offset), 1.0f); 130 offset = std::min(std::max(previousOffset, offset), 1.0f);
131 previousOffset = offset; 131 previousOffset = offset;
132 132
133 stops.append(Gradient::ColorStop(offset, stop.stopColorIncludingOpacity())); 133 stops.push_back(
134 Gradient::ColorStop(offset, stop.stopColorIncludingOpacity()));
134 } 135 }
135 return stops; 136 return stops;
136 } 137 }
137 138
138 } // namespace blink 139 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/svg/SVGFETurbulenceElement.cpp ('k') | third_party/WebKit/Source/core/svg/SVGMarkerElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698