diff options
Diffstat (limited to 'src/svg')
-rw-r--r-- | src/svg/SkSVGParser.cpp | 14 | ||||
-rw-r--r-- | src/svg/SkSVGRect.cpp | 2 | ||||
-rw-r--r-- | src/svg/SkSVGSVG.cpp | 4 | ||||
-rw-r--r-- | src/svg/SkSVGSVG.h | 3 |
4 files changed, 16 insertions, 7 deletions
diff --git a/src/svg/SkSVGParser.cpp b/src/svg/SkSVGParser.cpp index b55c5ed..df86178 100644 --- a/src/svg/SkSVGParser.cpp +++ b/src/svg/SkSVGParser.cpp @@ -43,7 +43,9 @@ static int gGeneratedMatrixID = 0; -SkSVGParser::SkSVGParser() : fHead(&fEmptyPaint), fIDs(256), +SkSVGParser::SkSVGParser(SkXMLParserError* errHandler) : + SkXMLParser(errHandler), + fHead(&fEmptyPaint), fIDs(256), fXMLWriter(&fStream), fCurrElement(NULL), fInSVG(false), fSuppressPaint(false) { fLastTransform.reset(); fEmptyPaint.f_fill.set("black"); @@ -157,7 +159,7 @@ bool SkSVGParser::onAddAttributeLen(const char name[], const char value[], size_ if (fCurrElement == NULL) // this signals we should ignore attributes for this element return true; if (fCurrElement->fIsDef == false && fCurrElement->fIsNotDef == false) - return true; // also an ignored element + return false; // also an ignored element size_t nameLen = strlen(name); int attrIndex = findAttribute(fCurrElement, name, nameLen, false); if (attrIndex == -1) { @@ -201,9 +203,11 @@ bool SkSVGParser::onStartElementLen(const char name[], size_t len) { if (nextColon && nextColon - name < len) return false; SkSVGTypes type = GetType(name, len); - SkASSERT(type >= 0); - if (type < 0) - return true; +// SkASSERT(type >= 0); + if (type < 0) { + type = SkSVGType_G; +// return true; + } SkSVGElement* parent = fParents.count() > 0 ? fParents.top() : NULL; SkSVGElement* element = CreateElement(type, parent); bool result = false; diff --git a/src/svg/SkSVGRect.cpp b/src/svg/SkSVGRect.cpp index 03fdfdc..8765d1d 100644 --- a/src/svg/SkSVGRect.cpp +++ b/src/svg/SkSVGRect.cpp @@ -33,7 +33,7 @@ SkSVGRect::SkSVGRect() { } void SkSVGRect::translate(SkSVGParser& parser, bool defState) { - parser._startElement("rectangle"); + parser._startElement("rect"); INHERITED::translate(parser, defState); SVG_ADD_ATTRIBUTE_ALIAS(left, x); SVG_ADD_ATTRIBUTE_ALIAS(top, y); diff --git a/src/svg/SkSVGSVG.cpp b/src/svg/SkSVGSVG.cpp index 1678fc1..9423c3a 100644 --- a/src/svg/SkSVGSVG.cpp +++ b/src/svg/SkSVGSVG.cpp @@ -27,9 +27,11 @@ const SkSVGAttribute SkSVGSVG::gAttributes[] = { SVG_ATTRIBUTE(width), SVG_ATTRIBUTE(version), SVG_ATTRIBUTE(viewBox), + SVG_ATTRIBUTE(x), SVG_LITERAL_ATTRIBUTE(xml:space, f_xml_space), SVG_ATTRIBUTE(xmlns), - SVG_LITERAL_ATTRIBUTE(xmlns:xlink, f_xml_xlink) + SVG_LITERAL_ATTRIBUTE(xmlns:xlink, f_xml_xlink), + SVG_ATTRIBUTE(y), }; DEFINE_SVG_INFO(SVG) diff --git a/src/svg/SkSVGSVG.h b/src/svg/SkSVGSVG.h index f331ccd..257c136 100644 --- a/src/svg/SkSVGSVG.h +++ b/src/svg/SkSVGSVG.h @@ -30,9 +30,12 @@ private: SkString f_width; SkString f_version; SkString f_viewBox; + SkString f_x; SkString f_xml_space; SkString f_xmlns; SkString f_xml_xlink; + SkString f_y; + typedef SkSVGElement INHERITED; }; |