Skia
2D Graphics Library
SkSVGDOM Class Reference

#include <SkSVGDOM.h>

Inheritance diagram for SkSVGDOM:

Classes

class  Builder
 

Public Member Functions

SkSVGSVGgetRoot () const
 Returns the root (outermost) SVG element. More...
 
void setContainerSize (const SkSize &)
 Specify a "container size" for the SVG dom. More...
 
const SkSizecontainerSize () const
 DEPRECATED: use getRoot()->intrinsicSize() to query the root element intrinsic size. More...
 
sk_sp< SkSVGNode > * findNodeById (const char *id)
 
void render (SkCanvas *) const
 
void renderNode (SkCanvas *, SkSVGPresentationContext &, const char *id) const
 Render the node with the given id as if it were the only child of the root. More...
 
bool unique () const
 May return true if the caller is the only owner. More...
 
void ref () const
 Increment the reference count. More...
 
void unref () const
 Decrement the reference count. More...
 

Static Public Member Functions

static sk_sp< SkSVGDOMMakeFromStream (SkStream &str)
 

Member Function Documentation

◆ containerSize()

const SkSize& SkSVGDOM::containerSize ( ) const

DEPRECATED: use getRoot()->intrinsicSize() to query the root element intrinsic size.

Returns the SVG dom container size.

If the client specified a container size via setContainerSize(), then the same size is returned.

When unspecified by clients, this returns the intrinsic size of the root element, as defined by its width/height attributes. If either width or height is specified in relative units (e.g. "100%"), then the corresponding intrinsic size dimension is zero.

◆ findNodeById()

sk_sp<SkSVGNode>* SkSVGDOM::findNodeById ( const char *  id)

◆ getRoot()

SkSVGSVG* SkSVGDOM::getRoot ( ) const
inline

Returns the root (outermost) SVG element.

◆ MakeFromStream()

static sk_sp<SkSVGDOM> SkSVGDOM::MakeFromStream ( SkStream str)
inlinestatic

◆ ref()

void SkRefCntBase::ref ( ) const
inlineinherited

Increment the reference count.

Must be balanced by a call to unref().

◆ render()

void SkSVGDOM::render ( SkCanvas ) const

◆ renderNode()

void SkSVGDOM::renderNode ( SkCanvas ,
SkSVGPresentationContext ,
const char *  id 
) const

Render the node with the given id as if it were the only child of the root.

◆ setContainerSize()

void SkSVGDOM::setContainerSize ( const SkSize )

Specify a "container size" for the SVG dom.

This is used to resolve the initial viewport when the root SVG width/height are specified in relative units.

If the root dimensions are in absolute units, then the container size has no effect since the initial viewport is fixed.

◆ unique()

bool SkRefCntBase::unique ( ) const
inlineinherited

May return true if the caller is the only owner.

Ensures that all previous owner's actions are complete.

◆ unref()

void SkRefCntBase::unref ( ) const
inlineinherited

Decrement the reference count.

If the reference count is 1 before the decrement, then delete the object. Note that if this is the case, then the object needs to have been allocated via new, and not on the stack.


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