diff options
author | 2015-02-06 08:43:51 -0800 | |
---|---|---|
committer | 2015-02-06 08:43:51 -0800 | |
commit | 02c8fd0ad5e5279004dd49ec49fbae00f8522ec0 (patch) | |
tree | 9481cf1a74644398c15565a00717b8a46de945ee /src/svg/parser/SkSVGUse.cpp | |
parent | 3cb3840c9af6f70896cf5565a38d4ee03c02d767 (diff) |
Move SVG parser files under {include,src}/svg/parser/
R=reed@google.com
Review URL: https://codereview.chromium.org/884713007
Diffstat (limited to 'src/svg/parser/SkSVGUse.cpp')
-rw-r--r-- | src/svg/parser/SkSVGUse.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/svg/parser/SkSVGUse.cpp b/src/svg/parser/SkSVGUse.cpp new file mode 100644 index 0000000000..0496d98b99 --- /dev/null +++ b/src/svg/parser/SkSVGUse.cpp @@ -0,0 +1,30 @@ + +/* + * Copyright 2006 The Android Open Source Project + * + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + + +#include "SkSVGUse.h" +#include "SkSVGParser.h" + +const SkSVGAttribute SkSVGUse::gAttributes[] = { + SVG_ATTRIBUTE(height), + SVG_ATTRIBUTE(width), + SVG_ATTRIBUTE(x), + SVG_LITERAL_ATTRIBUTE(xlink:href, f_xlink_href), + SVG_ATTRIBUTE(y) +}; + +DEFINE_SVG_INFO(Use) + +void SkSVGUse::translate(SkSVGParser& parser, bool defState) { + INHERITED::translate(parser, defState); + parser._startElement("add"); + const char* start = strchr(f_xlink_href.c_str(), '#') + 1; + SkASSERT(start); + parser._addAttributeLen("use", start, strlen(start) - 1); + parser._endElement(); // clip +} |