Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
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
 
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
 

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)
 
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 onAsPaint (const SkSVGRenderContext &, SkPaint *) const
 
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:99
T * release()
Definition SkRefCnt.h:324

◆ onShapeText()

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

Implements SkSVGTextFragment.

Reimplemented in SkSVGTextPath.

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.

Reimplemented in SkSVGTextPath.

Definition at line 584 of file SkSVGText.cpp.

584 {
585 return INHERITED::parseAndSetAttribute(name, value) ||
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
const char * name
Definition fuchsia.cc:50

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