Index: experimental/svg/model/SkSVGRenderContext.cpp |
diff --git a/experimental/svg/model/SkSVGRenderContext.cpp b/experimental/svg/model/SkSVGRenderContext.cpp |
index ee92c47d542ea39744f4487e4007f8a5ed916a7c..82ee2c78a5be7d5f98a3d3690a153fbbc0753d27 100644 |
--- a/experimental/svg/model/SkSVGRenderContext.cpp |
+++ b/experimental/svg/model/SkSVGRenderContext.cpp |
@@ -224,6 +224,14 @@ void SkSVGRenderContext::applyPresentationAttributes(const SkSVGPresentationAttr |
ApplyLazyInheritedAttribute(StrokeWidth); |
#undef ApplyLazyInheritedAttribute |
+ |
+ // Uninherited attributes. Only apply to the current context. |
+ |
+ if (auto* opacity = attrs.fOpacity.getMaybeNull()) { |
+ SkPaint opacityPaint; |
+ opacityPaint.setAlpha(static_cast<uint8_t>(opacity->value() * 255)); |
+ fCanvas->saveLayer(nullptr, &opacityPaint); |
robertphillips
2016/08/15 17:31:27
Where is the matching restore ?
f(malita)
2016/08/15 17:33:58
SkSVGRenderContext is node-scoped and always resto
robertphillips
2016/08/15 17:37:54
Ah - okay. Can you add that as a comment? It wasn'
f(malita)
2016/08/15 17:41:22
Done.
|
+ } |
} |
const SkPaint* SkSVGRenderContext::fillPaint() const { |