Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | |
michael@0 | 2 | /* |
michael@0 | 3 | * Copyright 2006 The Android Open Source Project |
michael@0 | 4 | * |
michael@0 | 5 | * Use of this source code is governed by a BSD-style license that can be |
michael@0 | 6 | * found in the LICENSE file. |
michael@0 | 7 | */ |
michael@0 | 8 | |
michael@0 | 9 | |
michael@0 | 10 | #include "SkSVGRadialGradient.h" |
michael@0 | 11 | #include "SkSVGParser.h" |
michael@0 | 12 | |
michael@0 | 13 | const SkSVGAttribute SkSVGRadialGradient::gAttributes[] = { |
michael@0 | 14 | SVG_ATTRIBUTE(cx), |
michael@0 | 15 | SVG_ATTRIBUTE(cy), |
michael@0 | 16 | SVG_ATTRIBUTE(fx), |
michael@0 | 17 | SVG_ATTRIBUTE(fy), |
michael@0 | 18 | SVG_ATTRIBUTE(gradientTransform), |
michael@0 | 19 | SVG_ATTRIBUTE(gradientUnits), |
michael@0 | 20 | SVG_ATTRIBUTE(r) |
michael@0 | 21 | }; |
michael@0 | 22 | |
michael@0 | 23 | DEFINE_SVG_INFO(RadialGradient) |
michael@0 | 24 | |
michael@0 | 25 | void SkSVGRadialGradient::translate(SkSVGParser& parser, bool defState) { |
michael@0 | 26 | if (fMatrixID.size() == 0) |
michael@0 | 27 | parser.translateMatrix(f_gradientTransform, &fMatrixID); |
michael@0 | 28 | parser._startElement("radialGradient"); |
michael@0 | 29 | if (fMatrixID.size() > 0) |
michael@0 | 30 | parser._addAttribute("matrix", fMatrixID); |
michael@0 | 31 | INHERITED::translateGradientUnits(f_gradientUnits); |
michael@0 | 32 | SkString center; |
michael@0 | 33 | center.appendUnichar('['); |
michael@0 | 34 | center.append(f_cx); |
michael@0 | 35 | center.appendUnichar(','); |
michael@0 | 36 | center.append(f_cy); |
michael@0 | 37 | center.appendUnichar(']'); |
michael@0 | 38 | parser._addAttribute("center", center); |
michael@0 | 39 | parser._addAttribute("radius", f_r); |
michael@0 | 40 | INHERITED::translate(parser, defState); |
michael@0 | 41 | parser._endElement(); |
michael@0 | 42 | } |