Flutter Engine
The Flutter Engine
Public Member Functions | Protected Member Functions | List of all members
SkSVGTextContainer Class Reference

#include <SkSVGText.h>

Inheritance diagram for SkSVGTextContainer:
SkSVGTextFragment SkSVGTransformableNode SkSVGNode SkRefCnt SkRefCntBase SkSVGTSpan SkSVGText SkSVGTextPath

Public Member Functions

void appendChild (sk_sp< SkSVGNode >) final
 
- Public Member Functions inherited from SkSVGTextFragment
void renderText (const SkSVGRenderContext &, SkSVGTextContext *, SkSVGXmlSpace) const
 
- Public Member Functions inherited from SkSVGTransformableNode
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

 SkSVGTextContainer (SkSVGTag t)
 
void onShapeText (const SkSVGRenderContext &, SkSVGTextContext *, SkSVGXmlSpace) const override
 
bool parseAndSetAttribute (const char *, const char *) override
 
- Protected Member Functions inherited from SkSVGTextFragment
 SkSVGTextFragment (SkSVGTag t)
 
virtual void onShapeText (const SkSVGRenderContext &, SkSVGTextContext *, SkSVGXmlSpace) const =0
 
void onRender (const SkSVGRenderContext &) const override
 
- 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 onPrepareToRender (SkSVGRenderContext *) const
 
virtual void onRender (const SkSVGRenderContext &) const =0
 
virtual bool onAsPaint (const SkSVGRenderContext &, SkPaint *) const
 
virtual SkPath onAsPath (const SkSVGRenderContext &) const =0
 
virtual void onSetAttribute (SkSVGAttribute, const SkSVGValue &)
 
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 38 of file SkSVGText.h.

Constructor & Destructor Documentation

◆ SkSVGTextContainer()

SkSVGTextContainer::SkSVGTextContainer ( SkSVGTag  t)
inlineexplicitprotected

Definition at line 51 of file SkSVGText.h.

51: INHERITED(t) {}

Member Function Documentation

◆ appendChild()

void SkSVGTextContainer::appendChild ( sk_sp< SkSVGNode child)
finalvirtual

Implements SkSVGNode.

Definition at line 547 of file SkSVGText.cpp.

547 {
548 // Only allow text content child nodes.
549 switch (child->tag()) {
552 case SkSVGTag::kTSpan:
553 fChildren.push_back(
554 sk_sp<SkSVGTextFragment>(static_cast<SkSVGTextFragment*>(child.release())));
555 break;
556 default:
557 break;
558 }
559}
SkSVGTag tag() const
Definition: SkSVGNode.h:106
T * release()
Definition: SkRefCnt.h:324

◆ onShapeText()

void SkSVGTextContainer::onShapeText ( const SkSVGRenderContext ctx,
SkSVGTextContext tctx,
SkSVGXmlSpace   
) const
overrideprotectedvirtual

Implements SkSVGTextFragment.

Definition at line 561 of file SkSVGText.cpp.

562 {
563 SkASSERT(tctx);
564
565 const SkSVGTextContext::ScopedPosResolver resolver(*this, ctx.lengthContext(), tctx);
566
567 for (const auto& frag : fChildren) {
568 // Containers always override xml:space with the local value.
569 frag->renderText(ctx, tctx, this->getXmlSpace());
570 }
571}
#define SkASSERT(cond)
Definition: SkAssert.h:116
const SkSVGLengthContext & lengthContext() const

◆ parseAndSetAttribute()

bool SkSVGTextContainer::parseAndSetAttribute ( const char *  name,
const char *  value 
)
overrideprotectedvirtual

Reimplemented from SkSVGNode.

Definition at line 584 of file SkSVGText.cpp.

584 {
586 this->setX(SkSVGAttributeParser::parse<std::vector<SkSVGLength>>("x", name, value)) ||
587 this->setY(SkSVGAttributeParser::parse<std::vector<SkSVGLength>>("y", name, value)) ||
588 this->setDx(SkSVGAttributeParser::parse<std::vector<SkSVGLength>>("dx", name, value)) ||
589 this->setDy(SkSVGAttributeParser::parse<std::vector<SkSVGLength>>("dy", name, value)) ||
590 this->setRotate(SkSVGAttributeParser::parse<std::vector<SkSVGNumberType>>("rotate",
591 name,
592 value)) ||
593 this->setXmlSpace(SkSVGAttributeParser::parse<SkSVGXmlSpace>("xml:space", name, value));
594}
bool parse(SkSVGIntegerType *v)
virtual bool parseAndSetAttribute(const char *name, const char *value)
Definition: SkSVGNode.cpp:90
uint8_t value
DEF_SWITCHES_START aot vmservice shared library name
Definition: switches.h:32

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