michael@0: michael@0: /* michael@0: * Copyright 2006 The Android Open Source Project michael@0: * michael@0: * Use of this source code is governed by a BSD-style license that can be michael@0: * found in the LICENSE file. michael@0: */ michael@0: michael@0: michael@0: #include "SkSVGRadialGradient.h" michael@0: #include "SkSVGParser.h" michael@0: michael@0: const SkSVGAttribute SkSVGRadialGradient::gAttributes[] = { michael@0: SVG_ATTRIBUTE(cx), michael@0: SVG_ATTRIBUTE(cy), michael@0: SVG_ATTRIBUTE(fx), michael@0: SVG_ATTRIBUTE(fy), michael@0: SVG_ATTRIBUTE(gradientTransform), michael@0: SVG_ATTRIBUTE(gradientUnits), michael@0: SVG_ATTRIBUTE(r) michael@0: }; michael@0: michael@0: DEFINE_SVG_INFO(RadialGradient) michael@0: michael@0: void SkSVGRadialGradient::translate(SkSVGParser& parser, bool defState) { michael@0: if (fMatrixID.size() == 0) michael@0: parser.translateMatrix(f_gradientTransform, &fMatrixID); michael@0: parser._startElement("radialGradient"); michael@0: if (fMatrixID.size() > 0) michael@0: parser._addAttribute("matrix", fMatrixID); michael@0: INHERITED::translateGradientUnits(f_gradientUnits); michael@0: SkString center; michael@0: center.appendUnichar('['); michael@0: center.append(f_cx); michael@0: center.appendUnichar(','); michael@0: center.append(f_cy); michael@0: center.appendUnichar(']'); michael@0: parser._addAttribute("center", center); michael@0: parser._addAttribute("radius", f_r); michael@0: INHERITED::translate(parser, defState); michael@0: parser._endElement(); michael@0: }