Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
SkSVGContainer Class Reference

#include <SkSVGContainer.h>

Inheritance diagram for SkSVGContainer:
SkSVGTransformableNode SkSVGNode SkRefCnt SkRefCntBase SkSVGG SkSVGHiddenContainer SkSVGSVG SkSVGClipPath SkSVGDefs SkSVGFe SkSVGFeLightSource SkSVGFilter SkSVGGradient SkSVGMask SkSVGPattern SkSVGStop

Public Member Functions

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)
 
virtual bool parseAndSetAttribute (const char *name, const char *value)
 
- Public Member Functions inherited from SkRefCntBase
 SkRefCntBase ()
 
virtual ~SkRefCntBase ()
 
bool unique () const
 
void ref () const
 
void unref () const
 

Protected Member Functions

 SkSVGContainer (SkSVGTag)
 
void onRender (const SkSVGRenderContext &) const override
 
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
 

Protected Attributes

skia_private::STArray< 1, sk_sp< SkSVGNode >, true > fChildren
 

Additional Inherited Members

- Static Protected Member Functions inherited from SkSVGNode
static SkMatrix ComputeViewboxMatrix (const SkRect &, const SkRect &, SkSVGPreserveAspectRatio)
 

Detailed Description

Definition at line 14 of file SkSVGContainer.h.

Constructor & Destructor Documentation

◆ SkSVGContainer()

SkSVGContainer::SkSVGContainer ( SkSVGTag  t)
explicitprotected

Definition at line 13 of file SkSVGContainer.cpp.

13: INHERITED(t) { }

Member Function Documentation

◆ appendChild()

void SkSVGContainer::appendChild ( sk_sp< SkSVGNode node)
overridevirtual

Implements SkSVGNode.

Reimplemented in SkSVGFeLightSource.

Definition at line 15 of file SkSVGContainer.cpp.

15 {
16 SkASSERT(node);
17 fChildren.push_back(std::move(node));
18}
#define SkASSERT(cond)
Definition SkAssert.h:116
skia_private::STArray< 1, sk_sp< SkSVGNode >, true > fChildren

◆ hasChildren()

bool SkSVGContainer::hasChildren ( ) const
finalprotectedvirtual

Reimplemented from SkSVGNode.

Definition at line 20 of file SkSVGContainer.cpp.

20 {
21 return !fChildren.empty();
22}
bool empty() const
Definition SkTArray.h:194

◆ onAsPath()

SkPath SkSVGContainer::onAsPath ( const SkSVGRenderContext ctx) const
overrideprotectedvirtual

Implements SkSVGNode.

Definition at line 30 of file SkSVGContainer.cpp.

30 {
32
33 for (int i = 0; i < fChildren.size(); ++i) {
34 const SkPath childPath = fChildren[i]->asPath(ctx);
35
36 Op(path, childPath, kUnion_SkPathOp, &path);
37 }
38
39 this->mapToParent(&path);
40 return path;
41}
@ kUnion_SkPathOp
union (inclusive-or) the two paths
Definition SkPathOps.h:25
void mapToParent(SkPath *) const
int size() const
Definition SkTArray.h:416
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir path
Definition switches.h:57

◆ onObjectBoundingBox()

SkRect SkSVGContainer::onObjectBoundingBox ( const SkSVGRenderContext ctx) const
overrideprotectedvirtual

Reimplemented from SkSVGNode.

Definition at line 43 of file SkSVGContainer.cpp.

43 {
45
46 for (int i = 0; i < fChildren.size(); ++i) {
47 const SkRect childBounds = fChildren[i]->objectBoundingBox(ctx);
48 bounds.join(childBounds);
49 }
50
51 return bounds;
52}
Optional< SkRect > bounds
Definition SkRecords.h:189
static constexpr SkRect MakeEmpty()
Definition SkRect.h:595

◆ onRender()

void SkSVGContainer::onRender ( const SkSVGRenderContext ctx) const
overrideprotectedvirtual

Implements SkSVGNode.

Reimplemented in SkSVGHiddenContainer.

Definition at line 24 of file SkSVGContainer.cpp.

24 {
25 for (int i = 0; i < fChildren.size(); ++i) {
26 fChildren[i]->render(ctx);
27 }
28}

Member Data Documentation

◆ fChildren

skia_private::STArray<1, sk_sp<SkSVGNode>, true> SkSVGContainer::fChildren
protected

Definition at line 30 of file SkSVGContainer.h.


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