| Index: experimental/svg/model/SkSVGSVG.cpp
|
| diff --git a/experimental/svg/model/SkSVGSVG.cpp b/experimental/svg/model/SkSVGSVG.cpp
|
| index aeccc7082b8e27036195ce9e5bb11b09a5c9a958..42bd280a5e1f7418fab5cb6de2bc6b164e1142ad 100644
|
| --- a/experimental/svg/model/SkSVGSVG.cpp
|
| +++ b/experimental/svg/model/SkSVGSVG.cpp
|
| @@ -6,5 +6,49 @@
|
| */
|
|
|
| #include "SkSVGSVG.h"
|
| +#include "SkSVGValue.h"
|
|
|
| SkSVGSVG::SkSVGSVG() : INHERITED(SkSVGTag::kSvg) { }
|
| +
|
| +void SkSVGSVG::setX(const SkSVGLength& x) {
|
| + fX = x;
|
| +}
|
| +
|
| +void SkSVGSVG::setY(const SkSVGLength& y) {
|
| + fY = y;
|
| +}
|
| +
|
| +void SkSVGSVG::setWidth(const SkSVGLength& w) {
|
| + fWidth = w;
|
| +}
|
| +
|
| +void SkSVGSVG::setHeight(const SkSVGLength& h) {
|
| + fHeight = h;
|
| +}
|
| +
|
| +void SkSVGSVG::onSetAttribute(SkSVGAttribute attr, const SkSVGValue& v) {
|
| + switch (attr) {
|
| + case SkSVGAttribute::kX:
|
| + if (const auto* x = v.as<SkSVGLengthValue>()) {
|
| + this->setX(*x);
|
| + }
|
| + break;
|
| + case SkSVGAttribute::kY:
|
| + if (const auto* y = v.as<SkSVGLengthValue>()) {
|
| + this->setY(*y);
|
| + }
|
| + break;
|
| + case SkSVGAttribute::kWidth:
|
| + if (const auto* w = v.as<SkSVGLengthValue>()) {
|
| + this->setWidth(*w);
|
| + }
|
| + break;
|
| + case SkSVGAttribute::kHeight:
|
| + if (const auto* h = v.as<SkSVGLengthValue>()) {
|
| + this->setHeight(*h);
|
| + }
|
| + break;
|
| + default:
|
| + this->INHERITED::onSetAttribute(attr, v);
|
| + }
|
| +}
|
|
|