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 "SkSVGLinearGradient.h" |
michael@0 | 11 | #include "SkSVGParser.h" |
michael@0 | 12 | |
michael@0 | 13 | const SkSVGAttribute SkSVGLinearGradient::gAttributes[] = { |
michael@0 | 14 | SVG_ATTRIBUTE(gradientTransform), |
michael@0 | 15 | SVG_ATTRIBUTE(gradientUnits), |
michael@0 | 16 | SVG_ATTRIBUTE(x1), |
michael@0 | 17 | SVG_ATTRIBUTE(x2), |
michael@0 | 18 | SVG_ATTRIBUTE(y1), |
michael@0 | 19 | SVG_ATTRIBUTE(y2) |
michael@0 | 20 | }; |
michael@0 | 21 | |
michael@0 | 22 | DEFINE_SVG_INFO(LinearGradient) |
michael@0 | 23 | |
michael@0 | 24 | void SkSVGLinearGradient::translate(SkSVGParser& parser, bool defState) { |
michael@0 | 25 | if (fMatrixID.size() == 0) |
michael@0 | 26 | parser.translateMatrix(f_gradientTransform, &fMatrixID); |
michael@0 | 27 | parser._startElement("linearGradient"); |
michael@0 | 28 | if (fMatrixID.size() > 0) |
michael@0 | 29 | parser._addAttribute("matrix", fMatrixID); |
michael@0 | 30 | INHERITED::translateGradientUnits(f_gradientUnits); |
michael@0 | 31 | SkString points; |
michael@0 | 32 | points.appendUnichar('['); |
michael@0 | 33 | points.append(f_x1); |
michael@0 | 34 | points.appendUnichar(','); |
michael@0 | 35 | points.append(f_y1); |
michael@0 | 36 | points.appendUnichar(','); |
michael@0 | 37 | points.append(f_x2); |
michael@0 | 38 | points.appendUnichar(','); |
michael@0 | 39 | points.append(f_y2); |
michael@0 | 40 | points.appendUnichar(']'); |
michael@0 | 41 | parser._addAttribute("points", points.c_str()); |
michael@0 | 42 | INHERITED::translate(parser, defState); |
michael@0 | 43 | parser._endElement(); |
michael@0 | 44 | } |