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

#include <SkSVGTransformableNode.h>

Inheritance diagram for SkSVGTransformableNode:
SkSVGNode SkRefCnt SkRefCntBase SkSVGContainer SkSVGImage SkSVGShape SkSVGTextFragment SkSVGUse SkSVGG SkSVGHiddenContainer SkSVGSVG SkSVGCircle SkSVGEllipse SkSVGLine SkSVGPath SkSVGPoly SkSVGRect SkSVGTextContainer SkSVGTextLiteral

Public Member Functions

void setTransform (const SkSVGTransformType &t)
 
- Public Member Functions inherited from SkSVGNode
 ~SkSVGNode () override
 
SkSVGTag tag () const
 
virtual void appendChild (sk_sp< SkSVGNode >)=0
 
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

 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 void onRender (const SkSVGRenderContext &) const =0
 
virtual bool onAsPaint (const SkSVGRenderContext &, SkPaint *) const
 
virtual SkPath onAsPath (const SkSVGRenderContext &) const =0
 
virtual bool hasChildren () const
 
virtual SkRect onObjectBoundingBox (const SkSVGRenderContext &) const
 

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 SkSVGTransformableNode.h.

Constructor & Destructor Documentation

◆ SkSVGTransformableNode()

SkSVGTransformableNode::SkSVGTransformableNode ( SkSVGTag  tag)
protected

Definition at line 13 of file SkSVGTransformableNode.cpp.

14 : INHERITED(tag)
15 , fTransform(SkMatrix::I()) { }
static const SkMatrix & I()
SkSVGTag tag() const
Definition SkSVGNode.h:99

Member Function Documentation

◆ mapToParent() [1/2]

void SkSVGTransformableNode::mapToParent ( SkPath path) const
protected

Definition at line 40 of file SkSVGTransformableNode.cpp.

40 {
41 // transforms the path to parent node coordinates.
42 path->transform(fTransform);
43}
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

◆ mapToParent() [2/2]

void SkSVGTransformableNode::mapToParent ( SkRect rect) const
protected

Definition at line 45 of file SkSVGTransformableNode.cpp.

45 {
46 *rect = fTransform.mapRect(*rect);
47}
bool mapRect(SkRect *dst, const SkRect &src, SkApplyPerspectiveClip pc=SkApplyPerspectiveClip::kYes) const
sk_sp< SkBlender > blender SkRect rect
Definition SkRecords.h:350

◆ onPrepareToRender()

bool SkSVGTransformableNode::onPrepareToRender ( SkSVGRenderContext ctx) const
overrideprotectedvirtual

Reimplemented from SkSVGNode.

Reimplemented in SkSVGUse.

Definition at line 18 of file SkSVGTransformableNode.cpp.

18 {
19 if (!fTransform.isIdentity()) {
20 ctx->saveOnce();
21 ctx->canvas()->concat(fTransform);
22 }
23
24 return this->INHERITED::onPrepareToRender(ctx);
25}
void concat(const SkMatrix &matrix)
bool isIdentity() const
Definition SkMatrix.h:223
virtual bool onPrepareToRender(SkSVGRenderContext *) const
Definition SkSVGNode.cpp:62
SkCanvas * canvas() const

◆ onSetAttribute()

void SkSVGTransformableNode::onSetAttribute ( SkSVGAttribute  attr,
const SkSVGValue v 
)
overrideprotectedvirtual

Reimplemented from SkSVGNode.

Definition at line 27 of file SkSVGTransformableNode.cpp.

27 {
28 switch (attr) {
30 if (const auto* transform = v.as<SkSVGTransformValue>()) {
31 this->setTransform(*transform);
32 }
33 break;
34 default:
35 this->INHERITED::onSetAttribute(attr, v);
36 break;
37 }
38}
virtual void onSetAttribute(SkSVGAttribute, const SkSVGValue &)
Definition SkSVGNode.h:168
void setTransform(const SkSVGTransformType &t)
const T * as() const
Definition SkSVGValue.h:36
static SkColor4f transform(SkColor4f c, SkColorSpace *src, SkColorSpace *dst)
Definition p3.cpp:47

◆ setTransform()

void SkSVGTransformableNode::setTransform ( const SkSVGTransformType t)
inline

Definition at line 16 of file SkSVGTransformableNode.h.

16{ fTransform = t; }

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