2 * Copyright 2016 Google Inc.
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
8 #include "modules/svg/include/SkSVGRenderContext.h"
9 #include "modules/svg/include/SkSVGShape.h"
11 SkSVGShape::SkSVGShape(SkSVGTag t) : INHERITED(t) {}
13 void SkSVGShape::onRender(const SkSVGRenderContext& ctx) const {
14 const auto fillType = ctx.presentationContext().fInherited.fFillRule->asFillType();
16 const auto fillPaint = ctx.fillPaint(),
17 strokePaint = ctx.strokePaint();
19 // TODO: this approach forces duplicate geometry resolution in onDraw(); refactor to avoid.
20 if (fillPaint.isValid()) {
21 this->onDraw(ctx.canvas(), ctx.lengthContext(), *fillPaint, fillType);
24 if (strokePaint.isValid()) {
25 this->onDraw(ctx.canvas(), ctx.lengthContext(), *strokePaint, fillType);
29 void SkSVGShape::appendChild(sk_sp<SkSVGNode>) {
30 SkDebugf("cannot append child nodes to an SVG shape.\n");