Tyler Denniston | 32b3089 | 2021-01-26 14:36:32 -0500 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2021 Google Inc. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license that can be |
| 5 | * found in the LICENSE file. |
| 6 | */ |
| 7 | |
| 8 | #include "modules/svg/include/SkSVGAttributeParser.h" |
| 9 | #include "modules/svg/include/SkSVGFeLightSource.h" |
| 10 | #include "modules/svg/include/SkSVGValue.h" |
| 11 | |
| 12 | bool SkSVGFeDistantLight::parseAndSetAttribute(const char* n, const char* v) { |
| 13 | return INHERITED::parseAndSetAttribute(n, v) || |
| 14 | this->setAzimuth(SkSVGAttributeParser::parse<SkSVGNumberType>("azimuth", n, v)) || |
| 15 | this->setElevation(SkSVGAttributeParser::parse<SkSVGNumberType>("elevation", n, v)); |
| 16 | } |
| 17 | |
| 18 | bool SkSVGFePointLight::parseAndSetAttribute(const char* n, const char* v) { |
| 19 | return INHERITED::parseAndSetAttribute(n, v) || |
| 20 | this->setX(SkSVGAttributeParser::parse<SkSVGNumberType>("x", n, v)) || |
| 21 | this->setY(SkSVGAttributeParser::parse<SkSVGNumberType>("y", n, v)) || |
| 22 | this->setZ(SkSVGAttributeParser::parse<SkSVGNumberType>("z", n, v)); |
| 23 | } |
| 24 | |
| 25 | bool SkSVGFeSpotLight::parseAndSetAttribute(const char* n, const char* v) { |
| 26 | return INHERITED::parseAndSetAttribute(n, v) || |
| 27 | this->setX(SkSVGAttributeParser::parse<SkSVGNumberType>("x", n, v)) || |
| 28 | this->setY(SkSVGAttributeParser::parse<SkSVGNumberType>("y", n, v)) || |
| 29 | this->setZ(SkSVGAttributeParser::parse<SkSVGNumberType>("z", n, v)) || |
| 30 | this->setPointsAtX(SkSVGAttributeParser::parse<SkSVGNumberType>("pointsAtX", n, v)) || |
| 31 | this->setPointsAtY(SkSVGAttributeParser::parse<SkSVGNumberType>("pointsAtY", n, v)) || |
| 32 | this->setPointsAtZ(SkSVGAttributeParser::parse<SkSVGNumberType>("pointsAtZ", n, v)) || |
| 33 | this->setSpecularExponent( |
| 34 | SkSVGAttributeParser::parse<SkSVGNumberType>("specularExponent", n, v)) || |
| 35 | this->setLimitingConeAngle( |
| 36 | SkSVGAttributeParser::parse<SkSVGNumberType>("limitingConeAngle", n, v)); |
| 37 | } |