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

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

Issue 22897011: Introduce toSVGRadialGradientElement(), and use it (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 4 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
« no previous file with comments | « Source/core/svg/SVGRadialGradientElement.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) 2008 Eric Seidel <eric@webkit.org> 4 * Copyright (C) 2008 Eric Seidel <eric@webkit.org>
5 * Copyright (C) 2008 Dirk Schulze <krit@webkit.org> 5 * Copyright (C) 2008 Dirk Schulze <krit@webkit.org>
6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 attributes.setGradientTransform(transform); 152 attributes.setGradientTransform(transform);
153 } 153 }
154 154
155 if (!attributes.hasStops()) { 155 if (!attributes.hasStops()) {
156 const Vector<Gradient::ColorStop>& stops(current->buildStops()); 156 const Vector<Gradient::ColorStop>& stops(current->buildStops());
157 if (!stops.isEmpty()) 157 if (!stops.isEmpty())
158 attributes.setStops(stops); 158 attributes.setStops(stops);
159 } 159 }
160 160
161 if (isRadial) { 161 if (isRadial) {
162 SVGRadialGradientElement* radial = static_cast<SVGRadialGradientElem ent*>(current); 162 SVGRadialGradientElement* radial = toSVGRadialGradientElement(curren t);
163 163
164 if (!attributes.hasCx() && current->hasAttribute(SVGNames::cxAttr)) 164 if (!attributes.hasCx() && current->hasAttribute(SVGNames::cxAttr))
165 attributes.setCx(radial->cxCurrentValue()); 165 attributes.setCx(radial->cxCurrentValue());
166 166
167 if (!attributes.hasCy() && current->hasAttribute(SVGNames::cyAttr)) 167 if (!attributes.hasCy() && current->hasAttribute(SVGNames::cyAttr))
168 attributes.setCy(radial->cyCurrentValue()); 168 attributes.setCy(radial->cyCurrentValue());
169 169
170 if (!attributes.hasR() && current->hasAttribute(SVGNames::rAttr)) 170 if (!attributes.hasR() && current->hasAttribute(SVGNames::rAttr))
171 attributes.setR(radial->rCurrentValue()); 171 attributes.setR(radial->rCurrentValue());
172 172
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 { 211 {
212 return cxCurrentValue().isRelative() 212 return cxCurrentValue().isRelative()
213 || cyCurrentValue().isRelative() 213 || cyCurrentValue().isRelative()
214 || rCurrentValue().isRelative() 214 || rCurrentValue().isRelative()
215 || fxCurrentValue().isRelative() 215 || fxCurrentValue().isRelative()
216 || fyCurrentValue().isRelative() 216 || fyCurrentValue().isRelative()
217 || frCurrentValue().isRelative(); 217 || frCurrentValue().isRelative();
218 } 218 }
219 219
220 } 220 }
OLDNEW
« no previous file with comments | « Source/core/svg/SVGRadialGradientElement.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698