Donner
C++20 SVG rendering library
Loading...
Searching...
No Matches
donner::svg::RendererSkia::Impl Class Reference

Implementation class for RendererSkia. More...

Classes

struct  StrokeConfig
 

Public Member Functions

 Impl (RendererSkia &renderer, const RenderingInstanceView &view)
 
void drawUntil (Registry &registry, Entity endEntity)
 
void skipUntil (Registry &registry, Entity endEntity)
 
void drawPath (EntityHandle dataHandle, const components::RenderingInstanceComponent &instance, const components::ComputedPathComponent &path, const PropertyRegistry &style, const Boxd &viewbox, const FontMetrics &fontMetrics)
 
std::optional< SkPaint > createFallbackPaint (const components::PaintResolvedReference &ref, css::RGBA currentColor, float opacity)
 
Lengthd toPercent (Lengthd value, bool numbersArePercent)
 
SkScalar resolveGradientCoord (Lengthd value, const Boxd &viewbox, bool numbersArePercent)
 
Vector2d resolveGradientCoords (Lengthd x, Lengthd y, const Boxd &viewbox, bool numbersArePercent)
 
Transformd ResolveTransform (const components::ComputedLocalTransformComponent *maybeTransformComponent, const Boxd &viewbox, const FontMetrics &fontMetrics)
 
std::optional< SkPaint > instantiateGradient (EntityHandle target, const components::ComputedGradientComponent &computedGradient, const components::PaintResolvedReference &ref, const Boxd &pathBounds, const Boxd &viewbox, css::RGBA currentColor, float opacity)
 
PreserveAspectRatio GetPreserveAspectRatio (EntityHandle handle)
 
void instantiateMask (EntityHandle dataHandle, const components::RenderingInstanceComponent &instance, EntityHandle target, const components::ResolvedMask &ref)
 Renders the mask contents to the current layer.
 
std::optional< SkPaint > instantiatePattern (components::ShadowBranchType branchType, EntityHandle dataHandle, EntityHandle target, const components::ComputedPatternComponent &computedPattern, const components::PaintResolvedReference &ref, const Boxd &pathBounds, const Boxd &viewbox, css::RGBA currentColor, float opacity)
 Instantiates a pattern paint.
 
std::optional< SkPaint > instantiatePaintReference (components::ShadowBranchType branchType, EntityHandle dataHandle, const components::PaintResolvedReference &ref, const Boxd &pathBounds, const Boxd &viewbox, css::RGBA currentColor, float opacity)
 
void drawPathFillWithSkPaint (const components::ComputedPathComponent &path, SkPaint &skPaint, const PropertyRegistry &style)
 
void drawPathFill (EntityHandle dataHandle, const components::ComputedPathComponent &path, const components::ResolvedPaintServer &paint, const PropertyRegistry &style, const Boxd &viewbox)
 
void drawPathStrokeWithSkPaint (EntityHandle dataHandle, const components::ComputedPathComponent &path, const StrokeConfig &config, SkPaint &skPaint, const PropertyRegistry &style, const Boxd &viewbox, const FontMetrics &fontMetrics)
 
void drawPathStroke (EntityHandle dataHandle, const components::ComputedPathComponent &path, const components::ResolvedPaintServer &paint, const PropertyRegistry &style, const Boxd &viewbox, const FontMetrics &fontMetrics)
 
void drawImage (EntityHandle dataHandle, const components::RenderingInstanceComponent &instance, const components::LoadedImageComponent &image)
 
void createFilterChain (SkPaint &filterPaint, const std::vector< FilterEffect > &effectList)
 
void createFilterPaint (SkPaint &filterPaint, Registry &registry, const components::ResolvedFilterEffect &filter)
 

Static Public Member Functions

static bool CircleContainsPoint (Vector2d center, double radius, Vector2d point)
 

Detailed Description

Implementation class for RendererSkia.


Class Documentation

◆ donner::svg::RendererSkia::Impl::StrokeConfig

struct donner::svg::RendererSkia::Impl::StrokeConfig
Class Members
double miterLimit
double strokeWidth

Member Function Documentation

◆ instantiateMask()

void donner::svg::RendererSkia::Impl::instantiateMask ( EntityHandle dataHandle,
const components::RenderingInstanceComponent & instance,
EntityHandle target,
const components::ResolvedMask & ref )
inline

Renders the mask contents to the current layer.

The caller should call saveLayer before this call.

Parameters
dataHandleThe handle to the pattern data.
instanceThe rendering instance component for the currently rendered entity (same entity as target).
targetThe target entity to which the pattern is applied.
refThe reference to the mask.

◆ instantiatePattern()

std::optional< SkPaint > donner::svg::RendererSkia::Impl::instantiatePattern ( components::ShadowBranchType branchType,
EntityHandle dataHandle,
EntityHandle target,
const components::ComputedPatternComponent & computedPattern,
const components::PaintResolvedReference & ref,
const Boxd & pathBounds,
const Boxd & viewbox,
css::RGBA currentColor,
float opacity )
inline

Instantiates a pattern paint.

See PatternUnits, PatternContentUnits for details on their behavior.

Parameters
branchTypeDetermined by whether this is the fill or stroke.
dataHandleThe handle to the pattern data.
targetThe target entity to which the pattern is applied.
computedPatternThe resolved pattern component.
refThe reference to the pattern.
pathBoundsThe bounds of the path to which the pattern is applied.
viewboxThe viewbox of the the target entity.
currentColorCurrent context color inherited from the parent.
opacityCurrent opacity inherited from the parent.
Returns
SkPaint instance containing the pattern.

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