Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | List of all members
SkSVGClipPath Class Referencefinal

#include <SkSVGClipPath.h>

Inheritance diagram for SkSVGClipPath:
SkSVGHiddenContainer SkSVGContainer SkSVGTransformableNode SkSVGNode SkRefCnt SkRefCntBase

Public Types

using INHERITED = SkSVGHiddenContainer
 

Public Member Functions

SVG_ATTR(ClipPathUnits, SkSVGObjectBoundingBoxUnits, SkSVGObjectBoundingBoxUnits(SkSVGObjectBoundingBoxUnits::Type::kUserSpaceOnUse)) private SkSVGClipPath ()
 
bool parseAndSetAttribute (const char *, const char *) override
 
SkPath resolveClip (const SkSVGRenderContext &) const
 
- Public Member Functions inherited from SkSVGContainer
void appendChild (sk_sp< SkSVGNode >) override
 
- Public Member Functions inherited from SkSVGTransformableNode
void setTransform (const SkSVGTransformType &t)
 
- Public Member Functions inherited from SkSVGNode
 ~SkSVGNode () override
 
SkSVGTag tag () const
 
void render (const SkSVGRenderContext &) const
 
bool asPaint (const SkSVGRenderContext &, SkPaint *) const
 
SkPath asPath (const SkSVGRenderContext &) const
 
SkRect objectBoundingBox (const SkSVGRenderContext &) const
 
void setAttribute (SkSVGAttribute, const SkSVGValue &)
 
bool setAttribute (const char *attributeName, const char *attributeValue)
 
- Public Member Functions inherited from SkRefCntBase
 SkRefCntBase ()
 
virtual ~SkRefCntBase ()
 
bool unique () const
 
void ref () const
 
void unref () const
 

Static Public Member Functions

static sk_sp< SkSVGClipPathMake ()
 

Additional Inherited Members

- Protected Member Functions inherited from SkSVGHiddenContainer
 SkSVGHiddenContainer (SkSVGTag t)
 
void onRender (const SkSVGRenderContext &) const final
 
- Protected Member Functions inherited from SkSVGContainer
 SkSVGContainer (SkSVGTag)
 
SkPath onAsPath (const SkSVGRenderContext &) const override
 
SkRect onObjectBoundingBox (const SkSVGRenderContext &) const override
 
bool hasChildren () const final
 
- Protected Member Functions inherited from SkSVGTransformableNode
 SkSVGTransformableNode (SkSVGTag)
 
bool onPrepareToRender (SkSVGRenderContext *) const override
 
void onSetAttribute (SkSVGAttribute, const SkSVGValue &) override
 
void mapToParent (SkPath *) const
 
void mapToParent (SkRect *) const
 
- Protected Member Functions inherited from SkSVGNode
 SkSVGNode (SkSVGTag)
 
virtual bool onAsPaint (const SkSVGRenderContext &, SkPaint *) const
 
- Static Protected Member Functions inherited from SkSVGNode
static SkMatrix ComputeViewboxMatrix (const SkRect &, const SkRect &, SkSVGPreserveAspectRatio)
 
- Protected Attributes inherited from SkSVGContainer
skia_private::STArray< 1, sk_sp< SkSVGNode >, true > fChildren
 

Detailed Description

Definition at line 14 of file SkSVGClipPath.h.

Member Typedef Documentation

◆ INHERITED

Definition at line 32 of file SkSVGClipPath.h.

Constructor & Destructor Documentation

◆ SkSVGClipPath()

SkSVGClipPath::SkSVGClipPath ( )

Definition at line 12 of file SkSVGClipPath.cpp.

SkSVGHiddenContainer INHERITED

Member Function Documentation

◆ Make()

static sk_sp< SkSVGClipPath > SkSVGClipPath::Make ( )
inlinestatic

Definition at line 16 of file SkSVGClipPath.h.

16 {
18 }
SVG_ATTR(ClipPathUnits, SkSVGObjectBoundingBoxUnits, SkSVGObjectBoundingBoxUnits(SkSVGObjectBoundingBoxUnits::Type::kUserSpaceOnUse)) private SkSVGClipPath()

◆ parseAndSetAttribute()

bool SkSVGClipPath::parseAndSetAttribute ( const char *  n,
const char *  v 
)
overridevirtual

Reimplemented from SkSVGNode.

Definition at line 14 of file SkSVGClipPath.cpp.

14 {
16 this->setClipPathUnits(
17 SkSVGAttributeParser::parse<SkSVGObjectBoundingBoxUnits>("clipPathUnits", n, v));
18}
virtual bool parseAndSetAttribute(const char *name, const char *value)
Definition SkSVGNode.cpp:90

◆ resolveClip()

SkPath SkSVGClipPath::resolveClip ( const SkSVGRenderContext ctx) const

Definition at line 20 of file SkSVGClipPath.cpp.

20 {
21 auto clip = this->asPath(ctx);
22
23 const auto obbt = ctx.transformForCurrentOBB(fClipPathUnits);
24 const auto m = SkMatrix::Translate(obbt.offset.x, obbt.offset.y)
25 * SkMatrix::Scale(obbt.scale.x, obbt.scale.y);
26 clip.transform(m);
27
28 return clip;
29}
static SkPath clip(const SkPath &path, const SkHalfPlane &plane)
Definition SkPath.cpp:3824
static SkMatrix Scale(SkScalar sx, SkScalar sy)
Definition SkMatrix.h:75
static SkMatrix Translate(SkScalar dx, SkScalar dy)
Definition SkMatrix.h:91
void transform(const SkMatrix &matrix, SkPath *dst, SkApplyPerspectiveClip pc=SkApplyPerspectiveClip::kYes) const
Definition SkPath.cpp:1647
SkPath asPath(const SkSVGRenderContext &) const
Definition SkSVGNode.cpp:42
OBBTransform transformForCurrentOBB(SkSVGObjectBoundingBoxUnits) const

The documentation for this class was generated from the following files: