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

Side by Side Diff: Source/core/layout/svg/LayoutSVGResourceGradient.cpp

Issue 1062283002: Use C++11 range-based loop for core/layout (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix it naming Created 5 years, 8 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) 2006 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org>
3 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> 3 * Copyright (C) 2008 Eric Seidel <eric@webkit.org>
4 * Copyright (C) 2008 Dirk Schulze <krit@webkit.org> 4 * Copyright (C) 2008 Dirk Schulze <krit@webkit.org>
5 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 5 * Copyright (C) Research In Motion Limited 2010. 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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 if (!child->isSVGResourceContainer()) 107 if (!child->isSVGResourceContainer())
108 return false; 108 return false;
109 109
110 return toLayoutSVGResourceContainer(child)->isSVGPaintServer(); 110 return toLayoutSVGResourceContainer(child)->isSVGPaintServer();
111 } 111 }
112 112
113 void LayoutSVGResourceGradient::addStops(GradientData* gradientData, const Vecto r<Gradient::ColorStop>& stops) const 113 void LayoutSVGResourceGradient::addStops(GradientData* gradientData, const Vecto r<Gradient::ColorStop>& stops) const
114 { 114 {
115 ASSERT(gradientData->gradient); 115 ASSERT(gradientData->gradient);
116 116
117 const Vector<Gradient::ColorStop>::const_iterator end = stops.end(); 117 for (const auto& stop : stops)
118 for (Vector<Gradient::ColorStop>::const_iterator it = stops.begin(); it != e nd; ++it) 118 gradientData->gradient->addColorStop(stop);
119 gradientData->gradient->addColorStop(*it);
120 } 119 }
121 120
122 GradientSpreadMethod LayoutSVGResourceGradient::platformSpreadMethodFromSVGType( SVGSpreadMethodType method) const 121 GradientSpreadMethod LayoutSVGResourceGradient::platformSpreadMethodFromSVGType( SVGSpreadMethodType method) const
123 { 122 {
124 switch (method) { 123 switch (method) {
125 case SVGSpreadMethodUnknown: 124 case SVGSpreadMethodUnknown:
126 case SVGSpreadMethodPad: 125 case SVGSpreadMethodPad:
127 return SpreadMethodPad; 126 return SpreadMethodPad;
128 case SVGSpreadMethodReflect: 127 case SVGSpreadMethodReflect:
129 return SpreadMethodReflect; 128 return SpreadMethodReflect;
130 case SVGSpreadMethodRepeat: 129 case SVGSpreadMethodRepeat:
131 return SpreadMethodRepeat; 130 return SpreadMethodRepeat;
132 } 131 }
133 132
134 ASSERT_NOT_REACHED(); 133 ASSERT_NOT_REACHED();
135 return SpreadMethodPad; 134 return SpreadMethodPad;
136 } 135 }
137 136
138 } 137 }
OLDNEW
« no previous file with comments | « Source/core/layout/svg/LayoutSVGResourceContainer.cpp ('k') | Source/core/layout/svg/SVGResourcesCycleSolver.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698