Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
SkSVGShape.cpp
Go to the documentation of this file.
1/*
2 * Copyright 2016 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
10
12
14 const auto fillType = ctx.presentationContext().fInherited.fFillRule->asFillType();
15
16 const auto fillPaint = ctx.fillPaint(),
17 strokePaint = ctx.strokePaint();
18
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);
22 }
23
24 if (strokePaint.isValid()) {
25 this->onDraw(ctx.canvas(), ctx.lengthContext(), *strokePaint, fillType);
26 }
27}
28
30 SkDebugf("cannot append child nodes to an SVG shape.\n");
31}
void SK_SPI SkDebugf(const char format[],...) SK_PRINTF_LIKE(1
SkSVGTag
Definition SkSVGNode.h:23
SkPathFillType asFillType() const
Definition SkSVGTypes.h:361
SkTLazy< SkPaint > fillPaint() const
const SkSVGPresentationContext & presentationContext() const
SkCanvas * canvas() const
const SkSVGLengthContext & lengthContext() const
SkTLazy< SkPaint > strokePaint() const
SkSVGShape(SkSVGTag)
void appendChild(sk_sp< SkSVGNode >) override
virtual void onDraw(SkCanvas *, const SkSVGLengthContext &, const SkPaint &, SkPathFillType) const =0
void onRender(const SkSVGRenderContext &) const final
SkSVGProperty< SkSVGFillRule, true > fFillRule
SkSVGPresentationAttributes fInherited