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 "SkSVGUse.h" michael@0: #include "SkSVGParser.h" michael@0: michael@0: const SkSVGAttribute SkSVGUse::gAttributes[] = { michael@0: SVG_ATTRIBUTE(height), michael@0: SVG_ATTRIBUTE(width), michael@0: SVG_ATTRIBUTE(x), michael@0: SVG_LITERAL_ATTRIBUTE(xlink:href, f_xlink_href), michael@0: SVG_ATTRIBUTE(y) michael@0: }; michael@0: michael@0: DEFINE_SVG_INFO(Use) michael@0: michael@0: void SkSVGUse::translate(SkSVGParser& parser, bool defState) { michael@0: INHERITED::translate(parser, defState); michael@0: parser._startElement("add"); michael@0: const char* start = strchr(f_xlink_href.c_str(), '#') + 1; michael@0: SkASSERT(start); michael@0: parser._addAttributeLen("use", start, strlen(start) - 1); michael@0: parser._endElement(); // clip michael@0: }