1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/gfx/skia/trunk/src/svg/SkSVGPolygon.cpp Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,33 @@ 1.4 + 1.5 +/* 1.6 + * Copyright 2006 The Android Open Source Project 1.7 + * 1.8 + * Use of this source code is governed by a BSD-style license that can be 1.9 + * found in the LICENSE file. 1.10 + */ 1.11 + 1.12 + 1.13 +#include "SkSVGPolygon.h" 1.14 +#include "SkSVGParser.h" 1.15 + 1.16 +const SkSVGAttribute SkSVGPolygon::gAttributes[] = { 1.17 + SVG_LITERAL_ATTRIBUTE(clip-rule, f_clipRule), 1.18 + SVG_LITERAL_ATTRIBUTE(fill-rule, f_fillRule), 1.19 + SVG_ATTRIBUTE(points) 1.20 +}; 1.21 + 1.22 +DEFINE_SVG_INFO(Polygon) 1.23 + 1.24 +void SkSVGPolygon::addAttribute(SkSVGParser& parser, int attrIndex, 1.25 + const char* attrValue, size_t attrLength) { 1.26 + INHERITED::addAttribute(parser, attrIndex, attrValue, attrLength); 1.27 +} 1.28 + 1.29 +void SkSVGPolygon::translate(SkSVGParser& parser, bool defState) { 1.30 + parser._startElement("polygon"); 1.31 + SkSVGElement::translate(parser, defState); 1.32 + SVG_ADD_ATTRIBUTE(points); 1.33 + if (f_fillRule.size() > 0) 1.34 + parser._addAttribute("fillType", f_fillRule.equals("evenodd") ? "evenOdd" : "winding"); 1.35 + parser._endElement(); 1.36 +}