8 #ifndef SkSVGRenderContext_DEFINED
9 #define SkSVGRenderContext_DEFINED
18 #include "modules/skresources/include/SkResources.h"
21 #include "src/base/SkTLazy.h"
22 #include "src/core/SkTHash.h"
30 : fViewport(viewport), fDPI(dpi) {}
55 const skia_private::THashMap<SkString, SkSVGColorType>* fNamedColors =
nullptr;
98 fBorrowed = std::move(*fOwner);
105 *fOwner = std::move(fBorrowed);
113 explicit operator bool()
const {
return !!fBorrowed; }
137 return fResourceProvider;
160 void*
operator new(size_t) =
delete;
161 void*
operator new(size_t,
void*) =
delete;
164 void applyOpacity(
SkScalar opacity, uint32_t flags,
bool hasFilter);
169 SkTLazy<SkPaint> commonPaint(
const SkSVGPaint&,
float opacity)
const;
174 SkTCopyOnFirstWrite<SkSVGLengthContext> fLengthContext;
175 SkTCopyOnFirstWrite<SkSVGPresentationContext> fPresentationContext;
179 int fCanvasSaveCount;
182 SkTLazy<SkPath> fClipPath;
185 float fDeferredPaintOpacity = 1;
skia_private::THashMap< SkString, sk_sp< SkSVGNode > > SkSVGIDMapper
Definition: SkSVGIDMapper.h:17
SkColor SkSVGColorType
Definition: SkSVGTypes.h:25
float SkScalar
Definition: SkScalar.h:14
SkCanvas provides an interface for drawing, and how the drawing is clipped and transformed.
Definition: SkCanvas.h:99
static sk_sp< SkFontMgr > RefEmpty()
SkPath contain geometry.
Definition: SkPath.h:58
Definition: SkSVGTypes.h:177
Definition: SkSVGTypes.h:264
Definition: SkSVGTypes.h:152
Definition: SkSVGRenderContext.h:27
const SkSize & viewPort() const
Definition: SkSVGRenderContext.h:38
LengthType
Definition: SkSVGRenderContext.h:32
void setViewPort(const SkSize &viewport)
Definition: SkSVGRenderContext.h:39
SkRect resolveRect(const SkSVGLength &x, const SkSVGLength &y, const SkSVGLength &w, const SkSVGLength &h) const
SkScalar resolve(const SkSVGLength &, LengthType) const
SkSVGLengthContext(const SkSize &viewport, SkScalar dpi=90)
Definition: SkSVGRenderContext.h:29
Definition: SkSVGTypes.h:116
Definition: SkSVGNode.h:95
Definition: SkSVGTypes.h:454
Definition: SkSVGTypes.h:224
Definition: SkSVGRenderContext.h:93
~BorrowedNode()
Definition: SkSVGRenderContext.h:103
BorrowedNode(sk_sp< SkSVGNode > *node)
Definition: SkSVGRenderContext.h:95
const SkSVGNode * get() const
Definition: SkSVGRenderContext.h:109
const SkSVGNode & operator*() const
Definition: SkSVGRenderContext.h:111
const SkSVGNode * operator->() const
Definition: SkSVGRenderContext.h:110
Definition: SkSVGRenderContext.h:61
SkSVGColorType resolveSvgColor(const SkSVGColor &) const
const sk_sp< skresources::ResourceProvider > & resourceProvider() const
Definition: SkSVGRenderContext.h:136
SkRect resolveOBBRect(const SkSVGLength &x, const SkSVGLength &y, const SkSVGLength &w, const SkSVGLength &h, SkSVGObjectBoundingBoxUnits) const
sk_sp< SkFontMgr > fontMgr() const
Definition: SkSVGRenderContext.h:140
ApplyFlags
Definition: SkSVGRenderContext.h:87
SkSVGRenderContext(SkCanvas *, const sk_sp< SkFontMgr > &, const sk_sp< skresources::ResourceProvider > &, const SkSVGIDMapper &, const SkSVGLengthContext &, const SkSVGPresentationContext &, const OBBScope &)
const SkPath * clipPath() const
Definition: SkSVGRenderContext.h:134
const SkSVGPresentationContext & presentationContext() const
Definition: SkSVGRenderContext.h:82
SkSVGRenderContext(const SkSVGRenderContext &, SkCanvas *)
SkTLazy< SkPaint > strokePaint() const
BorrowedNode findNodeById(const SkSVGIRI &) const
void applyPresentationAttributes(const SkSVGPresentationAttributes &, uint32_t flags)
SkTLazy< SkPaint > fillPaint() const
SkSVGRenderContext(const SkSVGRenderContext &, const SkSVGNode *)
SkCanvas * canvas() const
Definition: SkSVGRenderContext.h:84
SkSVGRenderContext(const SkSVGRenderContext &)
const SkSVGLengthContext & lengthContext() const
Definition: SkSVGRenderContext.h:79
OBBTransform transformForCurrentOBB(SkSVGObjectBoundingBoxUnits) const
SkSVGLengthContext * writableLengthContext()
Definition: SkSVGRenderContext.h:80
SkRect holds four float coordinates describing the upper and lower bounds of a rectangle.
Definition: SkRect.h:582
Definition: SkSVGAttribute.h:69
Definition: SkSVGRenderContext.h:50
SkSVGPresentationAttributes fInherited
Definition: SkSVGRenderContext.h:58
SkSVGPresentationContext()
SkSVGPresentationContext & operator=(const SkSVGPresentationContext &)=default
SkSVGPresentationContext(const SkSVGPresentationContext &)=default
Definition: SkSVGRenderContext.h:64
const SkSVGRenderContext * fCtx
Definition: SkSVGRenderContext.h:66
const SkSVGNode * fNode
Definition: SkSVGRenderContext.h:65
Definition: SkSVGRenderContext.h:149
SkV2 offset
Definition: SkSVGRenderContext.h:150