Index: experimental/svg/model/SkSVGNode.cpp |
diff --git a/experimental/svg/model/SkSVGNode.cpp b/experimental/svg/model/SkSVGNode.cpp |
index a039b59ff16865a5df70c8c30e2bdac3f9f69262..5a73ace548cfd71b1d2879bca7538a2e94616e6f 100644 |
--- a/experimental/svg/model/SkSVGNode.cpp |
+++ b/experimental/svg/model/SkSVGNode.cpp |
@@ -42,6 +42,11 @@ void SkSVGNode::setFillOpacity(const SkSVGNumberType& opacity) { |
SkSVGNumberType(SkTPin<SkScalar>(opacity.value(), 0, 1))); |
} |
+void SkSVGNode::setOpacity(const SkSVGNumberType& opacity) { |
+ fPresentationAttributes.fOpacity.set( |
+ SkSVGNumberType(SkTPin<SkScalar>(opacity.value(), 0, 1))); |
+} |
+ |
void SkSVGNode::setStroke(const SkSVGPaint& svgPaint) { |
fPresentationAttributes.fStroke.set(svgPaint); |
} |
@@ -67,6 +72,11 @@ void SkSVGNode::onSetAttribute(SkSVGAttribute attr, const SkSVGValue& v) { |
this->setFillOpacity(*opacity); |
} |
break; |
+ case SkSVGAttribute::kOpacity: |
+ if (const SkSVGNumberValue* opacity = v.as<SkSVGNumberValue>()) { |
+ this->setOpacity(*opacity); |
+ } |
+ break; |
case SkSVGAttribute::kStroke: |
if (const SkSVGPaintValue* paint = v.as<SkSVGPaintValue>()) { |
this->setStroke(*paint); |