Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(88)

Unified Diff: experimental/svg/model/SkSVGRenderContext.cpp

Issue 2349143002: [SVGDom] Only apply opacity when needed (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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().
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698