 Chromium Code Reviews
 Chromium Code Reviews Issue 2349143002:
  [SVGDom] Only apply opacity when needed  (Closed)
    
  
    Issue 2349143002:
  [SVGDom] Only apply opacity when needed  (Closed) 
  | Index: experimental/svg/model/SkSVGRenderContext.cpp | 
| diff --git a/experimental/svg/model/SkSVGRenderContext.cpp b/experimental/svg/model/SkSVGRenderContext.cpp | 
| index 46ed5a28c4675296e0b5cceb21d36c38b4a3c77a..7e2e90e22c4ddaa5ca743fbce51ea1d2c9083456 100644 | 
| --- a/experimental/svg/model/SkSVGRenderContext.cpp | 
| +++ b/experimental/svg/model/SkSVGRenderContext.cpp | 
| @@ -267,7 +267,8 @@ void SkSVGRenderContext::applyPresentationAttributes(const SkSVGPresentationAttr | 
| // Uninherited attributes. Only apply to the current context. | 
| - if (auto* opacity = attrs.fOpacity.getMaybeNull()) { | 
| + auto* opacity = attrs.fOpacity.getMaybeNull(); | 
| + if (opacity && opacity->value() < 1) { | 
| 
reed1
2016/09/19 12:47:38
// How is the restore conditionally execute, balan
 
f(malita)
2016/09/19 13:08:30
Comment a few lines below:
// Balanced in the des
 | 
| SkPaint opacityPaint; | 
| opacityPaint.setAlpha(opacity_to_alpha(opacity->value())); | 
| // Balanced in the destructor, via restoreToCount(). |