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/layout/svg/LayoutSVGResourceGradient.cpp

Issue 2749583002: Add Gradient::addColorStops method (Closed)
Patch Set: Created 3 years, 9 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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 const ComputedStyle&) const { 112 const ComputedStyle&) const {
113 if (child->isSVGGradientStop()) 113 if (child->isSVGGradientStop())
114 return true; 114 return true;
115 115
116 if (!child->isSVGResourceContainer()) 116 if (!child->isSVGResourceContainer())
117 return false; 117 return false;
118 118
119 return toLayoutSVGResourceContainer(child)->isSVGPaintServer(); 119 return toLayoutSVGResourceContainer(child)->isSVGPaintServer();
120 } 120 }
121 121
122 void LayoutSVGResourceGradient::addStops(
123 Gradient& gradient,
124 const Vector<Gradient::ColorStop>& stops) const {
125 for (const auto& stop : stops)
126 gradient.addColorStop(stop);
127 }
128
129 GradientSpreadMethod LayoutSVGResourceGradient::platformSpreadMethodFromSVGType( 122 GradientSpreadMethod LayoutSVGResourceGradient::platformSpreadMethodFromSVGType(
130 SVGSpreadMethodType method) { 123 SVGSpreadMethodType method) {
131 switch (method) { 124 switch (method) {
132 case SVGSpreadMethodUnknown: 125 case SVGSpreadMethodUnknown:
133 case SVGSpreadMethodPad: 126 case SVGSpreadMethodPad:
134 return SpreadMethodPad; 127 return SpreadMethodPad;
135 case SVGSpreadMethodReflect: 128 case SVGSpreadMethodReflect:
136 return SpreadMethodReflect; 129 return SpreadMethodReflect;
137 case SVGSpreadMethodRepeat: 130 case SVGSpreadMethodRepeat:
138 return SpreadMethodRepeat; 131 return SpreadMethodRepeat;
139 } 132 }
140 133
141 ASSERT_NOT_REACHED(); 134 ASSERT_NOT_REACHED();
142 return SpreadMethodPad; 135 return SpreadMethodPad;
143 } 136 }
144 137
145 } // namespace blink 138 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698