1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/gfx/skia/trunk/src/svg/SkSVGUse.cpp Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,30 @@ 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 "SkSVGUse.h" 1.14 +#include "SkSVGParser.h" 1.15 + 1.16 +const SkSVGAttribute SkSVGUse::gAttributes[] = { 1.17 + SVG_ATTRIBUTE(height), 1.18 + SVG_ATTRIBUTE(width), 1.19 + SVG_ATTRIBUTE(x), 1.20 + SVG_LITERAL_ATTRIBUTE(xlink:href, f_xlink_href), 1.21 + SVG_ATTRIBUTE(y) 1.22 +}; 1.23 + 1.24 +DEFINE_SVG_INFO(Use) 1.25 + 1.26 +void SkSVGUse::translate(SkSVGParser& parser, bool defState) { 1.27 + INHERITED::translate(parser, defState); 1.28 + parser._startElement("add"); 1.29 + const char* start = strchr(f_xlink_href.c_str(), '#') + 1; 1.30 + SkASSERT(start); 1.31 + parser._addAttributeLen("use", start, strlen(start) - 1); 1.32 + parser._endElement(); // clip 1.33 +}