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

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

Issue 19097005: Remove one SVG animated type special case from the bindings generator (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix the regressions Created 7 years, 5 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 | Annotate | Revision Log
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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 float previousOffset = 0.0f; 143 float previousOffset = 0.0f;
144 for (Node* n = firstChild(); n; n = n->nextSibling()) { 144 for (Node* n = firstChild(); n; n = n->nextSibling()) {
145 SVGElement* element = n->isSVGElement() ? toSVGElement(n) : 0; 145 SVGElement* element = n->isSVGElement() ? toSVGElement(n) : 0;
146 if (!element || !element->isGradientStop()) 146 if (!element || !element->isGradientStop())
147 continue; 147 continue;
148 148
149 SVGStopElement* stop = toSVGStopElement(element); 149 SVGStopElement* stop = toSVGStopElement(element);
150 Color color = stop->stopColorIncludingOpacity(); 150 Color color = stop->stopColorIncludingOpacity();
151 151
152 // Figure out right monotonic offset 152 // Figure out right monotonic offset
153 float offset = stop->offset(); 153 float offset = stop->offsetCurrentValue();
154 offset = std::min(std::max(previousOffset, offset), 1.0f); 154 offset = std::min(std::max(previousOffset, offset), 1.0f);
155 previousOffset = offset; 155 previousOffset = offset;
156 156
157 // Extract individual channel values 157 // Extract individual channel values
158 // FIXME: Why doesn't ColorStop take a Color and an offset?? 158 // FIXME: Why doesn't ColorStop take a Color and an offset??
159 float r, g, b, a; 159 float r, g, b, a;
160 color.getRGBA(r, g, b, a); 160 color.getRGBA(r, g, b, a);
161 161
162 stops.append(Gradient::ColorStop(offset, r, g, b, a)); 162 stops.append(Gradient::ColorStop(offset, r, g, b, a));
163 } 163 }
164 164
165 return stops; 165 return stops;
166 } 166 }
167 167
168 } 168 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698