OLD | NEW |
| (Empty) |
1 /* | |
2 * Copyright 2006 The Android Open Source Project | |
3 * | |
4 * Use of this source code is governed by a BSD-style license that can be | |
5 * found in the LICENSE file. | |
6 */ | |
7 | |
8 | |
9 #include "SkSVGRadialGradient.h" | |
10 #include "SkSVGParser.h" | |
11 | |
12 const SkSVGAttribute SkSVGRadialGradient::gAttributes[] = { | |
13 SVG_ATTRIBUTE(cx), | |
14 SVG_ATTRIBUTE(cy), | |
15 SVG_ATTRIBUTE(fx), | |
16 SVG_ATTRIBUTE(fy), | |
17 SVG_ATTRIBUTE(gradientTransform), | |
18 SVG_ATTRIBUTE(gradientUnits), | |
19 SVG_ATTRIBUTE(r) | |
20 }; | |
21 | |
22 DEFINE_SVG_INFO(RadialGradient) | |
23 | |
24 void SkSVGRadialGradient::translate(SkSVGParser& parser, bool defState) { | |
25 if (fMatrixID.size() == 0) | |
26 parser.translateMatrix(f_gradientTransform, &fMatrixID); | |
27 parser._startElement("radialGradient"); | |
28 if (fMatrixID.size() > 0) | |
29 parser._addAttribute("matrix", fMatrixID); | |
30 INHERITED::translateGradientUnits(f_gradientUnits); | |
31 SkString center; | |
32 center.appendUnichar('['); | |
33 center.append(f_cx); | |
34 center.appendUnichar(','); | |
35 center.append(f_cy); | |
36 center.appendUnichar(']'); | |
37 parser._addAttribute("center", center); | |
38 parser._addAttribute("radius", f_r); | |
39 INHERITED::translate(parser, defState); | |
40 parser._endElement(); | |
41 } | |
OLD | NEW |