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

Side by Side Diff: experimental/svg/model/SkSVGNode.cpp

Issue 2353503005: [SVGDom] Opacity optimization (Closed)
Patch Set: Win build fix + review 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 unified diff | Download patch
« no previous file with comments | « experimental/svg/model/SkSVGNode.h ('k') | experimental/svg/model/SkSVGRenderContext.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2016 Google Inc. 2 * Copyright 2016 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkCanvas.h" 8 #include "SkCanvas.h"
9 #include "SkMatrix.h" 9 #include "SkMatrix.h"
10 #include "SkSVGNode.h" 10 #include "SkSVGNode.h"
(...skipping 13 matching lines...) Expand all
24 } 24 }
25 } 25 }
26 26
27 bool SkSVGNode::asPaint(const SkSVGRenderContext& ctx, SkPaint* paint) const { 27 bool SkSVGNode::asPaint(const SkSVGRenderContext& ctx, SkPaint* paint) const {
28 SkSVGRenderContext localContext(ctx); 28 SkSVGRenderContext localContext(ctx);
29 29
30 return this->onPrepareToRender(&localContext) && this->onAsPaint(localContex t, paint); 30 return this->onPrepareToRender(&localContext) && this->onAsPaint(localContex t, paint);
31 } 31 }
32 32
33 bool SkSVGNode::onPrepareToRender(SkSVGRenderContext* ctx) const { 33 bool SkSVGNode::onPrepareToRender(SkSVGRenderContext* ctx) const {
34 ctx->applyPresentationAttributes(fPresentationAttributes); 34 ctx->applyPresentationAttributes(fPresentationAttributes,
35 this->hasChildren() ? 0 : SkSVGRenderContex t::kLeaf);
35 return true; 36 return true;
36 } 37 }
37 38
38 void SkSVGNode::setAttribute(SkSVGAttribute attr, const SkSVGValue& v) { 39 void SkSVGNode::setAttribute(SkSVGAttribute attr, const SkSVGValue& v) {
39 this->onSetAttribute(attr, v); 40 this->onSetAttribute(attr, v);
40 } 41 }
41 42
42 void SkSVGNode::setFill(const SkSVGPaint& svgPaint) { 43 void SkSVGNode::setFill(const SkSVGPaint& svgPaint) {
43 fPresentationAttributes.fFill.set(svgPaint); 44 fPresentationAttributes.fFill.set(svgPaint);
44 } 45 }
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 case SkSVGAttribute::kStrokeWidth: 107 case SkSVGAttribute::kStrokeWidth:
107 if (const SkSVGLengthValue* strokeWidth = v.as<SkSVGLengthValue>()) { 108 if (const SkSVGLengthValue* strokeWidth = v.as<SkSVGLengthValue>()) {
108 this->setStrokeWidth(*strokeWidth); 109 this->setStrokeWidth(*strokeWidth);
109 } 110 }
110 break; 111 break;
111 default: 112 default:
112 SkDebugf("attribute ID <%d> ignored for node <%d>\n", attr, fTag); 113 SkDebugf("attribute ID <%d> ignored for node <%d>\n", attr, fTag);
113 break; 114 break;
114 } 115 }
115 } 116 }
OLDNEW
« no previous file with comments | « experimental/svg/model/SkSVGNode.h ('k') | experimental/svg/model/SkSVGRenderContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698