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

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

Issue 2359603002: Revert of [SVGDom] Opacity optimization (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 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);
36 return true; 35 return true;
37 } 36 }
38 37
39 void SkSVGNode::setAttribute(SkSVGAttribute attr, const SkSVGValue& v) { 38 void SkSVGNode::setAttribute(SkSVGAttribute attr, const SkSVGValue& v) {
40 this->onSetAttribute(attr, v); 39 this->onSetAttribute(attr, v);
41 } 40 }
42 41
43 void SkSVGNode::setFill(const SkSVGPaint& svgPaint) { 42 void SkSVGNode::setFill(const SkSVGPaint& svgPaint) {
44 fPresentationAttributes.fFill.set(svgPaint); 43 fPresentationAttributes.fFill.set(svgPaint);
45 } 44 }
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 case SkSVGAttribute::kStrokeWidth: 106 case SkSVGAttribute::kStrokeWidth:
108 if (const SkSVGLengthValue* strokeWidth = v.as<SkSVGLengthValue>()) { 107 if (const SkSVGLengthValue* strokeWidth = v.as<SkSVGLengthValue>()) {
109 this->setStrokeWidth(*strokeWidth); 108 this->setStrokeWidth(*strokeWidth);
110 } 109 }
111 break; 110 break;
112 default: 111 default:
113 SkDebugf("attribute ID <%d> ignored for node <%d>\n", attr, fTag); 112 SkDebugf("attribute ID <%d> ignored for node <%d>\n", attr, fTag);
114 break; 113 break;
115 } 114 }
116 } 115 }
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