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 "SkSVGPolygon.h" michael@0: #include "SkSVGParser.h" michael@0: michael@0: const SkSVGAttribute SkSVGPolygon::gAttributes[] = { michael@0: SVG_LITERAL_ATTRIBUTE(clip-rule, f_clipRule), michael@0: SVG_LITERAL_ATTRIBUTE(fill-rule, f_fillRule), michael@0: SVG_ATTRIBUTE(points) michael@0: }; michael@0: michael@0: DEFINE_SVG_INFO(Polygon) michael@0: michael@0: void SkSVGPolygon::addAttribute(SkSVGParser& parser, int attrIndex, michael@0: const char* attrValue, size_t attrLength) { michael@0: INHERITED::addAttribute(parser, attrIndex, attrValue, attrLength); michael@0: } michael@0: michael@0: void SkSVGPolygon::translate(SkSVGParser& parser, bool defState) { michael@0: parser._startElement("polygon"); michael@0: SkSVGElement::translate(parser, defState); michael@0: SVG_ADD_ATTRIBUTE(points); michael@0: if (f_fillRule.size() > 0) michael@0: parser._addAttribute("fillType", f_fillRule.equals("evenodd") ? "evenOdd" : "winding"); michael@0: parser._endElement(); michael@0: }